Matt Arsenault | ea376da | 2017-04-28 20:25:27 +0000 | [diff] [blame] | 1 | ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s |
| 2 | |
| 3 | ; Make sure that speculatable is not allowed on a call site if the |
| 4 | ; declaration is not also speculatable. |
| 5 | |
| 6 | declare i32 @not_speculatable() |
| 7 | |
| 8 | ; CHECK: speculatable attribute may not apply to call sites |
| 9 | ; CHECK-NEXT: %ret = call i32 @not_speculatable() #0 |
| 10 | define i32 @call_not_speculatable() { |
| 11 | %ret = call i32 @not_speculatable() #0 |
| 12 | ret i32 %ret |
| 13 | } |
| 14 | |
| 15 | @gv = internal unnamed_addr constant i32 0 |
| 16 | |
| 17 | ; CHECK: speculatable attribute may not apply to call sites |
| 18 | ; CHECK-NEXT: %ret = call float bitcast (i32* @gv to float ()*)() #0 |
| 19 | define float @call_bitcast_speculatable() { |
| 20 | %ret = call float bitcast (i32* @gv to float()*)() #0 |
| 21 | ret float %ret |
| 22 | } |
| 23 | |
| 24 | attributes #0 = { speculatable } |