• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
2
3define void @f1(i8* %x) {
4entry:
5  store i8 0, i8* %x, align 1, !range !0
6  ret void
7}
8!0 = !{i8 0, i8 1}
9; CHECK: Ranges are only for loads, calls and invokes!
10; CHECK-NEXT: store i8 0, i8* %x, align 1, !range !0
11
12define i8 @f2(i8* %x) {
13entry:
14  %y = load i8, i8* %x, align 1, !range !1
15  ret i8 %y
16}
17!1 = !{}
18; CHECK: It should have at least one range!
19
20define i8 @f3(i8* %x) {
21entry:
22  %y = load i8, i8* %x, align 1, !range !2
23  ret i8 %y
24}
25!2 = !{i8 0}
26; CHECK: Unfinished range!
27
28define i8 @f4(i8* %x) {
29entry:
30  %y = load i8, i8* %x, align 1, !range !3
31  ret i8 %y
32}
33!3 = !{double 0.0, i8 0}
34; CHECK: The lower limit must be an integer!
35
36define i8 @f5(i8* %x) {
37entry:
38  %y = load i8, i8* %x, align 1, !range !4
39  ret i8 %y
40}
41!4 = !{i8 0, double 0.0}
42; CHECK: The upper limit must be an integer!
43
44define i8 @f6(i8* %x) {
45entry:
46  %y = load i8, i8* %x, align 1, !range !5
47  ret i8 %y
48}
49!5 = !{i32 0, i8 0}
50; CHECK: Range types must match instruction type!
51; CHECK:  %y = load
52
53define i8 @f7(i8* %x) {
54entry:
55  %y = load i8, i8* %x, align 1, !range !6
56  ret i8 %y
57}
58!6 = !{i8 0, i32 0}
59; CHECK: Range types must match instruction type!
60; CHECK:  %y = load
61
62define i8 @f8(i8* %x) {
63entry:
64  %y = load i8, i8* %x, align 1, !range !7
65  ret i8 %y
66}
67!7 = !{i32 0, i32 0}
68; CHECK: Range types must match instruction type!
69; CHECK:  %y = load
70
71define i8 @f9(i8* %x) {
72entry:
73  %y = load i8, i8* %x, align 1, !range !8
74  ret i8 %y
75}
76!8 = !{i8 0, i8 0}
77; CHECK: Range must not be empty!
78
79define i8 @f10(i8* %x) {
80entry:
81  %y = load i8, i8* %x, align 1, !range !9
82  ret i8 %y
83}
84!9 = !{i8 0, i8 2, i8 1, i8 3}
85; CHECK: Intervals are overlapping
86
87define i8 @f11(i8* %x) {
88entry:
89  %y = load i8, i8* %x, align 1, !range !10
90  ret i8 %y
91}
92!10 = !{i8 0, i8 2, i8 2, i8 3}
93; CHECK: Intervals are contiguous
94
95define i8 @f12(i8* %x) {
96entry:
97  %y = load i8, i8* %x, align 1, !range !11
98  ret i8 %y
99}
100!11 = !{i8 1, i8 2, i8 -1, i8 0}
101; CHECK: Intervals are not in order
102
103define i8 @f13(i8* %x) {
104entry:
105  %y = load i8, i8* %x, align 1, !range !12
106  ret i8 %y
107}
108!12 = !{i8 1, i8 3, i8 5, i8 1}
109; CHECK: Intervals are contiguous
110
111define i8 @f14(i8* %x) {
112entry:
113  %y = load i8, i8* %x, align 1, !range !13
114  ret i8 %y
115}
116!13 = !{i8 1, i8 3, i8 5, i8 2}
117; CHECK: Intervals are overlapping
118
119define i8 @f15(i8* %x) {
120entry:
121  %y = load i8, i8* %x, align 1, !range !14
122  ret i8 %y
123}
124!14 = !{i8 10, i8 1, i8 12, i8 13}
125; CHECK: Intervals are overlapping
126
127define i8 @f16(i8* %x) {
128entry:
129  %y = load i8, i8* %x, align 1, !range !16
130  ret i8 %y
131}
132!16 = !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 2}
133; CHECK: Intervals are overlapping
134
135define i8 @f17(i8* %x) {
136entry:
137  %y = load i8, i8* %x, align 1, !range !17
138  ret i8 %y
139}
140!17 = !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 1}
141; CHECK: Intervals are contiguous
142
143define i8 @f18() {
144entry:
145  %y = call i8 undef(), !range !18
146  ret i8 %y
147}
148!18 = !{}
149; CHECK: It should have at least one range!
150