aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/bool-zext.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/bool-zext.ll')
-rw-r--r--test/CodeGen/X86/bool-zext.ll35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGen/X86/bool-zext.ll b/test/CodeGen/X86/bool-zext.ll
new file mode 100644
index 000000000000..d2c30c64f237
--- /dev/null
+++ b/test/CodeGen/X86/bool-zext.ll
@@ -0,0 +1,35 @@
+; RUN: llc < %s -march=x86-64 | FileCheck %s
+
+; CHECK: @bar1
+; CHECK: movzbl
+; CHECK: callq
+define void @bar1(i1 zeroext %v1) nounwind ssp {
+entry:
+ %conv = zext i1 %v1 to i32
+ %call = tail call i32 (...)* @foo1(i32 %conv) nounwind
+ ret void
+}
+
+; CHECK: @bar2
+; CHECK-NOT: movzbl
+; CHECK: callq
+define void @bar2(i8 zeroext %v1) nounwind ssp {
+entry:
+ %conv = zext i8 %v1 to i32
+ %call = tail call i32 (...)* @foo1(i32 %conv) nounwind
+ ret void
+}
+
+; CHECK: @bar3
+; CHECK: callq
+; CHECK-NOT: movzbl
+; CHECK-NOT: and
+; CHECK: ret
+define zeroext i1 @bar3() nounwind ssp {
+entry:
+ %call = call i1 @foo2() nounwind
+ ret i1 %call
+}
+
+declare i32 @foo1(...)
+declare zeroext i1 @foo2()