1 # Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
12 ######################################################################
14 ######################################################################
16 # The names of crates that must be tested
18 # libcore/libunicode tests are in a separate crate
20 $(eval $(call RUST_CRATE,coretest))
22 TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
23 TEST_DOC_CRATES = $(DOC_CRATES)
24 TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve rustc_trans,\
26 TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
28 ######################################################################
29 # Environment configuration
30 ######################################################################
32 # The arguments to all test runners
34 TESTARGS += $(TESTNAME)
41 # Arguments to the cfail/rfail/rpass/bench tests
43 CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
46 # Arguments to the perf tests
48 CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
51 CTEST_TESTARGS := $(TESTARGS)
53 # --bench is only relevant for crate tests, not for the compile tests
59 CTEST_TESTARGS += --verbose
62 # Setting locale ensures that gdb's output remains consistent.
63 # This prevents tests from failing with some locales (fixes #17423).
66 # If we're running perf then set this environment variable
67 # to put the benchmarks into 'hard mode'
68 ifeq ($(MAKECMDGOALS),perf)
72 TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
73 TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
75 define DEF_TARGET_COMMANDS
78 CFG_RUN_TEST_$(1)=$$(TARGET_RPATH_VAR$$(2)_T_$$(3)_H_$$(4)) \
79 $$(call CFG_RUN_$(1),,$$(CFG_VALGRIND) $$(1))
82 ifdef CFG_WINDOWSY_$(1)
83 CFG_TESTLIB_$(1)=$$(CFG_BUILD_DIR)$$(2)/$$(strip \
84 $$(if $$(findstring stage0,$$(1)), \
85 stage0/$$(CFG_LIBDIR_RELATIVE), \
86 $$(if $$(findstring stage1,$$(1)), \
87 stage1/$$(CFG_LIBDIR_RELATIVE), \
88 $$(if $$(findstring stage2,$$(1)), \
89 stage2/$$(CFG_LIBDIR_RELATIVE), \
90 $$(if $$(findstring stage3,$$(1)), \
91 stage3/$$(CFG_LIBDIR_RELATIVE), \
92 )))))/rustlib/$$(CFG_BUILD)/lib
93 CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(4)),$$(1))
96 # Run the compiletest runner itself under valgrind
98 CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
99 $$(call CFG_RUN_TEST_$$(CFG_BUILD),$$(3),$$(4))
101 CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
102 $$(call CFG_RUN_$$(CFG_BUILD),$$(TLIB$$(1)_T_$$(3)_H_$$(3)),$$(2))
107 $(foreach target,$(CFG_TARGET), \
108 $(eval $(call DEF_TARGET_COMMANDS,$(target))))
110 # Target platform specific variables for android
111 define DEF_ADB_DEVICE_STATUS
112 CFG_ADB_DEVICE_STATUS=$(1)
115 $(foreach target,$(CFG_TARGET), \
116 $(if $(findstring android, $(target)), \
117 $(if $(findstring adb,$(CFG_ADB)), \
118 $(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
119 $(info check: android device attached) \
120 $(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
121 $(info check: android device not attached) \
122 $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
124 $(info check: adb not found) \
125 $(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
130 ifeq ($(CFG_ADB_DEVICE_STATUS),true)
131 CFG_ADB_TEST_DIR=/data/tmp
133 $(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
134 $(shell $(CFG_ADB) remount 1>/dev/null) \
135 $(shell $(CFG_ADB) shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
136 $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)) \
137 $(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
138 $(foreach target,$(CFG_TARGET), \
139 $(if $(findstring android, $(target)), \
140 $(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/$(target)) \
141 $(foreach crate,$(TARGET_CRATES), \
142 $(shell $(CFG_ADB) push $(TLIB2_T_$(target)_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_$(target),$(crate)) \
143 $(CFG_ADB_TEST_DIR)/$(target))), \
149 # $(1) - name of doc test
150 # $(2) - file of the test
152 DOC_NAMES := $$(DOC_NAMES) $(1)
156 $(foreach doc,$(DOCS), \
157 $(eval $(call DOCTEST,md-$(doc),$(S)src/doc/$(doc).md)))
158 $(foreach file,$(wildcard $(S)src/doc/trpl/*.md), \
159 $(eval $(call DOCTEST,$(file:$(S)src/doc/trpl/%.md=trpl-%),$(file))))
161 ######################################################################
163 ######################################################################
165 # The main testing target. Tests lots of stuff.
166 check: cleantmptestlogs cleantestlibs all check-stage2 tidy
167 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
169 # As above but don't bother running tidy.
170 check-notidy: cleantmptestlogs cleantestlibs all check-stage2
171 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
173 # A slightly smaller set of tests for smoke testing.
174 check-lite: cleantestlibs cleantmptestlogs \
175 $(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
176 check-stage2-rpass check-stage2-rpass-valgrind \
177 check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
178 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
180 # Only check the 'reference' tests: rpass/cfail/rfail/rmake.
181 check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
182 check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
183 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
185 # Only check the docs.
186 check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
187 $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
189 # Some less critical tests that are not prone to breakage.
190 # Not run as part of the normal test suite, but tested by bors on checkin.
191 check-secondary: check-build-compiletest check-build-lexer-verifier check-lexer check-pretty
193 # check + check-secondary.
195 # Issue #17883: build check-secondary first so hidden dependencies in
196 # e.g. building compiletest are exercised (resolve those by adding
197 # deps to rules that need them; not by putting `check` first here).
198 check-all: check-secondary check
200 # Pretty-printing tests.
201 check-pretty: check-stage2-T-$(CFG_BUILD)-H-$(CFG_BUILD)-pretty-exec
203 define DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE
204 check-stage$(1)-build-compiletest: $$(HBIN$(1)_H_$(CFG_BUILD))/compiletest$$(X_$(CFG_BUILD))
207 $(foreach stage,$(STAGES), \
208 $(eval $(call DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE,$(stage))))
210 check-build-compiletest: \
211 check-stage1-build-compiletest \
212 check-stage2-build-compiletest
214 .PHONY: cleantmptestlogs cleantestlibs
220 $(Q)find $(CFG_BUILD)/test \
221 -name '*.[odasS]' -o \
228 -name '*.libaux' -o \
231 -name '*.debugger.script' \
235 ######################################################################
237 ######################################################################
244 # Run the tidy script in multiple parts to avoid huge 'echo' commands
246 tidy: tidy-basic tidy-binaries tidy-errors tidy-features
252 @$(call E, check: formatting)
253 $(Q) $(CFG_PYTHON) $(S)src/etc/tidy.py $(S)src/
255 .PHONY: tidy-binaries
257 @$(call E, check: binaries)
258 $(Q)find $(S)src -type f -perm +a+x \
259 -not -name '*.rs' -and -not -name '*.py' \
260 -and -not -name '*.sh' \
261 | grep '^$(S)src/jemalloc' -v \
262 | grep '^$(S)src/libuv' -v \
263 | grep '^$(S)src/llvm' -v \
264 | grep '^$(S)src/rt/hoedown' -v \
265 | grep '^$(S)src/gyp' -v \
266 | grep '^$(S)src/etc' -v \
267 | grep '^$(S)src/doc' -v \
268 | grep '^$(S)src/compiler-rt' -v \
269 | grep '^$(S)src/libbacktrace' -v \
270 | grep '^$(S)src/rust-installer' -v \
271 | xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
275 @$(call E, check: extended errors)
276 $(Q) $(CFG_PYTHON) $(S)src/etc/errorck.py $(S)src/
278 .PHONY: tidy-features
280 @$(call E, check: feature sanity)
281 $(Q) $(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/
284 ######################################################################
286 ######################################################################
290 check-stage$(1)-T-$(2)-H-$(3)-exec: \
291 check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
292 check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
293 check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
294 check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
295 check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
296 check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
297 check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
298 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
299 check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
300 check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
301 check-stage$(1)-T-$(2)-H-$(3)-bench-exec \
302 check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
303 check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
304 check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
305 check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
306 check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
308 # Only test the compiler-dependent crates when the target is
309 # able to build a compiler (when the target triple is in the set of host triples)
310 ifneq ($$(findstring $(2),$$(CFG_HOST)),)
312 check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
313 $$(foreach crate,$$(TEST_CRATES), \
314 check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
318 check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
319 $$(foreach crate,$$(TEST_TARGET_CRATES), \
320 check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
324 check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec: \
325 $$(foreach crate,$$(TEST_DOC_CRATES), \
326 check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$$(crate)-exec)
328 check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
329 $$(foreach docname,$$(DOC_NAMES), \
330 check-stage$(1)-T-$(2)-H-$(3)-doc-$$(docname)-exec) \
332 check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
333 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-exec \
334 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-valgrind-exec \
335 check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
336 check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
337 check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-exec \
338 check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-exec
342 $(foreach host,$(CFG_HOST), \
343 $(foreach target,$(CFG_TARGET), \
344 $(foreach stage,$(STAGES), \
345 $(eval $(call DEF_TEST_SETS,$(stage),$(target),$(host))))))
348 ######################################################################
350 ######################################################################
354 # If NO_REBUILD is set then break the dependencies on everything but
355 # the source files so we can test crates without rebuilding any of the
357 ifeq ($(NO_REBUILD),)
358 TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
359 $$(foreach crate,$$(TARGET_CRATES), \
360 $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
361 $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
364 TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
367 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER_HOST_TRIPLE = $(2)
368 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
370 $$(TESTDEP_$(1)_$(2)_$(3)_$(4))
371 @$$(call E, rustc: $$@)
372 $(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
373 $$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
374 -L "$$(RT_OUTPUT_DIR_$(2))" \
375 -L "$$(LLVM_LIBDIR_$(2))" \
380 $(foreach host,$(CFG_HOST), \
381 $(eval $(foreach target,$(CFG_TARGET), \
382 $(eval $(foreach stage,$(STAGES), \
383 $(eval $(foreach crate,$(TEST_CRATES), \
384 $(eval $(call TEST_RUNNER,$(stage),$(target),$(host),$(crate))))))))))
386 define DEF_TEST_CRATE_RULES
387 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
389 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
390 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
391 @$$(call E, run: $$<)
392 $$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(1),$(2),$(3)) $$(TESTARGS) \
393 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
394 $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
398 define DEF_TEST_CRATE_RULES_android
399 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
401 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
402 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
403 @$$(call E, run: $$< via adb)
404 $$(Q)$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
405 $$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=./$(2) \
407 --logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
408 $$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) $(TESTARGS))' \
409 > tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
410 $$(Q)cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
411 $$(Q)touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
412 $$(Q)$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
413 $$(Q)$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
414 @if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
416 rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
419 rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
424 define DEF_TEST_CRATE_RULES_null
425 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
427 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
428 $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
429 @$$(call E, failing: no device for $$< )
433 $(foreach host,$(CFG_HOST), \
434 $(foreach target,$(CFG_TARGET), \
435 $(foreach stage,$(STAGES), \
436 $(foreach crate, $(TEST_CRATES), \
437 $(if $(findstring $(target),$(CFG_BUILD)), \
438 $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
439 $(if $(findstring android, $(target)), \
440 $(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
441 $(eval $(call DEF_TEST_CRATE_RULES_android,$(stage),$(target),$(host),$(crate))), \
442 $(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
444 $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
447 ######################################################################
448 # Rules for the compiletest tests (rpass, rfail, etc.)
449 ######################################################################
451 RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
452 RPASS_VALGRIND_RS := $(wildcard $(S)src/test/run-pass-valgrind/*.rs)
453 RPASS_FULL_RS := $(wildcard $(S)src/test/run-pass-fulldeps/*.rs)
454 CFAIL_FULL_RS := $(wildcard $(S)src/test/compile-fail-fulldeps/*.rs)
455 RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
456 CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
457 PFAIL_RS := $(wildcard $(S)src/test/parse-fail/*.rs)
458 BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
459 PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
460 DEBUGINFO_GDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
461 DEBUGINFO_LLDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
462 CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
463 CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
465 # perf tests are the same as bench tests only they run under
466 # a performance monitor.
467 PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
469 RPASS_TESTS := $(RPASS_RS)
470 RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
471 RPASS_FULL_TESTS := $(RPASS_FULL_RS)
472 CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
473 RFAIL_TESTS := $(RFAIL_RS)
474 CFAIL_TESTS := $(CFAIL_RS)
475 PFAIL_TESTS := $(PFAIL_RS)
476 BENCH_TESTS := $(BENCH_RS)
477 PERF_TESTS := $(PERF_RS)
478 PRETTY_TESTS := $(PRETTY_RS)
479 DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
480 DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
481 CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
483 CTEST_SRC_BASE_rpass = run-pass
484 CTEST_BUILD_BASE_rpass = run-pass
485 CTEST_MODE_rpass = run-pass
486 CTEST_RUNTOOL_rpass = $(CTEST_RUNTOOL)
488 CTEST_SRC_BASE_rpass-valgrind = run-pass-valgrind
489 CTEST_BUILD_BASE_rpass-valgrind = run-pass-valgrind
490 CTEST_MODE_rpass-valgrind = run-pass-valgrind
491 CTEST_RUNTOOL_rpass-valgrind = $(CTEST_RUNTOOL)
493 CTEST_SRC_BASE_rpass-full = run-pass-fulldeps
494 CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
495 CTEST_MODE_rpass-full = run-pass
496 CTEST_RUNTOOL_rpass-full = $(CTEST_RUNTOOL)
498 CTEST_SRC_BASE_cfail-full = compile-fail-fulldeps
499 CTEST_BUILD_BASE_cfail-full = compile-fail-fulldeps
500 CTEST_MODE_cfail-full = compile-fail
501 CTEST_RUNTOOL_cfail-full = $(CTEST_RUNTOOL)
503 CTEST_SRC_BASE_rfail = run-fail
504 CTEST_BUILD_BASE_rfail = run-fail
505 CTEST_MODE_rfail = run-fail
506 CTEST_RUNTOOL_rfail = $(CTEST_RUNTOOL)
508 CTEST_SRC_BASE_cfail = compile-fail
509 CTEST_BUILD_BASE_cfail = compile-fail
510 CTEST_MODE_cfail = compile-fail
511 CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
513 CTEST_SRC_BASE_pfail = parse-fail
514 CTEST_BUILD_BASE_pfail = parse-fail
515 CTEST_MODE_pfail = parse-fail
516 CTEST_RUNTOOL_pfail = $(CTEST_RUNTOOL)
518 CTEST_SRC_BASE_bench = bench
519 CTEST_BUILD_BASE_bench = bench
520 CTEST_MODE_bench = run-pass
521 CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
523 CTEST_SRC_BASE_perf = bench
524 CTEST_BUILD_BASE_perf = perf
525 CTEST_MODE_perf = run-pass
526 CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL)
528 CTEST_SRC_BASE_debuginfo-gdb = debuginfo
529 CTEST_BUILD_BASE_debuginfo-gdb = debuginfo-gdb
530 CTEST_MODE_debuginfo-gdb = debuginfo-gdb
531 CTEST_RUNTOOL_debuginfo-gdb = $(CTEST_RUNTOOL)
533 CTEST_SRC_BASE_debuginfo-lldb = debuginfo
534 CTEST_BUILD_BASE_debuginfo-lldb = debuginfo-lldb
535 CTEST_MODE_debuginfo-lldb = debuginfo-lldb
536 CTEST_RUNTOOL_debuginfo-lldb = $(CTEST_RUNTOOL)
538 CTEST_SRC_BASE_codegen = codegen
539 CTEST_BUILD_BASE_codegen = codegen
540 CTEST_MODE_codegen = codegen
541 CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
543 # CTEST_DISABLE_$(TEST_GROUP), if set, will cause the test group to be
544 # disabled and the associated message to be printed as a warning
545 # during attempts to run those tests.
548 CTEST_DISABLE_debuginfo-gdb = "no gdb found"
552 CTEST_DISABLE_debuginfo-lldb = "no lldb found"
556 CTEST_DISABLE_codegen = "no clang found"
559 ifneq ($(CFG_OSTYPE),apple-darwin)
560 CTEST_DISABLE_debuginfo-lldb = "lldb tests are only run on darwin"
563 ifeq ($(CFG_OSTYPE),apple-darwin)
564 CTEST_DISABLE_debuginfo-gdb = "gdb on darwin needs root"
567 # CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
568 # test group to be disabled *unless* the target is able to build a
569 # compiler (i.e. when the target triple is in the set of of host
570 # triples). The associated message will be printed as a warning
571 # during attempts to run those tests.
573 define DEF_CTEST_VARS
575 # All the per-stage build rules you might want to call from the
578 # $(1) is the stage number
579 # $(2) is the target triple to test
580 # $(3) is the host triple to test
582 # Prerequisites for compiletest tests
583 TEST_SREQ$(1)_T_$(2)_H_$(3) = \
584 $$(HBIN$(1)_H_$(3))/compiletest$$(X_$(3)) \
585 $$(SREQ$(1)_T_$(2)_H_$(3))
587 # Rules for the cfail/rfail/rpass/bench/perf test runner
589 # The tests select when to use debug configuration on their own;
590 # remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
591 CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
593 # The tests cannot be optimized while the rest of the compiler is optimized, so
594 # filter out the optimization (if any) from rustc and then figure out if we need
596 CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
597 ifndef CFG_DISABLE_OPTIMIZE_TESTS
598 CTEST_RUSTC_FLAGS += -O
602 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
603 --compile-lib-path $$(HLIB$(1)_H_$(3)) \
604 --run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
605 --rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
606 --clang-path $(if $(CFG_CLANG),$(CFG_CLANG),clang) \
607 --llvm-bin-path $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin \
608 --aux-base $$(S)src/test/auxiliary/ \
609 --stage-id stage$(1)-$(2) \
612 --gdb-version="$(CFG_GDB_VERSION)" \
613 --lldb-version="$(CFG_LLDB_VERSION)" \
614 --android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
615 --adb-path=$(CFG_ADB) \
616 --adb-test-dir=$(CFG_ADB_TEST_DIR) \
617 --host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
618 --lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
619 --target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
622 ifdef CFG_VALGRIND_RPASS
623 ifdef GOOD_VALGRIND_$(2)
624 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --valgrind-path "$(CFG_VALGRIND_RPASS)"
628 ifndef CFG_DISABLE_VALGRIND_RPASS
629 ifdef GOOD_VALGRIND_$(2)
630 CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --force-valgrind
634 CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
635 CTEST_DEPS_rpass-valgrind_$(1)-T-$(2)-H-$(3) = $$(RPASS_VALGRIND_TESTS)
636 CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
637 CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
638 CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
639 CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
640 CTEST_DEPS_pfail_$(1)-T-$(2)-H-$(3) = $$(PFAIL_TESTS)
641 CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
642 CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
643 CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
644 CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
645 $(S)src/etc/lldb_batchmode.py \
646 $(S)src/etc/lldb_rust_formatters.py
647 CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
651 $(foreach host,$(CFG_HOST), \
652 $(eval $(foreach target,$(CFG_TARGET), \
653 $(eval $(foreach stage,$(STAGES), \
654 $(eval $(call DEF_CTEST_VARS,$(stage),$(target),$(host))))))))
656 define DEF_RUN_COMPILETEST
658 CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
659 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
660 --src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
661 --build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
662 --mode $$(CTEST_MODE_$(4)) \
663 $$(CTEST_RUNTOOL_$(4))
665 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
667 # CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)
668 # Goal: leave this variable as empty string if we should run the test.
669 # Otherwise, set it to the reason we are not running the test.
670 # (Encoded as a separate variable because GNU make does not have a
671 # good way to express OR on ifeq commands)
673 ifneq ($$(CTEST_DISABLE_$(4)),)
674 # Test suite is disabled for all configured targets.
675 CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_$(4))
677 # else, check if non-self-hosted target (i.e. target not-in hosts) ...
678 ifeq ($$(findstring $(2),$$(CFG_HOST)),)
679 # ... if so, then check if this test suite is disabled for non-selfhosts.
680 ifneq ($$(CTEST_DISABLE_NONSELFHOST_$(4)),)
681 # Test suite is disabled for this target.
682 CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_NONSELFHOST_$(4))
685 # Neither DISABLE nor DISABLE_NONSELFHOST is set ==> okay, run the test.
688 ifeq ($$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)),)
689 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
690 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
691 $$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
692 @$$(call E, run $(4) [$(2)]: $$<)
693 $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
694 $$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
695 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
700 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)):
701 @$$(call E, run $(4) [$(2)]: $$<)
702 @$$(call E, warning: tests disabled: $$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)))
709 CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail pfail bench perf debuginfo-gdb debuginfo-lldb codegen
711 $(foreach host,$(CFG_HOST), \
712 $(eval $(foreach target,$(CFG_TARGET), \
713 $(eval $(foreach stage,$(STAGES), \
714 $(eval $(foreach name,$(CTEST_NAMES), \
715 $(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
717 PRETTY_NAMES = pretty-rpass pretty-rpass-valgrind pretty-rpass-full pretty-rfail pretty-bench pretty-pretty
718 PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS)
719 PRETTY_DEPS_pretty-rpass-valgrind = $(RPASS_VALGRIND_TESTS)
720 PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
721 PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
722 PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
723 PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
724 # The stage- and host-specific dependencies are for e.g. macro_crate_test which pulls in
726 PRETTY_DEPS$(1)_H_$(3)_pretty-rpass =
727 PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full = $$(HLIB$(1)_H_$(3))/stamp.syntax $$(HLIB$(1)_H_$(3))/stamp.rustc
728 PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
729 PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
730 PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
731 PRETTY_DIRNAME_pretty-rpass = run-pass
732 PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
733 PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
734 PRETTY_DIRNAME_pretty-rfail = run-fail
735 PRETTY_DIRNAME_pretty-bench = bench
736 PRETTY_DIRNAME_pretty-pretty = pretty
738 define DEF_RUN_PRETTY_TEST
740 PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
741 $$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
742 --src-base $$(S)src/test/$$(PRETTY_DIRNAME_$(4))/ \
743 --build-base $(3)/test/$$(PRETTY_DIRNAME_$(4))/ \
746 check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
748 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
749 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
750 $$(PRETTY_DEPS_$(4)) \
751 $$(PRETTY_DEPS$(1)_H_$(3)_$(4))
752 @$$(call E, run pretty-rpass [$(2)]: $$<)
753 $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
754 $$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
755 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
760 $(foreach host,$(CFG_HOST), \
761 $(foreach target,$(CFG_TARGET), \
762 $(foreach stage,$(STAGES), \
763 $(foreach pretty-name,$(PRETTY_NAMES), \
764 $(eval $(call DEF_RUN_PRETTY_TEST,$(stage),$(target),$(host),$(pretty-name)))))))
767 ######################################################################
768 # Crate & freestanding documentation tests
769 ######################################################################
772 RUSTDOC_EXE_$(1)_T_$(2)_H_$(3) := $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
773 RUSTDOC_$(1)_T_$(2)_H_$(3) := $$(RPATH_VAR$(1)_T_$(2)_H_$(3)) $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
776 $(foreach host,$(CFG_HOST), \
777 $(foreach target,$(CFG_TARGET), \
778 $(foreach stage,$(STAGES), \
779 $(eval $(call DEF_RUSTDOC,$(stage),$(target),$(host))))))
785 check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
787 # If NO_REBUILD is set then break the dependencies on everything but
788 # the source files so we can test documentation without rebuilding
790 ifeq ($(NO_REBUILD),)
791 DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
793 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
794 $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
796 DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(DOCFILE_$(4))
799 ifeq ($(2),$$(CFG_BUILD))
800 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
801 @$$(call E, run doc-$(4) [$(2)])
802 $$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --cfg dox --test $$< \
803 --test-args "$$(TESTARGS)" && touch $$@
805 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
810 $(foreach host,$(CFG_HOST), \
811 $(foreach target,$(CFG_TARGET), \
812 $(foreach stage,$(STAGES), \
813 $(foreach docname,$(DOC_NAMES), \
814 $(eval $(call DEF_DOC_TEST,$(stage),$(target),$(host),$(docname)))))))
818 define DEF_CRATE_DOC_TEST
820 # If NO_REBUILD is set then break the dependencies on everything but
821 # the source files so we can test crate documentation without
822 # rebuilding any of the parent crates.
823 ifeq ($(NO_REBUILD),)
824 CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
825 $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
826 $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
827 $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
829 CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
832 check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
833 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
835 ifeq ($(2),$$(CFG_BUILD))
836 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
837 @$$(call E, run doc-crate-$(4) [$(2)])
838 $$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
839 $$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
840 $$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
842 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)):
848 $(foreach host,$(CFG_HOST), \
849 $(foreach target,$(CFG_TARGET), \
850 $(foreach stage,$(STAGES), \
851 $(foreach crate,$(TEST_DOC_CRATES), \
852 $(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
854 ######################################################################
856 ######################################################################
860 $(foreach crate,$(TEST_CRATES),$(crate)) \
861 $(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
876 $(foreach docname,$(DOC_NAMES),doc-$(docname)) \
879 pretty-rpass-valgrind \
886 define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST
887 check-stage$(1)-T-$(2)-H-$(3): check-stage$(1)-T-$(2)-H-$(3)-exec
890 $(foreach stage,$(STAGES), \
891 $(foreach target,$(CFG_TARGET), \
892 $(foreach host,$(CFG_HOST), \
893 $(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST,$(stage),$(target),$(host))))))
895 define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP
896 check-stage$(1)-T-$(2)-H-$(3)-$(4): check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec
899 $(foreach stage,$(STAGES), \
900 $(foreach target,$(CFG_TARGET), \
901 $(foreach host,$(CFG_HOST), \
902 $(foreach group,$(TEST_GROUPS), \
903 $(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP,$(stage),$(target),$(host),$(group)))))))
905 define DEF_CHECK_FOR_STAGE
906 check-stage$(1): check-stage$(1)-H-$$(CFG_BUILD)
907 check-stage$(1)-H-all: $$(foreach target,$$(CFG_TARGET), \
908 check-stage$(1)-H-$$(target))
911 $(foreach stage,$(STAGES), \
912 $(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
914 define DEF_CHECK_FOR_STAGE_AND_GROUP
915 check-stage$(1)-$(2): check-stage$(1)-H-$$(CFG_BUILD)-$(2)
916 check-stage$(1)-H-all-$(2): $$(foreach target,$$(CFG_TARGET), \
917 check-stage$(1)-H-$$(target)-$(2))
920 $(foreach stage,$(STAGES), \
921 $(foreach group,$(TEST_GROUPS), \
922 $(eval $(call DEF_CHECK_FOR_STAGE_AND_GROUP,$(stage),$(group)))))
925 define DEF_CHECK_FOR_STAGE_AND_HOSTS
926 check-stage$(1)-H-$(2): $$(foreach target,$$(CFG_TARGET), \
927 check-stage$(1)-T-$$(target)-H-$(2))
930 $(foreach stage,$(STAGES), \
931 $(foreach host,$(CFG_HOST), \
932 $(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS,$(stage),$(host)))))
934 define DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP
935 check-stage$(1)-H-$(2)-$(3): $$(foreach target,$$(CFG_TARGET), \
936 check-stage$(1)-T-$$(target)-H-$(2)-$(3))
939 $(foreach stage,$(STAGES), \
940 $(foreach host,$(CFG_HOST), \
941 $(foreach group,$(TEST_GROUPS), \
942 $(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP,$(stage),$(host),$(group))))))
944 define DEF_CHECK_DOC_FOR_STAGE
945 check-stage$(1)-docs: $$(foreach docname,$$(DOC_NAMES), \
946 check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-$$(docname)) \
947 $$(foreach crate,$$(TEST_DOC_CRATES), \
948 check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate))
951 $(foreach stage,$(STAGES), \
952 $(eval $(call DEF_CHECK_DOC_FOR_STAGE,$(stage))))
954 define DEF_CHECK_CRATE
955 check-$(1): check-stage2-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-$(1)-exec
958 $(foreach crate,$(TEST_CRATES), \
959 $(eval $(call DEF_CHECK_CRATE,$(crate))))
961 ######################################################################
963 ######################################################################
965 RMAKE_TESTS := $(shell ls -d $(S)src/test/run-make/*/)
966 RMAKE_TESTS := $(RMAKE_TESTS:$(S)src/test/run-make/%/=%)
968 define DEF_RMAKE_FOR_T_H
974 ifeq ($(2)$(3),$$(CFG_BUILD)$$(CFG_BUILD))
975 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec: \
976 $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake)
978 $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake): \
979 $$(RMAKE_TESTS:%=$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok)
982 $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
983 $(S)src/test/run-make/%/Makefile \
984 $$(CSREQ$(1)_T_$(2)_H_$(3))
985 @rm -rf $(3)/test/run-make/$$*
986 @mkdir -p $(3)/test/run-make/$$*
987 $$(Q)$$(CFG_PYTHON) $(S)src/etc/maketest.py $$(dir $$<) \
989 $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
990 $(3)/test/run-make/$$* \
991 "$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
992 $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
994 $$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)) \
995 "$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3))" \
996 "$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))" \
1001 # FIXME #11094 - The above rule doesn't work right for multiple targets
1002 check-stage$(1)-T-$(2)-H-$(3)-rmake-exec:
1010 $(foreach stage,$(STAGES), \
1011 $(foreach target,$(CFG_TARGET), \
1012 $(foreach host,$(CFG_HOST), \
1013 $(eval $(call DEF_RMAKE_FOR_T_H,$(stage),$(target),$(host))))))