xref: /minix3/external/bsd/llvm/dist/llvm/test/Transforms/Inline/recursive.ll (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc; RUN: opt -inline -S < %s | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuctarget datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
4*f4a2713aSLionel Sambuctarget triple = "i386-apple-darwin10.0"
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc; rdar://10853263
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambuc; Make sure that the callee is still here.
9*f4a2713aSLionel Sambuc; CHECK-LABEL: define i32 @callee(
10*f4a2713aSLionel Sambucdefine i32 @callee(i32 %param) {
11*f4a2713aSLionel Sambuc %yyy = alloca [100000 x i8]
12*f4a2713aSLionel Sambuc %r = bitcast [100000 x i8]* %yyy to i8*
13*f4a2713aSLionel Sambuc call void @foo2(i8* %r)
14*f4a2713aSLionel Sambuc ret i32 4
15*f4a2713aSLionel Sambuc}
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc; CHECK-LABEL: define i32 @caller(
18*f4a2713aSLionel Sambuc; CHECK-NEXT: entry:
19*f4a2713aSLionel Sambuc; CHECK-NOT: alloca
20*f4a2713aSLionel Sambuc; CHECK: ret
21*f4a2713aSLionel Sambucdefine i32 @caller(i32 %param) {
22*f4a2713aSLionel Sambucentry:
23*f4a2713aSLionel Sambuc  %t = call i32 @foo(i32 %param)
24*f4a2713aSLionel Sambuc  %cmp = icmp eq i32 %t, -1
25*f4a2713aSLionel Sambuc  br i1 %cmp, label %exit, label %cont
26*f4a2713aSLionel Sambuc
27*f4a2713aSLionel Sambuccont:
28*f4a2713aSLionel Sambuc  %r = call i32 @caller(i32 %t)
29*f4a2713aSLionel Sambuc  %f = call i32 @callee(i32 %r)
30*f4a2713aSLionel Sambuc  br label %cont
31*f4a2713aSLionel Sambucexit:
32*f4a2713aSLionel Sambuc  ret i32 4
33*f4a2713aSLionel Sambuc}
34*f4a2713aSLionel Sambuc
35*f4a2713aSLionel Sambucdeclare void @foo2(i8* %in)
36*f4a2713aSLionel Sambuc
37*f4a2713aSLionel Sambucdeclare i32 @foo(i32 %param)
38*f4a2713aSLionel Sambuc
39