1 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
7 call i8* @foo(), !dereferenceable !{i64 2}
10 ; CHECK: dereferenceable, dereferenceable_or_null apply only to load instructions, use attributes for calls or invokes
11 ; CHECK-NEXT: call i8* @foo()
15 call i8* @foo(), !dereferenceable_or_null !{i64 2}
18 ; CHECK: dereferenceable, dereferenceable_or_null apply only to load instructions, use attributes for calls or invokes
19 ; CHECK-NEXT: call i8* @foo()
21 define i8 @f3(i8* %x) {
23 %y = load i8, i8* %x, !dereferenceable !{i64 2}
26 ; CHECK: dereferenceable, dereferenceable_or_null apply only to pointer types
27 ; CHECK-NEXT: load i8, i8* %x
29 define i8 @f4(i8* %x) {
31 %y = load i8, i8* %x, !dereferenceable_or_null !{i64 2}
34 ; CHECK: dereferenceable, dereferenceable_or_null apply only to pointer types
35 ; CHECK-NEXT: load i8, i8* %x
37 define i8* @f5(i8** %x) {
39 %y = load i8*, i8** %x, !dereferenceable !{}
42 ; CHECK: dereferenceable, dereferenceable_or_null take one operand
43 ; CHECK-NEXT: load i8*, i8** %x
46 define i8* @f6(i8** %x) {
48 %y = load i8*, i8** %x, !dereferenceable_or_null !{}
51 ; CHECK: dereferenceable, dereferenceable_or_null take one operand
52 ; CHECK-NEXT: load i8*, i8** %x
54 define i8* @f7(i8** %x) {
56 %y = load i8*, i8** %x, !dereferenceable !{!"str"}
59 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
60 ; CHECK-NEXT: load i8*, i8** %x
63 define i8* @f8(i8** %x) {
65 %y = load i8*, i8** %x, !dereferenceable_or_null !{!"str"}
68 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
69 ; CHECK-NEXT: load i8*, i8** %x
71 define i8* @f9(i8** %x) {
73 %y = load i8*, i8** %x, !dereferenceable !{i32 2}
76 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
77 ; CHECK-NEXT: load i8*, i8** %x
80 define i8* @f10(i8** %x) {
82 %y = load i8*, i8** %x, !dereferenceable_or_null !{i32 2}
85 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
86 ; CHECK-NEXT: load i8*, i8** %x