23#include <mlir/TableGen/AttrOrTypeDef.h>
24#include <mlir/TableGen/Dialect.h>
25#include <mlir/TableGen/GenInfo.h>
27#include <llvm/ADT/StringExtras.h>
28#include <llvm/Support/CommandLine.h>
29#include <llvm/Support/FormatVariadic.h>
30#include <llvm/TableGen/Record.h>
31#include <llvm/TableGen/TableGenBackend.h>
37using namespace mlir::tblgen;
40static bool emitTypeCAPITests(
const llvm::RecordKeeper &records, raw_ostream &os) {
42 emitSourceFileHeader(
"Type C API Tests", os, records);
48 generator.genTestClassPrologue();
51 for (
const auto *def : records.getAllDerivedDefinitions(
"TypeDef")) {
52 const AttrOrTypeDef type(def);
53 generator.genCompleteRecord(type,
true);
59static mlir::GenRegistration
60 genTypeCAPITests(
"gen-type-capi-tests",
"Generate type C API unit tests", &emitTypeCAPITests);
This file provides common utilities for generating C API link tests for attributes and types.
Base class for attribute and type test generators.