aboutsummaryrefslogtreecommitdiff
path: root/mlir
diff options
context:
space:
mode:
authorStephen Neuendorffer <stephen.neuendorffer@xilinx.com>2020-04-22 10:52:07 -0700
committerStephen Neuendorffer <stephen.neuendorffer@xilinx.com>2020-05-05 09:22:49 -0700
commit175a3df9c7afbde0b3aa75dbe06472557a523819 (patch)
tree3e39153edfd121cafa9ac706aa1ed74155cefbd8 /mlir
parentc05f35443c3bc6dc69e060c766b23669a33e14ac (diff)
downloadllvm-175a3df9c7afbde0b3aa75dbe06472557a523819.zip
llvm-175a3df9c7afbde0b3aa75dbe06472557a523819.tar.gz
llvm-175a3df9c7afbde0b3aa75dbe06472557a523819.tar.bz2
[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
Diffstat (limited to 'mlir')
-rw-r--r--mlir/test/Examples/standalone/lit.local.cfg3
-rw-r--r--mlir/test/Examples/standalone/test.toy4
-rw-r--r--mlir/test/lit.cfg.py1
-rw-r--r--mlir/test/lit.site.cfg.py.in1
4 files changed, 9 insertions, 0 deletions
diff --git a/mlir/test/Examples/standalone/lit.local.cfg b/mlir/test/Examples/standalone/lit.local.cfg
new file mode 100644
index 0000000..481b809
--- /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 0000000..4f9ba5c
--- /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 65f8031..e78c828 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -31,6 +31,7 @@ config.test_exec_root = os.path.join(config.mlir_obj_root, 'test')
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 dafb1c9..dc6286a 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@"