[Mlir-commits] [mlir] 175a3df - [MLIR] Add a tests for out of tree dialect example.

Stephen Neuendorffer llvmlistbot at llvm.org
Tue May 5 09:23:32 PDT 2020


Author: Stephen Neuendorffer
Date: 2020-05-05T09:22:49-07:00
New Revision: 175a3df9c7afbde0b3aa75dbe06472557a523819

URL: https://github.com/llvm/llvm-project/commit/175a3df9c7afbde0b3aa75dbe06472557a523819
DIFF: https://github.com/llvm/llvm-project/commit/175a3df9c7afbde0b3aa75dbe06472557a523819.diff

LOG: [MLIR] Add a tests for out of tree dialect example.

This attempts to ensure that out of tree usage remains stable.

Differential Revision: https://reviews.llvm.org/D78656

Added: 
    mlir/test/Examples/standalone/lit.local.cfg
    mlir/test/Examples/standalone/test.toy

Modified: 
    mlir/test/lit.cfg.py
    mlir/test/lit.site.cfg.py.in

Removed: 
    


################################################################################
diff  --git a/mlir/test/Examples/standalone/lit.local.cfg b/mlir/test/Examples/standalone/lit.local.cfg
new file mode 100644
index 000000000000..481b809a0e48
--- /dev/null
+++ b/mlir/test/Examples/standalone/lit.local.cfg
@@ -0,0 +1,3 @@
+config.substitutions.append(("%cmake", config.host_cmake))
+config.substitutions.append(("%host_cxx", config.host_cxx))
+config.substitutions.append(("%host_cc", config.host_cc))

diff  --git a/mlir/test/Examples/standalone/test.toy b/mlir/test/Examples/standalone/test.toy
new file mode 100644
index 000000000000..4f9ba5cc78e1
--- /dev/null
+++ b/mlir/test/Examples/standalone/test.toy
@@ -0,0 +1,4 @@
+# RUN: %cmake %mlir_src_root/examples/standalone -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc -DMLIR_DIR=%llvm_lib_dir/cmake/mlir ; %cmake --build . --target check-standalone-opt | tee %t | FileCheck %s
+
+# CHECK: Expected Passes: 1
+# UNSUPPORTED: windows, android

diff  --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
index 65f80315d57a..e78c82815b15 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -31,6 +31,7 @@
 
 config.substitutions.append(('%PATH%', config.environment['PATH']))
 config.substitutions.append(('%shlibext', config.llvm_shlib_ext))
+config.substitutions.append(("%mlir_src_root", config.mlir_src_root))
 
 llvm_config.with_system_environment(
     ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP'])

diff  --git a/mlir/test/lit.site.cfg.py.in b/mlir/test/lit.site.cfg.py.in
index dafb1c9a3eb8..dc6286a827bb 100644
--- a/mlir/test/lit.site.cfg.py.in
+++ b/mlir/test/lit.site.cfg.py.in
@@ -23,6 +23,7 @@ config.llvm_bindings = "@LLVM_BINDINGS@".split(' ')
 config.host_os = "@HOST_OS@"
 config.host_cc = "@HOST_CC@"
 config.host_cxx = "@HOST_CXX@"
+config.host_cmake = "@CMAKE_COMMAND@"
 # Note: ldflags can contain double-quoted paths, so must use single quotes here.
 config.host_ldflags = '@HOST_LDFLAGS@'
 config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"


        


More information about the Mlir-commits mailing list