summaryrefslogtreecommitdiffstats
path: root/mlir/test/Target/Cpp/conditional.mlir
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/test/Target/Cpp/conditional.mlir')
-rw-r--r--mlir/test/Target/Cpp/conditional.mlir9
1 files changed, 9 insertions, 0 deletions
diff --git a/mlir/test/Target/Cpp/conditional.mlir b/mlir/test/Target/Cpp/conditional.mlir
new file mode 100644
index 000000000000..2470fbeb33ad
--- /dev/null
+++ b/mlir/test/Target/Cpp/conditional.mlir
@@ -0,0 +1,9 @@
+// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s
+
+func.func @cond(%cond: i1, %arg0: i32, %arg1: i32) -> () {
+ %0 = emitc.conditional %cond, %arg0, %arg1 : i32
+ return
+}
+
+// CHECK-LABEL: void cond
+// CHECK-NEXT: int32_t [[V3:[^ ]*]] = [[V0:[^ ]*]] ? [[V1:[^ ]*]] : [[V2:[^ ]*]];