aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-27 06:44:18 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-27 06:44:18 +0000
commit0ae07098f7d2ad5a1868d448d0b1b4eef2a3b091 (patch)
treee8e00fbae3c35abdbcfe8f7aacd1df44a0fe00b7 /test/MC
parentb1df5b013a38ab7381630af8b3142c56f604d85b (diff)
downloadexternal_llvm-0ae07098f7d2ad5a1868d448d0b1b4eef2a3b091.zip
external_llvm-0ae07098f7d2ad5a1868d448d0b1b4eef2a3b091.tar.gz
external_llvm-0ae07098f7d2ad5a1868d448d0b1b4eef2a3b091.tar.bz2
Merging r195148:
------------------------------------------------------------------------ r195148 | rafael | 2013-11-19 11:52:52 -0800 (Tue, 19 Nov 2013) | 15 lines Support multiple COFF sections with the same name but different COMDAT. This is the first step to fix pr17918. It extends the .section directive a bit, inspired by what the ELF one looks like. The problem with using linkonce is that given .section foo .linkonce.... .section foo .linkonce we would already have switched sections when getting to .linkonce. The cleanest solution seems to be to add the comdat information in the .section itself. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/COFF/section-comdat.s188
1 files changed, 188 insertions, 0 deletions
diff --git a/test/MC/COFF/section-comdat.s b/test/MC/COFF/section-comdat.s
new file mode 100644
index 0000000..dd5be87
--- /dev/null
+++ b/test/MC/COFF/section-comdat.s
@@ -0,0 +1,188 @@
+// RUN: llvm-mc -triple i386-pc-win32 -filetype=obj %s | llvm-readobj -s -t | FileCheck %s
+// RUN: llvm-mc -triple x86_64-pc-win32 -filetype=obj %s | llvm-readobj -s -t | FileCheck %s
+
+.section assocSec
+.linkonce
+.long 1
+
+.section secName, "dr", discard, "Symbol1"
+.globl Symbol1
+Symbol1:
+.long 1
+
+.section secName, "dr", one_only, "Symbol2"
+.globl Symbol2
+Symbol2:
+.long 1
+
+.section SecName, "dr", same_size, "Symbol3"
+.globl Symbol3
+Symbol3:
+.long 1
+
+.section SecName, "dr", same_contents, "Symbol4"
+.globl Symbol4
+Symbol4:
+.long 1
+
+.section SecName, "dr", associative assocSec, "Symbol5"
+.globl Symbol5
+Symbol5:
+.long 1
+
+.section SecName, "dr", largest, "Symbol6"
+.globl Symbol6
+Symbol6:
+.long 1
+
+.section SecName, "dr", newest, "Symbol7"
+.globl Symbol7
+Symbol7:
+.long 1
+
+// CHECK: Sections [
+// CHECK: Section {
+// CHECK: Number: 1
+// CHECK: Name: assocSec
+// CHECK: Characteristics [
+// CHECK: IMAGE_SCN_LNK_COMDAT
+// CHECK: ]
+// CHECK: }
+// CHECK: Section {
+// CHECK: Number: 2
+// CHECK: Name: secName
+// CHECK: Characteristics [
+// CHECK: IMAGE_SCN_LNK_COMDAT
+// CHECK: ]
+// CHECK: }
+// CHECK: Section {
+// CHECK: Number: 3
+// CHECK: Name: secName
+// CHECK: Characteristics [
+// CHECK: IMAGE_SCN_LNK_COMDAT
+// CHECK: ]
+// CHECK: }
+// CHECK: Section {
+// CHECK: Number: 4
+// CHECK: Name: SecName
+// CHECK: Characteristics [
+// CHECK: IMAGE_SCN_LNK_COMDAT
+// CHECK: ]
+// CHECK: }
+// CHECK: Section {
+// CHECK: Number: 5
+// CHECK: Name: SecName
+// CHECK: Characteristics [
+// CHECK: IMAGE_SCN_LNK_COMDAT
+// CHECK: ]
+// CHECK: }
+// CHECK: Section {
+// CHECK: Number: 6
+// CHECK: Name: SecName
+// CHECK: Characteristics [
+// CHECK: IMAGE_SCN_LNK_COMDAT
+// CHECK: ]
+// CHECK: }
+// CHECK: Section {
+// CHECK: Number: 7
+// CHECK: Name: SecName
+// CHECK: Characteristics [
+// CHECK: IMAGE_SCN_LNK_COMDAT
+// CHECK: ]
+// CHECK: }
+// CHECK: Section {
+// CHECK: Number: 8
+// CHECK: Name: SecName
+// CHECK: Characteristics [
+// CHECK: IMAGE_SCN_LNK_COMDAT
+// CHECK: ]
+// CHECK: }
+// CHECK: ]
+// CHECK: Symbols [
+// CHECK: Symbol {
+// CHECK: Name: assocSec
+// CHECK: Section: assocSec (1)
+// CHECK: AuxSectionDef {
+// CHECK: Selection: Any
+// CHECK: }
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: secName
+// CHECK: Section: secName (2)
+// CHECK: AuxSectionDef {
+// CHECK: Selection: Any
+// CHECK: }
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: secName
+// CHECK: Section: secName (3)
+// CHECK: AuxSectionDef {
+// CHECK: Selection: NoDuplicates
+// CHECK: }
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: SecName
+// CHECK: Section: SecName (4)
+// CHECK: AuxSectionDef {
+// CHECK: Selection: SameSize
+// CHECK: }
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: SecName
+// CHECK: Section: SecName (5)
+// CHECK: AuxSymbolCount: 1
+// CHECK: AuxSectionDef {
+// CHECK: Selection: ExactMatch
+// CHECK: }
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: SecName
+// CHECK: Section: SecName (6)
+// CHECK: AuxSectionDef {
+// CHECK: Selection: Associative
+// CHECK: AssocSection: assocSec (1)
+// CHECK: }
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: SecName
+// CHECK: Section: SecName (7)
+// CHECK: AuxSectionDef {
+// CHECK: Selection: Largest
+// CHECK: }
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: SecName
+// CHECK: Section: SecName (8)
+// CHECK: AuxSectionDef {
+// CHECK: Selection: Newest (0x7)
+// CHECK: }
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol1
+// CHECK: Section: secName (2)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol2
+// CHECK: Section: secName (3)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol3
+// CHECK: Section: SecName (4)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol4
+// CHECK: Section: SecName (5)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol5
+// CHECK: Section: SecName (6)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol6
+// CHECK: Section: SecName (7)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol7
+// CHECK: Section: SecName (8)
+// CHECK: }
+// CHECK: ]