[PATCH] Regression tests for the Kaleidoscope tutorials.
NAKAMURA Takumi via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 08:23:21 PDT 2015
Lang, thanks for working!
I tweaked in some area.
--- a/llvm/examples/Kaleidoscope/Chapter5/CMakeLists.txt
+++ b/llvm/examples/Kaleidoscope/Chapter5/CMakeLists.txt
@@ -13,3 +13,5 @@ set(LLVM_LINK_COMPONENTS
add_kaleidoscope_chapter(Kaleidoscope-Ch5
toy.cpp
)
+
+export_executable_symbols(Kaleidoscope-Ch5)
^It is needed to resolve printd.
--- a/llvm/test/CMakeLists.txt
+++ b/llvm/test/CMakeLists.txt
@@ -1,3 +1,7 @@
+if(LLVM_BUILD_EXAMPLES)
+ set(ENABLE_EXAMPLES 1)
+endif()
+
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
@@ -96,6 +100,16 @@ if(TARGET ocaml_llvm)
)
endif()
+if(LLVM_BUILD_EXAMPLES)
+ list(APPEND LLVM_TEST_DEPENDS
+ Kaleidoscope-Ch3
+ Kaleidoscope-Ch4
+ Kaleidoscope-Ch5
+ Kaleidoscope-Ch6
+ Kaleidoscope-Ch7
+ )
+endif()
+
add_lit_testsuite(check-llvm "Running the LLVM regression tests"
${CMAKE_CURRENT_BINARY_DIR}
PARAMS llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
* LLVM_BUILD_EXAMPLES is BOOL but it has value "ON" or "OFF" as string.
--- a/llvm/test/Makefile
+++ b/llvm/test/Makefile
@@ -146,6 +146,7 @@ lit.site.cfg: FORCE
@$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
@$(ECHOPATH) s=@HAVE_LIBZ@=$(HAVE_LIBZ)=g >> lit.tmp
@$(ECHOPATH) s=@HAVE_DIA_SDK@=0=g >> lit.tmp
+ @$(ECHOPATH) s=@ENABLE_EXAMPLES@=$(BUILD_EXAMPLES)=g >> lit.tmp
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
@-rm -f lit.tmp
* Substitute ENABLE_EXAMPLES with BUILD_EXAMPLES in autoconf build.
--- a/llvm/test/lit.site.cfg.in
+++ b/llvm/test/lit.site.cfg.in
@@ -35,7 +35,7 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.have_zlib = "@HAVE_LIBZ@"
config.have_dia_sdk = @HAVE_DIA_SDK@
config.enable_ffi = "@LLVM_ENABLE_FFI@"
-config.test_examples = "@LLVM_BUILD_EXAMPLES@"
+config.test_examples = "@ENABLE_EXAMPLES@"
# Support substitution of the tools_dir with user parameters. This is
# used when we can't determine the tool dir at configuration time.
On Thu, Aug 27, 2015 at 3:26 PM Lang Hames via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Hi All,
>
> The attached patch adds some regression tests for the Kaleidoscope
> tutorials.
>
> I've tried to set these up so that they're only run if LLVM_BUILD_EXAMPLES
> is turned on, but I'm not a build-system/llvm-lit expert, so I'm not
> certain whether I've done this in the cleanest way. Feedback on that aspect
> of this patch would be helpful.
>
> Cheers,
> Lang.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150827/25d4396d/attachment.html>
More information about the llvm-commits
mailing list