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
This commit is contained in:
parent
96fd3851d2
commit
556d006c02
@ -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.
|
||||
|
@ -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));
|
@ -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;
|
||||
}
|
@ -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" } } */
|
@ -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;
|
@ -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" } } */
|
@ -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;
|
@ -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" } } */
|
@ -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
|
6
gcc/testsuite/gcc.dg/weak/weak-7.c
Normal file
6
gcc/testsuite/gcc.dg/weak/weak-7.c
Normal file
@ -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));
|
7
gcc/testsuite/gcc.dg/weak/weak-8.c
Normal file
7
gcc/testsuite/gcc.dg/weak/weak-8.c
Normal file
@ -0,0 +1,7 @@
|
||||
/* { dg-do assemble } */
|
||||
|
||||
__attribute__ ((weak)) int i;
|
||||
|
||||
int f() {
|
||||
return i;
|
||||
}
|
@ -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" } } */
|
41
gcc/testsuite/gcc.dg/weak/weak.exp
Normal file
41
gcc/testsuite/gcc.dg/weak/weak.exp
Normal file
@ -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"
|
||||
}
|
Loading…
Reference in New Issue
Block a user