# This file is licensed 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 load("//mlir:tblgen.bzl", "gentbl_cc_library") package( default_visibility = ["//visibility:public"], features = ["layering_check"], ) licenses(["notice"]) cc_test( name = "debug_tests", size = "small", srcs = glob([ "Debug/*.cpp", "Debug/*.h", ]), deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:Debug", "//mlir:IR", "//mlir:Support", "//third-party/unittest:gmock", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "ir_tests", size = "small", srcs = glob([ "IR/*.cpp", "IR/*.h", ]), deps = [ "//llvm:Support", "//mlir:FunctionInterfaces", "//mlir:IR", "//mlir:Parser", "//mlir:Support", "//mlir/test:TestDialect", "//third-party/unittest:gmock", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "interface_tests", size = "small", srcs = glob([ "Interfaces/*.cpp", "Interfaces/*.h", ]), deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:ArithDialect", "//mlir:ControlFlowInterfaces", "//mlir:DLTIDialect", "//mlir:DataLayoutInterfaces", "//mlir:FuncDialect", "//mlir:IR", "//mlir:InferIntRangeInterface", "//mlir:InferTypeOpInterface", "//mlir:Parser", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "support_tests", size = "small", srcs = glob([ "Support/*.cpp", "Support/*.h", ]), deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:Support", "//third-party/unittest:gmock", "//third-party/unittest:gtest_main", ], ) cc_test( name = "pass_tests", size = "small", srcs = glob([ "Pass/*.cpp", "Pass/*.h", ]), deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:Analysis", "//mlir:Debug", "//mlir:FuncDialect", "//mlir:IR", "//mlir:Pass", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "rewrite_tests", size = "small", srcs = glob([ "Rewrite/*.cpp", "Rewrite/*.h", ]), deps = [ "//mlir:IR", "//mlir:Rewrite", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "dialect_tests", size = "small", srcs = glob([ "Dialect/*.cpp", "Dialect/*.h", ]), deps = [ "//llvm:Support", "//mlir:Dialect", "//third-party/unittest:gmock", "//third-party/unittest:gtest_main", ], ) cc_test( name = "memref_tests", size = "small", srcs = glob([ "Dialect/MemRef/*.cpp", "Dialect/MemRef/*.h", ]), deps = [ "//llvm:TestingSupport", "//mlir:IR", "//mlir:MemRefDialect", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "quantops_tests", size = "small", srcs = glob([ "Dialect/Quant/*.cpp", "Dialect/Quant/*.h", ]), deps = [ "//llvm:TestingSupport", "//mlir:QuantOps", "//mlir:Transforms", "//third-party/unittest:gtest_main", ], ) cc_test( name = "scf_tests", size = "small", srcs = glob([ "Dialect/SCF/*.cpp", "Dialect/SCF/*.h", ]), deps = [ "//mlir:ArithDialect", "//mlir:FuncDialect", "//mlir:IR", "//mlir:Parser", "//mlir:SCFDialect", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "sparse_tensor_tests", size = "small", srcs = glob([ "Dialect/SparseTensor/*.cpp", "Dialect/SparseTensor/*.h", ]), deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:SparseTensorUtils", "//third-party/unittest:gmock", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "spirv_tests", size = "small", srcs = glob([ "Dialect/SPIRV/*.cpp", "Dialect/SPIRV/*.h", ]), deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:IR", "//mlir:SPIRVBinaryUtils", "//mlir:SPIRVDeserialization", "//mlir:SPIRVDialect", "//mlir:SPIRVSerialization", "//third-party/unittest:gmock", "//third-party/unittest:gtest_main", ], ) cc_test( name = "transform_dialect_tests", size = "small", srcs = glob([ "Dialect/Transform/*.cpp", "Dialect/Transform/*.h", ]), deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:FuncDialect", "//mlir:IR", "//mlir:MlirOptLib", "//mlir:Parser", "//mlir:Pass", "//mlir:Support", "//mlir:TransformDebugExtension", "//mlir:TransformDialect", "//mlir:TransformDialectTransforms", "//mlir/test:TestTransformDialect", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "dialect_utils_tests", size = "small", srcs = glob([ "Dialect/Utils/*.cpp", "Dialect/Utils/*.h", ]), deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:DialectUtils", "//mlir:IR", "//third-party/unittest:gmock", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) gentbl_cc_library( name = "EnumsIncGen", tbl_outs = [ ( ["-gen-enum-decls"], "TableGen/EnumsGenTest.h.inc", ), ( ["-gen-enum-defs"], "TableGen/EnumsGenTest.cpp.inc", ), ], tblgen = "//mlir:mlir-tblgen", td_file = "TableGen/enums.td", deps = [ "//mlir:OpBaseTdFiles", ], ) gentbl_cc_library( name = "PassIncGen", tbl_outs = [ ( ["-gen-pass-decls"], "TableGen/PassGenTest.h.inc", ), ], tblgen = "//mlir:mlir-tblgen", td_file = "TableGen/passes.td", deps = [ "//mlir:PassBaseTdFiles", "//mlir:RewritePassBaseTdFiles", ], ) cc_test( name = "tablegen_tests", size = "small", srcs = glob([ "TableGen/*.cpp", "TableGen/*.h", ]) + [ "TableGen/EnumsGenTest.cpp.inc", "TableGen/EnumsGenTest.h.inc", ], includes = ["TableGen/"], deps = [ ":EnumsIncGen", ":PassIncGen", "//llvm:Support", "//llvm:TestingSupport", "//mlir:IR", "//mlir:Pass", "//mlir:Support", "//mlir:TableGen", "//mlir/test:TestDialect", "//third-party/unittest:gmock", "//third-party/unittest:gtest_main", ], ) cc_test( name = "transforms_test", size = "small", srcs = glob([ "Transforms/*.cpp", "Transforms/*.h", ]), deps = [ "//mlir:AffineAnalysis", "//mlir:IR", "//mlir:Parser", "//mlir:Pass", "//mlir:TransformUtils", "//mlir:Transforms", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "analysis_tests", size = "small", srcs = glob([ "Analysis/*.cpp", "Analysis/*.h", "Analysis/*/*.cpp", "Analysis/*/*.h", ]), deps = [ "//llvm:TestingSupport", "//mlir:AffineAnalysis", "//mlir:Analysis", "//mlir:AsmParser", "//mlir:IR", "//mlir:Parser", "//mlir:Support", "//third-party/unittest:gmock", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "bytecode_tests", size = "small", srcs = glob([ "Bytecode/*.cpp", "Bytecode/*.h", "Bytecode/*/*.cpp", "Bytecode/*/*.h", ]), deps = [ "//llvm:Support", "//mlir:BytecodeReader", "//mlir:BytecodeWriter", "//mlir:IR", "//mlir:Parser", "//third-party/unittest:gmock", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "conversion_tests", size = "small", srcs = glob([ "Conversion/*.cpp", "Conversion/*.h", "Conversion/*/*.cpp", "Conversion/*/*.h", ]), deps = [ "//mlir:ArithDialect", "//mlir:IR", "//mlir:PDLToPDLInterp", "//third-party/unittest:gtest", "//third-party/unittest:gtest_main", ], ) cc_test( name = "execution_engine_tests", size = "small", srcs = glob([ "ExecutionEngine/*.cpp", ]), tags = [ # MSAN does not work with JIT. "nomsan", ], deps = [ "//llvm:Support", "//llvm:TestingSupport", "//mlir:AllPassesAndDialects", "//mlir:Analysis", "//mlir:ArithToLLVM", "//mlir:BuiltinToLLVMIRTranslation", "//mlir:ExecutionEngine", "//mlir:FuncDialect", "//mlir:FuncToLLVM", "//mlir:IR", "//mlir:LLVMToLLVMIRTranslation", "//mlir:LinalgTransforms", "//mlir:MemRefToLLVM", "//mlir:Parser", "//mlir:Pass", "//mlir:ReconcileUnrealizedCasts", "//mlir:ToLLVMIRTranslation", "//mlir:VectorToLLVM", "//mlir:VectorToSCF", "//mlir:mlir_c_runner_utils", "//mlir:mlir_runner_utils", "//third-party/unittest:gmock", "//third-party/unittest:gtest_main", ], )