Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 1 | # RUN: yaml2obj %s > %t |
Alexander Shaposhnikov | ecc8483 | 2018-05-31 20:42:13 +0000 | [diff] [blame^] | 2 | # RUN: cp %t %t3 |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 3 | # RUN: llvm-objcopy --strip-all %t %t2 |
| 4 | # RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s |
| 5 | |
Alexander Shaposhnikov | ecc8483 | 2018-05-31 20:42:13 +0000 | [diff] [blame^] | 6 | # Verify that the previous llvm-objcopy's run has not modified the input. |
| 7 | # RUN: cmp %t %t3 |
Alexander Shaposhnikov | cca6998 | 2018-05-07 19:32:09 +0000 | [diff] [blame] | 8 | |
Alexander Shaposhnikov | cca6998 | 2018-05-07 19:32:09 +0000 | [diff] [blame] | 9 | # RUN: llvm-strip %t3 |
Alexander Shaposhnikov | cca6998 | 2018-05-07 19:32:09 +0000 | [diff] [blame] | 10 | # RUN: cmp %t2 %t3 |
| 11 | |
Alexander Shaposhnikov | ecc8483 | 2018-05-31 20:42:13 +0000 | [diff] [blame^] | 12 | # RUN: cp %t %t4 |
| 13 | # RUN: llvm-strip %t4 -o %t5 |
| 14 | # RUN: cmp %t2 %t5 |
| 15 | |
| 16 | # Verify that the previous llvm-strip's run has not modified the input. |
| 17 | # RUN: cmp %t %t4 |
| 18 | |
| 19 | # RUN: cp %t %t-should-remain-the-same |
| 20 | # RUN: llvm-strip %t4 -o %t-should-remain-the-same -o %t-should-be-stripped |
| 21 | # RUN: cmp %t2 %t-should-be-stripped |
| 22 | # RUN: cmp %t %t-should-remain-the-same |
| 23 | |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 24 | !ELF |
| 25 | FileHeader: |
| 26 | Class: ELFCLASS64 |
| 27 | Data: ELFDATA2LSB |
| 28 | Type: ET_REL |
| 29 | Machine: EM_X86_64 |
| 30 | Sections: |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 31 | - Name: .bss |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 32 | Type: SHT_NOBITS |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 33 | Flags: [ SHF_ALLOC ] |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 34 | - Name: .text |
| 35 | Type: SHT_PROGBITS |
| 36 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 37 | - Name: .blarg |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 38 | Type: SHT_PROGBITS |
| 39 | Flags: [ ] |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 40 | - Name: .gnu.warning.foo |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 41 | Type: SHT_PROGBITS |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 42 | |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 43 | # CHECK: SectionHeaderCount: 5 |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 44 | |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 45 | # CHECK: Name: .bss |
| 46 | # CHECK: Name: .text |
| 47 | # CHECK: Name: .gnu.warning.foo |
| 48 | # CHECK: Name: .shstrtab |