1 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
3 define void @f1(ptr %x) {
5 store i8 0, ptr %x, align 1, !range !0
9 ; CHECK: Ranges are only for loads, calls and invokes!
10 ; CHECK-NEXT: store i8 0, ptr %x, align 1, !range !0
12 define i8 @f2(ptr %x) {
14 %y = load i8, ptr %x, align 1, !range !1
18 ; CHECK: It should have at least one range!
20 define i8 @f3(ptr %x) {
22 %y = load i8, ptr %x, align 1, !range !2
26 ; CHECK: Unfinished range!
28 define i8 @f4(ptr %x) {
30 %y = load i8, ptr %x, align 1, !range !3
33 !3 = !{double 0.0, i8 0}
34 ; CHECK: The lower limit must be an integer!
36 define i8 @f5(ptr %x) {
38 %y = load i8, ptr %x, align 1, !range !4
41 !4 = !{i8 0, double 0.0}
42 ; CHECK: The upper limit must be an integer!
44 define i8 @f6(ptr %x) {
46 %y = load i8, ptr %x, align 1, !range !5
50 ; CHECK: Range pair types must match!
53 define i8 @f7(ptr %x) {
55 %y = load i8, ptr %x, align 1, !range !6
59 ; CHECK: Range pair types must match!
62 define i8 @f8(ptr %x) {
64 %y = load i8, ptr %x, align 1, !range !7
68 ; CHECK: Range types must match instruction type!
71 define i8 @f9(ptr %x) {
73 %y = load i8, ptr %x, align 1, !range !8
77 ; CHECK: Range must not be empty!
79 define i8 @f10(ptr %x) {
81 %y = load i8, ptr %x, align 1, !range !9
84 !9 = !{i8 0, i8 2, i8 1, i8 3}
85 ; CHECK: Intervals are overlapping
87 define i8 @f11(ptr %x) {
89 %y = load i8, ptr %x, align 1, !range !10
92 !10 = !{i8 0, i8 2, i8 2, i8 3}
93 ; CHECK: Intervals are contiguous
95 define i8 @f12(ptr %x) {
97 %y = load i8, ptr %x, align 1, !range !11
100 !11 = !{i8 1, i8 2, i8 -1, i8 0}
101 ; CHECK: Intervals are not in order
103 define i8 @f13(ptr %x) {
105 %y = load i8, ptr %x, align 1, !range !12
108 !12 = !{i8 1, i8 3, i8 5, i8 1}
109 ; CHECK: Intervals are contiguous
111 define i8 @f14(ptr %x) {
113 %y = load i8, ptr %x, align 1, !range !13
116 !13 = !{i8 1, i8 3, i8 5, i8 2}
117 ; CHECK: Intervals are overlapping
119 define i8 @f15(ptr %x) {
121 %y = load i8, ptr %x, align 1, !range !14
124 !14 = !{i8 10, i8 1, i8 12, i8 13}
125 ; CHECK: Intervals are overlapping
127 define i8 @f16(ptr %x) {
129 %y = load i8, ptr %x, align 1, !range !16
132 !16 = !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 2}
133 ; CHECK: Intervals are overlapping
135 define i8 @f17(ptr %x) {
137 %y = load i8, ptr %x, align 1, !range !17
140 !17 = !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 1}
141 ; CHECK: Intervals are contiguous
145 %y = call i8 undef(), !range !18
149 ; CHECK: It should have at least one range!
151 define <2 x i8> @vector_range_wrong_type(ptr %x) {
152 %y = load <2 x i8>, ptr %x, !range !19
155 !19 = !{i16 0, i16 10}
156 ; CHECK: Range types must match instruction type!
158 define i32 @range_assert(ptr %x) {
159 %y = load i32, ptr %x, !range !20
162 ; CHECK: The upper and lower limits cannot be the same value{{$}}
163 !20 = !{i32 123, i32 123}