+2002-09-06 Stan Shebs <shebs@apple.com>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * gcc.dg/weak: New directory.
+ * gcc.dg/weak-[1-9].c: Move to new directory, remove all
+ target-specific xfail bits.
+ * gcc.dg/typeof-2.c: Move to new directory.
+ * gcc.dg/weak.exp: New expect script.
+
2002-09-06 Alan Modra <amodra@bigpond.net.au>
* gcc.c-torture/execute/extzvsi.c: New test.
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-excess-errors "COFF does not support weak symbols" { target *-*-coff i?86-pc-cygwin h8300-*-hms } } */
-/* { dg-excess-errors "Darwin does not support weak symbols" { target *-*-darwin* } } */
-
-extern void * foo (void);
-void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */
-
-extern void * foo (void) __attribute__((weak));
+++ /dev/null
-/* { dg-do assemble } */
-
-/* COFF does not support weak, and dg doesn't support UNSUPPORTED. */
-/* { dg-do assemble { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
-
-__attribute__ ((weak)) int i;
-
-int f() {
- return i;
-}
/* { dg-do compile } */
/* { dg-options "-fno-common" } */
-/* COFF does not support weak, and dg doesn't support UNSUPPORTED. */
-/* { dg-do compile { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
-
-/* { dg-final { global target_triplet } } */
-/* { dg-final { if [string match *-*-darwin* $target_triplet ] {return} } } */
-/* { dg-final { if [string match h8300-*-hms $target_triplet ] {return} } } */
-/* { dg-final { if [string match i?86-pc-cygwin $target_triplet ] {return} } } */
-/* { dg-final { if [string match *-*-coff $target_triplet ] {return} } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?c" } } */
/* { dg-do compile } */
/* { dg-options "-fno-common" } */
-/* COFF does not support weak, and dg doesn't support UNSUPPORTED. */
-/* { dg-do compile { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
-
-/* { dg-final { global target_triplet } } */
-/* { dg-final { if [string match *-*-darwin* $target_triplet ] {return} } } */
-/* { dg-final { if [string match h8300-*-hms $target_triplet ] {return} } } */
-/* { dg-final { if [string match i?86-pc-cygwin $target_triplet ] {return} } } */
-/* { dg-final { if [string match *-*-coff $target_triplet ] {return} } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1c" } } */
return (void *)ffoo1b;
}
-extern void * ffoo1c (void); /* { dg-warning "applying #pragma weak" "applying #pragma weak" { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
+extern void * ffoo1c (void); /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */
void * foo1c (void)
{
return (void *)ffoo1c;
/* { dg-do compile } */
/* { dg-options "-fno-common" } */
-/* COFF does not support weak, and dg doesn't support UNSUPPORTED. */
-/* { dg-do compile { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
-/* { dg-excess-errors "COFF does not support weak symbols" { target *-*-coff i?86-pc-cygwin h8300-*-hms } } */
-/* { dg-excess-errors "Darwin does not support weak symbols" { target *-*-darwin* } } */
-
-/* { dg-final { global target_triplet } } */
-/* { dg-final { if [string match *-*-darwin* $target_triplet ] {return} } } */
-/* { dg-final { if [string match h8300-*-hms $target_triplet ] {return} } } */
-/* { dg-final { if [string match i?86-pc-cygwin $target_triplet ] {return} } } */
-/* { dg-final { if [string match *-*-coff $target_triplet ] {return} } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1c" } } */
/* { dg-do compile } */
/* { dg-options "-fno-common" } */
-/* COFF does not support weak, and dg doesn't support UNSUPPORTED. */
-/* { dg-do compile { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
-
-/* { dg-final { global target_triplet } } */
-/* { dg-final { if [string match *-*-darwin* $target_triplet ] {return} } } */
-/* { dg-final { if [string match h8300-*-hms $target_triplet ] {return} } } */
-/* { dg-final { if [string match i?86-pc-cygwin $target_triplet ] {return} } } */
-/* { dg-final { if [string match *-*-coff $target_triplet ] {return} } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1c" } } */
}
-extern int vfoo1c; /* { dg-warning "applying #pragma weak" "applying #pragma weak" { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
+extern int vfoo1c; /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */
void * foo1c (void)
{
return (void *)&vfoo1c;
#pragma weak vfoo1f
-extern int vfoo1g; /* { dg-warning "applying #pragma weak" "applying #pragma weak" { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
+extern int vfoo1g; /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */
void * foo1g (void)
{
return (void *)&vfoo1g;
/* { dg-do compile } */
/* { dg-options "-fno-common" } */
-/* COFF does not support weak, and dg doesn't support UNSUPPORTED. */
-/* { dg-do compile { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
-/* { dg-excess-errors "COFF does not support weak symbols" { target *-*-coff i?86-pc-cygwin h8300-*-hms } } */
-/* { dg-excess-errors "Darwin does not support weak symbols" { target *-*-darwin* } } */
-
-/* { dg-final { global target_triplet } } */
-/* { dg-final { if [string match *-*-darwin* $target_triplet ] {return} } } */
-/* { dg-final { if [string match h8300-*-hms $target_triplet ] {return} } } */
-/* { dg-final { if [string match i?86-pc-cygwin $target_triplet ] {return} } } */
-/* { dg-final { if [string match *-*-coff $target_triplet ] {return} } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1c" } } */
/* { dg-do compile } */
extern void * foo (void);
-void * foo (void) { return (void *)foo; } /* { dg-error "precede" "" { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
+void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */
#pragma weak foo
--- /dev/null
+/* { dg-do compile } */
+
+extern void * foo (void);
+void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */
+
+extern void * foo (void) __attribute__((weak));
--- /dev/null
+/* { dg-do assemble } */
+
+__attribute__ ((weak)) int i;
+
+int f() {
+ return i;
+}
/* { dg-do compile } */
/* { dg-options "-fno-common" } */
-/* COFF does not support weak, and dg doesn't support UNSUPPORTED. */
-/* { dg-do compile { xfail *-*-coff i?86-pc-cygwin h8300-*-hms *-*-darwin* } } */
-
-/* { dg-final { global target_triplet } } */
-/* { dg-final { if [string match *-*-darwin* $target_triplet ] {return} } } */
-/* { dg-final { if [string match h8300-*-hms $target_triplet ] {return} } } */
-/* { dg-final { if [string match i?86-pc-cygwin $target_triplet ] {return} } } */
-/* { dg-final { if [string match *-*-coff $target_triplet ] {return} } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f1" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f2" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f3" } } */
--- /dev/null
+# Copyright (C) 1997 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.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+if { [ check_weak_available ] == 1 } {
+
+ dg-init
+
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+ dg-finish
+
+} elseif { [ check_weak_available ] == 0 } {
+ unsupported "gcc.dg/weak"
+} else {
+ unresolved "gcc.dg/weak"
+}