[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / llvm / test / MC / WebAssembly / global-ctor-dtor.ll
blobf1ec71da1ebb64129176143926ec20b2c002f2ed
1 ; RUN: llc -mcpu=mvp -filetype=obj %s -o - | obj2yaml | FileCheck %s
3 target triple = "wasm32-unknown-unknown"
5 @global1 = global i32 1025, align 8
7 declare void @func0()
8 declare void @func1()
9 declare void @func2()
10 declare void @func3()
12 @llvm.global_ctors = appending global [2 x { i32, ptr, ptr }] [
13   { i32, ptr, ptr } { i32 65535, ptr @func0, ptr null },
14   { i32, ptr, ptr } { i32 42,    ptr @func1, ptr null }
17 @llvm.global_dtors = appending global [2 x { i32, ptr, ptr }] [
18   { i32, ptr, ptr } { i32 65535, ptr @func2, ptr null },
19   { i32, ptr, ptr } { i32 42,    ptr @func3, ptr null }
22 ; CHECK:        - Type:            IMPORT
23 ; CHECK-NEXT:     Imports:
24 ; CHECK-NEXT:       - Module:          env
25 ; CHECK-NEXT:         Field:           __linear_memory
26 ; CHECK-NEXT:         Kind:            MEMORY
27 ; CHECK-NEXT:         Memory:
28 ; CHECK-NEXT:           Minimum:         0x1
29 ; CHECK-NEXT:       - Module:          env
30 ; CHECK-NEXT:         Field:           func3
31 ; CHECK-NEXT:         Kind:            FUNCTION
32 ; CHECK-NEXT:         SigIndex:        1
33 ; CHECK-NEXT:       - Module:          env
34 ; CHECK-NEXT:         Field:           __cxa_atexit
35 ; CHECK-NEXT:         Kind:            FUNCTION
36 ; CHECK-NEXT:         SigIndex:        2
37 ; CHECK-NEXT:       - Module:          env
38 ; CHECK-NEXT:         Field:           func2
39 ; CHECK-NEXT:         Kind:            FUNCTION
40 ; CHECK-NEXT:         SigIndex:        1
41 ; CHECK-NEXT:       - Module:          env
42 ; CHECK-NEXT:         Field:           func1
43 ; CHECK-NEXT:         Kind:            FUNCTION
44 ; CHECK-NEXT:         SigIndex:        1
45 ; CHECK-NEXT:       - Module:          env
46 ; CHECK-NEXT:         Field:           func0
47 ; CHECK-NEXT:         Kind:            FUNCTION
48 ; CHECK-NEXT:         SigIndex:        1
49 ; CHECK-NEXT:       - Module:          env
50 ; CHECK-NEXT:         Field:           __indirect_function_table
51 ; CHECK-NEXT:         Kind:            TABLE
52 ; CHECK-NEXT:         Table:
53 ; CHECK-NEXT:           Index:           0
54 ; CHECK-NEXT:           ElemType:        FUNCREF
55 ; CHECK-NEXT:           Limits:
56 ; CHECK-NEXT:             Minimum:         0x2
57 ; CHECK-NEXT:   - Type:            FUNCTION
58 ; CHECK-NEXT:     FunctionTypes:   [ 0, 1, 0, 1 ]
59 ; CHECK-NEXT:   - Type:            ELEM
60 ; CHECK-NEXT:     Segments:
61 ; CHECK-NEXT:       - Offset:
62 ; CHECK-NEXT:           Opcode:          I32_CONST
63 ; CHECK-NEXT:           Value:           1
64 ; CHECK-NEXT:         Functions:       [ 5, 7 ]
65 ; CHECK-NEXT:   - Type:            DATACOUNT
66 ; CHECK-NEXT:     Count:           1
67 ; CHECK-NEXT:   - Type:            CODE
68 ; CHECK-NEXT:     Relocations:
69 ; CHECK-NEXT:       - Type:            R_WASM_FUNCTION_INDEX_LEB
70 ; CHECK-NEXT:         Index:           1
71 ; CHECK-NEXT:         Offset:          0x4
72 ; CHECK-NEXT:       - Type:            R_WASM_TABLE_INDEX_SLEB
73 ; CHECK-NEXT:         Index:           0
74 ; CHECK-NEXT:         Offset:          0xF
75 ; CHECK-NEXT:       - Type:            R_WASM_MEMORY_ADDR_SLEB
76 ; CHECK-NEXT:         Index:           3
77 ; CHECK-NEXT:         Offset:          0x17
78 ; CHECK-NEXT:       - Type:            R_WASM_FUNCTION_INDEX_LEB
79 ; CHECK-NEXT:         Index:           4
80 ; CHECK-NEXT:         Offset:          0x1D
81 ; CHECK-NEXT:       - Type:            R_WASM_FUNCTION_INDEX_LEB
82 ; CHECK-NEXT:         Index:           6
83 ; CHECK-NEXT:         Offset:          0x2B
84 ; CHECK-NEXT:       - Type:            R_WASM_TABLE_INDEX_SLEB
85 ; CHECK-NEXT:         Index:           5
86 ; CHECK-NEXT:         Offset:          0x36
87 ; CHECK-NEXT:       - Type:            R_WASM_MEMORY_ADDR_SLEB
88 ; CHECK-NEXT:         Index:           3
89 ; CHECK-NEXT:         Offset:          0x3E
90 ; CHECK-NEXT:       - Type:            R_WASM_FUNCTION_INDEX_LEB
91 ; CHECK-NEXT:         Index:           4
92 ; CHECK-NEXT:         Offset:          0x44
93 ; CHECK-NEXT:     Functions:
94 ; CHECK-NEXT:       - Index:           5
95 ; CHECK-NEXT:         Locals:
96 ; CHECK-NEXT:         Body:            1080808080000B
97 ; CHECK-NEXT:       - Index:           6
98 ; CHECK-NEXT:         Locals:
99 ; CHECK-NEXT:         Body:            02404181808080004100418080808000108180808000450D00000B0B
100 ; CHECK-NEXT:       - Index:           7
101 ; CHECK-NEXT:         Locals:
102 ; CHECK-NEXT:         Body:            1082808080000B
103 ; CHECK-NEXT:       - Index:           8
104 ; CHECK-NEXT:         Locals:
105 ; CHECK-NEXT:         Body:            02404182808080004100418080808000108180808000450D00000B0B
106 ; CHECK-NEXT:   - Type:            DATA
107 ; CHECK-NEXT:     Segments:
108 ; CHECK-NEXT:       - SectionOffset:   6
109 ; CHECK-NEXT:         InitFlags:       0
110 ; CHECK-NEXT:         Offset:
111 ; CHECK-NEXT:           Opcode:          I32_CONST
112 ; CHECK-NEXT:           Value:           0
113 ; CHECK-NEXT:         Content:         '01040000'
114 ; CHECK-NEXT:   - Type:            CUSTOM
115 ; CHECK-NEXT:     Name:            linking
116 ; CHECK-NEXT:     Version:         2
117 ; CHECK-NEXT:     SymbolTable:
118 ; CHECK-NEXT:       - Index:           0
119 ; CHECK-NEXT:         Kind:            FUNCTION
120 ; CHECK-NEXT:         Name:            .Lcall_dtors.42
121 ; CHECK-NEXT:         Flags:           [ BINDING_LOCAL ]
122 ; CHECK-NEXT:         Function:        5
123 ; CHECK-NEXT:       - Index:           1
124 ; CHECK-NEXT:         Kind:            FUNCTION
125 ; CHECK-NEXT:         Name:            func3
126 ; CHECK-NEXT:         Flags:           [ UNDEFINED ]
127 ; CHECK-NEXT:         Function:        0
128 ; CHECK-NEXT:       - Index:           2
129 ; CHECK-NEXT:         Kind:            FUNCTION
130 ; CHECK-NEXT:         Name:            .Lregister_call_dtors.42
131 ; CHECK-NEXT:         Flags:           [ BINDING_LOCAL ]
132 ; CHECK-NEXT:         Function:        6
133 ; CHECK-NEXT:       - Index:           3
134 ; CHECK-NEXT:         Kind:            DATA
135 ; CHECK-NEXT:         Name:            __dso_handle
136 ; CHECK-NEXT:         Flags:           [ BINDING_WEAK, VISIBILITY_HIDDEN, UNDEFINED ]
137 ; CHECK-NEXT:       - Index:           4
138 ; CHECK-NEXT:         Kind:            FUNCTION
139 ; CHECK-NEXT:         Name:            __cxa_atexit
140 ; CHECK-NEXT:         Flags:           [ UNDEFINED ]
141 ; CHECK-NEXT:         Function:        1
142 ; CHECK-NEXT:       - Index:           5
143 ; CHECK-NEXT:         Kind:            FUNCTION
144 ; CHECK-NEXT:         Name:            .Lcall_dtors
145 ; CHECK-NEXT:         Flags:           [ BINDING_LOCAL ]
146 ; CHECK-NEXT:         Function:        7
147 ; CHECK-NEXT:       - Index:           6
148 ; CHECK-NEXT:         Kind:            FUNCTION
149 ; CHECK-NEXT:         Name:            func2
150 ; CHECK-NEXT:         Flags:           [ UNDEFINED ]
151 ; CHECK-NEXT:         Function:        2
152 ; CHECK-NEXT:       - Index:           7
153 ; CHECK-NEXT:         Kind:            FUNCTION
154 ; CHECK-NEXT:         Name:            .Lregister_call_dtors
155 ; CHECK-NEXT:         Flags:           [ BINDING_LOCAL ]
156 ; CHECK-NEXT:         Function:        8
157 ; CHECK-NEXT:       - Index:           8
158 ; CHECK-NEXT:         Kind:            DATA
159 ; CHECK-NEXT:         Name:            global1
160 ; CHECK-NEXT:         Flags:           [  ]
161 ; CHECK-NEXT:         Segment:         0
162 ; CHECK-NEXT:         Size:            4
163 ; CHECK-NEXT:       - Index:           9
164 ; CHECK-NEXT:         Kind:            FUNCTION
165 ; CHECK-NEXT:         Name:            func1
166 ; CHECK-NEXT:         Flags:           [ UNDEFINED ]
167 ; CHECK-NEXT:         Function:        3
168 ; CHECK-NEXT:       - Index:           10
169 ; CHECK-NEXT:         Kind:            FUNCTION
170 ; CHECK-NEXT:         Name:            func0
171 ; CHECK-NEXT:         Flags:           [ UNDEFINED ]
172 ; CHECK-NEXT:         Function:        4
173 ; CHECK-NEXT:     SegmentInfo:
174 ; CHECK-NEXT:       - Index:           0
175 ; CHECK-NEXT:         Name:            .data.global1
176 ; CHECK-NEXT:         Alignment:       3
177 ; CHECK-NEXT:         Flags:           [ ]
178 ; CHECK-NEXT:     InitFunctions:
179 ; CHECK-NEXT:       - Priority: 42
180 ; CHECK-NEXT:         Symbol: 9
181 ; CHECK-NEXT:       - Priority: 42
182 ; CHECK-NEXT:         Symbol: 2
183 ; CHECK-NEXT:       - Priority: 65535
184 ; CHECK-NEXT:         Symbol: 10
185 ; CHECK-NEXT:       - Priority: 65535
186 ; CHECK-NEXT:         Symbol: 7
187 ; CHECK-NEXT: ...