From e2995714b3bf1295d389a80a951be8c3330e80ac Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 13 Jul 2011 16:30:54 -0400 Subject: [PATCH] Also test -std=c++0x mode with 'make check-c++' at top level Also test -std=c++0x mode with 'make check-c++' at top level * Makefile.in (check-gcc-c++0x): New. (check-c++): Depend on it. gcc/ * Makefile.in ($(lang_checks_parallelized)): Allow --tool_opts. gcc/cp/ * Make-lang.in (check-c++0x): New. gcc/testsuite/ * lib/g++.exp (${tool}_option_help, ${tool}_option_proc): Remove. * lib/lto.exp (lto_prune_warns): Prune warning about -std=c++0x when compiling C files. From-SVN: r176250 --- ChangeLog | 5 ++++ Makefile.in | 7 +++++- gcc/ChangeLog | 4 +++ gcc/Makefile.in | 4 +-- gcc/cp/ChangeLog | 4 +++ gcc/cp/Make-lang.in | 4 +++ gcc/testsuite/ChangeLog | 15 +++++++++++ .../g++.dg/debug/dwarf2/lineno-simple1.C | 1 + gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C | 7 +++--- gcc/testsuite/g++.dg/ext/utf-dflt.C | 2 +- gcc/testsuite/g++.dg/init/vector1.C | 3 ++- gcc/testsuite/g++.dg/lookup/anon2.C | 2 +- gcc/testsuite/g++.dg/torture/pr35526.C | 2 ++ gcc/testsuite/g++.dg/tree-ssa/copyprop.C | 4 +-- gcc/testsuite/g++.old-deja/g++.ext/arrnew.C | 3 ++- gcc/testsuite/g++.old-deja/g++.jason/rfg27.C | 2 +- gcc/testsuite/lib/g++.exp | 25 ------------------- gcc/testsuite/lib/lto.exp | 3 +++ 18 files changed, 59 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec1b42bd20b..ee64c35de89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-13 Jason Merrill + + * Makefile.in (check-gcc-c++0x): New. + (check-c++): Depend on it. + 2011-07-07 Rainer Orth PR target/39150 diff --git a/Makefile.in b/Makefile.in index 4f8b396edcb..506d26e544c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -40152,7 +40152,12 @@ check-gcc-c++: s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); -check-c++: check-gcc-c++ check-target-libstdc++-v3 +check-gcc-c++0x: + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++0x); +check-c++: check-gcc-c++ check-gcc-c++0x check-target-libstdc++-v3 .PHONY: check-gcc-fortran check-fortran check-gcc-fortran: diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 46df27b6502..5182bbc8dde 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-07-13 Jason Merrill + + * Makefile.in ($(lang_checks_parallelized)): Allow --tool_opts. + 2011-07-13 Ulrich Weigand * config/spu/spu.c (spu_init_libfuncs): Install __clrsbdi2. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index fcc8b7e203c..cd4f7820ce6 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -5018,7 +5018,7 @@ check_p_subdirs=$(wordlist 1,$(words $(check_$*_parallelize)),$(check_p_numbers) # For parallelized check-% targets, this decides whether parallelization # is desirable (if -jN is used and RUNTESTFLAGS doesn't contain anything -# but optionally --target_board argument). If it is desirable, +# but optional --target_board or --tool_opts arguments). If it is desirable, # recursive make is run with check-parallel-$lang{,1,2,3,4,5} etc. goals, # which can be executed in parallel, as they are run in separate directories. # check-parallel-$lang{1,2,3,4,5} etc. goals invoke runtest with the longest @@ -5035,7 +5035,7 @@ check_p_subdirs=$(wordlist 1,$(words $(check_$*_parallelize)),$(check_p_numbers) # to lang_checks_parallelized variable and define check_$lang_parallelize # variable (see above check_gcc_parallelize description). $(lang_checks_parallelized): check-% : site.exp - @if [ -z "$(filter-out --target_board=%, $(RUNTESTFLAGS))" ] \ + @if [ -z "$(filter-out --target_board=%,$(filter-out --tool_opts%,$(RUNTESTFLAGS)))" ] \ && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \ $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \ check-parallel-$* \ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cfe3bab6f8c..8e45b2ee196 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2011-07-13 Jason Merrill + + * Make-lang.in (check-c++0x): New. + 2011-07-13 Richard Sandiford * typeck2.c (split_nonconstant_init_1): Pass the initializer directly, diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 1b53b3875dd..b9251a44099 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -149,6 +149,10 @@ 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: + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --tool_opts=-std=gnu++0x" \ + TESTSUITEDIR="$(TESTSUITEDIR).c++0x" check-g++ check-c++-subtargets : check-g++-subtargets # List of targets that can use the generic check- rule and its // variant. lang_checks += check-g++ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f6fd7f0ebb1..eebf940c8a2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2011-07-13 Jason Merrill + + * lib/g++.exp (${tool}_option_help, ${tool}_option_proc): Remove. + * lib/lto.exp (lto_prune_warns): Prune warning about -std=c++0x + when compiling C files. + * g++.dg/debug/dwarf2/lineno-simple1.C: Avoid constexpr ctor. + * g++.dg/debug/dwarf2/pr44641.C: Avoid constexpr ctor. + * g++.dg/ext/utf-dflt.C: Specify -std=c++98. + * g++.dg/lookup/anon2.C: Likewise. + * g++.dg/tree-ssa/copyprop.C: Likewise. + * g++.old-deja/g++.jason/rfg27.C: Likewise. + * g++.dg/init/vector1.C: Ignore narrowing errors. + * g++.dg/torture/pr35526.C: Likewise. + * g++.old-deja/g++.ext/arrnew.C: Prune C++0x warning. + 2011-07-13 Janne Blomqvist PR libfortran/49296 diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C b/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C index e0ef7f71ca3..3fcc4f235fc 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C @@ -2,6 +2,7 @@ // { dg-options "-g -O0 -dA" } struct C { // { dg-function-on-line {_ZN1CC[12]Ev} } + int i; virtual void foo() {} // { dg-function-on-line _ZN1C3fooEv } }; diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C index 2df002f6b00..7b061eb0e6b 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C @@ -13,26 +13,27 @@ typedef MisplacedDbg Typedef2; typedef MisplacedDbg Typedef3; template struct Base { + int i; virtual ~Base() { } }; template <> struct MisplacedDbg // { dg-function-on-line {_ZN12MisplacedDbgI4FullEC[12]Ev} } - // { dg-function-on-line {_ZN12MisplacedDbgI4FullED0Ev} { target *-*-* } 21 } + // { dg-function-on-line {_ZN12MisplacedDbgI4FullED0Ev} { target *-*-* } 22 } : public Base { }; template struct MisplacedDbg // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgEC[12]Ev} } - // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgED0Ev} { target *-*-* } 28 } + // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgED0Ev} { target *-*-* } 29 } : public Base { }; template struct MisplacedDbg // { dg-function-on-line {_ZN12MisplacedDbgI3ArgEC[12]Ev} } - // { dg-function-on-line {_ZN12MisplacedDbgI3ArgED0Ev} { target *-*-* } 34 } + // { dg-function-on-line {_ZN12MisplacedDbgI3ArgED0Ev} { target *-*-* } 35 } : public Base { }; diff --git a/gcc/testsuite/g++.dg/ext/utf-dflt.C b/gcc/testsuite/g++.dg/ext/utf-dflt.C index 942f2b26d38..04849bfbf06 100644 --- a/gcc/testsuite/g++.dg/ext/utf-dflt.C +++ b/gcc/testsuite/g++.dg/ext/utf-dflt.C @@ -2,7 +2,7 @@ /* Expected errors for char16_t/char32_t in default std. */ /* Ensure u and U prefixes are parsed as separate tokens in default std. */ /* { dg-do compile } */ -/* { dg-options "" } */ +/* { dg-options "-std=c++98" } */ const static char16_t c0 = 'a'; /* { dg-error "not name a type" } */ const static char32_t c1 = 'a'; /* { dg-error "not name a type" } */ diff --git a/gcc/testsuite/g++.dg/init/vector1.C b/gcc/testsuite/g++.dg/init/vector1.C index ce4f40c9082..f33df2a92fa 100644 --- a/gcc/testsuite/g++.dg/init/vector1.C +++ b/gcc/testsuite/g++.dg/init/vector1.C @@ -1,6 +1,7 @@ // PR c++/19263 // { dg-do run } -// { dg-options "-O2" } +// { dg-options "-O2 -fpermissive" } +// { dg-prune-output "narrowing" } typedef signed char v8qi __attribute__ ((vector_size (8))); diff --git a/gcc/testsuite/g++.dg/lookup/anon2.C b/gcc/testsuite/g++.dg/lookup/anon2.C index d556ba0034a..4984307e454 100644 --- a/gcc/testsuite/g++.dg/lookup/anon2.C +++ b/gcc/testsuite/g++.dg/lookup/anon2.C @@ -1,5 +1,5 @@ // { dg-do compile } -// { dg-options "" } +// { dg-options "-std=c++98" } // Make sure we issue a diagnostic if a type with no linkage is used // to declare a a variable that has linkage. diff --git a/gcc/testsuite/g++.dg/torture/pr35526.C b/gcc/testsuite/g++.dg/torture/pr35526.C index d0a8e6d2c2f..2d745b50edd 100644 --- a/gcc/testsuite/g++.dg/torture/pr35526.C +++ b/gcc/testsuite/g++.dg/torture/pr35526.C @@ -1,4 +1,6 @@ /* { dg-do compile } */ +// { dg-options "-fpermissive" } +// { dg-prune-output "narrowing" } extern void *memcpy (void *__dest, __const void *__src, __SIZE_TYPE__ __n); diff --git a/gcc/testsuite/g++.dg/tree-ssa/copyprop.C b/gcc/testsuite/g++.dg/tree-ssa/copyprop.C index 5ba193618dd..b30e5ddc5ba 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/copyprop.C +++ b/gcc/testsuite/g++.dg/tree-ssa/copyprop.C @@ -1,7 +1,7 @@ // PR 39548 verify ssa ICE // // { dg-do compile { target { lp64 } } } -// { dg-options "-Wno-error -fno-exceptions -fno-tree-vrp -O2 -fprofile-generate -finline-limit=500" } +// { dg-options "-Wno-error -fno-exceptions -fno-tree-vrp -O2 -fprofile-generate -finline-limit=500 -std=c++98" } // #include @@ -85,7 +85,7 @@ template while (__cur != 0) { _M_delete_node(__cur); } } } -template, class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> > struct hash_map { +template, class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> > struct hash_map { typedef hashtable,_Key, _HashFn, _Select1st >, _EqualKey, _Alloc> _Ht; _Ht _M_ht; typedef typename _Ht::key_type key_type; diff --git a/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C b/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C index ea3f4201470..0c37eb1e9fc 100644 --- a/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C +++ b/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C @@ -2,7 +2,8 @@ // { dg-options "" } // PRMS Id: 4992 +// { dg-prune-output "extended init" } + int *f(){ return new int[1] = { 1 }; // { dg-error "lvalue" "err" } - // { dg-warning "extended init" "warn" { target *-*-* } 6 } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/rfg27.C b/gcc/testsuite/g++.old-deja/g++.jason/rfg27.C index dd20747efab..a598c341f59 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/rfg27.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/rfg27.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-pedantic-errors" } +// { dg-options "-std=c++98 -pedantic-errors" } // Don't compile this one with -Wno-long-long... short volatile short var_0_2; /* { dg-error "" } duplicate short */ diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 70c7aed4688..81c4398a4e1 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -307,28 +307,3 @@ proc g++_target_compile { source dest type options } { return $result } - -# -# ${tool}_option_help -# - -proc ${tool}_option_help { } { - send_user " --additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n" -} - -# -# ${tool}_option_proc -# - -proc ${tool}_option_proc { option } { - if [regexp "^--additional_options," $option] { - global gpp_compile_options - regsub "--additional_options," $option "" option - foreach x [split $option ","] { - lappend gpp_compile_options "additional_flags=$x" - } - return 1 - } else { - return 0 - } -} diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp index 762dbbf82de..f1f3a68631a 100644 --- a/gcc/testsuite/lib/lto.exp +++ b/gcc/testsuite/lib/lto.exp @@ -25,6 +25,9 @@ proc lto_prune_warns { text } { # Many tests that use visibility will still pass on platforms that don't support it. regsub -all "(^|\n)\[^\n\]*: warning: visibility attribute not supported in this configuration; ignored\[^\n\]*" $text "" text + # Allow mixed-language LTO tests to pass with make check-c++0x + regsub -all "(^|\n)\[^\n\]*: warning: command line option '-std=\[^\n\]*" $text "" text + # And any stray location lines. regsub -all "(^|\n)\[^\n\]*: In function \[^\n\]*" $text "" text regsub -all "(^|\n)In file included from \[^\n\]*" $text "" text