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
6declare i32 @not_speculatable()
7
8; CHECK: speculatable attribute may not apply to call sites
9; CHECK-NEXT: %ret = call i32 @not_speculatable() #0
10define 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
19define float @call_bitcast_speculatable() {
20  %ret = call float bitcast (i32* @gv to float()*)() #0
21  ret float %ret
22}
23
24attributes #0 = { speculatable }
25