1 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s 2 3 define void @f1(i8* %x) { 4 entry: 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 12 define i8 @f2(i8* %x) { 13 entry: 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 20 define i8 @f3(i8* %x) { 21 entry: 22 %y = load i8, i8* %x, align 1, !range !2 23 ret i8 %y 24 } 25 !2 = !{i8 0} 26 ; CHECK: Unfinished range! 27 28 define i8 @f4(i8* %x) { 29 entry: 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 36 define i8 @f5(i8* %x) { 37 entry: 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 44 define i8 @f6(i8* %x) { 45 entry: 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 53 define i8 @f7(i8* %x) { 54 entry: 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 62 define i8 @f8(i8* %x) { 63 entry: 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 71 define i8 @f9(i8* %x) { 72 entry: 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 79 define i8 @f10(i8* %x) { 80 entry: 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 87 define i8 @f11(i8* %x) { 88 entry: 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 95 define i8 @f12(i8* %x) { 96 entry: 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 103 define i8 @f13(i8* %x) { 104 entry: 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 111 define i8 @f14(i8* %x) { 112 entry: 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 119 define i8 @f15(i8* %x) { 120 entry: 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 127 define i8 @f16(i8* %x) { 128 entry: 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 135 define i8 @f17(i8* %x) { 136 entry: 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 143 define i8 @f18() { 144 entry: 145 %y = call i8 undef(), !range !18 146 ret i8 %y 147 } 148 !18 = !{} 149 ; CHECK: It should have at least one range! 150