OSDN Git Service

* lib/target-supports.exp (check_named_sections_available): New.
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Apr 2004 22:24:29 +0000 (22:24 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Apr 2004 22:24:29 +0000 (22:24 +0000)
* 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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80572 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/init-ref4.C
gcc/testsuite/g++.dg/parse/attr-ctor1.C
gcc/testsuite/g++.old-deja/g++.pt/static3.C
gcc/testsuite/g++.old-deja/old-deja.exp
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/prune.exp
gcc/testsuite/lib/target-supports.exp

index 40d5e47..9135371 100644 (file)
@@ -1,3 +1,15 @@
+2004-04-09  Zack Weinberg  <zack@codesourcery.com>
+
+       * 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  <roger@eyesopen.com>
 
        * 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.
        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  <nathan@codesourcery.com>
 
index 26d2e97..7cd6986 100644 (file)
@@ -1,9 +1,9 @@
 // Origin: dgregor@gcc.gnu.org
 // PR c++/11384
-// foo<int>::_S_something was not being emitted.
+// foo<int>::_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<typename T> 
   struct foo
@@ -19,4 +19,3 @@ int main()
   const int* p = &foo<int>::_S_something;
   return 0;
 }
-
index d48543c..23d488a 100644 (file)
@@ -1,10 +1,9 @@
 // PR c++/6992
 // Origin: <petr@scssoft.com>
 // { 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();
 };
index 6688d23..5a638b1 100644 (file)
@@ -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<class T>
 struct A {
index 425fdd4..5e3f6b7 100644 (file)
@@ -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
 
index d1a85a8..7977893 100644 (file)
@@ -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
index 2d1b109..d706eac 100644 (file)
 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
index 99b418e..7dfa893 100644 (file)
@@ -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
+}