Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / llvm-objcopy / ELF / globalize.test
blob044e5e8e634809aa31554a295f58322893f9a997
1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy --globalize-symbol Global \
3 # RUN:   --globalize-symbol Local \
4 # RUN:   --globalize-symbol Weak \
5 # RUN:   --globalize-symbol WeakUndef \
6 # RUN:   --globalize-symbol Missing %t %t2
7 # RUN: llvm-readobj --symbols %t2 | FileCheck %s
8 # RUN: llvm-objcopy --regex --globalize-symbol='[GLW].*' %t %t3
9 # RUN: cmp %t2 %t3
10 # RUN: echo " Global # global" > %t-list.txt
11 # RUN: echo "Local" >> %t-list.txt
12 # RUN: echo "Weak" >> %t-list.txt
13 # RUN: echo "WeakUndef" >> %t-list.txt
14 # RUN: echo "Missing" >> %t-list.txt
15 # RUN: echo " # comment " >> %t-list.txt
16 # RUN: llvm-objcopy --globalize-symbols %t-list.txt %t %t4
17 # RUN: cmp %t2 %t4
18 # RUN: echo "[GLW].+ # .+ " > %t-list2.txt
19 # RUN: llvm-objcopy --regex --globalize-symbols %t-list2.txt %t %t5
20 # RUN: cmp %t2 %t5
22 !ELF
23 FileHeader:
24   Class:           ELFCLASS64
25   Data:            ELFDATA2LSB
26   Type:            ET_REL
27   Machine:         EM_X86_64
28 Sections:
29   - Name:            .text
30     Type:            SHT_PROGBITS
31     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
32     Address:         0x1000
33     AddressAlign:    0x0000000000000010
34     Size:            64
35 Symbols:
36   - Name:     Local
37     Type:     STT_FUNC
38     Section:  .text
39     Value:    0x1000
40     Size:     8
41   - Name:     Global
42     Type:     STT_FUNC
43     Size:     8
44     Section:  .text
45     Value:    0x1010
46     Binding:  STB_GLOBAL
47   - Name:     Weak
48     Type:     STT_FUNC
49     Size:     8
50     Section:  .text
51     Value:    0x1008
52     Binding:  STB_WEAK
53   - Name:     WeakUndef
54     Binding:  STB_WEAK
55   - Name:     Unspecified
56     Section:  .text
57     Binding:  STB_WEAK
59 #CHECK: Symbols [
60 #CHECK-NEXT:  Symbol {
61 #CHECK-NEXT:    Name:
62 #CHECK-NEXT:    Value: 0x0
63 #CHECK-NEXT:    Size: 0
64 #CHECK-NEXT:    Binding: Local
65 #CHECK-NEXT:    Type: None
66 #CHECK-NEXT:    Other: 0
67 #CHECK-NEXT:    Section: Undefined
68 #CHECK-NEXT:  }
69 #CHECK-NEXT:  Symbol {
70 #CHECK-NEXT:    Name: Local
71 #CHECK-NEXT:    Value: 0x1000
72 #CHECK-NEXT:    Size: 8
73 #CHECK-NEXT:    Binding: Global
74 #CHECK-NEXT:    Type: Function
75 #CHECK-NEXT:    Other: 0
76 #CHECK-NEXT:    Section: .text
77 #CHECK-NEXT:  }
78 #CHECK-NEXT:  Symbol {
79 #CHECK-NEXT:    Name: Global
80 #CHECK-NEXT:    Value: 0x1010
81 #CHECK-NEXT:    Size: 8
82 #CHECK-NEXT:    Binding: Global
83 #CHECK-NEXT:    Type: Function
84 #CHECK-NEXT:    Other: 0
85 #CHECK-NEXT:    Section: .text
86 #CHECK-NEXT:  }
87 #CHECK-NEXT:  Symbol {
88 #CHECK-NEXT:    Name: Weak
89 #CHECK-NEXT:    Value: 0x1008
90 #CHECK-NEXT:    Size: 8
91 #CHECK-NEXT:    Binding: Global
92 #CHECK-NEXT:    Type: Function
93 #CHECK-NEXT:    Other: 0
94 #CHECK-NEXT:    Section: .text
95 #CHECK-NEXT:  }
96 #CHECK-NEXT:  Symbol {
97 #CHECK-NEXT:    Name: WeakUndef
98 #CHECK-NEXT:    Value: 0x0
99 #CHECK-NEXT:    Size: 0
100 #CHECK-NEXT:    Binding: Weak
101 #CHECK-NEXT:    Type: None
102 #CHECK-NEXT:    Other: 0
103 #CHECK-NEXT:    Section: Undefined
104 #CHECK-NEXT:  }
105 #CHECK-NEXT:  Symbol {
106 #CHECK-NEXT:    Name: Unspecified
107 #CHECK-NEXT:    Value: 0x0
108 #CHECK-NEXT:    Size: 0
109 #CHECK-NEXT:    Binding: Weak
110 #CHECK-NEXT:    Type: None
111 #CHECK-NEXT:    Other: 0
112 #CHECK-NEXT:    Section: .text
113 #CHECK-NEXT:  }
114 #CHECK-NEXT:]