From ca2ca5a741a2570bfeeed2f8cba371cb10a811b7 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 9 Apr 2004 22:24:29 +0000 Subject: * lib/target-supports.exp (check_named_sections_available): New. * lib/gcc-dg.exp (dg-require-named-sections): New. * lib/prune.exp (prune_gcc_output): Incorporate prunes from old-deja.exp. Also prune error-count message from HP linker. * g++.old-deja/old-deja.exp (g++-dg-prune): Delete. * g++.dg/init/init-ref4.C: Use dg-require-weak. * g++.old-deja/g++.pt/static3.C: Likewise. * g++.dg/parse/attr-ctor1.C: Use dg-require-named-sections. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@80572 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 18 +++++++++++++++--- gcc/testsuite/g++.dg/init/init-ref4.C | 7 +++---- gcc/testsuite/g++.dg/parse/attr-ctor1.C | 5 ++--- gcc/testsuite/g++.old-deja/g++.pt/static3.C | 3 ++- gcc/testsuite/g++.old-deja/old-deja.exp | 11 ----------- gcc/testsuite/lib/gcc-dg.exp | 11 +++++++++++ gcc/testsuite/lib/prune.exp | 5 ++++- gcc/testsuite/lib/target-supports.exp | 20 ++++++++++++++++++++ 8 files changed, 57 insertions(+), 23 deletions(-) (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 40d5e47cf99..91353711df7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2004-04-09 Zack Weinberg + + * lib/target-supports.exp (check_named_sections_available): New. + * lib/gcc-dg.exp (dg-require-named-sections): New. + * lib/prune.exp (prune_gcc_output): Incorporate prunes from + old-deja.exp. Also prune error-count message from HP linker. + * g++.old-deja/old-deja.exp (g++-dg-prune): Delete. + + * g++.dg/init/init-ref4.C: Use dg-require-weak. + * g++.old-deja/g++.pt/static3.C: Likewise. + * g++.dg/parse/attr-ctor1.C: Use dg-require-named-sections. + 2004-04-09 Roger Sayle * gcc.c-torture/execute/20040409-1.c: New test case. @@ -49,7 +61,7 @@ * gcc.dg/compat/struct-by-value-5a_y.c, gcc.dg/compat/struct-by-value-5b_y.c: New, split out from gcc.dg/compat/struct-by-value-5_y.c. - + * gcc.dg/compat/struct-by-value-6a_main.c, gcc.dg/compat/struct-by-value-6b_main.c: New files. * gcc.dg/compat/struct-by-value-6_main.c: Delete. @@ -59,7 +71,7 @@ * gcc.dg/compat/struct-by-value-6a_y.c, gcc.dg/compat/struct-by-value-6b_y.c: New, split out from gcc.dg/compat/struct-by-value-6_y.c. - + * gcc.dg/compat/struct-by-value-7a_main.c, gcc.dg/compat/struct-by-value-7b_main.c: New files. * gcc.dg/compat/struct-by-value-7_main.c: Delete. @@ -92,7 +104,7 @@ failure and exit(0) on success. * g++.dg/expr/anew2.C: Ditto. * g++.dg/expr/anew3.C: Ditto. - * g++.dg/expr/anew4.C: Ditto. + * g++.dg/expr/anew4.C: Ditto. 2004-04-05 Nathan Sidwell diff --git a/gcc/testsuite/g++.dg/init/init-ref4.C b/gcc/testsuite/g++.dg/init/init-ref4.C index 26d2e97562c..7cd6986ce52 100644 --- a/gcc/testsuite/g++.dg/init/init-ref4.C +++ b/gcc/testsuite/g++.dg/init/init-ref4.C @@ -1,9 +1,9 @@ // Origin: dgregor@gcc.gnu.org // PR c++/11384 -// foo::_S_something was not being emitted. +// foo::_S_something was not being emitted (as a weak definition). -// { dg-do run { xfail *-*-aout *-*-coff *-*-hpux* *-*-hms } } -// On targets that don't support weak symbols, we require an explicit +// { dg-do run } +// { dg-require-weak "" } template struct foo @@ -19,4 +19,3 @@ int main() const int* p = &foo::_S_something; return 0; } - diff --git a/gcc/testsuite/g++.dg/parse/attr-ctor1.C b/gcc/testsuite/g++.dg/parse/attr-ctor1.C index d48543cf100..23d488a2003 100644 --- a/gcc/testsuite/g++.dg/parse/attr-ctor1.C +++ b/gcc/testsuite/g++.dg/parse/attr-ctor1.C @@ -1,10 +1,9 @@ // PR c++/6992 // Origin: // { dg-do compile } - -// Requires section attribute support +// { dg-require-named-sections "" } class A { - __attribute__((section("whatever"))) A(); // { dg-bogus "" "" { xfail hppa*-*-hpux* } } + __attribute__((section("whatever"))) A(); }; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static3.C b/gcc/testsuite/g++.old-deja/g++.pt/static3.C index 6688d23cda5..5a638b1f7ad 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/static3.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/static3.C @@ -1,6 +1,7 @@ -// { dg-do run { xfail *-*-aout *-*-coff *-*-hpux* *-*-hms } } +// { dg-do run } // On targets that don't support weak symbols, we require an explicit // instantiation of arr. +// { dg-require-weak "" } template struct A { diff --git a/gcc/testsuite/g++.old-deja/old-deja.exp b/gcc/testsuite/g++.old-deja/old-deja.exp index 425fdd42336..5e3f6b7fc34 100644 --- a/gcc/testsuite/g++.old-deja/old-deja.exp +++ b/gcc/testsuite/g++.old-deja/old-deja.exp @@ -30,17 +30,6 @@ dg-init # that are handled specially. set tests [lsort [find $srcdir/$subdir *.C]] -proc g++-dg-prune { system text } { - regsub -all "(^|\n)\[^\n\]*: In (\[^\n\]*function|method|\[^\n\]*structor) \[^\n\]*" $text "" text - regsub -all "(^|\n)\[^\n\]*: In instantiation of \[^\n\]*" $text "" text - regsub -all "(^|\n)\[^\n\]*: instantiated from \[^\n\]*" $text "" text - regsub -all "(^|\n)\[^\n\]*: At (top level|global scope):\[^\n\]*" $text "" text - regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $text "" text - regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $text "" text - regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $text "" text - return $text -} - # Main loop. dg-runtest $tests "" $DEFAULT_CXXFLAGS diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index d1a85a819c5..7977893cae6 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -357,6 +357,17 @@ proc dg-require-iconv { args } { return } +# If this target does not support named sections skip this test. + +proc dg-require-named-sections { args } { + upvar name name + + if { ![ check_named_sections_available ] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # Prune any messages matching ARGS[1] (a regexp) from test output. proc dg-prune-output { args } { global additional_prunes diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp index 2d1b1096198..d706eacd1c0 100644 --- a/gcc/testsuite/lib/prune.exp +++ b/gcc/testsuite/lib/prune.exp @@ -19,10 +19,13 @@ proc prune_gcc_output { text } { #send_user "Before:$text\n" - regsub -all "(^|\n)\[^\n\]*: In ((static member )?function|member|method|(copy )?constructor|instantiation|program|subroutine|block-data) \[^\n\]*" $text "" text + regsub -all "(^|\n)\[^\n\]*: In ((static member )?function|member|method|(copy )?constructor|destructor|instantiation|program|subroutine|block-data) \[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: At (top level|global scope):\[^\n\]*" $text "" text + regsub -all "(^|\n)\[^\n\]*: instantiated from \[^\n\]*" $text "" text regsub -all "(^|\n)collect2: ld returned \[^\n\]*" $text "" text + regsub -all "(^|\n)collect: re(compiling|linking)\[^\n\]*" $text "" text regsub -all "(^|\n)Please submit.*instructions\[^\n\]*" $text "" text + regsub -all "(^|\n)\[0-9\]\[0-9\]* errors\." $text "" text # Ignore harmless -fpic warnings. regsub -all "(^|\n)\[^\n\]*: warning: -f(pic|PIC) ignored for target\[^\n\]*" $text "" text diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 99b418e78a7..7dfa893ced6 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -247,3 +247,23 @@ proc check_iconv_available { test_what } { return 0 } + +# Return true if named sections are supported on this target. +# This proc does not cache results, because the answer may vary +# when cycling over subtarget options (e.g. irix o32/n32/n64) in +# the same test run. +proc check_named_sections_available { } { + global tool + + set f [open "tmp.c" "w"] + # Compile a small test program. + puts $f "int __attribute__ ((section(\"whatever\"))) foo;" + close $f + set lines [${tool}_target_compile "tmp.c" "tmp.o" object ""] + file delete "tmp.c" + + # If we got no error messages, everything is OK. + set answer [string match "" $lines] + verbose "check_named_sections_available returning $answer" 2 + return $answer +} -- cgit v1.2.3