Home | History | Annotate | Download | only in Verifier
      1 ; RUN: not llvm-as < %s -o /dev/null |& 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 = metadata !{i8 0, i8 1}
      9 ; CHECK: Ranges are only for loads!
     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* %x, align 1, !range !1
     15   ret i8 %y
     16 }
     17 !1 = metadata !{}
     18 ; CHECK: It should have at least one range!
     19 ; CHECK-NEXT: metadata
     20 
     21 define i8 @f3(i8* %x) {
     22 entry:
     23   %y = load i8* %x, align 1, !range !2
     24   ret i8 %y
     25 }
     26 !2 = metadata !{i8 0}
     27 ; CHECK: Unfinished range!
     28 
     29 define i8 @f4(i8* %x) {
     30 entry:
     31   %y = load i8* %x, align 1, !range !3
     32   ret i8 %y
     33 }
     34 !3 = metadata !{double 0.0, i8 0}
     35 ; CHECK: The lower limit must be an integer!
     36 
     37 define i8 @f5(i8* %x) {
     38 entry:
     39   %y = load i8* %x, align 1, !range !4
     40   ret i8 %y
     41 }
     42 !4 = metadata !{i8 0, double 0.0}
     43 ; CHECK: The upper limit must be an integer!
     44 
     45 define i8 @f6(i8* %x) {
     46 entry:
     47   %y = load i8* %x, align 1, !range !5
     48   ret i8 %y
     49 }
     50 !5 = metadata !{i32 0, i8 0}
     51 ; CHECK: Range types must match load type!
     52 ; CHECK:  %y = load
     53 
     54 define i8 @f7(i8* %x) {
     55 entry:
     56   %y = load i8* %x, align 1, !range !6
     57   ret i8 %y
     58 }
     59 !6 = metadata !{i8 0, i32 0}
     60 ; CHECK: Range types must match load type!
     61 ; CHECK:  %y = load
     62 
     63 define i8 @f8(i8* %x) {
     64 entry:
     65   %y = load i8* %x, align 1, !range !7
     66   ret i8 %y
     67 }
     68 !7 = metadata !{i32 0, i32 0}
     69 ; CHECK: Range types must match load type!
     70 ; CHECK:  %y = load
     71 
     72 define i8 @f9(i8* %x) {
     73 entry:
     74   %y = load i8* %x, align 1, !range !8
     75   ret i8 %y
     76 }
     77 !8 = metadata !{i8 0, i8 0}
     78 ; CHECK: Range must not be empty!
     79