1 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
7 call ptr @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 ptr @foo()
15 call ptr @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 ptr @foo()
21 define i8 @f3(ptr %x) {
23 %y = load i8, ptr %x, !dereferenceable !{i64 2}
26 ; CHECK: dereferenceable, dereferenceable_or_null apply only to pointer types
27 ; CHECK-NEXT: load i8, ptr %x
29 define i8 @f4(ptr %x) {
31 %y = load i8, ptr %x, !dereferenceable_or_null !{i64 2}
34 ; CHECK: dereferenceable, dereferenceable_or_null apply only to pointer types
35 ; CHECK-NEXT: load i8, ptr %x
37 define ptr @f5(ptr %x) {
39 %y = load ptr, ptr %x, !dereferenceable !{}
42 ; CHECK: dereferenceable, dereferenceable_or_null take one operand
43 ; CHECK-NEXT: load ptr, ptr %x
46 define ptr @f6(ptr %x) {
48 %y = load ptr, ptr %x, !dereferenceable_or_null !{}
51 ; CHECK: dereferenceable, dereferenceable_or_null take one operand
52 ; CHECK-NEXT: load ptr, ptr %x
54 define ptr @f7(ptr %x) {
56 %y = load ptr, ptr %x, !dereferenceable !{!"str"}
59 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
60 ; CHECK-NEXT: load ptr, ptr %x
63 define ptr @f8(ptr %x) {
65 %y = load ptr, ptr %x, !dereferenceable_or_null !{!"str"}
68 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
69 ; CHECK-NEXT: load ptr, ptr %x
71 define ptr @f9(ptr %x) {
73 %y = load ptr, ptr %x, !dereferenceable !{i32 2}
76 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
77 ; CHECK-NEXT: load ptr, ptr %x
80 define ptr @f10(ptr %x) {
82 %y = load ptr, ptr %x, !dereferenceable_or_null !{i32 2}
85 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
86 ; CHECK-NEXT: load ptr, ptr %x
88 define ptr @f_11(i8 %val) {
89 %ptr = inttoptr i8 %val to ptr, !dereferenceable !{i32 2}
92 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
93 ; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable !3
95 define ptr @f_12(i8 %val) {
96 %ptr = inttoptr i8 %val to ptr, !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 ptr, !dereferenceable_or_null !3
102 define ptr @f_13(i8 %val) {
103 %ptr = inttoptr i8 %val to ptr, !dereferenceable !{}
106 ; CHECK: dereferenceable, dereferenceable_or_null take one operand
107 ; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable !1
109 define ptr @f_14(i8 %val) {
110 %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !{}
113 ; CHECK: dereferenceable, dereferenceable_or_null take one operand
114 ; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !1
116 define ptr @f_15(i8 %val) {
117 %ptr = inttoptr i8 %val to ptr, !dereferenceable !{!"str"}
120 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
121 ; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable !2
123 define ptr @f_16(i8 %val) {
124 %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !{!"str"}
127 ; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
128 ; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !2