@@ -796,9 +796,9 @@ void test_function_pointer_funcref(FFuncRef func) {
796
796
// the normal type lowering code.
797
797
// Single element structs are unboxed, multi element structs are passed on
798
798
// stack.
799
- typedef struct {double x ;} (* Fstructs1 )(struct {double x ;}, struct {float x ;}, struct {double x ; float y ;}, union { double x ; float y ;} );
799
+ typedef struct {double x ;} (* Fstructs1 )(struct {double x ;}, struct {float x ;}, struct {double x ; float y ;});
800
800
void test_function_pointer_structs1 (Fstructs1 func ) {
801
- // WEBASSEMBLY: %0 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, double poison, token poison, double poison, float poison, ptr poison, ptr poison )
801
+ // WEBASSEMBLY: %0 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, double poison, token poison, double poison, float poison, ptr poison)
802
802
use (__builtin_wasm_test_function_pointer_signature (func ));
803
803
}
804
804
@@ -808,3 +808,10 @@ void test_function_pointer_structs2(Fstructs2 func) {
808
808
// WEBASSEMBLY: %0 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token poison, ptr poison)
809
809
use (__builtin_wasm_test_function_pointer_signature (func ));
810
810
}
811
+
812
+ // Return union ==> return ptr on stack, one element union => unboxed
813
+ typedef union {double x ; float y ;} (* FUnions )(union {double x ; float y ;}, union {double x ;});
814
+ void test_function_pointer_unions (FUnions func ) {
815
+ // WEBASSEMBLY: %0 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token poison, ptr poison, ptr poison, double poison)
816
+ use (__builtin_wasm_test_function_pointer_signature (func ));
817
+ }
0 commit comments