@@ -745,3 +745,27 @@ void *tp (void) {
745
745
return __builtin_thread_pointer ();
746
746
// WEBASSEMBLY: call {{.*}} @llvm.thread.pointer()
747
747
}
748
+
749
+
750
+ typedef void (* funcref_t )();
751
+ typedef int (* funcref_int_t )(int );
752
+ typedef float (* F1 )(float , double , int );
753
+ typedef int (* F2 )(float , double , int );
754
+ typedef int (* F3 )(int , int , int );
755
+ typedef void (* F4 )(int , int , int );
756
+ typedef void (* F5 )(void );
757
+
758
+ void use (int );
759
+
760
+ void test_function_pointer_signature_void (F1 func ) {
761
+ // 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)
762
+ use (__builtin_wasm_test_function_pointer_signature (func ));
763
+ // 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)
764
+ use (__builtin_wasm_test_function_pointer_signature ((F2 )func ));
765
+ // WEBASSEMBLY: %2 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, i32 0, i32 0, i32 0, i32 0)
766
+ use (__builtin_wasm_test_function_pointer_signature ((F3 )func ));
767
+ // WEBASSEMBLY: %3 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token undef, i32 0, i32 0, i32 0)
768
+ use (__builtin_wasm_test_function_pointer_signature ((F4 )func ));
769
+ // WEBASSEMBLY: %4 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token undef)
770
+ use (__builtin_wasm_test_function_pointer_signature ((F5 )func ));
771
+ }
0 commit comments