mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 11:56:07 +00:00

This is the funcref counterpart to 890146b. We introduce a new attribute that marks a function pointer as a funcref. It also implements builtin __builtin_wasm_ref_null_func(), that returns a null funcref value. Differential Revision: https://reviews.llvm.org/D128440
10 lines
503 B
C
10 lines
503 B
C
// RUN: %clang_cc1 -triple powerpc-linux-gnu -fsyntax-only -verify %s
|
|
|
|
// Test that we trigger an error at parse time if using keyword funcref
|
|
// while not using a wasm triple.
|
|
typedef void (*__funcref funcref_t)(); // expected-error {{invalid use of '__funcref' keyword outside the WebAssembly triple}}
|
|
typedef int (*__funcref fn_funcref_t)(int);// expected-error {{invalid use of '__funcref' keyword outside the WebAssembly triple}}
|
|
typedef int (*fn_t)(int);
|
|
|
|
static fn_funcref_t nullFuncref = 0;
|