summaryrefslogtreecommitdiff
path: root/test/ELF/gc-sections-alloc.s
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:19:15 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:19:15 +0000
commitd93e1dfac8711cfed1a9d9cd1876a788b83945cd (patch)
tree5896fa6c02a262a6148b215487e545d937de58b7 /test/ELF/gc-sections-alloc.s
parent8d43286d630f9224de07809ea253e83ebb9cdee6 (diff)
Notes
Diffstat (limited to 'test/ELF/gc-sections-alloc.s')
-rw-r--r--test/ELF/gc-sections-alloc.s31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/ELF/gc-sections-alloc.s b/test/ELF/gc-sections-alloc.s
new file mode 100644
index 0000000000000..bffd1f9cdcab7
--- /dev/null
+++ b/test/ELF/gc-sections-alloc.s
@@ -0,0 +1,31 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: ld.lld %t -o %t2 --gc-sections -shared
+# RUN: llvm-readobj -sections -section-data %t2 | FileCheck %s
+
+# Non alloca section .bar should not keep section .foo alive.
+
+# CHECK-NOT: Name: .foo
+
+# CHECK: Name: .bar
+# CHECK-NEXT: Type: SHT_PROGBITS
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address:
+# CHECK-NEXT: Offset:
+# CHECK-NEXT: Size:
+# CHECK-NEXT: Link:
+# CHECK-NEXT: Info:
+# CHECK-NEXT: AddressAlignment:
+# CHECK-NEXT: EntrySize:
+# CHECK-NEXT: SectionData (
+# CHECK-NEXT: 0000: 00000000 00000000 |
+# CHECK-NEXT: )
+
+
+.section .foo,"a"
+.byte 0
+
+.section .bar
+.quad .foo