llvm/mlir/test/CAPI/ir.c

//===- ir.c - Simple test of C APIs ---------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
// Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

/* RUN: mlir-capi-ir-test 2>&1 | FileCheck %s
 */

#include "mlir-c/IR.h"
#include "mlir-c/AffineExpr.h"
#include "mlir-c/AffineMap.h"
#include "mlir-c/BuiltinAttributes.h"
#include "mlir-c/BuiltinTypes.h"
#include "mlir-c/Diagnostics.h"
#include "mlir-c/Dialect/Func.h"
#include "mlir-c/IntegerSet.h"
#include "mlir-c/RegisterEverything.h"
#include "mlir-c/Support.h"

#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static void registerAllUpstreamDialects(MlirContext ctx) {}

struct ResourceDeleteUserData {};
static struct ResourceDeleteUserData resourceI64BlobUserData =;
static void reportResourceDelete(void *userData, const void *data, size_t size,
                                 size_t align) {}

void populateLoopBody(MlirContext ctx, MlirBlock loopBody,
                      MlirLocation location, MlirBlock funcBody) {}

MlirModule makeAndDumpAdd(MlirContext ctx, MlirLocation location) {}

struct OpListNode {};
OpListNode;

struct ModuleStats {};
ModuleStats;

int collectStatsSingle(OpListNode *head, ModuleStats *stats) {}

int collectStats(MlirOperation operation) {}

static void printToStderr(MlirStringRef str, void *userData) {}

static void printFirstOfEach(MlirContext ctx, MlirOperation operation) {}

static int constructAndTraverseIr(MlirContext ctx) {}

/// Creates an operation with a region containing multiple blocks with
/// operations and dumps it. The blocks and operations are inserted using
/// block/operation-relative API and their final order is checked.
static void buildWithInsertionsAndPrint(MlirContext ctx) {}

/// Creates operations with type inference and tests various failure modes.
static int createOperationWithTypeInference(MlirContext ctx) {}

/// Dumps instances of all builtin types to check that C API works correctly.
/// Additionally, performs simple identity checks that a builtin type
/// constructed with C API can be inspected and has the expected type. The
/// latter achieves full coverage of C API for builtin types. Returns 0 on
/// success and a non-zero error code on failure.
static int printBuiltinTypes(MlirContext ctx) {}

void callbackSetFixedLengthString(const char *data, intptr_t len,
                                  void *userData) {}

bool stringIsEqual(const char *lhs, MlirStringRef rhs) {}

int printBuiltinAttributes(MlirContext ctx) {}

int printAffineMap(MlirContext ctx) {}

int printAffineExpr(MlirContext ctx) {}

int affineMapFromExprs(MlirContext ctx) {}

int printIntegerSet(MlirContext ctx) {}

int registerOnlyStd(void) {}

/// Tests backreference APIs
static int testBackreferences(void) {}

/// Tests operand APIs.
int testOperands(void) {}

/// Tests clone APIs.
int testClone(void) {}

// Wraps a diagnostic into additional text we can match against.
MlirLogicalResult errorHandler(MlirDiagnostic diagnostic, void *userData) {}

// Logs when the delete user data callback is called
static void deleteUserData(void *userData) {}

int testTypeID(MlirContext ctx) {}

int testSymbolTable(MlirContext ctx) {}

callBackData;

MlirWalkResult walkCallBack(MlirOperation op, void *rootOpVoid) {}

MlirWalkResult walkCallBackTestWalkResult(MlirOperation op, void *rootOpVoid) {}

int testOperationWalk(MlirContext ctx) {}

int testDialectRegistry(void) {}

void testExplicitThreadPools(void) {}

void testDiagnostics(void) {}

int main(void) {}