1 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -verify-machineinstrs | FileCheck %s
2 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -verify-machineinstrs -fast-isel | FileCheck %s
4 ; ModuleID = 'test/dot_s/indirect-import.c'
5 source_filename = "test/dot_s/indirect-import.c"
6 target triple = "wasm32"
8 ; CHECK: .functype extern_fd (f64) -> (f32)
9 ; CHECK: .functype extern_vj (i64) -> ()
10 ; CHECK: .functype extern_v () -> ()
11 ; CHECK: .functype extern_ijidf (i64, i32, f64, f32) -> (i32)
12 ; CHECK: .functype extern_struct (i32) -> ()
13 ; CHECK: .functype extern_sret (i32) -> ()
14 ; CHECK: .functype extern_i128ret (i32, i64) -> ()
16 %struct.big = type { float, double, i32 }
18 ; Function Attrs: nounwind
20 define hidden i32 @bar() #0 {
22 %fd = alloca ptr, align 4
23 %vj = alloca ptr, align 4
24 %v = alloca ptr, align 4
25 %ijidf = alloca ptr, align 4
26 %vs = alloca ptr, align 4
27 %s = alloca ptr, align 4
28 %i128ret = alloca ptr, align 8
30 ; CHECK-DAG: i32.const {{.+}}=, extern_fd
31 ; CHECK-DAG: i32.const {{.+}}=, extern_vj
32 store ptr @extern_fd, ptr %fd, align 4
33 store ptr @extern_vj, ptr %vj, align 4
34 %0 = load ptr, ptr %vj, align 4
37 ; CHECK: i32.const {{.+}}=, extern_v
38 store ptr @extern_v, ptr %v, align 4
39 %1 = load ptr, ptr %v, align 4
42 ; CHECK: i32.const {{.+}}=, extern_ijidf
43 store ptr @extern_ijidf, ptr %ijidf, align 4
44 %2 = load ptr, ptr %ijidf, align 4
45 %call = call i32 %2(i64 1, i32 2, double 3.000000e+00, float 4.000000e+00)
47 ; CHECK-DAG: i32.const {{.+}}=, extern_struct
48 ; CHECK-DAG: i32.const {{.+}}=, extern_sret
49 store ptr @extern_struct, ptr %vs, align 4
50 store ptr @extern_sret, ptr %s, align 4
51 %3 = load ptr, ptr %fd, align 4
52 %4 = ptrtoint ptr %3 to i32
54 ; CHECK: i32.const {{.+}}=, extern_i128ret
55 store ptr @extern_i128ret, ptr %i128ret, align 8
56 %5 = load ptr, ptr %i128ret, align 8
57 %6 = call i128 %5(i64 1)
62 declare float @extern_fd(double) #1
64 declare void @extern_vj(i64) #1
66 declare void @extern_v() #1
68 declare i32 @extern_ijidf(i64, i32, double, float) #1
70 declare void @extern_struct(ptr byval(%struct.big) align 8) #1
72 declare void @extern_sret(ptr sret(%struct.big)) #1
74 declare i128 @extern_i128ret(i64) #1
76 attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
77 attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }