Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / common-gc.s
blob6c37f20ffc13f9feca19d959de1dcb197ce6a92d
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
4 # RUN: ld.lld %t -o %t2
5 # RUN: llvm-readobj --sections --symbols %t2 | FileCheck %s --check-prefix=NOGC
7 # NOGC: Name: .bss
8 # NOGC-NEXT: Type:
9 # NOGC-NEXT: Flags [
10 # NOGC-NEXT: SHF_ALLOC
11 # NOGC-NEXT: SHF_WRITE
12 # NOGC-NEXT: ]
13 # NOGC-NEXT: Address:
14 # NOGC-NEXT: Offset:
15 # NOGC-NEXT: Size: 8
17 # NOGC: Name: bar
18 # NOGC: Name: foo
20 # RUN: ld.lld -gc-sections %t -o %t1
21 # RUN: llvm-readobj --sections --symbols %t1 | FileCheck %s --check-prefix=GC
23 # GC: Name: .bss
24 # GC-NEXT: Type:
25 # GC-NEXT: Flags [
26 # GC-NEXT: SHF_ALLOC
27 # GC-NEXT: SHF_WRITE
28 # GC-NEXT: ]
29 # GC-NEXT: Address:
30 # GC-NEXT: Offset:
31 # GC-NEXT: Size: 4
33 # GC-NOT: Name: bar
35 .comm bar,4,4
36 .comm foo,4,4
38 .text
39 .globl _start
40 _start:
41 .quad foo