1 # RUN: yaml2obj %s > %t.o
2 # RUN: llvm-objcopy %t.o %t.2.o
3 # RUN: llvm-readelf --elf-section-groups --sections %t.o | FileCheck %s --check-prefix=IN
4 # RUN: llvm-readelf --elf-section-groups --sections %t.2.o | FileCheck %s --check-prefix=OUT
6 # In this test, .group gets moved to the beginning. Run readelf -gS on input as
7 # well as output to make sure it really moved, as well as to verify that we
8 # aren't purely sorting based on offsets (it gets moved to the beginning
9 # despite having a larger offset).
11 # IN: There are 7 section headers, starting at offset 0x160:
12 # IN: [Nr] Name Type Address Off Size
13 # IN-NEXT: [ 0] NULL 0000000000000000 000000 000000
14 # IN-NEXT: [ 1] .foo PROGBITS 0000000000000000 000040 000040
15 # IN-NEXT: [ 2] .group GROUP 0000000000000000 000080 000008
16 # IN-NEXT: [ 3] .bar PROGBITS 0000000000000000 000088 000040
18 # IN: COMDAT group section [ 2] `.group' [bar] contains 1 sections:
19 # IN-NEXT: [Index] Name
22 # OUT: There are 7 section headers, starting at offset 0x160:
23 # OUT: [Nr] Name Type Address Off Size
24 # OUT-NEXT: [ 0] NULL 0000000000000000 000000 000000
25 # OUT-NEXT: [ 1] .group GROUP 0000000000000000 000040 000008
26 # OUT-NEXT: [ 2] .foo PROGBITS 0000000000000000 000048 000040
27 # OUT-NEXT: [ 3] .bar PROGBITS 0000000000000000 000088 000040
29 # OUT: COMDAT group section [ 1] `.group' [bar] contains 1 sections:
30 # OUT-NEXT: [Index] Name
42 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
49 - SectionOrType: GRP_COMDAT
53 Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]