mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 15:56:40 +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
14 lines
382 B
C++
14 lines
382 B
C++
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -fsyntax-only -verify -triple wasm32 -Wno-unused-value -target-feature +reference-types %s
|
|
|
|
// Testing that funcrefs work on template aliases
|
|
// expected-no-diagnostics
|
|
|
|
using IntIntFuncref = int(*)(int) __funcref;
|
|
using DoubleQual = IntIntFuncref __funcref;
|
|
|
|
int get(int);
|
|
|
|
IntIntFuncref getFuncref() {
|
|
return get;
|
|
}
|