1# RUN: yaml2obj %s -o %t
2# RUN: cp %t %t1
3
4# RUN: llvm-strip --remove-section=.text.bar %t
5# RUN: llvm-readobj --file-headers --sections --symbols %t | FileCheck %s
6
7# RUN: llvm-objcopy --strip-all --remove-section=.text.bar %t1 %t1
8# RUN: cmp %t %t1
9
10!ELF
11FileHeader:
12  Class:           ELFCLASS64
13  Data:            ELFDATA2LSB
14  Type:            ET_REL
15  Machine:         EM_X86_64
16Sections:
17  - Name:            .debug_foo
18    Type:            SHT_PROGBITS
19    Content:         "00000000"
20  - Name:            .text
21    Type:            SHT_PROGBITS
22    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
23    AddressAlign:    0x0000000000000010
24    Content:         "00000000"
25  - Name:            .text.bar
26    Type:            SHT_PROGBITS
27    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
28    AddressAlign:    0x0000000000000010
29    Content:         "00000000"
30Symbols:
31  - Name:    debugfoo
32    Section: .debug_foo
33    Binding:  STB_GLOBAL
34  - Name:    foo
35    Section: .text
36    Binding:  STB_GLOBAL
37  - Name:    bar
38    Section: .text.bar
39    Binding:  STB_GLOBAL
40
41# CHECK: SectionHeaderCount: 3
42
43# CHECK:     Name: .text
44# CHECK:     Name: .shstrtab
45# CHECK-NOT: Name: .text.bar
46# CHECK-NOT: Name: .debug_foo
47# CHECK-NOT: Name: .symtab
48
49# Check that *only* foo is copied and no debugfoo or textbar
50# CHECK:      Symbols [
51# CHECK-NEXT: ]
52