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]

Revised final patches for ia64 testsuite


Here are the patches I've applied to 3.4 branch and mainline.  The
major differences from the last version are that I've merged with
Andreas Schwab's more comprehensive patch for the A/B-step assembler
warnings, and I've fixed dg-require-named-sections per Kaveh's
discovery that this can vary within a test run.

zw
gcc:
	PR 14887
        * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Look only at
        mode argument.
        * config/ia64/ia64.c (ia64_hpux_file_end): Check
        TREE_SYMBOL_REFERENCED on DECL_ASSEMBLER_NAME, not DECL_NAME.

gcc/testsuite:
	* 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.

===================================================================
Index: gcc/config/ia64/hpux.h
--- gcc/config/ia64/hpux.h	15 Mar 2004 18:20:48 -0000	1.41
+++ gcc/config/ia64/hpux.h	9 Apr 2004 22:08:23 -0000
@@ -112,13 +112,13 @@ do {							\
   (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32 | MASK_INLINE_FLOAT_DIV_THR)
 
 /* This needs to be set to force structure arguments with a single
-   field to be treated as structures and not as the type of their
-   field.  Without this a structure with a single char will be
-   returned just like a char variable and that is wrong on HP-UX
-   IA64.  */
+   integer field to be treated as structures and not as the type of
+   their field.  Without this a structure with a single char will be
+   returned just like a char variable, instead of being returned at the
+   top of the register as specified for big-endian IA64.  */
 
 #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \
-  (TREE_CODE (TREE_TYPE (FIELD)) != REAL_TYPE || MODE == TFmode)
+  (!FLOAT_MODE_P (MODE) || (MODE) == TFmode)
 
 /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call,
    but that doesn't put out the @function type information which causes
===================================================================
Index: gcc/config/ia64/ia64.c
--- gcc/config/ia64/ia64.c	8 Apr 2004 05:04:26 -0000	1.284
+++ gcc/config/ia64/ia64.c	9 Apr 2004 22:08:23 -0000
@@ -8732,7 +8732,7 @@ ia64_hpux_file_end (void)
   for (p = extern_func_head; p; p = p->next)
     {
       tree decl = p->decl;
-      tree id = DECL_NAME (decl);
+      tree id = DECL_ASSEMBLER_NAME (decl);
 
       if (!id)
 	abort ();
===================================================================
Index: gcc/testsuite/g++.dg/init/init-ref4.C
--- gcc/testsuite/g++.dg/init/init-ref4.C	18 Jul 2003 13:07:22 -0000	1.2
+++ gcc/testsuite/g++.dg/init/init-ref4.C	9 Apr 2004 22:08:23 -0000
@@ -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: gcc/testsuite/g++.dg/parse/attr-ctor1.C
--- gcc/testsuite/g++.dg/parse/attr-ctor1.C	19 Feb 2004 12:46:49 -0000	1.2
+++ gcc/testsuite/g++.dg/parse/attr-ctor1.C	9 Apr 2004 22:08:23 -0000
@@ -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: gcc/testsuite/g++.old-deja/old-deja.exp
--- gcc/testsuite/g++.old-deja/old-deja.exp	1 May 2003 02:02:33 -0000	1.8
+++ gcc/testsuite/g++.old-deja/old-deja.exp	9 Apr 2004 22:08:23 -0000
@@ -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: gcc/testsuite/g++.old-deja/g++.pt/static3.C
--- gcc/testsuite/g++.old-deja/g++.pt/static3.C	1 May 2003 02:02:55 -0000	1.10
+++ gcc/testsuite/g++.old-deja/g++.pt/static3.C	9 Apr 2004 22:08:24 -0000
@@ -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: gcc/testsuite/lib/gcc-dg.exp
--- gcc/testsuite/lib/gcc-dg.exp	27 Feb 2004 02:01:10 -0000	1.30
+++ gcc/testsuite/lib/gcc-dg.exp	9 Apr 2004 22:08:25 -0000
@@ -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: gcc/testsuite/lib/prune.exp
--- gcc/testsuite/lib/prune.exp	24 Mar 2004 19:54:25 -0000	1.11
+++ gcc/testsuite/lib/prune.exp	9 Apr 2004 22:08:25 -0000
@@ -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
===================================================================
Index: gcc/testsuite/lib/target-supports.exp
--- gcc/testsuite/lib/target-supports.exp	9 Mar 2004 01:53:28 -0000	1.14
+++ gcc/testsuite/lib/target-supports.exp	9 Apr 2004 22:08:25 -0000
@@ -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
+}
2004-04-09  Zack Weinberg  <zack@codesourcery.com>

gcc/testsuite:
        * 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  Andreas Schwab  <schwab@suse.de>

gcc/testsuite:
	* lib/prune.exp (prune_gcc_output): Ignore errata warning from
	IA64 assembler.
libstdc++-v3:
	* testsuite/lib/prune.exp (prune_g++_output): Ignore errata
	warning from IA64 assembler.


===================================================================
Index: gcc/testsuite/g++.dg/init/init-ref4.C
--- gcc/testsuite/g++.dg/init/init-ref4.C	18 Jul 2003 13:07:22 -0000	1.2
+++ gcc/testsuite/g++.dg/init/init-ref4.C	9 Apr 2004 22:07:36 -0000
@@ -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: gcc/testsuite/g++.dg/parse/attr-ctor1.C
--- gcc/testsuite/g++.dg/parse/attr-ctor1.C	19 Feb 2004 11:53:43 -0000	1.1.26.1
+++ gcc/testsuite/g++.dg/parse/attr-ctor1.C	9 Apr 2004 22:07:36 -0000
@@ -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: gcc/testsuite/g++.old-deja/old-deja.exp
--- gcc/testsuite/g++.old-deja/old-deja.exp	1 May 2003 02:02:33 -0000	1.8
+++ gcc/testsuite/g++.old-deja/old-deja.exp	9 Apr 2004 22:07:36 -0000
@@ -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: gcc/testsuite/g++.old-deja/g++.pt/static3.C
--- gcc/testsuite/g++.old-deja/g++.pt/static3.C	1 May 2003 02:02:55 -0000	1.10
+++ gcc/testsuite/g++.old-deja/g++.pt/static3.C	9 Apr 2004 22:07:37 -0000
@@ -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: gcc/testsuite/lib/gcc-dg.exp
--- gcc/testsuite/lib/gcc-dg.exp	21 Feb 2004 03:00:46 -0000	1.28.4.1
+++ gcc/testsuite/lib/gcc-dg.exp	9 Apr 2004 22:07:37 -0000
@@ -348,6 +348,17 @@ proc dg-require-dll { args } { 
     set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
 }
 
+# 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: gcc/testsuite/lib/prune.exp
--- gcc/testsuite/lib/prune.exp	15 Apr 2003 20:23:36 -0000	1.10
+++ gcc/testsuite/lib/prune.exp	9 Apr 2004 22:07:37 -0000
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+#   Copyright (C) 1997, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,14 +19,21 @@
 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
     regsub -all "(^|\n)\[^\n\]*: warning: -f(pic|PIC)( and -fpic are| is)? not supported\[^\n\]*" $text "" text
+
+    # Ignore errata warning from IA64 assembler.
+    regsub -all "(^|\n)\[^\n\]*: Additional NOP may be necessary to workaround Itanium processor A/B step errata" $text "" text
+    regsub -all "(^|\n)\[^\n*\]*: Assembler messages:\[^\n\]*" $text "" text
 
     # It would be nice to avoid passing anything to gcc that would cause it to
     # issue these messages (since ignoring them seems like a hack on our part),
===================================================================
Index: gcc/testsuite/lib/target-supports.exp
--- gcc/testsuite/lib/target-supports.exp	21 Feb 2004 03:03:57 -0000	1.9.4.3
+++ gcc/testsuite/lib/target-supports.exp	9 Apr 2004 22:07:37 -0000
@@ -211,3 +211,24 @@ proc check_profiling_available { test_wh
     
     return $profiling_available_saved
 }
+
+# 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
+
+    verbose "check_named_sections_available  compiling testfile" 2
+    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
+}
===================================================================
Index: libstdc++-v3/testsuite/lib/prune.exp
--- libstdc++-v3/testsuite/lib/prune.exp	7 Jan 2002 00:07:27 -0000	1.3
+++ libstdc++-v3/testsuite/lib/prune.exp	9 Apr 2004 22:07:40 -0000
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+#   Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,6 +24,10 @@ proc prune_g++_output { text } {
     # Remove parts of warnings that refer to location of previous
     # definitions, etc as these confuse dejagnu
     regsub -all "(^|\n)\[^\n\]*: In function \[^\n\]*" $text "" text
+
+    # Ignore errata warning from IA64 assembler.
+    regsub -all "(^|\n)\[^\n\]*: Additional NOP may be necessary to workaround Itanium processor A/B step errata" $text "" text
+    regsub -all "(^|\n)\[^\n*\]*: Assembler messages:\[^\n\]*" $text "" text
 
     return $text
 }

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