summaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-01-26 22:29:43 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-01-26 22:29:43 +0000
commit10096880c8fb08c58d4476577551397bc29f9508 (patch)
tree04b1e483d06f9d92d43498376e33c9e695145bcc /test/MC
parent425eb00894c3eb8df459e0b3ff5efce3dcf5bee9 (diff)
downloadllvm-10096880c8fb08c58d4476577551397bc29f9508.tar.gz
llvm-10096880c8fb08c58d4476577551397bc29f9508.tar.bz2
llvm-10096880c8fb08c58d4476577551397bc29f9508.tar.xz
AsmParser: improve diagnostics for invalid variants
An emitted diagnostic for an invalid relocation variant would place the caret on the token following the relocation variant indicator or at the end of the line if there was no following token. This change corrects the placement of the caret to point to the token. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/AsmParser/variant-diagnostics-2.s11
-rw-r--r--test/MC/AsmParser/variant-diagnostics.s13
2 files changed, 24 insertions, 0 deletions
diff --git a/test/MC/AsmParser/variant-diagnostics-2.s b/test/MC/AsmParser/variant-diagnostics-2.s
new file mode 100644
index 0000000000..bf6a7c772b
--- /dev/null
+++ b/test/MC/AsmParser/variant-diagnostics-2.s
@@ -0,0 +1,11 @@
+# RUN: not llvm-mc -triple i386-linux-gnu -filetype asm -o /dev/null 2>&1 %s \
+# RUN: | FileCheck %s
+
+ .text
+
+function:
+ call external@invalid
+
+# CHECK: error: invalid variant 'invalid'
+# CHECK: call external@invalid
+# CHECK: ^
diff --git a/test/MC/AsmParser/variant-diagnostics.s b/test/MC/AsmParser/variant-diagnostics.s
new file mode 100644
index 0000000000..535ee2686f
--- /dev/null
+++ b/test/MC/AsmParser/variant-diagnostics.s
@@ -0,0 +1,13 @@
+@ RUN: not llvm-mc -triple armv7-linux-eabi -filetype asm -o /dev/null 2>&1 %s \
+@ RUN: | FileCheck %s
+
+ .arch armv7
+
+ .type invalid_variant,%function
+invalid_variant:
+ bx target(invalid)
+
+@ CHECK: error: invalid variant 'invalid'
+@ CHECK: bx target(invalid)
+@ CHECK: ^
+