2 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-pc-linux
%s
-o
%t.o
3 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-pc-linux
%p
/Inputs
/comdat.s
-o
%t2.o
4 // RUN
: ld.lld
-shared
%t.o
%t2.o
-o
%t
5 // RUN
: llvm-objdump
-d
%t | FileCheck
%s
6 // RUN
: llvm-readelf
-S
-s
%t | FileCheck
--check-prefix
=READ
%s
8 // Check that we don
't crash with --gc-section and that we print a list of
9 // reclaimed sections on stderr.
10 // RUN: ld.lld --gc-sections --print-gc-sections -shared %t.o %t.o %t2.o -o %t \
11 // RUN: 2>&1 | FileCheck --check-prefix=GC %s
12 // GC: removing unused section {{.*}}.o:(.text)
13 // GC: removing unused section {{.*}}.o:(.text3)
14 // GC: removing unused section {{.*}}.o:(.text)
15 // GC: removing unused section {{.*}}.o:(.text)
18 .section .text2,"axG",@progbits,foo,comdat,unique,0
22 // CHECK: Disassembly of section .text2:
31 // CHECK: Disassembly of section bar:
34 // CHECK-NEXT: callq {{.*}} <foo@plt>
38 .section .text3,"axG",@progbits,zed,comdat,unique,0
40 # READ: .text2 PROGBITS {{.*}} AX
41 # READ: .text3 PROGBITS {{.*}} AX
43 # SYM: NOTYPE LOCAL DEFAULT UND
44 # SYM: NOTYPE LOCAL HIDDEN [[#]] _DYNAMIC
45 # SYM: NOTYPE GLOBAL DEFAULT [[#]] foo
46 # SYM: NOTYPE GLOBAL DEFAULT [[#]] zed
47 # SYM: NOTYPE GLOBAL DEFAULT UND abc