This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++/testsuite PATCH to allow running testsuite in C++1z mode


Even if we aren't going to routinely run the testsuite in C++1z mode, I would like it to be straightforward to do so. This patch adds a --stds= option to runtest for the C++ testsuite, and new check-c++1z and check-c++-all targets to the gcc directory.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit 7d0282eee9e91e6f1e3b9fcb7b6b9ff879a7682b
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Dec 2 16:53:31 2015 -0500

    	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.

diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index a16f228..50a1359 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/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp
index 421f8b6..be63dea 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 229fbc3..0b99903 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
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]