summaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-12-25 09:41:00 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-12-25 09:41:00 +0000
commit76618721e0da56377b77906f97bcf407a0b801d7 (patch)
tree4b58238527c43abd31248de322129b9413066f59 /test/MC
parentcbe298eee6ea9aa21fa062244e5e449b2da1052b (diff)
[MC] - Disallow invalid section groups declarations.
This fixes parseGroup() so that it always sets error condition on error. Previously it was not done, because parseIdentifier looks never do that, assuming that caller should do it if he wants to. So previously cases from test were silently accepted and produced broken output. Differential revision: https://reviews.llvm.org/D41559 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/ELF/comdat-declaration-errors.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/MC/ELF/comdat-declaration-errors.s b/test/MC/ELF/comdat-declaration-errors.s
new file mode 100644
index 00000000000..fade8cfe41d
--- /dev/null
+++ b/test/MC/ELF/comdat-declaration-errors.s
@@ -0,0 +1,14 @@
+// RUN: not llvm-mc -triple x86_64-pc-linux-gnu %s \
+// RUN: -filetype=obj -o %t.o 2>&1 | FileCheck %s
+
+// Check we error out on incorrect COMDATs declarations
+// and not just silently ingnore them.
+
+// CHECK: error: invalid group name
+// CHECK-NEXT: .section .foo,"G",@progbits,-abc,comdat
+
+// CHECK: error: invalid linkage
+// CHECK-NEXT: .section .bar,"G",@progbits,abc,-comdat
+
+.section .foo,"G",@progbits,-abc,comdat
+.section .bar,"G",@progbits,abc,-comdat