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. :( |
Chris Lattner | c98deeb | 2006-05-24 20:52:08 +0000 | [diff] [blame^] | 4 | ; RUN: llvm-as < %s | llc -march=c |
Chris Lattner | 8408d0b | 2004-11-13 22:21:15 +0000 | [diff] [blame] | 5 | |
| 6 | implementation |
| 7 | |
| 8 | declare void %external(sbyte*) |
| 9 | |
| 10 | int %test(int *%X) { |
| 11 | %RV = call int (int*)* cast (void(sbyte*)* %external to int(int*)*)(int* %X) |
| 12 | ret int %RV |
| 13 | } |
| 14 | |
| 15 | |
| 16 | |
| 17 | |