summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorColin LeMahieu <colinl@codeaurora.org>2015-06-06 20:12:40 +0000
committerColin LeMahieu <colinl@codeaurora.org>2015-06-06 20:12:40 +0000
commit1c8c213529e08e82c26548199f13bfebe42900af (patch)
treee594a82d162b9f418fd663e79e1408facbfef098 /llvm/test
parent253fd159779114fa2bcb9deb814b4db29fa12d0a (diff)
downloadbcm5719-llvm-1c8c213529e08e82c26548199f13bfebe42900af.tar.gz
bcm5719-llvm-1c8c213529e08e82c26548199f13bfebe42900af.zip
[MC] Common symbols weren't being checked for redeclaration which allowed an assembly file to generate an assertion in setCommon(): !isCommon(). This change allows redeclaration as long as the size and alignment match exactly, otherwise report a fatal error.
llvm-svn: 239227
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/ELF/common-error3.s5
-rw-r--r--llvm/test/MC/ELF/common-redeclare.s5
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/MC/ELF/common-error3.s b/llvm/test/MC/ELF/common-error3.s
new file mode 100644
index 00000000000..a84779e653e
--- /dev/null
+++ b/llvm/test/MC/ELF/common-error3.s
@@ -0,0 +1,5 @@
+# RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux %s 2>&1 | FileCheck %s
+
+# CHECK: Symbol: C redeclared as different type
+ .comm C,4,4
+ .comm C,8,4 \ No newline at end of file
diff --git a/llvm/test/MC/ELF/common-redeclare.s b/llvm/test/MC/ELF/common-redeclare.s
new file mode 100644
index 00000000000..f8ee17d84e2
--- /dev/null
+++ b/llvm/test/MC/ELF/common-redeclare.s
@@ -0,0 +1,5 @@
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s | llvm-objdump -t - | FileCheck %s
+
+# CHECK: 0000000000000004 g *COM* 00000004 C
+ .comm C,4,4
+ .comm C,4,4 \ No newline at end of file
OpenPOWER on IntegriCloud