summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-03-16 20:15:44 +0000
committerCameron Zwarich <zwarich@apple.com>2011-03-16 20:15:44 +0000
commit49e354bcb6caf6c9aa8d62f3e3d3734fa9a2bc41 (patch)
tree4d1ce43b6409293bc496519a67411bb94a7be0cc /llvm
parentf6ce2fb1b3e94ba7e99fc7093f5ad6402fab64ab (diff)
downloadbcm5719-llvm-49e354bcb6caf6c9aa8d62f3e3d3734fa9a2bc41.tar.gz
bcm5719-llvm-49e354bcb6caf6c9aa8d62f3e3d3734fa9a2bc41.zip
Add a test for i1 zeroext arguments on x86-64. We currently generate code that
conforms to the ABI, but DAGCombine could in theory recognize the sequence of zext asserts and truncates and generate incorrect code. llvm-svn: 127754
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/X86/bool-args-zext.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/bool-args-zext.ll b/llvm/test/CodeGen/X86/bool-args-zext.ll
new file mode 100644
index 00000000000..67168d4bf04
--- /dev/null
+++ b/llvm/test/CodeGen/X86/bool-args-zext.ll
@@ -0,0 +1,23 @@
+; 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 (...)* @foo(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 (...)* @foo(i32 %conv) nounwind
+ ret void
+}
+
+declare i32 @foo(...)
OpenPOWER on IntegriCloud