diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-05-31 13:45:46 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-05-31 13:45:46 +0000 |
commit | c49b29ef5d4071cc4679d5560855f446f95919fc (patch) | |
tree | 05467ba198eafc2c05ec42aefee52b4fbeb769db /test/Verifier | |
parent | 177cf1e1a3685209ab805f82897902a8d2b61661 (diff) |
Require intervals in the range metadata to be in a canonical form: They must
be non contiguous, non overlapping and sorted by the lower end.
While this is technically a backward incompatibility, every frontent currently
produces range metadata with a single interval and we don't have any pass
that merges intervals yet, so no existing bitcode files should be rejected by
this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier')
-rw-r--r-- | test/Verifier/range-1.ll | 40 | ||||
-rw-r--r-- | test/Verifier/range-2.ll | 14 |
2 files changed, 54 insertions, 0 deletions
diff --git a/test/Verifier/range-1.ll b/test/Verifier/range-1.ll index 611933a1ec..af4382e0fa 100644 --- a/test/Verifier/range-1.ll +++ b/test/Verifier/range-1.ll @@ -76,3 +76,43 @@ entry: } !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, contiguous or not in order + +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 overlapping, contiguous or not in order + +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 overlapping, contiguous or 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: First and last intervals are contiguous or overlap + +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: First and last intervals are contiguous or overlap diff --git a/test/Verifier/range-2.ll b/test/Verifier/range-2.ll index ef542c8c93..8d85d19151 100644 --- a/test/Verifier/range-2.ll +++ b/test/Verifier/range-2.ll @@ -20,3 +20,17 @@ entry: ret i8 %y } !2 = metadata !{i8 1, i8 3, i8 5, i8 42} + +define i8 @f4(i8* %x) { +entry: + %y = load i8* %x, align 1, !range !3 + ret i8 %y +} +!3 = metadata !{i8 -1, i8 0, i8 1, i8 2} + +define i8 @f5(i8* %x) { +entry: + %y = load i8* %x, align 1, !range !4 + ret i8 %y +} +!4 = metadata !{i8 -1, i8 0, i8 1, i8 -2} |