diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2014-06-27 18:19:56 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2014-06-27 18:19:56 +0000 |
| commit | dad0a645a7b392900c9fb34f11815060d03a2233 (patch) | |
| tree | 99d27820893e856b1492d86fb612f2a2d147cc99 /llvm/test/CodeGen/X86/elf-comdat2.ll | |
| parent | 3260478c10b56f9ee81cc415c962356b1153cd1c (diff) | |
| download | bcm5719-llvm-dad0a645a7b392900c9fb34f11815060d03a2233.tar.gz bcm5719-llvm-dad0a645a7b392900c9fb34f11815060d03a2233.zip | |
IR: Add COMDATs to the IR
This new IR facility allows us to represent the object-file semantic of
a COMDAT group.
COMDATs allow us to tie together sections and make the inclusion of one
dependent on another. This is required to implement features like MS
ABI VFTables and optimizing away certain kinds of initialization in C++.
This functionality is only representable in COFF and ELF, Mach-O has no
similar mechanism.
Differential Revision: http://reviews.llvm.org/D4178
llvm-svn: 211920
Diffstat (limited to 'llvm/test/CodeGen/X86/elf-comdat2.ll')
| -rw-r--r-- | llvm/test/CodeGen/X86/elf-comdat2.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/elf-comdat2.ll b/llvm/test/CodeGen/X86/elf-comdat2.ll new file mode 100644 index 00000000000..209da39ed88 --- /dev/null +++ b/llvm/test/CodeGen/X86/elf-comdat2.ll @@ -0,0 +1,12 @@ +; RUN: llc -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s + +$foo = comdat any +@bar = global i32 42, comdat $foo +@foo = global i32 42 + +; CHECK: .type bar,@object +; CHECK-NEXT: .section .data.bar,"aGw",@progbits,foo,comdat +; CHECK-NEXT: .globl bar +; CHECK: .type foo,@object +; CHECK-NEXT: .data +; CHECK-NEXT: .globl foo |

