From fa26da223666589dee005765740ed40ee290c22f Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 2 Dec 2015 17:18:18 -0500 Subject: [PATCH] Allow running the testsuite in C++1z mode. gcc/cp/ * Make-lang.in (check-c++1z, check-c++-all): New. gcc/testsuite/ * lib/g++.exp: Handle --stds= option. * lib/g++-dg.exp (g++-dg-runtest): Use it. From-SVN: r231209 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/Make-lang.in | 12 +++++++++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/lib/g++-dg.exp | 15 +++++++++++++-- gcc/testsuite/lib/g++.exp | 9 +++++++++ 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ce26e5daa2f..f7483c053f7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2015-12-02 Jason Merrill + + * Make-lang.in (check-c++1z, check-c++-all): New. + 2015-12-02 Markus Trippelsdorf PR c++/67337 diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index a16f228146c..50a13590a0d 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -145,9 +145,15 @@ c++.srcman: doc/g++.1 # check targets. However, our DejaGNU framework requires 'check-g++' as its # entry point. We feed the former to the latter here. check-c++ : check-g++ -# Run the testsute in C++0x mode. -check-c++0x: - @echo Normal 'make check' now runs the testsuite in C++11 mode as well as C++98. + +# Run the testsuite in C++1z mode. +check-c++1z: + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --stds=1z" check-g++ + +# Run the testsuite in all standard conformance levels. +check-c++-all: + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --stds=98,11,14,1z" check-g++ + # Run the testsuite with garbage collection at every opportunity. check-g++-strict-gc: $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --extra_opts,--param,ggc-min-heapsize=0,--param,ggc-min-expand=0" \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 517b23e832f..299250b89ae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-12-02 Jason Merrill + + * lib/g++.exp: Handle --stds= option. + * lib/g++-dg.exp (g++-dg-runtest): Use it. + 2015-12-02 Tobias Burnus Alessandro Fanfarillo diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp index 421f8b62bee..be63dea3455 100644 --- a/gcc/testsuite/lib/g++-dg.exp +++ b/gcc/testsuite/lib/g++-dg.exp @@ -43,9 +43,20 @@ proc g++-dg-runtest { testcases flags default-extra-flags } { # if there's a dg-options line. if ![search_for $test "-std=*++"] { if [search_for $test "dg-options"] { - set option_list { -std=gnu++98 -std=gnu++11 -std=gnu++14 } + set std_prefix "-std=gnu++" } else { - set option_list { -std=c++98 -std=c++11 -std=c++14 } + set std_prefix "-std=c++" + } + + global gpp_std_list + if { [llength $gpp_std_list] > 0 } { + set std_list $gpp_std_list + } else { + set std_list { 98 11 14 } + } + set option_list { } + foreach x $std_list { + lappend option_list "${std_prefix}$x" } } else { set option_list { "" } diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 229fbc3f633..0b99903dd70 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -32,6 +32,7 @@ load_lib target-libpath.exp set gpp_compile_options "" +set gpp_std_list { } # # g++_version -- extract and print the version number of the compiler @@ -367,6 +368,14 @@ proc ${tool}_option_proc { option } { } verbose -log "gpp_compile_options set to $gpp_compile_options" return 1 + } elseif [regexp "^--stds=" $option] { + global gpp_std_list + regsub "^--stds=" $option "" option + foreach x [split $option ","] { + lappend gpp_std_list "$x" + } + verbose -log "gpp_std_list set to $gpp_std_list" + return 1 } else { return 0 } -- 2.30.2