1 # RUN: llvm-mc -triple=wasm64-unknown-unknown < %s | FileCheck %s
2 # RUN: llvm-mc -triple=wasm64-unknown-unknown -filetype=obj -o %t.o < %s
3 # RUN: obj2yaml %t.o | FileCheck %s --check-prefix=CHECK-OBJ --match-full-lines
5 .globaltype __tls_base, i64
8 .functype tls_store (i32) -> ()
9 # CHECK: global.get __tls_base
10 # CHECK-NEXT: i64.const tls1@TLSREL
12 # CHECK-NEXT: local.get 0
13 # CHECK-NEXT: i32.store 0
21 .section .tls.foo,"T",@
22 # CHECK: .tls.foo,"T",@
27 .section custom_tls,"T",@
28 # CHECK: custom_tls,"T",@
33 # CHECK-OBJ: - Type: CODE
34 # CHECK-OBJ-NEXT: Relocations:
35 # CHECK-OBJ-NEXT: - Type: R_WASM_GLOBAL_INDEX_LEB
36 # CHECK-OBJ-NEXT: Index: 1
37 # CHECK-OBJ-NEXT: Offset: 0x4
38 # CHECK-OBJ-NEXT: - Type: R_WASM_MEMORY_ADDR_TLS_SLEB64
39 # CHECK-OBJ-NEXT: Index: 2
40 # CHECK-OBJ-NEXT: Offset: 0xA
42 # CHECK-OBJ: - Type: CUSTOM
43 # CHECK-OBJ-NEXT: Name: linking
44 # CHECK-OBJ-NEXT: Version: 2
45 # CHECK-OBJ-NEXT: SymbolTable:
46 # CHECK-OBJ-NEXT: - Index: 0
47 # CHECK-OBJ-NEXT: Kind: FUNCTION
48 # CHECK-OBJ-NEXT: Name: tls_store
49 # CHECK-OBJ-NEXT: Flags: [ BINDING_LOCAL ]
50 # CHECK-OBJ-NEXT: Function: 0
51 # CHECK-OBJ-NEXT: - Index: 1
52 # CHECK-OBJ-NEXT: Kind: GLOBAL
53 # CHECK-OBJ-NEXT: Name: __tls_base
54 # CHECK-OBJ-NEXT: Flags: [ UNDEFINED ]
55 # CHECK-OBJ-NEXT: Global: 0
56 # CHECK-OBJ-NEXT: - Index: 2
57 # CHECK-OBJ-NEXT: Kind: DATA
58 # CHECK-OBJ-NEXT: Name: tls1
59 # CHECK-OBJ-NEXT: Flags: [ BINDING_LOCAL, TLS ]
60 # CHECK-OBJ-NEXT: Segment: 0
61 # CHECK-OBJ-NEXT: Size: 4
62 # CHECK-OBJ-NEXT: - Index: 3
63 # CHECK-OBJ-NEXT: Kind: DATA
64 # CHECK-OBJ-NEXT: Name: tls2
65 # CHECK-OBJ-NEXT: Flags: [ BINDING_LOCAL, TLS ]
66 # CHECK-OBJ-NEXT: Segment: 1
67 # CHECK-OBJ-NEXT: Size: 4
68 # CHECK-OBJ-NEXT: SegmentInfo:
69 # CHECK-OBJ-NEXT: - Index: 0
70 # CHECK-OBJ-NEXT: Name: .tls.foo
71 # CHECK-OBJ-NEXT: Alignment: 0
72 # CHECK-OBJ-NEXT: Flags: [ TLS ]
73 # CHECK-OBJ-NEXT: - Index: 1
74 # CHECK-OBJ-NEXT: Name: custom_tls
75 # CHECK-OBJ-NEXT: Alignment: 0
76 # CHECK-OBJ-NEXT: Flags: [ TLS ]