diff --git a/mlir/test/Examples/standalone/lit.local.cfg b/mlir/test/Examples/standalone/lit.local.cfg new file mode 100644 --- /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 --- /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 --- 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 --- a/mlir/test/lit.site.cfg.py.in +++ b/mlir/test/lit.site.cfg.py.in @@ -23,6 +23,7 @@ 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@"