blob: b48a9a79e7afaebbc6797deb3d47c456f0a4db56 [file] [log] [blame]
Chris Lattner1f714012003-08-24 05:02:26 +00001; This checks to ensure that the inline pass deletes functions if they get
2; inlined into all of their callers.
3
Tanya Lattner5640bd12008-03-01 09:15:35 +00004; RUN: llvm-as < %s | opt -inline | llvm-dis | \
Reid Spencer951d8dc2007-04-15 08:30:33 +00005; RUN: not grep %reallysmall
Chris Lattner1f714012003-08-24 05:02:26 +00006
Tanya Lattner5640bd12008-03-01 09:15:35 +00007define internal i32 @reallysmall(i32 %A) {
8 ret i32 %A
Chris Lattner1f714012003-08-24 05:02:26 +00009}
10
Tanya Lattner5640bd12008-03-01 09:15:35 +000011define void @caller1() {
12 call i32 @reallysmall( i32 5 ) ; <i32>:1 [#uses=0]
13 ret void
Chris Lattner1f714012003-08-24 05:02:26 +000014}
15
Tanya Lattner5640bd12008-03-01 09:15:35 +000016define void @caller2(i32 %A) {
17 call i32 @reallysmall( i32 %A ) ; <i32>:1 [#uses=0]
18 ret void
Chris Lattner1f714012003-08-24 05:02:26 +000019}
20
Tanya Lattner5640bd12008-03-01 09:15:35 +000021define i32 @caller3(i32 %A) {
22 %B = call i32 @reallysmall( i32 %A ) ; <i32> [#uses=1]
23 ret i32 %B
Chris Lattner1f714012003-08-24 05:02:26 +000024}
Tanya Lattner5640bd12008-03-01 09:15:35 +000025