gcc-defs.exp (additional_sources): New variable.
authorMark Mitchell <mark@codesourcery.com>
Thu, 5 Jun 2003 22:18:55 +0000 (22:18 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 5 Jun 2003 22:18:55 +0000 (22:18 +0000)
* lib/gcc-defs.exp (additional_sources): New variable.
(dg-additional-sources): New function.
(additional_files): New variable.
(dg-additional-files): New function.
(dg-additional-files-options): Likewise.
* lib/gcc-dg.exp (dg-require-weak): New function.
(dg-require-alias): Likewise.
(dg-require-gc-sections): Likewise.
* lib/target-supports.exp (check_alias_available): Remove testfile
parameter.
(check_gc_sections_available): New function.
* lib/g++-dg.exp (dg-gpp-additional-sources): Remove.
(dg-gpp-additional-files): Likewise.
* lib/g++.exp (additional_sources): Remove.
(additional_files): Likewise.
(g++_target_compile): Use dg-additional-files-options.

* gcc.dg/special/special.exp: Add "ecos" tests.  Remove complex
Tcl logic.
* gcc.dg/special/ecos.exp: Remove.
* gcc.dg/special/20000419-2.c: Use dg-require-*.
* gcc.dg/special/alias-1.c: Likewise.
* gcc.dg/special/alias-2.c: Likewise.
* gcc.dg/special/gcsec-1.c: Likewise.
* gcc.dg/special/weak-1.c: Likewise.
* gcc.dg/special/weak-2.c: Likewise.
* gcc.dg/special/wkali-1.c: Likewise.
* gcc.dg/special/wkali-2.c: Likewise.

* g++.dg/special/conpr-2.C: Use dg-additional-*, not
dg-gpp-additional-*.
* g++.dg/special/conpr-3.C: Likewise.
* g++.dg/special/conpr-4.C: Likewise.
* g++.old-deja/g++.abi/vtable3a.C: Likewise.
* g++.old-deja/g++.abi/vtable3b.C: Likewise.
* g++.old-deja/g++.abi/vtable3c.C: Likewise.
* g++.old-deja/g++.abi/vtable3d.C: Likewise.
* g++.old-deja/g++.abi/vtable3e.C: Likewise.
* g++.old-deja/g++.abi/vtable3f.C: Likewise.
* g++.old-deja/g++.abi/vtable3g.C: Likewise.
* g++.old-deja/g++.abi/vtable3h.C: Likewise.
* g++.old-deja/g++.abi/vtable3i.C: Likewise.
* g++.old-deja/g++.abi/vtable3j.C: Likewise.
* g++.old-deja/g++.oliva/linkage1.C: Likewise.
* g++.old-deja/g++.other/comdat1.C: Likewise.
* g++.old-deja/g++.other/comdat2.C: Likewise.
* g++.old-deja/g++.other/comdat3.C: Likewise.
* g++.old-deja/g++.other/ctor1.C: Likewise.
* g++.old-deja/g++.pt/instantiate5.C: Likewise.

From-SVN: r67514

36 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/special/conpr-2.C
gcc/testsuite/g++.dg/special/conpr-3.C
gcc/testsuite/g++.dg/special/conpr-4.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3a.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3b.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3c.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3d.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3e.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3f.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3g.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3h.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3i.C
gcc/testsuite/g++.old-deja/g++.abi/vtable3j.C
gcc/testsuite/g++.old-deja/g++.oliva/linkage1.C
gcc/testsuite/g++.old-deja/g++.other/comdat1.C
gcc/testsuite/g++.old-deja/g++.other/comdat2.C
gcc/testsuite/g++.old-deja/g++.other/comdat3.C
gcc/testsuite/g++.old-deja/g++.other/ctor1.C
gcc/testsuite/g++.old-deja/g++.pt/instantiate5.C
gcc/testsuite/gcc.dg/special/20000419-2.c
gcc/testsuite/gcc.dg/special/alias-1.c
gcc/testsuite/gcc.dg/special/alias-2.c
gcc/testsuite/gcc.dg/special/ecos.exp [deleted file]
gcc/testsuite/gcc.dg/special/gcsec-1.c
gcc/testsuite/gcc.dg/special/special.exp
gcc/testsuite/gcc.dg/special/weak-1.c
gcc/testsuite/gcc.dg/special/weak-2.c
gcc/testsuite/gcc.dg/special/wkali-1.c
gcc/testsuite/gcc.dg/special/wkali-2.c
gcc/testsuite/lib/g++-dg.exp
gcc/testsuite/lib/g++.exp
gcc/testsuite/lib/gcc-defs.exp
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/gcc.exp
gcc/testsuite/lib/target-supports.exp

index ca874aaa71536ff35d372b79aaff19dc1f9a4bdf..daf275fe99892b412eb31f7dd5dd554c77ca4b46 100644 (file)
@@ -1,3 +1,55 @@
+2003-06-05  Mark Mitchell  <mark@codesourcery.com>
+
+       * lib/gcc-defs.exp (additional_sources): New variable.
+       (dg-additional-sources): New function.
+       (additional_files): New variable.
+       (dg-additional-files): New function.
+       (dg-additional-files-options): Likewise.
+       * lib/gcc-dg.exp (dg-require-weak): New function.
+       (dg-require-alias): Likewise.
+       (dg-require-gc-sections): Likewise.
+       * lib/target-supports.exp (check_alias_available): Remove testfile
+       parameter.
+       (check_gc_sections_available): New function.
+       * lib/g++-dg.exp (dg-gpp-additional-sources): Remove.
+       (dg-gpp-additional-files): Likewise.
+       * lib/g++.exp (additional_sources): Remove.
+       (additional_files): Likewise.
+       (g++_target_compile): Use dg-additional-files-options.
+       
+       * gcc.dg/special/special.exp: Add "ecos" tests.  Remove complex
+       Tcl logic.
+       * gcc.dg/special/ecos.exp: Remove.
+       * gcc.dg/special/20000419-2.c: Use dg-require-*.
+       * gcc.dg/special/alias-1.c: Likewise.
+       * gcc.dg/special/alias-2.c: Likewise.
+       * gcc.dg/special/gcsec-1.c: Likewise.
+       * gcc.dg/special/weak-1.c: Likewise.
+       * gcc.dg/special/weak-2.c: Likewise.
+       * gcc.dg/special/wkali-1.c: Likewise.
+       * gcc.dg/special/wkali-2.c: Likewise.
+       
+       * g++.dg/special/conpr-2.C: Use dg-additional-*, not
+       dg-gpp-additional-*.
+       * g++.dg/special/conpr-3.C: Likewise.
+       * g++.dg/special/conpr-4.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3a.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3b.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3c.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3d.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3e.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3f.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3g.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3h.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3i.C: Likewise.
+       * g++.old-deja/g++.abi/vtable3j.C: Likewise.
+       * g++.old-deja/g++.oliva/linkage1.C: Likewise.
+       * g++.old-deja/g++.other/comdat1.C: Likewise.
+       * g++.old-deja/g++.other/comdat2.C: Likewise.
+       * g++.old-deja/g++.other/comdat3.C: Likewise.
+       * g++.old-deja/g++.other/ctor1.C: Likewise.
+       * g++.old-deja/g++.pt/instantiate5.C: Likewise.
+
 2003-06-05  Richard Henderson  <rth@redhat.com>
 
        * gcc.dg/debug/20030605-1.c: New.
index 9c482b95fb66b179cf8cbf2d4b1729f6feb39a4d..67333c8a98b7c58737249044d353dad9b54937e8 100644 (file)
@@ -1,6 +1,6 @@
 /* This doesn't work on solaris2 for reasons described in PR 6482.  */
 /* { dg-do run { xfail *-*-solaris2* } } */
-/* { dg-gpp-additional-sources "conpr-2a.cc" } */
+/* { dg-additional-sources "conpr-2a.cc" } */
 
 #include <stdlib.h>
 
index 3fe5741f54682b5a602b8f99196bc2621a392752..04a080bacefe61318433f6ca512c9050f87b86ff 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-gpp-additional-sources "conpr-3a.cc conpr-3b.cc" } */
+/* { dg-additional-sources "conpr-3a.cc conpr-3b.cc" } */
 
 #include <stdlib.h>
 
index 68ac543ad1c49205f96b4fb1514e6a46a2b43e9b..c04d188ad70e48cff6e7ca05247900ee23fbc153 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-gpp-additional-sources "conpr-3b.cc conpr-3a.cc" } */
+/* { dg-additional-sources "conpr-3b.cc conpr-3a.cc" } */
 
 #include <stdlib.h>
 
index 5e272e1f76a7cc099271b8a274dd86d5cf9b7e57..d2eaa562ddbf866f4d553a862aff304d593e7d7e 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index daa25b9cfb6e7a479e8027568b0abf66db677667..1a108f8cc1d4c503a50e3064ea9a01c5f3b9a589 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index 3bc2de5a736225b772e93e8e1926b475f24d9e2f..c7b1365b67931006c9c7b3b451bf515c768d4229 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index b0a662ce45bd1b384cd9a4783993a0c5c8fc1ace..82edae697d6934bcc5b7d6c309114eb12a8ce8cd 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index b3040181787e52fca4172c8e96b5f0daecdc70e6..e8469cf422e6937c2e80e2637f406f8c49efb124 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index f8356c39125c99aa9a407e9ef555451c54c17bd5..c604af88920f5fd3b45cc3d6dc4262c08733a1ba 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index 111b80cae4acd3e6aec049370aaa2bea45983470..9218f40776aebc360a20ba71195d7bfe005b36ec 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index f2b3a0dde6584df739ac25daed4f73c8b0dcf81f..1a756fe62d50e986a0923e3e56c2b8a93400f633 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index d9861d563433055dbce9f8d6d151be1d640f55b1..a71087bd4b3b930c3ca5c8a0943fa121e890fc19 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index 03832ae4da13f6950d257162637ae189863502fe..de4f590def59c5a8be8a01cd9000ae8d5f546d36 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-files "vtable3.h" }
+// { dg-additional-files "vtable3.h" }
 
 // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
index 57ef45ff911e0fc2ff06c50db3a99270b5e69419..23295ea363da7b926f49bec04c0ecfe8e69aa940 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do link }
-// { dg-gpp-additional-sources " linkage1-main.cc" }
+// { dg-additional-sources " linkage1-main.cc" }
 
 // Copyright 2002 Free Software Foundation
 
index 073260b0a4729be3722e51f22e72850282bb4fab..a60c865935cc40b413726975c8ea4e512ad24aae 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-sources " comdat1-aux.cc" }
+// { dg-additional-sources " comdat1-aux.cc" }
 // { dg-options "-O" }
 // Test that statics in inline functions are unified between
 // translation units.  Currently we handle this by just suppressing
index aaa3d7431a6ed6d349d2ce228173e6cc09ff2d95..5c44d0c33bdba74750050e77071d463b1bead9d8 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-sources " comdat2-aux.cc" }
+// { dg-additional-sources " comdat2-aux.cc" }
 // { dg-options "-O" }
 // Test that statics in inline functions are unified between
 // translation units.  Currently we handle this by just suppressing
index 3ac9638142a55565cf59334d57da64f5c239b698..2a538cad9241baf62b2ebadc411a3258408b0478 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-sources " comdat3-aux.cc" }
+// { dg-additional-sources " comdat3-aux.cc" }
 // Test that duplicate elimination of implicit instantiations of static
 // data members works properly.
 
index 5baf41b051de23a6da106ca8cd19dfc87f595a54..e813d20b15b0640afecfe415f9980111ea00b7ff 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do run  }
-// { dg-gpp-additional-sources " ctor1-aux.cc" }
+// { dg-additional-sources " ctor1-aux.cc" }
 
 // Origin: Mark Mitchell <mark@codesourcery.com>
 
index 70ec41255191a07396cb94072e5a0d65cc7e7491..21d8b334732fd606afbb41dce4c6940902ae626c 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do link  }
-// { dg-gpp-additional-sources " instantiate5.cc instantiate5-main.cc" }
+// { dg-additional-sources " instantiate5.cc instantiate5-main.cc" }
 
 // `global constructors' are given the same name, based on foo(), on
 // both translation units, which is wrong, because it must be possible
index 05e4729572cfeb9dd6ceb35ae5293588cd21e15a..9b468115a944c1343d55da712fb6b872548fbe00 100644 (file)
@@ -1,6 +1,7 @@
 /* A static function with a global alias should not get 'defined but
    not used' warnings.  Exposed by Linux kernel.  */
 /* { dg-do compile } */
+/* { dg-require-alias } */
 /* { dg-options "-Wall" } */
 
 extern void do_something (void);
index d58393179a87ef19735f73852baa764e99a21e06..6798c5be4c656ad8c0aa3b80541932795a6e20c0 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-do link } */
+/* { dg-require-alias "" } */
 
 #include <stdlib.h>
 
index 5dd9f537cb0abc8f0d27e33c5da1f9f6ce1e9770..4cc8ce150f11fa32d93b61470ebf7696c113d14a 100644 (file)
@@ -1,5 +1,6 @@
 /* PR 3997 */
 /* { dg-do run } */
+/* { dg-require-alias "" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/special/ecos.exp b/gcc/testsuite/gcc.dg/special/ecos.exp
deleted file mode 100644 (file)
index 835233f..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-#   Copyright (C) 1999, 2000, 2001 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
-
-# Please email any bugs, comments, and/or additions to this file to:
-# jlarmour@cygnus.co.uk
-
-# This file was written by Jonathan Larmour (jlarmour@cygnus.co.uk).
-
-# GCC testsuite that uses the `dg.exp' driver.
-
-# Load support procs.
-load_lib gcc-dg.exp
-
-###############################
-# proc gcc_target_object_format {}
-###############################
-# has been moved to:  gcc/testsuite/lib/file-format.exp
-
-###############################
-# proc check_weak_available { }
-###############################
-# has been moved to:  gcc/testsuite/lib/target-supports.exp
-
-##########
-# weak-1.c
-##########
-
-if { [ check_weak_available ] == 1 } {
-    dg-init
-
-    set lines [gcc_target_compile "$srcdir/$subdir/weak-1a.c" "weak-1a.o" object ""]
-    if ![string match "" $lines] then {
-        fail "weak-1a.o"
-    } else {
-        dg-runtest "$srcdir/$subdir/weak-1.c" "weak-1a.o" "" 
-        file delete weak-1a.o
-    }
-    dg-finish
-} elseif { [ check_weak_available ] == 0 } {
-    unsupported "weak-1.c"
-} else {
-    unresolved "weak-1.c"
-}
-
-##########
-# weak-2.c
-##########
-
-if { [ check_weak_available ] == 1 } {
-    dg-init
-    
-    set lines [gcc_target_compile "$srcdir/$subdir/weak-2a.c" "weak-2a.o" object ""]
-    if ![string match "" $lines] then {
-        fail "weak-2a.o"
-    } else {
-        set lines [gcc_target_compile "$srcdir/$subdir/weak-2b.c" "weak-2b.o" object ""]
-        if ![string match "" $lines] then {
-            fail "weak-2b.o"
-        } else {
-            dg-runtest "$srcdir/$subdir/weak-2.c" "weak-2a.o weak-2b.o" "" 
-            file delete weak-2a.o weak-2b.o
-        }
-    }
-    dg-finish
-} elseif { [ check_weak_available ] == 0 } {
-    unsupported "weak-2.c"
-} else {
-    unresolved "weak-2.c"
-}
-
-###########
-# alias-1.c
-###########
-
-dg-init
-switch [check_alias_available "$srcdir/$subdir/alias-1.c"] {
-    yes     { dg-runtest "$srcdir/$subdir/alias-1.c" "" "" }
-    no      { unsupported "alias-1.c" }
-    default { fail "alias-1.c" }
-}
-dg-finish
-
-###########
-# alias-2.c
-###########
-
-dg-init
-switch [check_alias_available "$srcdir/$subdir/alias-2.c"] {
-    yes     { dg-runtest "$srcdir/$subdir/alias-2.c" "" "" }
-    no      { unsupported "alias-2.c" }
-    default { fail "alias-2.c" }
-}
-dg-finish
-
-###########
-# wkali-1.c
-###########
-
-if { [ check_weak_available ] == 1 } {
-    dg-init
-    switch [check_alias_available "$srcdir/$subdir/wkali-1.c"] {
-        yes     { dg-runtest "$srcdir/$subdir/wkali-1.c" "" "" }
-        no      { unsupported "wkali-1.c" }
-        default { fail "wkali-1.c" }
-    }
-    dg-finish
-} elseif { [ check_weak_available ] == 0 } {
-    unsupported "wkali-1.c"
-} else {
-    unresolved "wkali-1.c"
-}
-
-###########
-# wkali-2.c
-###########
-
-if { [ check_weak_available ] == 1 } {
-    dg-init
-    set lines [gcc_target_compile "$srcdir/$subdir/wkali-2a.c" "wkali-2a.o" object ""]
-    if ![string match "" $lines] then {
-        fail "wkali-2a.o"
-    } else {
-        set lines [gcc_target_compile "$srcdir/$subdir/wkali-2b.c" "wkali-2b.o" object ""]
-        if [string match "*only weak aliases*" $lines] then {
-           xfail "wkali-2b.o"
-           file delete $srcdir/$subdir/wkali-2.exe
-        } elseif ![string match "" $lines] then {
-            fail "wkali-2b.o"
-        } else {
-            dg-runtest "$srcdir/$subdir/wkali-2.c" "wkali-2a.o wkali-2b.o" ""
-            file delete wkali-2a.o wkali-2b.o
-        }
-    }
-    dg-finish
-} elseif { [ check_weak_available ] == 0 } {
-    unsupported "wkali-2.c"
-} else {
-    unresolved "wkali-2.c"
-}
-
-###########
-# gcsec-1.c
-###########
-
-# Check if the ld used by gcc supports --gc-sections.
-set gcc_ld [lindex [gcc_target_compile "-print-prog-name=ld" "" "none" ""] 0]
-set ld_output [remote_exec host "$gcc_ld" "--help"]
-
-# AIX gld supports garbage collection. But AIX gcc does not support 
-# -ffunction-sections or -fdata-sections.
-if { [ string first "--gc-sections" $ld_output ] >= 0 
-     && ! [istarget rs6000-*-aix*]
-     && ! [istarget powerpc*-*-aix*] } {
-
-    dg-init
-    if [isnative] {
-       dg-runtest "$srcdir/$subdir/gcsec-1.c" "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" ""
-    } else {
-       dg-runtest "$srcdir/$subdir/gcsec-1.c" "-ffunction-sections -fdata-sections -Wl,--gc-sections" ""
-    }
-    dg-finish
-} else {
-    unsupported "gcsec-1.c"
-}
-
-### EOF ecos.exp
index 125ae1f218be87cabbba2cf6f0455edd4096749f..f2a63d1b520d2f6eccb0d4da6967c5a77ac6d469 100644 (file)
@@ -1,4 +1,10 @@
-/* { dg-do run } */
+/* AIX gld supports garbage collection. But AIX gcc does not support 
+   -ffunction-sections or -fdata-sections.  */
+/* { dg-do run { xfail rs6000-*-aix* powerpc*-*-aix* } } */
+/* { dg-require-gc-sections "" } */
+
+/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" } */
+/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" { target native } } */
 
 #include <stdlib.h>
 
index 25c441204fbe4565b49e822fabc07eef26003dd1..d661e053df6e4ec0a0183ffa94d9f67ad27e0eeb 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright (C) 2001 Free Software Foundation, Inc.
+#   Copyright (C) 2001, 2003 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
 # Load support procs.
 load_lib gcc-dg.exp
 
-##############
-# 20000419-2.c
-##############
-
 dg-init
-switch [check_alias_available "$srcdir/$subdir/20000419-2.c"] {
-    yes     { dg-runtest "$srcdir/$subdir/20000419-2.c" "" "" }
-    no      { unsupported "20000419-2.c" }
-    default { fail "20000419-2.c" }
-}
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*\[1-9\].c]] \
+       "" ""
 dg-finish
 
-
 ### EOF special.exp
index fa02f22ace3a3d3561a964fdb4a2452cca7797dd..b7fb909716a040cd1067ccb48312c03bdc82e84b 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do run } */
+/* { dg-require-weak "" } */
+/* { dg-additional-sources weak-1a.c } */
 
 #include <stdlib.h>
 
index b51ba8373e0ade3ff11ac9a1f4b739234608beb3..bc481430eb5985bdfe0883861e6e650bd88a7084 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-additional-sources "weak-2a.c weak-2b.c" } */
 
 #include <stdlib.h>
 
index f28d40b97959676063dd5a9337d5c6f16057edbb..9d97b8e1288295687c4f0b22d229df747c41b4db 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do link } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
 
 #include <stdlib.h>
 
index b51ba8373e0ade3ff11ac9a1f4b739234608beb3..b53d4f270243e86882a95efc55c9a9eaa2b6f78a 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do run } */
+/* { dg-require-weak "" } */
+/* { dg-additional-sources "wkali-2a.c wkali-2b.c" } */
 
 #include <stdlib.h>
 
index 9f6364576a04cee0bf19bbfb841ff3043a9771f9..1efb93d427251f74f4bc232a6dd5ba5c65ed81ec 100644 (file)
@@ -26,20 +26,3 @@ proc g++-dg-test { prog do_what extra_tool_flags } {
 proc g++-dg-prune { system text } {
     return [gcc-dg-prune $system $text]
 }
-
-# Record additional sources files that must be compiled along with the
-# main source file.
-
-proc dg-gpp-additional-sources { args } {
-    global additional_sources
-    set additional_sources [lindex $args 1]
-}
-
-# Record additional files -- other than source files -- that must be
-# present on the system where the compiler runs.
-
-proc dg-gpp-additional-files { args } {
-    global additional_files
-    set additional_files [lindex $args 1]
-}
-
index 68b4d16023e7bf05ed033cf63edf47fe9f36a057..821c3d7c758bc9537b130166bac85d8d7395124b 100644 (file)
@@ -31,8 +31,6 @@ load_lib gcc-defs.exp
 
 
 set gpp_compile_options ""
-set additional_sources ""
-set additional_files ""
 
 #
 # g++_version -- extract and print the version number of the compiler
@@ -306,34 +304,10 @@ proc g++_target_compile { source dest type options } {
        exec rm -f $rponame
     }
 
-    global additional_sources
-    global additional_files
-    set to_download ""
-    if { $additional_sources != "" } then {
-       if [is_remote host] {
-           lappend options "additional_flags=$additional_sources"
-       }
-       regsub -all "^| " $additional_sources " [file dirname $source]/" additional_sources
-       if ![is_remote host] {
-           lappend options "additional_flags=$additional_sources"
-       }
-       set to_download [concat $to_download $additional_sources]
-    }
-    if { $additional_files != "" } then { 
-       regsub -all " " $additional_files " [file dirname $source]/" additional_files
-       set to_download [concat $to_download $additional_files]
-    }
-    if [is_remote host] {
-       foreach file $to_download {
-           remote_download host $file
-       }
-    }
+    set options [dg-additional-files-options $options $source]
 
     set result [target_compile $source $dest $type $options]
 
-    set additional_sources ""
-    set additional_files ""
-
     return $result
 }
 
index 30e4b13ff29b664404e505dd664f8eb552e646b3..bb2369c21100b3e9a21b2a5198b5df1f7cdaaafd 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003 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
@@ -164,3 +164,56 @@ if { [info procs runtest_file_p] == "" } then {
        return 1
     }
 }
+
+# Record additional sources files that must be compiled along with the
+# main source file.
+
+set additional_sources ""
+
+proc dg-additional-sources { args } {
+    global additional_sources
+    set additional_sources [lindex $args 1]
+}
+
+# Record additional files -- other than source files -- that must be
+# present on the system where the compiler runs.
+
+set additional_files ""
+
+proc dg-additional-files { args } {
+    global additional_files
+    set additional_files [lindex $args 1]
+}
+
+# Return an updated version of OPTIONS that mentions any additional
+# source files registered with dg-additional-sources.  SOURCE is the
+# name of the test case.
+
+proc dg-additional-files-options { options source } {
+    global additional_sources
+    global additional_files
+    set to_download [list]
+    if { $additional_sources != "" } then {
+       if [is_remote host] {
+           lappend options "additional_flags=$additional_sources"
+       }
+       regsub -all "^| " $additional_sources " [file dirname $source]/" additional_sources
+       if ![is_remote host] {
+           lappend options "additional_flags=$additional_sources"
+       }
+       set to_download [concat $to_download $additional_sources]
+       set additional_sources ""
+    }
+    if { $additional_files != "" } then { 
+       regsub -all " " $additional_files " [file dirname $source]/" additional_files
+       set to_download [concat $to_download $additional_files]
+       set additional_files ""
+    }
+    if [is_remote host] {
+       foreach file $to_download {
+           remote_download host $file
+       }
+    }
+
+    return $options
+}
index f01cd8aede13d6a860a192c150b8be7e1a482600..09fd618d90a02ea60935fd2ea91f7acc1bcd43c1 100644 (file)
@@ -250,3 +250,47 @@ proc gcc-dg-debug-runtest { target_compile trivial opt_opts testcases } {
        }
     }
 }
+
+# If this target does not support weak symbols, skip this test.
+
+proc dg-require-weak { args } {
+    upvar dg-do-what dg-do-what
+    upvar name name
+
+    set weak_available [ check_weak_available ]
+    if { $weak_available == -1 } {
+       unresolved "$name"
+    }
+    if { $weak_available != 1 } {
+       set dg-do-what [list [lindex $dg_do_what 0] "N" "P"]
+       return
+    }
+}
+
+# If this target does not support the "alias" attribute, skip this
+# test.
+
+proc dg-require-alias { args } {
+    upvar dg-do-what dg-do-what
+    upvar name name
+
+    set alias_available [ check_alias_available ]
+    if { $alias_available == -1 } {
+       unresolved "$name"
+    }
+    if { $alias_available < 2 } {
+       set dg-do-what [list [lindex $dg_do_what 0] "N" "P"]
+       return
+    }
+}
+
+# If this target's linker does not support the --gc-sections flag,
+# skip this test.
+
+proc dg-require-gc-sections { args } {
+    if { ![ check_gc_sections_available ] } {
+       upvar dg-do-what dg-do-what
+       set dg-do-what [list [lindex $dg_do_what 0] "N" "P"]
+       return
+    }
+}
index f090cb11f49a5dbd94ccc3b8ce8e0200f0292ee1..bec0e2e42587e41ea7070216a4379e1b9662baeb 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001, 2003 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
@@ -153,5 +153,6 @@ proc gcc_target_compile { source dest type options } {
        lappend options "timeout=[target_info gcc,timeout]"
     }
     lappend options "compiler=$GCC_UNDER_TEST"
+    set options [dg-additional-files-options $options $source]
     return [target_compile $source $dest $type $options]
 }
index efcc941c22032e9682caa2d54d5315f0001741c7..0944777c9d27c4c12ad28ddf0d98574ed7c918a4 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+#   Copyright (C) 1999, 2001, 2003 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
@@ -67,24 +67,28 @@ proc check_weak_available { } {
 ###############################
 
 # Determine if the target toolchain supports the alias attribute.
-# Parameter is the pathname of a file that can be used to test the alias support.
-# Returns yes if it does.
-# Returns no if it does not.
-# Returns dontknow if something went wrong
-# For an example of the use of this function, see gcc.dg/special/ecos.exp
 
-proc check_alias_available { testfile } {
+# Returns 2 if the target supports aliases.  Returns 1 if the target
+# only supports weak aliased.  Returns 0 if the target does not
+# support aliases at all.  Returns -1 if support for aliases could not
+# be determined.
+
+proc check_alias_available { } {
     global alias_available_saved
     
     if [info exists alias_available_saved] {
         verbose "check_alias_available  returning saved $alias_available_saved" 2
     } else {
-        verbose "check_alias_available  compiling testfile $testfile" 2
-       set lines [gcc_target_compile $testfile "tmp.o" object ""]
-       
+        verbose "check_alias_available  compiling testfile" 2
+       set f [open "tmp.c" "w"]
+       puts $f "void f() __attribute__((alias(\"g\")));"
+       close $f
+       set lines [gcc_target_compile "tmp.c" "tmp.o" object ""]
+       file delete "tmp.c"
+
        if [string match "" $lines] then {
            # No error messages, everything is OK.
-           set alias_available_saved yes
+           set alias_available_saved 2
        } else {
            if [regexp "alias definitions not supported" $lines] {
                verbose "check_alias_available  target does not support aliases" 2
@@ -93,16 +97,16 @@ proc check_alias_available { testfile } {
 
                if { $objformat == "elf" } {
                    verbose "check_alias_available  but target uses ELF format, so it ought to" 2
-                   set alias_available_saved dontknow
+                   set alias_available_saved -1
                } else {
-                   set alias_available_saved no
+                   set alias_available_saved 0
                }
            } else {
                if [regexp "only weak aliases are supported" $lines] {
                verbose "check_alias_available  target supports only weak aliases" 2
-               set alias_available_saved no
+               set alias_available_saved 1
                } else {
-                   set alias_available_saved dontknow
+                   set alias_available_saved -1
                }
            }
        }
@@ -112,3 +116,21 @@ proc check_alias_available { testfile } {
 
     return $alias_available_saved
 }
+
+# Returns true if --gc-sections is supported on the target.
+
+proc check_gc_sections_available { } {
+    global gc_sections_available_saved
+
+    if {![info exists alias_available_saved]} {
+       # Check if the ld used by gcc supports --gc-sections.
+       set gcc_ld [lindex [gcc_target_compile "-print-prog-name=ld" "" "none" ""] 0]
+       set ld_output [remote_exec host "$gcc_ld" "--help"]
+       if { [ string first "--gc-sections" $ld_output ] >= 0 } {
+           set gc_sections_available_saved 1
+       } else {
+           set gc_sections_available_saved 0
+       }
+    }
+    return $gc_sections_available_saved
+}