Skip to content

Commit 56f5256

Browse files
committed
---
yaml --- r: 157437 b: refs/heads/snap-stage3 c: 37f2db7 h: refs/heads/master i: 157435: ce97ec0 v: v3
1 parent dace243 commit 56f5256

File tree

142 files changed

+1873
-947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1873
-947
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 065caf34f5ff29e04605f95d9c5d511af219439a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f11f58dc97daeba79f77338cfa0e4710124ff429
4+
refs/heads/snap-stage3: 37f2db769f620edc1059762ffaf615466812c312
55
refs/heads/try: 0ee4d8b0b112c608646fa75463ab4dc59132efd9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/configure

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ VAL_OPTIONS=""
411411

412412
opt valgrind 0 "run tests with valgrind (memcheck by default)"
413413
opt helgrind 0 "run tests with helgrind instead of memcheck"
414+
opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"
414415
opt docs 1 "build documentation"
415416
opt optimize 1 "build optimized rust code"
416417
opt optimize-cxx 1 "build optimized C++ code"
@@ -906,6 +907,7 @@ do
906907
done
907908

908909
make_dir $h/test/run-pass
910+
make_dir $h/test/run-pass-valgrind
909911
make_dir $h/test/run-pass-fulldeps
910912
make_dir $h/test/run-fail
911913
make_dir $h/test/compile-fail
@@ -1235,15 +1237,6 @@ then
12351237
putvar CFG_PANDOC
12361238
fi
12371239

1238-
# Valgrind is only reliable on Linux. On Windows it doesn't work at all, and
1239-
# on the Mac the dynamic linker causes Valgrind to emit a huge stream of
1240-
# errors.
1241-
if [ $CFG_OSTYPE != unknown-linux-gnu ] && [ $CFG_OSTYPE != apple-darwin ]
1242-
then
1243-
CFG_BAD_VALGRIND=1
1244-
putvar CFG_BAD_VALGRIND
1245-
fi
1246-
12471240
putvar CFG_LLVM_ROOT
12481241
putvar CFG_LLVM_SRC_DIR
12491242

branches/snap-stage3/mk/main.mk

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ RUSTFLAGS_STAGE1 += -C prefer-dynamic
157157
# by not emitting them.
158158
RUSTFLAGS_STAGE0 += -Z no-landing-pads
159159

160+
# Go fast for stage0, and also for stage1/stage2 if optimization is off.
161+
RUSTFLAGS_STAGE0 += -C codegen-units=4
162+
ifdef CFG_DISABLE_OPTIMIZE
163+
RUSTFLAGS_STAGE1 += -C codegen-units=4
164+
RUSTFLAGS_STAGE2 += -C codegen-units=4
165+
endif
166+
160167
# platform-specific auto-configuration
161168
include $(CFG_SRC_DIR)mk/platform.mk
162169

@@ -167,16 +174,20 @@ else
167174
CFG_VALGRIND_COMPILE :=
168175
endif
169176

177+
178+
ifndef CFG_DISABLE_VALGRIND_RPASS
179+
$(info cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS))
180+
CFG_VALGRIND_RPASS :=$(CFG_VALGRIND)
181+
else
182+
CFG_VALGRIND_RPASS :=
183+
endif
184+
185+
170186
ifdef CFG_ENABLE_VALGRIND
171187
$(info cfg: enabling valgrind (CFG_ENABLE_VALGRIND))
172188
else
173189
CFG_VALGRIND :=
174190
endif
175-
ifdef CFG_BAD_VALGRIND
176-
$(info cfg: disabling valgrind due to its unreliability on this platform)
177-
CFG_VALGRIND :=
178-
endif
179-
180191

181192
######################################################################
182193
# Target-and-rule "utility variables"

branches/snap-stage3/mk/platform.mk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ ifdef CFG_VALGRIND
5858
endif
5959
endif
6060

61+
# If we actually want to run Valgrind on a given platform, set this variable
62+
define DEF_GOOD_VALGRIND
63+
ifeq ($(OSTYPE_$(1)),unknown-linux-gnu)
64+
GOOD_VALGRIND_$(1) = 1
65+
endif
66+
ifneq (,$(filter $(OSTYPE_$(1)),darwin freebsd))
67+
ifeq (HOST_$(1),x86_64)
68+
GOOD_VALGRIND_$(1) = 1
69+
endif
70+
endif
71+
endef
72+
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_GOOD_VALGRIND,$(t))))
73+
$(foreach t,$(CFG_TARGET),$(info cfg: good valgrind for $(t) is $(GOOD_VALGRIND_$(t))))
74+
6175
ifneq ($(findstring linux,$(CFG_OSTYPE)),)
6276
ifdef CFG_PERF
6377
ifneq ($(CFG_PERF_WITH_LOGFD),)

branches/snap-stage3/mk/tests.mk

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
# Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
# file at the top-level directory of this distribution and at
33
# http://rust-lang.org/COPYRIGHT.
44
#
@@ -184,12 +184,12 @@ check-notidy: cleantmptestlogs cleantestlibs all check-stage2
184184
# A slightly smaller set of tests for smoke testing.
185185
check-lite: cleantestlibs cleantmptestlogs \
186186
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
187-
check-stage2-rpass \
187+
check-stage2-rpass check-stage2-rpass-valgrind \
188188
check-stage2-rfail check-stage2-cfail check-stage2-rmake
189189
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
190190

191191
# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
192-
check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass \
192+
check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
193193
check-stage2-rfail check-stage2-cfail check-stage2-rmake
194194
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
195195

@@ -326,7 +326,8 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
326326
check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
327327
check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
328328
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
329-
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
329+
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
330+
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
330331
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
331332
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
332333
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
@@ -364,6 +365,7 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
364365

365366
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
366367
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-exec \
368+
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-valgrind-exec \
367369
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
368370
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
369371
check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-exec \
@@ -489,15 +491,11 @@ $(foreach host,$(CFG_HOST), \
489491
# Rules for the compiletest tests (rpass, rfail, etc.)
490492
######################################################################
491493

492-
RPASS_RC := $(wildcard $(S)src/test/run-pass/*.rc)
493494
RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
494-
RPASS_FULL_RC := $(wildcard $(S)src/test/run-pass-fulldeps/*.rc)
495+
RPASS_VALGRIND_RS := $(wildcard $(S)src/test/run-pass-valgrind/*.rs)
495496
RPASS_FULL_RS := $(wildcard $(S)src/test/run-pass-fulldeps/*.rs)
496-
CFAIL_FULL_RC := $(wildcard $(S)src/test/compile-fail-fulldeps/*.rc)
497497
CFAIL_FULL_RS := $(wildcard $(S)src/test/compile-fail-fulldeps/*.rs)
498-
RFAIL_RC := $(wildcard $(S)src/test/run-fail/*.rc)
499498
RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
500-
CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
501499
CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
502500
BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
503501
PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
@@ -510,11 +508,12 @@ CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
510508
# a performance monitor.
511509
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
512510

513-
RPASS_TESTS := $(RPASS_RC) $(RPASS_RS)
514-
RPASS_FULL_TESTS := $(RPASS_FULL_RC) $(RPASS_FULL_RS)
515-
CFAIL_FULL_TESTS := $(CFAIL_FULL_RC) $(CFAIL_FULL_RS)
516-
RFAIL_TESTS := $(RFAIL_RC) $(RFAIL_RS)
517-
CFAIL_TESTS := $(CFAIL_RC) $(CFAIL_RS)
511+
RPASS_TESTS := $(RPASS_RS)
512+
RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
513+
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
514+
CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
515+
RFAIL_TESTS := $(RFAIL_RS)
516+
CFAIL_TESTS := $(CFAIL_RS)
518517
BENCH_TESTS := $(BENCH_RS)
519518
PERF_TESTS := $(PERF_RS)
520519
PRETTY_TESTS := $(PRETTY_RS)
@@ -527,6 +526,11 @@ CTEST_BUILD_BASE_rpass = run-pass
527526
CTEST_MODE_rpass = run-pass
528527
CTEST_RUNTOOL_rpass = $(CTEST_RUNTOOL)
529528

529+
CTEST_SRC_BASE_rpass-valgrind = run-pass-valgrind
530+
CTEST_BUILD_BASE_rpass-valgrind = run-pass-valgrind
531+
CTEST_MODE_rpass-valgrind = run-pass-valgrind
532+
CTEST_RUNTOOL_rpass-valgrind = $(CTEST_RUNTOOL)
533+
530534
CTEST_SRC_BASE_rpass-full = run-pass-fulldeps
531535
CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
532536
CTEST_MODE_rpass-full = run-pass
@@ -584,13 +588,14 @@ ifeq ($(CFG_LLDB),)
584588
CTEST_DISABLE_debuginfo-lldb = "no lldb found"
585589
endif
586590

587-
# Completely disable LLDB tests for now
588-
CTEST_DISABLE_debuginfo-lldb = "LLDB tests are not enabled yet"
589-
590591
ifeq ($(CFG_CLANG),)
591592
CTEST_DISABLE_codegen = "no clang found"
592593
endif
593594

595+
ifneq ($(CFG_OSTYPE),apple-darwin)
596+
CTEST_DISABLE_debuginfo-lldb = "lldb tests are only run on darwin"
597+
endif
598+
594599
ifeq ($(CFG_OSTYPE),apple-darwin)
595600
CTEST_DISABLE_debuginfo-gdb = "gdb on darwing needs root"
596601
endif
@@ -621,13 +626,18 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
621626
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
622627
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
623628

624-
# The tests can not be optimized while the rest of the compiler is optimized, so
629+
# The tests cannot be optimized while the rest of the compiler is optimized, so
625630
# filter out the optimization (if any) from rustc and then figure out if we need
626631
# to be optimized
627632
CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
628633
ifndef CFG_DISABLE_OPTIMIZE_TESTS
629634
CTEST_RUSTC_FLAGS += -O
630635
endif
636+
# Force codegen-units=1 for compiletest tests. compiletest does its own
637+
# parallelization internally, so rustc's default codegen-units=2 will actually
638+
# slow things down.
639+
CTEST_RUSTC_FLAGS += -C codegen-units=1
640+
631641

632642
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
633643
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
@@ -649,7 +659,21 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
649659
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
650660
$$(CTEST_TESTARGS)
651661

662+
ifdef CFG_VALGRIND_RPASS
663+
ifdef GOOD_VALGRIND_$(2)
664+
$(info cfg: valgrind-path set to $(CFG_VALGRIND_RPASS))
665+
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --valgrind-path "$(CFG_VALGRIND_RPASS)"
666+
endif
667+
endif
668+
669+
ifndef CFG_DISABLE_VALGRIND_RPASS
670+
ifdef GOOD_VALGRIND_$(2)
671+
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --force-valgrind
672+
endif
673+
endif
674+
652675
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
676+
CTEST_DEPS_rpass-valgrind_$(1)-T-$(2)-H-$(3) = $$(RPASS_VALGRIND_TESTS)
653677
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
654678
CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
655679
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
@@ -721,16 +745,17 @@ endif
721745

722746
endef
723747

724-
CTEST_NAMES = rpass rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
748+
CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
725749

726750
$(foreach host,$(CFG_HOST), \
727751
$(eval $(foreach target,$(CFG_TARGET), \
728752
$(eval $(foreach stage,$(STAGES), \
729753
$(eval $(foreach name,$(CTEST_NAMES), \
730754
$(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
731755

732-
PRETTY_NAMES = pretty-rpass pretty-rpass-full pretty-rfail pretty-bench pretty-pretty
756+
PRETTY_NAMES = pretty-rpass pretty-rpass-valgrind pretty-rpass-full pretty-rfail pretty-bench pretty-pretty
733757
PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS)
758+
PRETTY_DEPS_pretty-rpass-valgrind = $(RPASS_VALGRIND_TESTS)
734759
PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
735760
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
736761
PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
@@ -743,6 +768,7 @@ PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
743768
PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
744769
PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
745770
PRETTY_DIRNAME_pretty-rpass = run-pass
771+
PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
746772
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
747773
PRETTY_DIRNAME_pretty-rfail = run-fail
748774
PRETTY_DIRNAME_pretty-bench = bench
@@ -890,6 +916,7 @@ TEST_GROUPS = \
890916
$(foreach crate,$(TEST_CRATES),$(crate)) \
891917
$(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
892918
rpass \
919+
rpass-valgrind \
893920
rpass-full \
894921
cfail-full \
895922
rfail \
@@ -904,6 +931,7 @@ TEST_GROUPS = \
904931
$(foreach docname,$(DOCS),doc-$(docname)) \
905932
pretty \
906933
pretty-rpass \
934+
pretty-rpass-valgrind \
907935
pretty-rpass-full \
908936
pretty-rfail \
909937
pretty-bench \

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub enum Mode {
1717
CompileFail,
1818
RunFail,
1919
RunPass,
20+
RunPassValgrind,
2021
Pretty,
2122
DebugInfoGdb,
2223
DebugInfoLldb,
@@ -29,6 +30,7 @@ impl FromStr for Mode {
2930
"compile-fail" => Some(CompileFail),
3031
"run-fail" => Some(RunFail),
3132
"run-pass" => Some(RunPass),
33+
"run-pass-valgrind" => Some(RunPassValgrind),
3234
"pretty" => Some(Pretty),
3335
"debuginfo-lldb" => Some(DebugInfoLldb),
3436
"debuginfo-gdb" => Some(DebugInfoGdb),
@@ -44,6 +46,7 @@ impl fmt::Show for Mode {
4446
CompileFail => "compile-fail",
4547
RunFail => "run-fail",
4648
RunPass => "run-pass",
49+
RunPassValgrind => "run-pass-valgrind",
4750
Pretty => "pretty",
4851
DebugInfoGdb => "debuginfo-gdb",
4952
DebugInfoLldb => "debuginfo-lldb",
@@ -70,6 +73,13 @@ pub struct Config {
7073
// The llvm binaries path
7174
pub llvm_bin_path: Option<Path>,
7275

76+
// The valgrind path
77+
pub valgrind_path: Option<String>,
78+
79+
// Whether to fail if we can't run run-pass-valgrind tests under valgrind
80+
// (or, alternatively, to silently run them like regular run-pass tests).
81+
pub force_valgrind: bool,
82+
7383
// The directory containing the tests to run
7484
pub src_base: Path,
7585

0 commit comments

Comments
 (0)