1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy --discard-all -K foo --keep-symbol bar %t %t2
3 # RUN: llvm-objcopy -K foo -N foo -N bar --keep-symbol bar -N baz %t %t3
4 # RUN: llvm-objcopy --discard-all --regex -K '^ba.*' %t %t4
5 # RUN: llvm-readobj --symbols %t2 | FileCheck %s
6 # RUN: llvm-readobj --symbols %t3 | FileCheck %s
7 # RUN: llvm-readobj --symbols %t4 | FileCheck %s --check-prefix=REGEX
9 # RUN: echo 'foo' > %t.symbols
10 # RUN: echo 'bar' >> %t.symbols
11 # RUN: echo '.* # no regex without --regex' >> %t.symbols
12 # RUN: llvm-objcopy --discard-all --keep-symbols %t.symbols %t %t5
13 # RUN: llvm-objcopy -K foo -N foo -N bar --keep-symbols %t.symbols -N baz %t %t6
14 # RUN: llvm-readobj --symbols %t5 | FileCheck %s
15 # RUN: llvm-readobj --symbols %t6 | FileCheck %s
17 # RUN: echo 'f.*' > %t.symbols.regex
18 # RUN: echo '.*ar' >> %t.symbols.regex
19 # RUN: llvm-objcopy --discard-all --keep-symbols %t.symbols.regex --regex %t %t7
31 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
33 AddressAlign: 0x0000000000000010
55 #CHECK-NEXT: Value: 0x0
57 #CHECK-NEXT: Binding: Local
58 #CHECK-NEXT: Type: None
60 #CHECK-NEXT: Section: Undefined
63 #CHECK-NEXT: Name: foo
64 #CHECK-NEXT: Value: 0x1000
66 #CHECK-NEXT: Binding: Local
67 #CHECK-NEXT: Type: Function
69 #CHECK-NEXT: Section: .text
72 #CHECK-NEXT: Name: bar
73 #CHECK-NEXT: Value: 0x1008
75 #CHECK-NEXT: Binding: Local
76 #CHECK-NEXT: Type: Function
78 #CHECK-NEXT: Section: .text