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 | |
Alexander Shaposhnikov | 42b5ef0 | 2018-07-06 17:51:03 +0000 | [diff] [blame] | 24 | # RUN: rm -f %t.a |
| 25 | # RUN: llvm-ar crs %t.a %t |
| 26 | # RUN: llvm-objcopy --strip-all %t.a %t.a |
| 27 | # RUN: llvm-ar p %t.a > %t6 |
| 28 | # RUN: cmp %t2 %t6 |
| 29 | |
Stephen Hines | e8c3c5f | 2018-07-12 17:42:17 +0000 | [diff] [blame] | 30 | # RUN: cp %t %t7 |
| 31 | # RUN: llvm-strip -strip-all %t7 |
| 32 | # RUN: cmp %t2 %t7 |
| 33 | |
| 34 | # RUN: cp %t %t8 |
| 35 | # RUN: llvm-strip --strip-all %t8 |
| 36 | # RUN: cmp %t2 %t8 |
| 37 | |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 38 | !ELF |
| 39 | FileHeader: |
| 40 | Class: ELFCLASS64 |
| 41 | Data: ELFDATA2LSB |
| 42 | Type: ET_REL |
| 43 | Machine: EM_X86_64 |
| 44 | Sections: |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 45 | - Name: .bss |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 46 | Type: SHT_NOBITS |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 47 | Flags: [ SHF_ALLOC ] |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 48 | - Name: .text |
| 49 | Type: SHT_PROGBITS |
| 50 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 51 | - Name: .blarg |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 52 | Type: SHT_PROGBITS |
| 53 | Flags: [ ] |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 54 | - Name: .gnu.warning.foo |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 55 | Type: SHT_PROGBITS |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 56 | |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 57 | # CHECK: SectionHeaderCount: 5 |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 58 | |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 59 | # CHECK: Name: .bss |
| 60 | # CHECK: Name: .text |
| 61 | # CHECK: Name: .gnu.warning.foo |
| 62 | # CHECK: Name: .shstrtab |