dereferenceable-md.ll
3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
declare i8* @foo()
define void @f1() {
entry:
call i8* @foo(), !dereferenceable !{i64 2}
ret void
}
; CHECK: dereferenceable, dereferenceable_or_null apply only to load and inttoptr instructions, use attributes for calls or invokes
; CHECK-NEXT: call i8* @foo()
define void @f2() {
entry:
call i8* @foo(), !dereferenceable_or_null !{i64 2}
ret void
}
; CHECK: dereferenceable, dereferenceable_or_null apply only to load and inttoptr instructions, use attributes for calls or invokes
; CHECK-NEXT: call i8* @foo()
define i8 @f3(i8* %x) {
entry:
%y = load i8, i8* %x, !dereferenceable !{i64 2}
ret i8 %y
}
; CHECK: dereferenceable, dereferenceable_or_null apply only to pointer types
; CHECK-NEXT: load i8, i8* %x
define i8 @f4(i8* %x) {
entry:
%y = load i8, i8* %x, !dereferenceable_or_null !{i64 2}
ret i8 %y
}
; CHECK: dereferenceable, dereferenceable_or_null apply only to pointer types
; CHECK-NEXT: load i8, i8* %x
define i8* @f5(i8** %x) {
entry:
%y = load i8*, i8** %x, !dereferenceable !{}
ret i8* %y
}
; CHECK: dereferenceable, dereferenceable_or_null take one operand
; CHECK-NEXT: load i8*, i8** %x
define i8* @f6(i8** %x) {
entry:
%y = load i8*, i8** %x, !dereferenceable_or_null !{}
ret i8* %y
}
; CHECK: dereferenceable, dereferenceable_or_null take one operand
; CHECK-NEXT: load i8*, i8** %x
define i8* @f7(i8** %x) {
entry:
%y = load i8*, i8** %x, !dereferenceable !{!"str"}
ret i8* %y
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
; CHECK-NEXT: load i8*, i8** %x
define i8* @f8(i8** %x) {
entry:
%y = load i8*, i8** %x, !dereferenceable_or_null !{!"str"}
ret i8* %y
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
; CHECK-NEXT: load i8*, i8** %x
define i8* @f9(i8** %x) {
entry:
%y = load i8*, i8** %x, !dereferenceable !{i32 2}
ret i8* %y
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
; CHECK-NEXT: load i8*, i8** %x
define i8* @f10(i8** %x) {
entry:
%y = load i8*, i8** %x, !dereferenceable_or_null !{i32 2}
ret i8* %y
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
; CHECK-NEXT: load i8*, i8** %x
define i8* @f_11(i8 %val) {
%ptr = inttoptr i8 %val to i8*, !dereferenceable !{i32 2}
ret i8* %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !3
define i8* @f_12(i8 %val) {
%ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{i32 2}
ret i8* %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !3
define i8* @f_13(i8 %val) {
%ptr = inttoptr i8 %val to i8*, !dereferenceable !{}
ret i8* %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null take one operand
; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !1
define i8* @f_14(i8 %val) {
%ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{}
ret i8* %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null take one operand
; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !1
define i8* @f_15(i8 %val) {
%ptr = inttoptr i8 %val to i8*, !dereferenceable !{!"str"}
ret i8* %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !2
define i8* @f_16(i8 %val) {
%ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{!"str"}
ret i8* %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !2