[X86][MC,LLD][NFC] Rename R_X86_64_REX2_GOTPCRELX (#116737)
[llvm-project.git] / lld / test / wasm / tls-align.s
blob4fd296e1ef7fd21362af4faf60b2aee26b3fdc84
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
3 .globaltype __tls_base, i32
4 .globaltype __tls_align, i32, immutable
6 .globl tls1_addr
7 tls1_addr:
8 .functype tls1_addr () -> (i32)
9 global.get __tls_base
10 i32.const tls1
11 i32.add
12 end_function
14 .globl tls2_addr
15 tls2_addr:
16 .functype tls2_addr () -> (i32)
17 global.get __tls_base
18 i32.const tls2
19 i32.add
20 end_function
22 .globl tls_align
23 tls_align:
24 .functype tls_align () -> (i32)
25 global.get __tls_align
26 end_function
28 .section .bss.no_tls,"",@
29 .globl no_tls
30 .p2align 2
31 no_tls:
32 .int32 0
33 .size no_tls, 4
35 .section .tdata.tls1,"",@
36 .globl tls1
37 .p2align 2
38 tls1:
39 .int32 1
40 .size tls1, 4
42 .section .tdata.tls2,"",@
43 .globl tls2
44 .p2align 4
45 tls2:
46 .int32 1
47 .size tls2, 4
49 .section .custom_section.target_features,"",@
50 .int8 2
51 .int8 43
52 .int8 7
53 .ascii "atomics"
54 .int8 43
55 .int8 11
56 .ascii "bulk-memory"
58 # RUN: wasm-ld -no-gc-sections --shared-memory --max-memory=131072 --no-entry -o %t.wasm %t.o
59 # RUN: obj2yaml %t.wasm | FileCheck %s
61 # CHECK: - Type: GLOBAL
62 # CHECK-NEXT: Globals:
63 # CHECK-NEXT: - Index: 0
64 # CHECK-NEXT: Type: I32
65 # CHECK-NEXT: Mutable: true
66 # CHECK-NEXT: InitExpr:
67 # CHECK-NEXT: Opcode: I32_CONST
68 # CHECK-NEXT: Value: 66592
70 # __tls_base
71 # CHECK-NEXT: - Index: 1
72 # CHECK-NEXT: Type: I32
73 # CHECK-NEXT: Mutable: true
74 # CHECK-NEXT: InitExpr:
75 # CHECK-NEXT: Opcode: I32_CONST
76 # CHECK-NEXT: Value: 0
78 # __tls_size
79 # CHECK-NEXT: - Index: 2
80 # CHECK-NEXT: Type: I32
81 # CHECK-NEXT: Mutable: false
82 # CHECK-NEXT: InitExpr:
83 # CHECK-NEXT: Opcode: I32_CONST
84 # CHECK-NEXT: Value: 20
86 # __tls_align
87 # CHECK-NEXT: - Index: 3
88 # CHECK-NEXT: Type: I32
89 # CHECK-NEXT: Mutable: false
90 # CHECK-NEXT: InitExpr:
91 # CHECK-NEXT: Opcode: I32_CONST
92 # CHECK-NEXT: Value: 16