This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: gcc.dg testsuite cleanups
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 Jun 2003 14:35:28 -0700
- Subject: PATCH: gcc.dg testsuite cleanups
- Reply-to: mark at codesourcery dot com
This patch uses dg-require-weak in gcc.dg/weak, rather than the ugly
Tcl bits.
Tested on i686-pc-linux-gnu, applied on the mainline.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2003-06-06 Mark Mitchell <mark@codesourcery.com>
* gcc.dg/weak/weak.exp: Simplify.
* gcc.dg/weak/typeof-2.c: Use dg-require-weak.
* gcc.dg/weak/weak-1.c: Likewise.
* gcc.dg/weak/weak-2.c: Likewise.
* gcc.dg/weak/weak-3.c: Likewise.
* gcc.dg/weak/weak-4.c: Likewise.
* gcc.dg/weak/weak-5.c: Likewise.
* gcc.dg/weak/weak-6.c: Likewise.
* gcc.dg/weak/weak-7.c: Likewise.
* gcc.dg/weak/weak-8.c: Likewise.
* gcc.dg/weak/weak-9.c: Likewise.
Index: gcc.dg/weak/typeof-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/typeof-2.c,v
retrieving revision 1.4
diff -c -5 -p -r1.4 typeof-2.c
*** gcc.dg/weak/typeof-2.c 21 Oct 2002 15:42:22 -0000 1.4
--- gcc.dg/weak/typeof-2.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,7 ****
--- 1,8 ----
/* Test typeof with __asm redirection. */
/* { dg-do compile } */
+ /* { dg-require-weak "" } */
/* { dg-options "-O2" } */
extern int foo1 (int x) __asm ("baz1");
int bar1 (int x) { return x; }
extern __typeof (bar1) foo1 __attribute ((weak, alias ("bar1")));
Index: gcc.dg/weak/weak-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-1.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-1.c
*** gcc.dg/weak/weak-1.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-1.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
--- 1,7 ----
/* { dg-do compile } */
+ /* { dg-require-weak "" } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?c" } } */
Index: gcc.dg/weak/weak-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-2.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-2.c
*** gcc.dg/weak/weak-2.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-2.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
--- 1,7 ----
/* { dg-do compile } */
+ /* { dg-require-weak "" } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1c" } } */
Index: gcc.dg/weak/weak-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-3.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-3.c
*** gcc.dg/weak/weak-3.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-3.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,5 ****
--- 1,6 ----
+ /* { dg-require-weak "" } */
/* { dg-do compile } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
Index: gcc.dg/weak/weak-4.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-4.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-4.c
*** gcc.dg/weak/weak-4.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-4.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
--- 1,7 ----
/* { dg-do compile } */
+ /* { dg-require-weak "" } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1c" } } */
Index: gcc.dg/weak/weak-5.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-5.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-5.c
*** gcc.dg/weak/weak-5.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-5.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
--- 1,7 ----
/* { dg-do compile } */
+ /* { dg-require-weak "" } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1c" } } */
Index: gcc.dg/weak/weak-6.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-6.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-6.c
*** gcc.dg/weak/weak-6.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-6.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
--- 1,7 ----
/* { dg-do compile } */
+ /* { dg-require-weak "" } */
extern void * foo (void);
void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */
#pragma weak foo
Index: gcc.dg/weak/weak-7.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-7.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-7.c
*** gcc.dg/weak/weak-7.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-7.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
--- 1,7 ----
/* { dg-do compile } */
+ /* { dg-require-weak "" } */
extern void * foo (void);
void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */
extern void * foo (void) __attribute__((weak));
Index: gcc.dg/weak/weak-8.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-8.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-8.c
*** gcc.dg/weak/weak-8.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-8.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
--- 1,7 ----
/* { dg-do assemble } */
+ /* { dg-require-weak "" } */
__attribute__ ((weak)) int i;
int f() {
return i;
Index: gcc.dg/weak/weak-9.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak-9.c,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak-9.c
*** gcc.dg/weak/weak-9.c 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak-9.c 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
--- 1,7 ----
/* { dg-do compile } */
+ /* { dg-require-weak "" } */
/* { dg-options "-fno-common" } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f1" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f2" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f3" } } */
Index: gcc.dg/weak/weak.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/weak/weak.exp,v
retrieving revision 1.1
diff -c -5 -p -r1.1 weak.exp
*** gcc.dg/weak/weak.exp 6 Sep 2002 13:00:39 -0000 1.1
--- gcc.dg/weak/weak.exp 6 Jun 2003 21:00:04 -0000
***************
*** 1,6 ****
! # 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.
--- 1,6 ----
! # Copyright (C) 1997, 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
*************** load_lib gcc-dg.exp
*** 23,41 ****
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"
! }
--- 23,31 ----
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
set DEFAULT_CFLAGS " -ansi -pedantic-errors"
}
! dg-init
! dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
! "" $DEFAULT_CFLAGS
! dg-finish