@@ -751,3 +751,27 @@ void *tp (void) {
751
751
return __builtin_thread_pointer ();
752
752
// WEBASSEMBLY: call {{.*}} @llvm.thread.pointer.p0()
753
753
}
754
+
755
+
756
+ typedef void (* funcref_t )();
757
+ typedef int (* funcref_int_t )(int );
758
+ typedef float (* F1 )(float , double , int );
759
+ typedef int (* F2 )(float , double , int );
760
+ typedef int (* F3 )(int , int , int );
761
+ typedef void (* F4 )(int , int , int );
762
+ typedef void (* F5 )(void );
763
+
764
+ void use (int );
765
+
766
+ void test_function_pointer_signature_void (F1 func ) {
767
+ // WEBASSEMBLY: %0 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, float 0.000000e+00, float 0.000000e+00, double 0.000000e+00, i32 0)
768
+ use (__builtin_wasm_test_function_pointer_signature (func ));
769
+ // WEBASSEMBLY: %1 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, i32 0, float 0.000000e+00, double 0.000000e+00, i32 0)
770
+ use (__builtin_wasm_test_function_pointer_signature ((F2 )func ));
771
+ // WEBASSEMBLY: %2 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, i32 0, i32 0, i32 0, i32 0)
772
+ use (__builtin_wasm_test_function_pointer_signature ((F3 )func ));
773
+ // WEBASSEMBLY: %3 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token undef, i32 0, i32 0, i32 0)
774
+ use (__builtin_wasm_test_function_pointer_signature ((F4 )func ));
775
+ // WEBASSEMBLY: %4 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token undef)
776
+ use (__builtin_wasm_test_function_pointer_signature ((F5 )func ));
777
+ }
0 commit comments