add basic test
This commit is contained in:
parent
95fc37ffa8
commit
e88366b851
32
BUILD
32
BUILD
|
@ -129,6 +129,20 @@ cc_binary(
|
|||
"tools/mlir-tblgen-builder/*.cpp",
|
||||
"tools/mlir-tblgen-builder/TableGen/*.h",
|
||||
"tools/mlir-tblgen-builder/TableGen/*.cpp",
|
||||
]),
|
||||
deps = [
|
||||
"@llvm-project//mlir:MlirTableGenMain",
|
||||
"@llvm-project//mlir:Support",
|
||||
"@llvm-project//mlir:IR",
|
||||
"@llvm-project//llvm:Support",
|
||||
"@llvm-project//llvm:TableGen",
|
||||
"@llvm-project//llvm:config",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "mlir-hlo-builder",
|
||||
srcs = glob([
|
||||
"tools/mlir-tblgen-builder/Builder/*.h",
|
||||
"tools/mlir-tblgen-builder/Builder/*.cpp",
|
||||
]),
|
||||
|
@ -142,6 +156,23 @@ cc_binary(
|
|||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "mlir-tblgen-builder-basic",
|
||||
srcs = [
|
||||
"tests/mlir-tblgen-builder/test_basic.cpp",
|
||||
],
|
||||
deps = [
|
||||
":hlo_ops_builder_gen",
|
||||
":mlir-hlo-builder",
|
||||
"@llvm-project//mlir:MlirTableGenMain",
|
||||
"@llvm-project//mlir:Support",
|
||||
"@llvm-project//mlir:IR",
|
||||
"@llvm-project//llvm:Support",
|
||||
"@llvm-project//llvm:TableGen",
|
||||
"@llvm-project//llvm:config",
|
||||
],
|
||||
)
|
||||
|
||||
gentbl_cc_library(
|
||||
name = "hlo_ops_builder_gen",
|
||||
strip_include_prefix = "include",
|
||||
|
@ -561,7 +592,6 @@ cc_library(
|
|||
":hlo_ops_base_structs",
|
||||
":hlo_ops_common",
|
||||
":hlo_ops_inc_gen",
|
||||
":hlo_ops_builder_gen",
|
||||
":hlo_ops_pattern_gen",
|
||||
":infer_fusibility_op_interface",
|
||||
"@llvm-project//llvm:Support",
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#include "include/mlir-hlo/Dialect/mhlo/IR/hlo_builder.h.inc"
|
||||
#include "tools/mlir-tblgen-builder/Builder/Attribute.h"
|
||||
#include "tools/mlir-tblgen-builder/Builder/Builder.h"
|
||||
#include "tools/mlir-tblgen-builder/Builder/Op.h"
|
||||
#include "tools/mlir-tblgen-builder/Builder/PrimitiveType.h"
|
||||
#include "tools/mlir-tblgen-builder/Builder/Shape.h"
|
||||
#include "tools/mlir-tblgen-builder/Builder/Tensor.h"
|
||||
|
||||
int main() {
|
||||
builder::Integer i(322);
|
||||
return 0;
|
||||
}
|
|
@ -11,7 +11,7 @@ class Op {
|
|||
|
||||
private:
|
||||
std::shared_ptr<Impl> impl_;
|
||||
}
|
||||
};
|
||||
} // namespace builder
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue