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 and inttoptr 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 and inttoptr 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
88 define i8* @f_11(i8 %val) {
89 %ptr = inttoptr i8 %val to i8*, !dereferenceable !{i32 2}
92 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
93 ; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !3
95 define i8* @f_12(i8 %val) {
96 %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{i32 2}
99 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
100 ; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !3
102 define i8* @f_13(i8 %val) {
103 %ptr = inttoptr i8 %val to i8*, !dereferenceable !{}
106 ; CHECK: dereferenceable, dereferenceable_or_null take one operand
107 ; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !1
109 define i8* @f_14(i8 %val) {
110 %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{}
113 ; CHECK: dereferenceable, dereferenceable_or_null take one operand
114 ; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !1
116 define i8* @f_15(i8 %val) {
117 %ptr = inttoptr i8 %val to i8*, !dereferenceable !{!"str"}
120 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
121 ; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !2
123 define i8* @f_16(i8 %val) {
124 %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{!"str"}
127 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
128 ; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !2