blob: 5143d0249421c30d2eed2b959c28f8a8d0669e15 [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
Dan Gohman18800922009-09-11 18:01:28 +00004; RUN: opt < %s -inline -S | \
Dan Gohman2cdcf2b2008-05-01 23:50:07 +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