llvm-project/llvm/test/TableGen/RuntimeLibcallEmitter-nested-predicates-error.td
Matt Arsenault 5088231e52
TableGen: Allow defining sets of runtime libraries (#144978)
Add a way to define a SystemLibrary for a complete set of
libcalls, subdivided by a predicate based on the triple.
Libraries can be defined using dag set operations, and the
prior default set can be subtracted from and added to (though
I think eventually all targets should move to explicit opt-ins.
We're still doing things like reporting ppcf128 libcalls as
available dy default on all targets).

Start migrating some of the easier targets to only use the new
system. Targets that don't define a SystemLibrary are still
manually mutating a table set to the old defaults.
2025-07-08 10:17:45 +09:00

19 lines
678 B
TableGen

// RUN: not llvm-tblgen -gen-runtime-libcalls -I %p/../../include %s 2>&1 | FileCheck -check-prefix=ERR %s
include "llvm/IR/RuntimeLibcallsImpl.td"
def FUNC0 : RuntimeLibcall;
def FUNC1 : RuntimeLibcall;
def isFoo : RuntimeLibcallPredicate<[{isFoo()}]>;
def isBar : RuntimeLibcallPredicate<[{isBar()}]>;
def isTargetArch : RuntimeLibcallPredicate<[{isTargetArch()}]>;
def func0 : RuntimeLibcallImpl<FUNC0>;
def func1 : RuntimeLibcallImpl<FUNC1>;
// ERR: :[[@LINE+2]]:8: error: combining nested libcall set predicates currently unhandled
def TheSystemLibrary : SystemRuntimeLibrary<isTargetArch,
(add LibcallImpls<(add func0, LibcallImpls<(add func1), isBar>), isFoo>)
>;