Index: tests_lit/llvm2ice_tests/select-opt.ll |
diff --git a/tests_lit/llvm2ice_tests/select-opt.ll b/tests_lit/llvm2ice_tests/select-opt.ll |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e47dd3c2b37144a3b2c605344c35a0aadb146a1a |
--- /dev/null |
+++ b/tests_lit/llvm2ice_tests/select-opt.ll |
@@ -0,0 +1,28 @@ |
+; RUIN: %llvm2ice %s | FileCheck %s |
+; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
+; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s |
+ |
+define void @testSelect(i32 %a, i32 %b) { |
+entry: |
+ %cmp = icmp slt i32 %a, %b |
+ %cond = select i1 %cmp, i32 %a, i32 %b |
+ tail call void @useInt(i32 %cond) |
+ %cmp1 = icmp sgt i32 %a, %b |
+ %cond2 = select i1 %cmp1, i32 10, i32 20 |
+ tail call void @useInt(i32 %cond2) |
+ ret void |
+} |
+ |
+declare void @useInt(i32) |
+ |
+; CHECK: .globl testSelect |
+; CHECK: cmp |
+; CHECK: cmp |
+; CHECK: call useInt |
+; CHECK: cmp |
+; CHECK: cmp |
+; CHECK: call useInt |
+; CHECK: ret |
+ |
+; ERRORS-NOT: ICE translation error |
+; DUMP-NOT: SZ |