OSDN Git Service

with this patch you can run check-lit on a specific test.
authorReed Kotler <rkotlerimgtec@gmail.com>
Fri, 22 Jan 2016 04:33:08 +0000 (20:33 -0800)
committerJim Stichnoth <stichnot@chromium.org>
Fri, 22 Jan 2016 04:33:08 +0000 (20:33 -0800)
i.e.make -f Makefile.standalone check-lit CHECK_LIT_TESTS=tests_lit/llvm2ice_tests/arith.lll

The default will be for the directory to be in subzero but
it's also possible to create an absolute pathname.

Extended this to work with cross tests.

Added some primitive help for the makefile.

make -f Makefile.standalone help
make -f Makefile.standalone help-check-lit
make -f makefile.standalone help-check-xtest

BUG=
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1582243005 .

Patch from Reed Kotler <rkotlerimgtec@gmail.com>.

Makefile.standalone
Makefile.standalone-help/check-lit.txt [new file with mode: 0644]
Makefile.standalone-help/check-xtest.txt [new file with mode: 0644]
Makefile.standalone-help/help.txt [new file with mode: 0644]

index 38e7bd9..4549618 100644 (file)
@@ -33,6 +33,14 @@ PNACL_TOOLCHAIN_ROOT ?= $(shell readlink -e $(TOOLCHAIN_ROOT)/pnacl_newlib_raw)
 # The location of PNaCl tools (e.g., binutils objdump, pnacl-clang++, etc.).
 PNACL_BIN_PATH ?= $(shell readlink -e $(PNACL_TOOLCHAIN_ROOT)/bin)
 
+# Allow tests to be overridden, e.g.:
+#   make -f Makefile.standalone check-lit \
+#     CHECK_LIT_TESTS="tests_lit/llvm2ice_tests/{alloc,arith}.ll"
+#   make -f Makefile.standalone check-xtest \
+#     CHECK_XTEST_TESTS=crosstest/Output/simple_loop_x8632_native_O2_sse2.xtest
+CHECK_LIT_TESTS ?= tests_lit
+CHECK_XTEST_TESTS ?= crosstest/Output
+
 # Hack to auto-detect autoconf versus cmake build of LLVM.  If the LLVM tools
 # were dynamically linked with something like libLLVM-3.7svn.so, it is an
 # autoconf build, otherwise it is a cmake build.  AUTOCONF is set to 0 for
@@ -334,7 +342,8 @@ make_symlink: $(OBJDIR)/pnacl-sz
        @echo "Build Attributes:"
        @$(SHOW_BUILD_ATTS)
 
-.PHONY: all compile_only make_symlink runtime bloat sb docs
+.PHONY: all compile_only make_symlink runtime bloat sb docs help \
+  help-check-lit help-check-xtest
 
 compile_only: $(OBJS)
 
@@ -415,7 +424,7 @@ runtime.is.built: $(RT_SRC) pydir/build-runtime.py
 
 check-lit: $(OBJDIR)/pnacl-sz make_symlink
        PNACL_BIN_PATH=$(PNACL_BIN_PATH) \
-       $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit \
+       $(LLVM_SRC_PATH)/utils/lit/lit.py -sv $(CHECK_LIT_TESTS) \
             $(FORCEASM_LIT_TEST_EXCLUDES) $(FORCEASM_LIT_PARAM)
 
 ifdef MINIMAL
@@ -441,7 +450,7 @@ check-xtest: $(OBJDIR)/pnacl-sz make_symlink runtime
           -e arm32,neon,test_vector_ops \
           -e arm32,neon,test_select
        PNACL_BIN_PATH=$(PNACL_BIN_PATH) \
-       $(LLVM_SRC_PATH)/utils/lit/lit.py -sv crosstest/Output
+       $(LLVM_SRC_PATH)/utils/lit/lit.py -sv $(CHECK_XTEST_TESTS)
 endif
 
 check-unit: $(OBJDIR)/run_unittests
@@ -552,6 +561,15 @@ bloat: make_symlink
 docs:
        make -C docs -f Makefile.standalone
 
+help:
+       @cat Makefile.standalone-help/help.txt
+
+help-check-lit:
+       @cat Makefile.standalone-help/check-lit.txt
+
+help-check-xtest:
+       @cat Makefile.standalone-help/check-xtest.txt
+
 clean:
        rm -rf pnacl-sz *.o $(OBJDIR) $(SB_OBJDIR) build/pnacl-sz.bloat.json
 
diff --git a/Makefile.standalone-help/check-lit.txt b/Makefile.standalone-help/check-lit.txt
new file mode 100644 (file)
index 0000000..0f6dacd
--- /dev/null
@@ -0,0 +1,4 @@
+check-lit - run the lit tests
+To check a specific test, override CHECK_LIT_TESTS, e.g.:
+  make -f Makefile.standalone check-lit \
+    CHECK_LIT_TESTS=tests_lit/llvm2ice_tests/arith.lll
diff --git a/Makefile.standalone-help/check-xtest.txt b/Makefile.standalone-help/check-xtest.txt
new file mode 100644 (file)
index 0000000..d193393
--- /dev/null
@@ -0,0 +1,5 @@
+check-xtest - run the cross tests
+
+To check a specific test, override CHECK_XTEST_TESTS, e.g.:
+  make -f Makefile.standalone check-xtest \
+    CHECK_XTEST_TESTS=crosstest/Output/mem_intrin_x8632_nonsfi_O2_sse2.xtest
diff --git a/Makefile.standalone-help/help.txt b/Makefile.standalone-help/help.txt
new file mode 100644 (file)
index 0000000..4bf2f3a
--- /dev/null
@@ -0,0 +1,9 @@
+Targets:
+
+check-lit - run the lit tests
+check-xtest - run the cross tests
+
+ For more detailed help:
+
+ make -f Makefile.standalone help-<target> , e.g:
+ make -f Makefile.standalone help-check-lit