summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/conditional-tailcall.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/X86/conditional-tailcall.ll')
-rw-r--r--llvm/test/CodeGen/X86/conditional-tailcall.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/conditional-tailcall.ll b/llvm/test/CodeGen/X86/conditional-tailcall.ll
new file mode 100644
index 00000000000..00e8f9f52e9
--- /dev/null
+++ b/llvm/test/CodeGen/X86/conditional-tailcall.ll
@@ -0,0 +1,24 @@
+; RUN: llc < %s -march=x86 -show-mc-encoding | FileCheck %s
+
+declare void @foo()
+declare void @bar()
+
+define void @f(i32 %x, i32 %y) optsize {
+entry:
+ %p = icmp eq i32 %x, %y
+ br i1 %p, label %bb1, label %bb2
+bb1:
+ tail call void @foo()
+ ret void
+bb2:
+ tail call void @bar()
+ ret void
+}
+
+; CHECK-LABEL: f:
+; CHECK: cmp
+; CHECK: jne bar
+; Check that the asm doesn't just look good, but uses the correct encoding.
+; CHECK: encoding: [0x75,A]
+
+; CHECK: jmp foo
OpenPOWER on IntegriCloud