1 ; RUN: llc --mtriple=wasm32-unknown-unknown -asm-verbose=false < %s | FileCheck %s
3 @i32_global = local_unnamed_addr addrspace(1) global i32 undef
4 @i64_global = local_unnamed_addr addrspace(1) global i64 undef
5 @f32_global = local_unnamed_addr addrspace(1) global float undef
6 @f64_global = local_unnamed_addr addrspace(1) global double undef
8 define void @set_i32_global(i32 %v) {
9 ; CHECK-LABEL: set_i32_global:
10 ; CHECK-NEXT: functype set_i32_global (i32) -> ()
11 ; CHECK-NEXT: local.get 0
12 ; CHECK-NEXT: global.set i32_global
13 ; CHECK-NEXT: end_function
14 store i32 %v, ptr addrspace(1) @i32_global
18 define void @set_i64_global(i64 %v) {
19 ; CHECK-LABEL: set_i64_global:
20 ; CHECK-NEXT: functype set_i64_global (i64) -> ()
21 ; CHECK-NEXT: local.get 0
22 ; CHECK-NEXT: global.set i64_global
23 ; CHECK-NEXT: end_function
24 store i64 %v, ptr addrspace(1) @i64_global
28 define void @set_f32_global(float %v) {
29 ; CHECK-LABEL: set_f32_global:
30 ; CHECK-NEXT: functype set_f32_global (f32) -> ()
31 ; CHECK-NEXT: local.get 0
32 ; CHECK-NEXT: global.set f32_global
33 ; CHECK-NEXT: end_function
34 store float %v, ptr addrspace(1) @f32_global
38 define void @set_f64_global(double %v) {
39 ; CHECK-LABEL: set_f64_global:
40 ; CHECK-NEXT: functype set_f64_global (f64) -> ()
41 ; CHECK-NEXT: local.get 0
42 ; CHECK-NEXT: global.set f64_global
43 ; CHECK-NEXT: end_function
44 store double %v, ptr addrspace(1) @f64_global
48 ; CHECK: .globaltype i32_global, i32
49 ; CHECK: .globl i32_global
50 ; CHECK-LABEL: i32_global:
52 ; CHECK: .globaltype i64_global, i64
53 ; CHECK: .globl i64_global
54 ; CHECK-LABEL: i64_global:
56 ; CHECK: .globaltype f32_global, f32
57 ; CHECK: .globl f32_global
58 ; CHECK-LABEL: f32_global:
60 ; CHECK: .globaltype f64_global, f64
61 ; CHECK: .globl f64_global
62 ; CHECK-LABEL: f64_global: