aboutsummaryrefslogtreecommitdiffstats
path: root/test/ExecutionEngine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-03 07:14:47 +0000
committerChris Lattner <sabre@nondot.org>2005-12-03 07:14:47 +0000
commit8e22200f2ba395243403e12adc4a09609fb7fd23 (patch)
tree1792aa208285a8432707007f11f5836574018c50 /test/ExecutionEngine
parent52098898b463923a01a0bf3d18d6fb9f96c8d5ef (diff)
downloadexternal_llvm-8e22200f2ba395243403e12adc4a09609fb7fd23.zip
external_llvm-8e22200f2ba395243403e12adc4a09609fb7fd23.tar.gz
external_llvm-8e22200f2ba395243403e12adc4a09609fb7fd23.tar.bz2
new testcase for PR672
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ExecutionEngine')
-rw-r--r--test/ExecutionEngine/2005-12-02-TailCallBug.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ExecutionEngine/2005-12-02-TailCallBug.ll b/test/ExecutionEngine/2005-12-02-TailCallBug.ll
new file mode 100644
index 0000000..0adb3b7
--- /dev/null
+++ b/test/ExecutionEngine/2005-12-02-TailCallBug.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as %s | lli
+
+; PR672
+
+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
+ %res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
+ ret int %res
+
+if-else:
+ ret int %x
+}