summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/tail-call-casts.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/tail-call-casts.ll b/llvm/test/CodeGen/X86/tail-call-casts.ll
new file mode 100644
index 00000000000..5421b498e1e
--- /dev/null
+++ b/llvm/test/CodeGen/X86/tail-call-casts.ll
@@ -0,0 +1,27 @@
+; RUN: llc -mtriple=i686-unknown-linux-gnu -o - %s | FileCheck %s
+
+declare void @g_bool(i1 zeroext)
+define void @f_bool(i1 zeroext %x) {
+entry:
+ tail call void @g_bool(i1 zeroext %x)
+ ret void
+
+; Forwarding a bool in a tail call works.
+; CHECK-LABEL: f_bool:
+; CHECK-NOT: movz
+; CHECK: jmp g_bool
+}
+
+
+declare void @g_float(float)
+define void @f_i32(i32 %x) {
+entry:
+ %0 = bitcast i32 %x to float
+ tail call void @g_float(float %0)
+ ret void
+
+; Forwarding a bitcasted value works too.
+; CHECK-LABEL: f_i32
+; CHECK-NOT: mov
+; CHECK: jmp g_float
+}
OpenPOWER on IntegriCloud