aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll')
-rw-r--r--test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll b/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll
new file mode 100644
index 000000000000..52e025900780
--- /dev/null
+++ b/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=c | grep {llvm_cbe_t.*&1}
+define i32 @test(i32 %r) {
+ %s = icmp eq i32 %r, 0
+ %t = add i1 %s, %s
+ %u = zext i1 %t to i32
+ br i1 %t, label %A, label %B
+A:
+
+ ret i32 %u
+B:
+
+ %v = select i1 %t, i32 %r, i32 %u
+ ret i32 %v
+}