diff options
author | Stan Shebs <shebs@apple.com> | 2002-09-06 13:00:39 +0000 |
---|---|---|
committer | Stan Shebs <shebs@gcc.gnu.org> | 2002-09-06 13:00:39 +0000 |
commit | 556d006c025885af824930d84776ec7119590850 (patch) | |
tree | 46c2f4a534b00e06016a7f48a6bd315e193eacc1 | |
parent | 96fd3851d2dccd73474ac16058cb606612f39e7a (diff) | |
download | gcc-556d006c025885af824930d84776ec7119590850.zip gcc-556d006c025885af824930d84776ec7119590850.tar.gz gcc-556d006c025885af824930d84776ec7119590850.tar.bz2 |
weak: New directory.
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.
Co-Authored-By: David Edelsohn <edelsohn@gnu.org>
From-SVN: r56882
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak-7.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak-8.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/typeof-2.c (renamed from gcc/testsuite/gcc.dg/typeof-2.c) | 0 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-1.c (renamed from gcc/testsuite/gcc.dg/weak-1.c) | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-2.c (renamed from gcc/testsuite/gcc.dg/weak-2.c) | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-3.c (renamed from gcc/testsuite/gcc.dg/weak-3.c) | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-4.c (renamed from gcc/testsuite/gcc.dg/weak-4.c) | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-5.c (renamed from gcc/testsuite/gcc.dg/weak-5.c) | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-6.c (renamed from gcc/testsuite/gcc.dg/weak-6.c) | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-7.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-8.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak-9.c (renamed from gcc/testsuite/gcc.dg/weak-9.c) | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/weak/weak.exp | 41 |
14 files changed, 67 insertions, 74 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index adc9f53..578b9b5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +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. diff --git a/gcc/testsuite/gcc.dg/weak-7.c b/gcc/testsuite/gcc.dg/weak-7.c deleted file mode 100644 index 77a231d..0000000 --- a/gcc/testsuite/gcc.dg/weak-7.c +++ /dev/null @@ -1,8 +0,0 @@ -/* { 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)); diff --git a/gcc/testsuite/gcc.dg/weak-8.c b/gcc/testsuite/gcc.dg/weak-8.c deleted file mode 100644 index b5bb120..0000000 --- a/gcc/testsuite/gcc.dg/weak-8.c +++ /dev/null @@ -1,10 +0,0 @@ -/* { 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; -} diff --git a/gcc/testsuite/gcc.dg/typeof-2.c b/gcc/testsuite/gcc.dg/weak/typeof-2.c index 34d67b2..34d67b2 100644 --- a/gcc/testsuite/gcc.dg/typeof-2.c +++ b/gcc/testsuite/gcc.dg/weak/typeof-2.c diff --git a/gcc/testsuite/gcc.dg/weak-1.c b/gcc/testsuite/gcc.dg/weak/weak-1.c index 6cedfea..52d7230 100644 --- a/gcc/testsuite/gcc.dg/weak-1.c +++ b/gcc/testsuite/gcc.dg/weak/weak-1.c @@ -1,14 +1,6 @@ /* { 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" } } */ diff --git a/gcc/testsuite/gcc.dg/weak-2.c b/gcc/testsuite/gcc.dg/weak/weak-2.c index 5310faa..37fa19a 100644 --- a/gcc/testsuite/gcc.dg/weak-2.c +++ b/gcc/testsuite/gcc.dg/weak/weak-2.c @@ -1,14 +1,6 @@ /* { 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" } } */ @@ -31,7 +23,7 @@ void * foo1b (void) 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; diff --git a/gcc/testsuite/gcc.dg/weak-3.c b/gcc/testsuite/gcc.dg/weak/weak-3.c index 26061c2..47359ed 100644 --- a/gcc/testsuite/gcc.dg/weak-3.c +++ b/gcc/testsuite/gcc.dg/weak/weak-3.c @@ -1,16 +1,6 @@ /* { 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" } } */ diff --git a/gcc/testsuite/gcc.dg/weak-4.c b/gcc/testsuite/gcc.dg/weak/weak-4.c index f371586..bd530ab 100644 --- a/gcc/testsuite/gcc.dg/weak-4.c +++ b/gcc/testsuite/gcc.dg/weak/weak-4.c @@ -1,14 +1,6 @@ /* { 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" } } */ @@ -39,7 +31,7 @@ void * foo1b (void) } -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; @@ -71,7 +63,7 @@ void * foo1f (void) #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; diff --git a/gcc/testsuite/gcc.dg/weak-5.c b/gcc/testsuite/gcc.dg/weak/weak-5.c index 383e36d..c4f67e59 100644 --- a/gcc/testsuite/gcc.dg/weak-5.c +++ b/gcc/testsuite/gcc.dg/weak/weak-5.c @@ -1,16 +1,6 @@ /* { 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" } } */ diff --git a/gcc/testsuite/gcc.dg/weak-6.c b/gcc/testsuite/gcc.dg/weak/weak-6.c index a6e49c8..8f88a67 100644 --- a/gcc/testsuite/gcc.dg/weak-6.c +++ b/gcc/testsuite/gcc.dg/weak/weak-6.c @@ -1,6 +1,6 @@ /* { 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 diff --git a/gcc/testsuite/gcc.dg/weak/weak-7.c b/gcc/testsuite/gcc.dg/weak/weak-7.c new file mode 100644 index 0000000..64d6155 --- /dev/null +++ b/gcc/testsuite/gcc.dg/weak/weak-7.c @@ -0,0 +1,6 @@ +/* { dg-do compile } */ + +extern void * foo (void); +void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */ + +extern void * foo (void) __attribute__((weak)); diff --git a/gcc/testsuite/gcc.dg/weak/weak-8.c b/gcc/testsuite/gcc.dg/weak/weak-8.c new file mode 100644 index 0000000..6e9c267 --- /dev/null +++ b/gcc/testsuite/gcc.dg/weak/weak-8.c @@ -0,0 +1,7 @@ +/* { dg-do assemble } */ + +__attribute__ ((weak)) int i; + +int f() { + return i; +} diff --git a/gcc/testsuite/gcc.dg/weak-9.c b/gcc/testsuite/gcc.dg/weak/weak-9.c index ee919b5..e5cbdb8 100644 --- a/gcc/testsuite/gcc.dg/weak-9.c +++ b/gcc/testsuite/gcc.dg/weak/weak-9.c @@ -1,14 +1,6 @@ /* { 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" } } */ diff --git a/gcc/testsuite/gcc.dg/weak/weak.exp b/gcc/testsuite/gcc.dg/weak/weak.exp new file mode 100644 index 0000000..595ca92 --- /dev/null +++ b/gcc/testsuite/gcc.dg/weak/weak.exp @@ -0,0 +1,41 @@ +# 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" +} |