diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-13 21:10:44 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-13 21:10:44 +0000 |
| commit | 6a4848324bc8ed9789e3d9d99e8715b1667547d3 (patch) | |
| tree | 0d7be7c5469f3d78cc75b980930e1f0c72c2d674 /llvm/test/Assembler | |
| parent | a4f2925bd10233f143ef92a4df18a5f2457df0dd (diff) | |
| download | bcm5719-llvm-6a4848324bc8ed9789e3d9d99e8715b1667547d3.tar.gz bcm5719-llvm-6a4848324bc8ed9789e3d9d99e8715b1667547d3.zip | |
AsmParser/Bitcode: Add support for MDLocation
This adds assembly and bitcode support for `MDLocation`. The assembly
side is rather big, since this is the first `MDNode` subclass (that
isn't `MDTuple`). Part of PR21433.
(If you're wondering where the mountains of testcase updates are, we
don't need them until I update `DILocation` and `DebugLoc` to actually
use this class.)
llvm-svn: 225830
Diffstat (limited to 'llvm/test/Assembler')
6 files changed, 52 insertions, 0 deletions
diff --git a/llvm/test/Assembler/invalid-mdlocation-field-bad.ll b/llvm/test/Assembler/invalid-mdlocation-field-bad.ll new file mode 100644 index 00000000000..6ec7c64bb4d --- /dev/null +++ b/llvm/test/Assembler/invalid-mdlocation-field-bad.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s + +; CHECK: <stdin>:[[@LINE+1]]:18: error: invalid field 'bad' +!0 = !MDLocation(bad: 0) diff --git a/llvm/test/Assembler/invalid-mdlocation-field-twice.ll b/llvm/test/Assembler/invalid-mdlocation-field-twice.ll new file mode 100644 index 00000000000..2335c935a5f --- /dev/null +++ b/llvm/test/Assembler/invalid-mdlocation-field-twice.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s + +!0 = !{} + +; CHECK: <stdin>:[[@LINE+1]]:38: error: field 'line' cannot be specified more than once +!1 = !MDLocation(line: 3, scope: !0, line: 3) diff --git a/llvm/test/Assembler/invalid-mdlocation-overflow-column.ll b/llvm/test/Assembler/invalid-mdlocation-overflow-column.ll new file mode 100644 index 00000000000..d1dbb27173d --- /dev/null +++ b/llvm/test/Assembler/invalid-mdlocation-overflow-column.ll @@ -0,0 +1,9 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s + +!0 = !{} + +; CHECK-NOT: error +!1 = !MDLocation(column: 255, scope: !0) + +; CHECK: <stdin>:[[@LINE+1]]:26: error: value for 'column' too large, limit is 255 +!2 = !MDLocation(column: 256, scope: !0) diff --git a/llvm/test/Assembler/invalid-mdlocation-overflow-line.ll b/llvm/test/Assembler/invalid-mdlocation-overflow-line.ll new file mode 100644 index 00000000000..8e19f6919bf --- /dev/null +++ b/llvm/test/Assembler/invalid-mdlocation-overflow-line.ll @@ -0,0 +1,9 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s + +!0 = !{} + +; CHECK-NOT: error +!1 = !MDLocation(line: 16777215, scope: !0) + +; CHECK: <stdin>:[[@LINE+1]]:24: error: value for 'line' too large, limit is 16777215 +!2 = !MDLocation(line: 16777216, scope: !0) diff --git a/llvm/test/Assembler/invalid-specialized-mdnode.ll b/llvm/test/Assembler/invalid-specialized-mdnode.ll new file mode 100644 index 00000000000..9a84abbb314 --- /dev/null +++ b/llvm/test/Assembler/invalid-specialized-mdnode.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s + +; CHECK: <stdin>:[[@LINE+1]]:6: error: expected metadata type +!0 = !Invalid(field: 0) diff --git a/llvm/test/Assembler/mdlocation.ll b/llvm/test/Assembler/mdlocation.ll new file mode 100644 index 00000000000..e1216fa2750 --- /dev/null +++ b/llvm/test/Assembler/mdlocation.ll @@ -0,0 +1,20 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s + +; CHECK: !named = !{!0, !1, !1, !2, !2, !3, !3} +!named = !{!0, !1, !2, !3, !4, !5, !6} + +; CHECK: !0 = !{} +!0 = !{} + +; CHECK-NEXT: !1 = !MDLocation(line: 3, column: 7, scope: !0) +!1 = !MDLocation(line: 3, column: 7, scope: !0) +!2 = !MDLocation(scope: !0, column: 7, line: 3) + +; CHECK-NEXT: !2 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !1) +!3 = !MDLocation(scope: !0, inlinedAt: !1, column: 7, line: 3) +!4 = !MDLocation(column: 7, line: 3, scope: !0, inlinedAt: !1) + +; CHECK-NEXT: !3 = !MDLocation(scope: !0) +!5 = !MDLocation(scope: !0) +!6 = !MDLocation(scope: !0, column: 0, line: 0) |

