From 092f3facad466522cfeab80ee92f6950176be7aa Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Wed, 3 Apr 2019 19:16:32 -0700 Subject: [PATCH] Fix Toy Ch3 testing with CMake Mainly a missing dependency caused the tests to pass if one already built the repo, but not from a clean (or incremental) build. -- PiperOrigin-RevId: 241852313 --- mlir/test/CMakeLists.txt | 1 + mlir/test/Examples/Toy/Ch3/scalar.toy | 2 ++ mlir/test/lit.cfg.py | 1 + 3 files changed, 4 insertions(+) diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt index f3737f295c93..7f3cc9cd139b 100644 --- a/mlir/test/CMakeLists.txt +++ b/mlir/test/CMakeLists.txt @@ -30,6 +30,7 @@ if(LLVM_BUILD_EXAMPLES) list(APPEND MLIR_TEST_DEPENDS toyc-ch1 toyc-ch2 + toyc-ch3 ) endif() diff --git a/mlir/test/Examples/Toy/Ch3/scalar.toy b/mlir/test/Examples/Toy/Ch3/scalar.toy index 41153ec92e1e..16bb2541b6ca 100644 --- a/mlir/test/Examples/Toy/Ch3/scalar.toy +++ b/mlir/test/Examples/Toy/Ch3/scalar.toy @@ -1,3 +1,5 @@ +# RUN: toyc-ch3 %s -emit=mlir 2>&1 | FileCheck %s + def main() { var a<2, 2> = 5.5; print(a); diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py index 172558a659d5..5008ec25272b 100644 --- a/mlir/test/lit.cfg.py +++ b/mlir/test/lit.cfg.py @@ -59,6 +59,7 @@ tools = [ tools.extend([ ToolSubst('toy-ch1', unresolved='ignore'), ToolSubst('toy-ch2', unresolved='ignore'), + ToolSubst('toy-ch3', unresolved='ignore'), ]) llvm_config.add_tool_substitutions(tools, tool_dirs)