blob: a8ee438cc431d85358bf0e103c6513a86dc43bd6 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; 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 Lattnerf28e0ce2008-02-19 01:41:04 +00004; RUN: llvm-as < %s | llc -march=c
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +00006declare void @external(i8*)
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +00008define i32 @test(i32* %X) {
9 %RV = call i32 bitcast (void (i8*)* @external to i32 (i32*)*)( i32* %X ) ; <i32> [#uses=1]
10 ret i32 %RV
Dan Gohmanf17a25c2007-07-18 16:29:46 +000011}
12