1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -t | FileCheck %s 2 3// Test that both % and @ are accepted. 4 .global foo 5 .type foo,%function 6foo: 7 8 .global bar 9 .type bar,@object 10bar: 11 12 .type zed,@gnu_unique_object 13zed: 14 15obj: 16 .global obj 17 .type obj,@object 18 .type obj,@notype 19 20func: 21 .global func 22 .type func,@function 23 .type func,@object 24 25ifunc: 26 .global ifunc 27 .type ifunc,@gnu_indirect_function 28 29tls: 30 .global tls 31 .type tls,@tls_object 32 .type tls,@gnu_indirect_function 33 34// Test that "<type>" is accepted. 35tls_quoted: 36 .global tls_quoted 37 .type tls_quoted,"tls_object" 38 39// Test that "<type>" is accepted. 40tls_upper_case: 41 .global tls_upper_case 42 .type tls_upper_case,STT_TLS 43 44// Test that .set doesnt downgrade the type: 45// IFUNC > FUNC > OBJECT > NOTYPE 46// TLS_OBJECT > OBJECT > NOTYPE 47// also TLS_OBJECT is incompatible with IFUNC and FUNC 48 49 .global sym1 50 .type sym1, @gnu_indirect_function 51alias1: 52 .global alias1 53 .type alias1, @function 54 .set sym1, alias1 55 56 .global sym2 57 .type sym2, @gnu_indirect_function 58alias2: 59 .global alias2 60 .type alias2, @object 61 .set sym2, alias2 62 63 .global sym3 64 .type sym3, @gnu_indirect_function 65alias3: 66 .global alias3 67 .type alias3, @notype 68 .set sym3, alias3 69 70 .global sym4 71 .type sym4, @function 72alias4: 73 .global alias4 74 .type alias4, @object 75 .set sym4, alias4 76 77 .global sym5 78 .type sym5, @function 79alias5: 80 .global alias5 81 .type alias5, @notype 82 .set sym5, alias5 83 84 .global sym6 85 .type sym6, @object 86alias6: 87 .global alias6 88 .type alias6, @notype 89 .set sym6, alias6 90 91 .global sym7 92 .type sym7, @gnu_indirect_function 93alias7: 94 .global alias7 95 .type alias7, @tls_object 96 .set sym7, alias7 97 98 .global sym8 99 .type sym8, @function 100 .global alias8 101alias8: 102 .type alias8, @tls_object 103 .set sym8, alias8 104 105 .global sym9 106 .type sym9, @tls_object 107alias9: 108 .global alias9 109 .type alias9, @object 110 .set sym9, alias9 111 112 .global sym10 113 .type sym10, @tls_object 114alias10: 115 .global alias10 116 .type alias10, @notype 117 .set sym10, alias10 118 119 .global sym11 120 .type sym11, @tls_object 121alias11: 122 .global alias11 123 .type alias11, @gnu_indirect_function 124 .set sym11, alias11 125 126 .global sym12 127 .type sym12, @tls_object 128alias12: 129 .global alias12 130 .type alias12, @function 131 .set sym12, alias12 132 133// CHECK: Symbol { 134// CHECK: Name: bar 135// CHECK-NEXT: Value: 0x0 136// CHECK-NEXT: Size: 0 137// CHECK-NEXT: Binding: Global 138// CHECK-NEXT: Type: Object 139// CHECK-NEXT: Other: 0 140// CHECK-NEXT: Section: .text 141// CHECK-NEXT: } 142// CHECK-NEXT: Symbol { 143// CHECK-NEXT: Name: foo 144// CHECK-NEXT: Value: 0x0 145// CHECK-NEXT: Size: 0 146// CHECK-NEXT: Binding: Global 147// CHECK-NEXT: Type: Function 148// CHECK-NEXT: Other: 0 149// CHECK-NEXT: Section: .text 150// CHECK-NEXT: } 151// CHECK-NEXT: Symbol { 152// CHECK-NEXT: Name: func 153// CHECK-NEXT: Value: 0x0 154// CHECK-NEXT: Size: 0 155// CHECK-NEXT: Binding: Global 156// CHECK-NEXT: Type: Function 157// CHECK-NEXT: Other: 0 158// CHECK-NEXT: Section: .text 159// CHECK-NEXT: } 160// CHECK-NEXT: Symbol { 161// CHECK-NEXT: Name: ifunc 162// CHECK-NEXT: Value: 0x0 163// CHECK-NEXT: Size: 0 164// CHECK-NEXT: Binding: Global 165// CHECK-NEXT: Type: GNU_IFunc 166// CHECK-NEXT: Other: 0 167// CHECK-NEXT: Section: .text 168// CHECK-NEXT: } 169// CHECK-NEXT: Symbol { 170// CHECK-NEXT: Name: obj 171// CHECK-NEXT: Value: 0x0 172// CHECK-NEXT: Size: 0 173// CHECK-NEXT: Binding: Global 174// CHECK-NEXT: Type: Object 175// CHECK-NEXT: Other: 0 176// CHECK-NEXT: Section: .text 177// CHECK-NEXT: } 178// CHECK-NEXT: Symbol { 179// CHECK-NEXT: Name: sym1 180// CHECK-NEXT: Value: 0x0 181// CHECK-NEXT: Size: 0 182// CHECK-NEXT: Binding: Global (0x1) 183// CHECK-NEXT: Type: GNU_IFunc (0xA) 184// CHECK-NEXT: Other: 0 185// CHECK-NEXT: Section: .text 186// CHECK-NEXT: } 187// CHECK-NEXT: Symbol { 188// CHECK-NEXT: Name: sym10 189// CHECK-NEXT: Value: 0x0 190// CHECK-NEXT: Size: 0 191// CHECK-NEXT: Binding: Global (0x1) 192// CHECK-NEXT: Type: TLS (0x6) 193// CHECK-NEXT: Other: 0 194// CHECK-NEXT: Section: .text 195// CHECK-NEXT: } 196// CHECK-NEXT: Symbol { 197// CHECK-NEXT: Name: sym11 198// CHECK-NEXT: Value: 0x0 199// CHECK-NEXT: Size: 0 200// CHECK-NEXT: Binding: Global (0x1) 201// CHECK-NEXT: Type: TLS (0x6) 202// CHECK-NEXT: Other: 0 203// CHECK-NEXT: Section: .text 204// CHECK-NEXT: } 205// CHECK-NEXT: Symbol { 206// CHECK-NEXT: Name: sym12 207// CHECK-NEXT: Value: 0x0 208// CHECK-NEXT: Size: 0 209// CHECK-NEXT: Binding: Global (0x1) 210// CHECK-NEXT: Type: TLS (0x6) 211// CHECK-NEXT: Other: 0 212// CHECK-NEXT: Section: .text 213// CHECK-NEXT: } 214// CHECK-NEXT: Symbol { 215// CHECK-NEXT: Name: sym2 216// CHECK-NEXT: Value: 0x0 217// CHECK-NEXT: Size: 0 218// CHECK-NEXT: Binding: Global (0x1) 219// CHECK-NEXT: Type: GNU_IFunc (0xA) 220// CHECK-NEXT: Other: 0 221// CHECK-NEXT: Section: .text 222// CHECK-NEXT: } 223// CHECK-NEXT: Symbol { 224// CHECK-NEXT: Name: sym3 225// CHECK-NEXT: Value: 0x0 226// CHECK-NEXT: Size: 0 227// CHECK-NEXT: Binding: Global (0x1) 228// CHECK-NEXT: Type: GNU_IFunc (0xA) 229// CHECK-NEXT: Other: 0 230// CHECK-NEXT: Section: .text 231// CHECK-NEXT: } 232// CHECK-NEXT: Symbol { 233// CHECK-NEXT: Name: sym4 234// CHECK-NEXT: Value: 0x0 235// CHECK-NEXT: Size: 0 236// CHECK-NEXT: Binding: Global (0x1) 237// CHECK-NEXT: Type: Function (0x2) 238// CHECK-NEXT: Other: 0 239// CHECK-NEXT: Section: .text 240// CHECK-NEXT: } 241// CHECK-NEXT: Symbol { 242// CHECK-NEXT: Name: sym5 243// CHECK-NEXT: Value: 0x0 244// CHECK-NEXT: Size: 0 245// CHECK-NEXT: Binding: Global (0x1) 246// CHECK-NEXT: Type: Function (0x2) 247// CHECK-NEXT: Other: 0 248// CHECK-NEXT: Section: .text 249// CHECK-NEXT: } 250// CHECK-NEXT: Symbol { 251// CHECK-NEXT: Name: sym6 252// CHECK-NEXT: Value: 0x0 253// CHECK-NEXT: Size: 0 254// CHECK-NEXT: Binding: Global (0x1) 255// CHECK-NEXT: Type: Object (0x1) 256// CHECK-NEXT: Other: 0 257// CHECK-NEXT: Section: .text 258// CHECK-NEXT: } 259// CHECK-NEXT: Symbol { 260// CHECK-NEXT: Name: sym7 261// CHECK-NEXT: Value: 0x0 262// CHECK-NEXT: Size: 0 263// CHECK-NEXT: Binding: Global (0x1) 264// CHECK-NEXT: Type: GNU_IFunc (0xA) 265// CHECK-NEXT: Other: 0 266// CHECK-NEXT: Section: .text 267// CHECK-NEXT: } 268// CHECK-NEXT: Symbol { 269// CHECK-NEXT: Name: sym8 270// CHECK-NEXT: Value: 0x0 271// CHECK-NEXT: Size: 0 272// CHECK-NEXT: Binding: Global (0x1) 273// CHECK-NEXT: Type: Function (0x2) 274// CHECK-NEXT: Other: 0 275// CHECK-NEXT: Section: .text 276// CHECK-NEXT: } 277// CHECK-NEXT: Symbol { 278// CHECK-NEXT: Name: sym9 279// CHECK-NEXT: Value: 0x0 280// CHECK-NEXT: Size: 0 281// CHECK-NEXT: Binding: Global (0x1) 282// CHECK-NEXT: Type: TLS (0x6) 283// CHECK-NEXT: Other: 0 284// CHECK-NEXT: Section: .text 285// CHECK-NEXT: } 286// CHECK-NEXT: Symbol { 287// CHECK-NEXT: Name: tls 288// CHECK-NEXT: Value: 0x0 289// CHECK-NEXT: Size: 0 290// CHECK-NEXT: Binding: Global 291// CHECK-NEXT: Type: TLS 292// CHECK-NEXT: Other: 0 293// CHECK-NEXT: Section: .text 294// CHECK-NEXT: } 295// CHECK-NEXT: Symbol { 296// CHECK-NEXT: Name: tls_quoted 297// CHECK-NEXT: Value: 0x0 298// CHECK-NEXT: Size: 0 299// CHECK-NEXT: Binding: Global 300// CHECK-NEXT: Type: TLS 301// CHECK-NEXT: Other: 0 302// CHECK-NEXT: Section: .text 303// CHECK-NEXT: } 304// CHECK-NEXT: Symbol { 305// CHECK-NEXT: Name: tls_upper_case 306// CHECK-NEXT: Value: 0x0 307// CHECK-NEXT: Size: 0 308// CHECK-NEXT: Binding: Global 309// CHECK-NEXT: Type: TLS 310// CHECK-NEXT: Other: 0 311// CHECK-NEXT: Section: .text 312// CHECK-NEXT: } 313// CHECK-NEXT: Symbol { 314// CHECK-NEXT: Name: zed 315// CHECK-NEXT: Value: 0x0 316// CHECK-NEXT: Size: 0 317// CHECK-NEXT: Binding: Unique (0xA) 318// CHECK-NEXT: Type: Object (0x1) 319// CHECK-NEXT: Other: 0 320// CHECK-NEXT: Section: .text 321// CHECK-NEXT: } 322// CHECK-NEXT: ] 323