aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-04 06:03:25 +0000
committerChris Lattner <sabre@nondot.org>2005-12-04 06:03:25 +0000
commit6a0beed626e8e81ff2125f886144592a50f7a933 (patch)
treea590f6eb17ff529a770d9f64395735b314e5ebc9 /test/CodeGen/X86
parentd67b3a8bf75d4d3c50263960a9375e6856588f2c (diff)
downloadexternal_llvm-6a0beed626e8e81ff2125f886144592a50f7a933.zip
external_llvm-6a0beed626e8e81ff2125f886144592a50f7a933.tar.gz
external_llvm-6a0beed626e8e81ff2125f886144592a50f7a933.tar.bz2
new testcase, for PR672
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r--test/CodeGen/X86/2005-12-03-IndirectTailCall.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2005-12-03-IndirectTailCall.ll b/test/CodeGen/X86/2005-12-03-IndirectTailCall.ll
new file mode 100644
index 0000000..77a21f4
--- /dev/null
+++ b/test/CodeGen/X86/2005-12-03-IndirectTailCall.ll
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | llc -march=x86 -enable-x86-fastcc | grep 'jmp \*%ecx'
+declare int %putchar(int)
+
+int %main(){
+ %f = cast int (int, int*, int)* %check_tail to int*
+ %res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
+ ret int %res
+}
+
+fastcc int %check_tail(int %x, int* %f, int %g) {
+ %tmp1 = setgt int %x, 0
+ br bool %tmp1, label %if-then, label %if-else
+
+if-then:
+ %fun_ptr = cast int* %f to int(int, int*, int)*
+ %arg1 = add int %x, -1
+ call int %putchar(int 90)
+ %res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
+ ret int %res
+
+if-else:
+ ret int %x
+}
+