Chris Lattner | fe9af3b | 2010-04-22 23:37:35 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -inline -S | FileCheck %s |
Chris Lattner | b374b90 | 2009-08-31 03:15:49 +0000 | [diff] [blame] | 2 | ; PR4834 |
| 3 | |
Chris Lattner | fe9af3b | 2010-04-22 23:37:35 +0000 | [diff] [blame] | 4 | define i32 @test1() { |
Chris Lattner | b374b90 | 2009-08-31 03:15:49 +0000 | [diff] [blame] | 5 | %funcall1_ = call fastcc i32 ()* ()* @f1() |
| 6 | %executecommandptr1_ = call i32 %funcall1_() |
| 7 | ret i32 %executecommandptr1_ |
| 8 | } |
| 9 | |
| 10 | define internal fastcc i32 ()* @f1() nounwind readnone { |
| 11 | ret i32 ()* @f2 |
| 12 | } |
| 13 | |
| 14 | define internal i32 @f2() nounwind readnone { |
| 15 | ret i32 1 |
| 16 | } |
Chris Lattner | fe9af3b | 2010-04-22 23:37:35 +0000 | [diff] [blame] | 17 | |
| 18 | ; CHECK: @test1() |
| 19 | ; CHECK-NEXT: ret i32 1 |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | declare i8* @f1a(i8*) ssp align 2 |
| 26 | |
| 27 | define internal i32 @f2a(i8* %t) inlinehint ssp { |
| 28 | entry: |
| 29 | ret i32 41 |
| 30 | } |
| 31 | |
| 32 | define internal i32 @f3a(i32 (i8*)* %__f) ssp { |
| 33 | entry: |
| 34 | %A = call i32 %__f(i8* undef) |
| 35 | ret i32 %A |
| 36 | } |
| 37 | |
| 38 | define i32 @test2(i8* %this) ssp align 2 { |
| 39 | %X = call i32 @f3a(i32 (i8*)* @f2a) ssp |
| 40 | ret i32 %X |
| 41 | } |
| 42 | |
| 43 | ; CHECK: @test2 |
Chris Lattner | d46316e | 2010-04-23 22:39:33 +0000 | [diff] [blame] | 44 | ; CHECK-NEXT: ret i32 41 |