blob: 4c217f1d9466a211437526a638cfc1dfdca9d7b7 [file] [log] [blame]
Jake Ehrlich1bfefc12017-11-13 22:13:08 +00001# RUN: yaml2obj %s > %t
Alexander Shaposhnikovd7eaf272018-06-04 18:55:41 +00002# RUN: cp %t %t3
Jake Ehrlich1bfefc12017-11-13 22:13:08 +00003# RUN: llvm-objcopy -strip-debug %t %t2
4# RUN: llvm-readobj -file-headers -sections -symbols %t2 | FileCheck %s
5
Alexander Shaposhnikovd7eaf272018-06-04 18:55:41 +00006# Verify that the previous run of llvm-objcopy has not modified the input.
7# RUN: cmp %t %t3
Alexander Shaposhnikovcca69982018-05-07 19:32:09 +00008
Alexander Shaposhnikovcca69982018-05-07 19:32:09 +00009# RUN: llvm-strip -strip-debug %t3
Alexander Shaposhnikovcca69982018-05-07 19:32:09 +000010# RUN: cmp %t2 %t3
11
Alexander Shaposhnikovd7eaf272018-06-04 18:55:41 +000012# RUN: cp %t %t4
13# RUN: llvm-strip -d %t4
14# RUN: cmp %t2 %t4
15
16# RUN: cp %t %t5
17# RUN: llvm-strip -g %t5
18# RUN: cmp %t2 %t5
19
20# RUN: cp %t %t6
21# RUN: llvm-strip -S %t6
22# RUN: cmp %t2 %t6
23
Jake Ehrlich1bfefc12017-11-13 22:13:08 +000024!ELF
25FileHeader:
26 Class: ELFCLASS64
27 Data: ELFDATA2LSB
28 Type: ET_REL
29 Machine: EM_X86_64
30Sections:
31 - Name: .debugfoo
32 Type: SHT_PROGBITS
33 Content: "00000000"
34 - Name: .text
35 Type: SHT_PROGBITS
36 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
37 AddressAlign: 0x0000000000000010
38 Content: "00000000"
39Symbols:
40 Global:
41 - Name: foo
42 Section: .text
43 - Name: debugfoo
44 Section: .debugfoo
45
46# CHECK: SectionHeaderCount: 5
47
48# CHECK: Name: .text
49# CHECK: Name: .symtab
50# CHECK: Name: .strtab
51# CHECK: Name: .shstrtab
52
53# Check that *only* foo is copied and not debugfoo
54# CHECK: Symbols [
55# CHECK-NEXT: Symbol {
56# CHECK-NEXT: Name:
57# CHECK-NEXT: Value:
58# CHECK-NEXT: Size:
59# CHECK-NEXT: Binding:
60# CHECK-NEXT: Type:
61# CHECK-NEXT: Other:
62# CHECK-NEXT: Section: Undefined
63# CHECK-NEXT: }
64# CHECK-NEXT: Symbol {
65# CHECK-NEXT: Name: foo
66# CHECK-NEXT: Value:
67# CHECK-NEXT: Size:
68# CHECK-NEXT: Binding: Global
69# CHECK-NEXT: Type:
70# CHECK-NEXT: Other:
71# CHECK-NEXT: Section: .text
72# CHECK-NEXT: }
73# CHECK-NEXT: ]