2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %tfile0.o
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/common-filespec1.s -o %tfile1.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/common-filespec2.s -o %tfile2.o
5 # RUN: echo "SECTIONS { .common.incl : { *(EXCLUDE_FILE (*file2.o) COMMON) } .common.excl : { *(COMMON) } }" > %t.script
6 # RUN: ld.lld -o %t1 --script %t.script %tfile0.o %tfile1.o %tfile2.o
7 # RUN: llvm-readobj -S --symbols %t1 | FileCheck %s
9 # Commons from file0 and file1 are not excluded, so they must be in .common.incl
10 # Commons from file2 are excluded from the first rule and should be caught by
11 # the second in .common.excl
14 # CHECK: Name: .common.incl
15 # CHECK-NEXT: Type: SHT_NOBITS
17 # CHECK-NEXT: SHF_ALLOC
18 # CHECK-NEXT: SHF_WRITE
20 # CHECK-NEXT: Address: 0x8
21 # CHECK-NEXT: Offset: 0x
22 # CHECK-NEXT: Size: 16
25 # CHECK-NEXT: AddressAlignment: 8
26 # CHECK-NEXT: EntrySize: 0
30 # CHECK: Name: .common.excl
31 # CHECK-NEXT: Type: SHT_NOBITS
33 # CHECK-NEXT: SHF_ALLOC
34 # CHECK-NEXT: SHF_WRITE
36 # CHECK-NEXT: Address: 0x20
37 # CHECK-NEXT: Offset: 0x
38 # CHECK-NEXT: Size: 48
41 # CHECK-NEXT: AddressAlignment: 16
42 # CHECK-NEXT: EntrySize: 0
45 # CHECK: Name: common_multiple
46 # CHECK-NEXT: Value: 0x20
47 # CHECK-NEXT: Size: 32
48 # CHECK-NEXT: Binding: Global
49 # CHECK-NEXT: Type: Object
50 # CHECK-NEXT: Other: 0
51 # CHECK-NEXT: Section: .common.excl
54 # CHECK: Name: common_uniq_0
55 # CHECK-NEXT: Value: 0x8
57 # CHECK-NEXT: Binding: Global
58 # CHECK-NEXT: Type: Object
59 # CHECK-NEXT: Other: 0
60 # CHECK-NEXT: Section: .common.incl
63 # CHECK: Name: common_uniq_1
64 # CHECK-NEXT: Value: 0x10
66 # CHECK-NEXT: Binding: Global
67 # CHECK-NEXT: Type: Object
68 # CHECK-NEXT: Other: 0
69 # CHECK-NEXT: Section: .common.incl
72 # CHECK: Name: common_uniq_2
73 # CHECK-NEXT: Value: 0x40
74 # CHECK-NEXT: Size: 16
75 # CHECK-NEXT: Binding: Global
76 # CHECK-NEXT: Type: Object
77 # CHECK-NEXT: Other: 0
78 # CHECK-NEXT: Section: .common.excl
85 .comm common_multiple,8,8
86 .comm common_uniq_0,4,4