diff options
author | Philip Reames <listmail@philipreames.com> | 2014-10-20 23:52:07 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2014-10-20 23:52:07 +0000 |
commit | bf9676f7f073e40ea9956cbc99148067bcce96b2 (patch) | |
tree | b7d4665f1b6d2651c366e5d930afe2e7daae4c34 /llvm/test/Verifier/range-1.ll | |
parent | 84801c217c69d31c24d0f1f5c7623fba5ce00536 (diff) | |
download | bcm5719-llvm-bf9676f7f073e40ea9956cbc99148067bcce96b2.tar.gz bcm5719-llvm-bf9676f7f073e40ea9956cbc99148067bcce96b2.zip |
Extend the verifier to validate range metadata on calls and invokes.
Range metadata applies to loads, call, and invokes. We were validating that metadata applied to loads was correct according to the LangRef, but we were not validating metadata applied to calls or invokes. This change extracts the checking functionality to a common location, reuses it for all valid locations, and adds a simple test to ensure a misused range on a call gets reported.
llvm-svn: 220246
Diffstat (limited to 'llvm/test/Verifier/range-1.ll')
-rw-r--r-- | llvm/test/Verifier/range-1.ll | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/test/Verifier/range-1.ll b/llvm/test/Verifier/range-1.ll index f15ca3f7406..0b20ca25dfb 100644 --- a/llvm/test/Verifier/range-1.ll +++ b/llvm/test/Verifier/range-1.ll @@ -48,7 +48,7 @@ entry: ret i8 %y } !5 = metadata !{i32 0, i8 0} -; CHECK: Range types must match load type! +; CHECK: Range types must match instruction type! ; CHECK: %y = load define i8 @f7(i8* %x) { @@ -57,7 +57,7 @@ entry: ret i8 %y } !6 = metadata !{i8 0, i32 0} -; CHECK: Range types must match load type! +; CHECK: Range types must match instruction type! ; CHECK: %y = load define i8 @f8(i8* %x) { @@ -66,7 +66,7 @@ entry: ret i8 %y } !7 = metadata !{i32 0, i32 0} -; CHECK: Range types must match load type! +; CHECK: Range types must match instruction type! ; CHECK: %y = load define i8 @f9(i8* %x) { @@ -140,3 +140,12 @@ entry: } !17 = metadata !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 1} ; CHECK: Intervals are contiguous + +define i8 @f18() { +entry: + %y = call i8 undef(), !range !18 + ret i8 %y +} +!18 = metadata !{} +; CHECK: It should have at least one range! +; CHECK-NEXT: metadata |