1 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s | llvm-readelf -s - | FileCheck %s
3 # CHECK: Symbol table '.symtab' contains 34 entries:
4 # CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name
5 # CHECK-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
6 # CHECK-NEXT: 1: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 foo
7 # CHECK-NEXT: 2: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 bar
8 # CHECK-NEXT: 3: 0000000000000000 0 OBJECT UNIQUE DEFAULT 2 zed
9 # CHECK-NEXT: 4: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 obj
10 # CHECK-NEXT: 5: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 func
11 # CHECK-NEXT: 6: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 ifunc
12 # CHECK-NEXT: 7: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls
13 # CHECK-NEXT: 8: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls_quoted
14 # CHECK-NEXT: 9: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls_upper_case
15 # CHECK-NEXT: 10: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym1
16 # CHECK-NEXT: 11: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 alias1
17 # CHECK-NEXT: 12: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym2
18 # CHECK-NEXT: 13: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias2
19 # CHECK-NEXT: 14: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym3
20 # CHECK-NEXT: 15: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias3
21 # CHECK-NEXT: 16: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym4
22 # CHECK-NEXT: 17: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias4
23 # CHECK-NEXT: 18: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym5
24 # CHECK-NEXT: 19: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias5
25 # CHECK-NEXT: 20: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 sym6
26 # CHECK-NEXT: 21: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias6
27 # CHECK-NEXT: 22: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym7
28 # CHECK-NEXT: 23: 0000000000000000 0 TLS GLOBAL DEFAULT 2 alias7
29 # CHECK-NEXT: 24: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym8
30 # CHECK-NEXT: 25: 0000000000000000 0 TLS GLOBAL DEFAULT 2 alias8
31 # CHECK-NEXT: 26: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym9
32 # CHECK-NEXT: 27: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias9
33 # CHECK-NEXT: 28: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym10
34 # CHECK-NEXT: 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias10
35 # CHECK-NEXT: 30: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym11
36 # CHECK-NEXT: 31: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 alias11
37 # CHECK-NEXT: 32: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym12
38 # CHECK-NEXT: 33: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 alias12
40 // Test that both
% and @ are accepted.
49 .type zed,@gnu_unique_object
64 .type ifunc,@gnu_indirect_function
69 .type tls,@gnu_indirect_function
71 // Test that
"<type>" is accepted.
74 .type tls_quoted,"tls_object"
76 // Test that
"<type>" is accepted.
78 .global tls_upper_case
79 .type tls_upper_case,STT_TLS
81 // Test that
.set doesnt downgrade the type:
82 // IFUNC
> FUNC
> OBJECT
> NOTYPE
83 // TLS_OBJECT
> OBJECT
> NOTYPE
84 // also TLS_OBJECT is incompatible with IFUNC
and FUNC
87 .type sym1, @gnu_indirect_function
90 .type alias1, @function
94 .type sym2, @gnu_indirect_function
101 .type sym3, @gnu_indirect_function
104 .type alias3, @notype
108 .type sym4, @function
111 .type alias4, @object
115 .type sym5, @function
118 .type alias5, @notype
125 .type alias6, @notype
129 .type sym7, @gnu_indirect_function
132 .type alias7, @tls_object
136 .type sym8, @function
139 .type alias8, @tls_object
143 .type sym9, @tls_object
146 .type alias9, @object
150 .type sym10, @tls_object
153 .type alias10, @notype
157 .type sym11, @tls_object
160 .type alias11, @gnu_indirect_function
164 .type sym12, @tls_object
167 .type alias12, @function