Chris Lattner | 8408d0b | 2004-11-13 22:21:15 +0000 | [diff] [blame] | 1 | ; The CBE should not emit code that casts the function pointer. This causes |
| 2 | ; GCC to get testy and insert trap instructions instead of doing the right |
| 3 | ; thing. :( |
Tanya Lattner | 53a66d1 | 2008-02-19 01:41:04 +0000 | [diff] [blame^] | 4 | ; RUN: llvm-as < %s | llc -march=c |
Chris Lattner | 8408d0b | 2004-11-13 22:21:15 +0000 | [diff] [blame] | 5 | |
Tanya Lattner | 53a66d1 | 2008-02-19 01:41:04 +0000 | [diff] [blame^] | 6 | declare void @external(i8*) |
Chris Lattner | 8408d0b | 2004-11-13 22:21:15 +0000 | [diff] [blame] | 7 | |
Tanya Lattner | 53a66d1 | 2008-02-19 01:41:04 +0000 | [diff] [blame^] | 8 | define i32 @test(i32* %X) { |
| 9 | %RV = call i32 bitcast (void (i8*)* @external to i32 (i32*)*)( i32* %X ) ; <i32> [#uses=1] |
| 10 | ret i32 %RV |
Chris Lattner | 8408d0b | 2004-11-13 22:21:15 +0000 | [diff] [blame] | 11 | } |
| 12 | |