summaryrefslogtreecommitdiffstats
path: root/test/Verifier/range-1.ll
blob: b6a75d13bba0963f18068607f7add705c0ea5e65 (plain)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s

define void @f1(i8* %x) {
entry:
  store i8 0, i8* %x, align 1, !range !0
  ret void
}
!0 = metadata !{i8 0, i8 1}
; CHECK: Ranges are only for loads!
; CHECK-NEXT: store i8 0, i8* %x, align 1, !range !0

define i8 @f2(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !1
  ret i8 %y
}
!1 = metadata !{}
; CHECK: It should have at least one range!
; CHECK-NEXT: metadata

define i8 @f3(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !2
  ret i8 %y
}
!2 = metadata !{i8 0}
; CHECK: Unfinished range!

define i8 @f4(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !3
  ret i8 %y
}
!3 = metadata !{double 0.0, i8 0}
; CHECK: The lower limit must be an integer!

define i8 @f5(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !4
  ret i8 %y
}
!4 = metadata !{i8 0, double 0.0}
; CHECK: The upper limit must be an integer!

define i8 @f6(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !5
  ret i8 %y
}
!5 = metadata !{i32 0, i8 0}
; CHECK: Range types must match load type!
; CHECK:  %y = load

define i8 @f7(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !6
  ret i8 %y
}
!6 = metadata !{i8 0, i32 0}
; CHECK: Range types must match load type!
; CHECK:  %y = load

define i8 @f8(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !7
  ret i8 %y
}
!7 = metadata !{i32 0, i32 0}
; CHECK: Range types must match load type!
; CHECK:  %y = load

define i8 @f9(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !8
  ret i8 %y
}
!8 = metadata !{i8 0, i8 0}
; CHECK: Range must not be empty!

define i8 @f10(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !9
  ret i8 %y
}
!9 = metadata !{i8 0, i8 2, i8 1, i8 3}
; CHECK: Intervals are overlapping

define i8 @f11(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !10
  ret i8 %y
}
!10 = metadata !{i8 0, i8 2, i8 2, i8 3}
; CHECK: Intervals are contiguous

define i8 @f12(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !11
  ret i8 %y
}
!11 = metadata !{i8 1, i8 2, i8 -1, i8 0}
; CHECK: Intervals are not in order

define i8 @f13(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !12
  ret i8 %y
}
!12 = metadata !{i8 1, i8 3, i8 5, i8 1}
; CHECK: Intervals are contiguous

define i8 @f14(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !13
  ret i8 %y
}
!13 = metadata !{i8 1, i8 3, i8 5, i8 2}
; CHECK: Intervals are overlapping

define i8 @f15(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !14
  ret i8 %y
}
!14 = metadata !{i8 10, i8 1, i8 12, i8 13}
; CHECK: Intervals are overlapping

define i8 @f16(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !16
  ret i8 %y
}
!16 = metadata !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 2}
; CHECK: Intervals are overlapping

define i8 @f17(i8* %x) {
entry:
  %y = load i8* %x, align 1, !range !17
  ret i8 %y
}
!17 = metadata !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 1}
; CHECK: Intervals are contiguous