[flang] Support OPEN(..., FORM="BINARY") (#124657)
[llvm-project.git] / lld / test / ELF / comdat.s
blob32dfc91cf5509149b265f7a0006c1f9359c6438d
1 // REQUIRES: x86
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
7 // RUN: ld.lld -shared --force-group-allocation %t.o %t2.o -o - | cmp - %t
9 // Check that we don't crash with --gc-section and that we print a list of
10 // reclaimed sections on stderr.
11 // RUN: ld.lld --gc-sections --print-gc-sections -shared %t.o %t.o %t2.o -o %t \
12 // RUN: 2>&1 | FileCheck --check-prefix=GC %s
13 // GC: removing unused section {{.*}}.o:(.text)
14 // GC: removing unused section {{.*}}.o:(.text3)
15 // GC: removing unused section {{.*}}.o:(.text)
16 // GC: removing unused section {{.*}}.o:(.text)
18 .globl foo
19 .section .text2,"axG",@progbits,foo,comdat,unique,0
20 foo:
21 nop
23 // CHECK: Disassembly of section .text2:
24 // CHECK-EMPTY:
25 // CHECK-NEXT: <foo>:
26 // CHECK-NEXT: nop
27 // CHECK-NOT: nop
29 .section bar, "ax"
30 call foo
32 // CHECK: Disassembly of section bar:
33 // CHECK-EMPTY:
34 // CHECK-NEXT: <bar>:
35 // CHECK-NEXT: callq {{.*}} <foo@plt>
37 .weak zed
38 zed:
39 .section .text3,"axG",@progbits,zed,comdat,unique,0
41 # READ: .text2 PROGBITS {{.*}} AX
42 # READ: .text3 PROGBITS {{.*}} AX
44 # SYM: NOTYPE LOCAL DEFAULT UND
45 # SYM: NOTYPE LOCAL HIDDEN [[#]] _DYNAMIC
46 # SYM: NOTYPE GLOBAL DEFAULT [[#]] foo
47 # SYM: NOTYPE GLOBAL DEFAULT [[#]] zed
48 # SYM: NOTYPE GLOBAL DEFAULT UND abc