summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/ELF/comdat-declaration-errors.s
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
commit18e6a788fb156993fc42d22b3e29d49afbf7fa81 (patch)
treea70a0d3f148a105b5c40797dc991a3499f00f235 /llvm/test/MC/ELF/comdat-declaration-errors.s
parentddb096853d008b54788eb427dd1d56387996f00a (diff)
downloadbcm5719-llvm-18e6a788fb156993fc42d22b3e29d49afbf7fa81.tar.gz
bcm5719-llvm-18e6a788fb156993fc42d22b3e29d49afbf7fa81.zip
[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 llvm-svn: 321439
Diffstat (limited to 'llvm/test/MC/ELF/comdat-declaration-errors.s')
-rw-r--r--llvm/test/MC/ELF/comdat-declaration-errors.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/MC/ELF/comdat-declaration-errors.s b/llvm/test/MC/ELF/comdat-declaration-errors.s
new file mode 100644
index 00000000000..fade8cfe41d
--- /dev/null
+++ b/llvm/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
OpenPOWER on IntegriCloud