Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / llvm-objcopy / ELF / prefix-symbols.test
blob8c6503d4c8e09d729928969febca1653b5592670
1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy --prefix-symbols prefix %t %t2
3 # RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefixes=COMMON,BASIC
4 # RUN: llvm-objcopy --redefine-sym bar=baz --prefix-symbols prefix %t %t3
5 # RUN: llvm-readobj --symbols %t3 | FileCheck %s --check-prefixes=COMMON,REDEF
7 ## Show that an empty string is permitted as the argument to
8 ## --prefix-symbols.
9 # RUN: llvm-objcopy --prefix-symbols= %t2 %t4
10 # RUN: cmp %t2 %t4
12 ## Show that the last prefix wins.
13 # RUN: llvm-objcopy --prefix-symbols foo --prefix-symbols prefix %t %t5
14 # RUN: cmp %t2 %t5
16 !ELF
17 FileHeader:
18   Class:           ELFCLASS64
19   Data:            ELFDATA2LSB
20   Type:            ET_REL
21   Machine:         EM_X86_64
22 Sections:
23   - Name:            .text
24     Type:            SHT_PROGBITS
25     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
26     Address:         0x1000
27     AddressAlign:    0x0000000000000010
28     Size:            64
29 Symbols:
30   - Name:     foo
31     Type:     STT_SECTION
32     Section:  .text
33   - Name:     bar
34     Type:     STT_FILE
35     Section:  .text
36   - Name:     foobar
37     Type:     STT_FUNC
38     Section:  .text
39     Binding:  STB_GLOBAL
40   - Name:     undef
41     Binding:  STB_GLOBAL
43 # COMMON: Symbols [
44 # COMMON-NEXT:  Symbol {
45 # COMMON-NEXT:    Name:
46 # COMMON-NEXT:    Value: 0x0
47 # COMMON-NEXT:    Size: 0
48 # COMMON-NEXT:    Binding: Local
49 # COMMON-NEXT:    Type: None
50 # COMMON-NEXT:    Other: 0
51 # COMMON-NEXT:    Section: Undefined
52 # COMMON-NEXT:  }
53 # COMMON-NEXT:  Symbol {
54 # COMMON-NEXT:    Name: foo
55 # COMMON-NEXT:    Value: 0x0
56 # COMMON-NEXT:    Size: 0
57 # COMMON-NEXT:    Binding: Local
58 # COMMON-NEXT:    Type: Section
59 # COMMON-NEXT:    Other: 0
60 # COMMON-NEXT:    Section: .text
61 # COMMON-NEXT:  }
62 # COMMON-NEXT:  Symbol {
63 # BASIC-NEXT:    Name: prefixbar
64 # REDEF-NEXT:    Name: prefixbaz
65 # COMMON-NEXT:    Value: 0x0
66 # COMMON-NEXT:    Size: 0
67 # COMMON-NEXT:    Binding: Local
68 # COMMON-NEXT:    Type: File
69 # COMMON-NEXT:    Other: 0
70 # COMMON-NEXT:    Section: .text
71 # COMMON-NEXT:  }
72 # COMMON-NEXT:  Symbol {
73 # COMMON-NEXT:    Name: prefixfoobar
74 # COMMON-NEXT:    Value: 0x0
75 # COMMON-NEXT:    Size: 0
76 # COMMON-NEXT:    Binding: Global
77 # COMMON-NEXT:    Type: Function
78 # COMMON-NEXT:    Other: 0
79 # COMMON-NEXT:    Section: .text
80 # COMMON-NEXT:  }
81 # COMMON-NEXT:  Symbol {
82 # COMMON-NEXT:    Name: prefixundef
83 # COMMON-NEXT:    Value: 0x0
84 # COMMON-NEXT:    Size: 0
85 # COMMON-NEXT:    Binding: Global
86 # COMMON-NEXT:    Type: None
87 # COMMON-NEXT:    Other: 0
88 # COMMON-NEXT:    Section: Undefined
89 # COMMON-NEXT:  }
90 # COMMON-NEXT:]