This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Remove special "ecos.exp" driver


With my recent enhancements to g++-dg.exp, there's no longer any
reason to have a special test driver for g++.dg/special; this patch
converts those tests to use the g++-dg driver.

Tested by running the tests on i686-pc-linux-gnu, applied on the
mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

Index: gcc/testsuite/g++.dg/special/conpr-2.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/special/conpr-2.C,v
retrieving revision 1.4
diff -c -5 -p -r1.4 conpr-2.C
*** gcc/testsuite/g++.dg/special/conpr-2.C	9 Dec 2002 00:47:29 -0000	1.4
--- gcc/testsuite/g++.dg/special/conpr-2.C	12 May 2003 04:54:28 -0000
***************
*** 1,7 ****
--- 1,8 ----
  /* This doesn't work on solaris2 for reasons described in PR 6482.  */
  /* { dg-do run { xfail *-*-solaris2* } } */
+ /* { dg-gpp-additional-sources "conpr-2a.cc" } */
  
  #include <stdlib.h>
  
  class foo_t {
      int x;
Index: gcc/testsuite/g++.dg/special/conpr-2a.C
===================================================================
RCS file: gcc/testsuite/g++.dg/special/conpr-2a.C
diff -N gcc/testsuite/g++.dg/special/conpr-2a.C
*** gcc/testsuite/g++.dg/special/conpr-2a.C	4 Sep 1999 15:09:01 -0000	1.2
--- /dev/null	1 Jan 1970 00:00:00 -0000
***************
*** 1,12 ****
- /* { dg-do run } */
- 
- class foo_t {
-     int x;
-     static int count;
- public:
-     foo_t(void) { x=++count; }
-     int get(void) { return x; }
- };
- 
- foo_t foo1 __attribute__((init_priority(6000)));
- foo_t foo2 __attribute__((init_priority(5000)));
--- 0 ----
Index: gcc/testsuite/g++.dg/special/conpr-2a.cc
===================================================================
RCS file: gcc/testsuite/g++.dg/special/conpr-2a.cc
diff -N gcc/testsuite/g++.dg/special/conpr-2a.cc
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/g++.dg/special/conpr-2a.cc	12 May 2003 04:54:28 -0000
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-do run } */
+ 
+ class foo_t {
+     int x;
+     static int count;
+ public:
+     foo_t(void) { x=++count; }
+     int get(void) { return x; }
+ };
+ 
+ foo_t foo1 __attribute__((init_priority(6000)));
+ foo_t foo2 __attribute__((init_priority(5000)));
Index: gcc/testsuite/g++.dg/special/conpr-3.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/special/conpr-3.C,v
retrieving revision 1.3
diff -c -5 -p -r1.3 conpr-3.C
*** gcc/testsuite/g++.dg/special/conpr-3.C	28 May 2000 05:38:01 -0000	1.3
--- gcc/testsuite/g++.dg/special/conpr-3.C	12 May 2003 04:54:28 -0000
***************
*** 1,6 ****
--- 1,7 ----
  /* { dg-do run } */
+ /* { dg-gpp-additional-sources "conpr-3a.cc conpr-3b.cc" } */
  
  #include <stdlib.h>
  
  class foo_t {
      int x;
Index: gcc/testsuite/g++.dg/special/conpr-3a.C
===================================================================
RCS file: gcc/testsuite/g++.dg/special/conpr-3a.C
diff -N gcc/testsuite/g++.dg/special/conpr-3a.C
*** gcc/testsuite/g++.dg/special/conpr-3a.C	4 Sep 1999 15:09:01 -0000	1.2
--- /dev/null	1 Jan 1970 00:00:00 -0000
***************
*** 1,11 ****
- /* { dg-do run } */
- 
- class foo_t {
-     int x;
-     static int count;
- public:
-     foo_t(void) { x=++count; }
-     int get(void) { return x; }
- };
- 
- foo_t foo1 __attribute__((init_priority(6000)));
--- 0 ----
Index: gcc/testsuite/g++.dg/special/conpr-3a.cc
===================================================================
RCS file: gcc/testsuite/g++.dg/special/conpr-3a.cc
diff -N gcc/testsuite/g++.dg/special/conpr-3a.cc
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/g++.dg/special/conpr-3a.cc	12 May 2003 04:54:28 -0000
***************
*** 0 ****
--- 1,11 ----
+ /* { dg-do run } */
+ 
+ class foo_t {
+     int x;
+     static int count;
+ public:
+     foo_t(void) { x=++count; }
+     int get(void) { return x; }
+ };
+ 
+ foo_t foo1 __attribute__((init_priority(6000)));
Index: gcc/testsuite/g++.dg/special/conpr-3b.C
===================================================================
RCS file: gcc/testsuite/g++.dg/special/conpr-3b.C
diff -N gcc/testsuite/g++.dg/special/conpr-3b.C
*** gcc/testsuite/g++.dg/special/conpr-3b.C	4 Sep 1999 15:09:01 -0000	1.2
--- /dev/null	1 Jan 1970 00:00:00 -0000
***************
*** 1,11 ****
- /* { dg-do run } */
- 
- class foo_t {
-     int x;
-     static int count;
- public:
-     foo_t(void) { x=++count; }
-     int get(void) { return x; }
- };
- 
- foo_t foo2 __attribute__((init_priority(5000)));
--- 0 ----
Index: gcc/testsuite/g++.dg/special/conpr-3b.cc
===================================================================
RCS file: gcc/testsuite/g++.dg/special/conpr-3b.cc
diff -N gcc/testsuite/g++.dg/special/conpr-3b.cc
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/g++.dg/special/conpr-3b.cc	12 May 2003 04:54:28 -0000
***************
*** 0 ****
--- 1,11 ----
+ /* { dg-do run } */
+ 
+ class foo_t {
+     int x;
+     static int count;
+ public:
+     foo_t(void) { x=++count; }
+     int get(void) { return x; }
+ };
+ 
+ foo_t foo2 __attribute__((init_priority(5000)));
Index: gcc/testsuite/g++.dg/special/conpr-4.C
===================================================================
RCS file: gcc/testsuite/g++.dg/special/conpr-4.C
diff -N gcc/testsuite/g++.dg/special/conpr-4.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc/testsuite/g++.dg/special/conpr-4.C	12 May 2003 04:54:28 -0000
***************
*** 0 ****
--- 1,23 ----
+ /* { dg-do run } */
+ /* { dg-gpp-additional-sources "conpr-3b.cc conpr-3a.cc" } */
+ 
+ #include <stdlib.h>
+ 
+ class foo_t {
+     int x;
+     static int count;
+ public:
+     foo_t(void) { x=++count; }
+     int get(void) { return x; }
+ };
+ 
+ int foo_t::count;
+ 
+ extern foo_t foo1, foo2;
+ 
+ int main(void) {
+ 
+     if ( (foo1.get() != 2) || (foo2.get() != 1) )
+         abort();
+     exit(0);
+ }
Index: gcc/testsuite/g++.dg/special/ecos.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/special/ecos.exp,v
retrieving revision 1.9
diff -c -5 -p -r1.9 ecos.exp
*** gcc/testsuite/g++.dg/special/ecos.exp	9 Dec 2002 00:47:29 -0000	1.9
--- gcc/testsuite/g++.dg/special/ecos.exp	12 May 2003 04:54:28 -0000
***************
*** 1,6 ****
! # Copyright (C) 1999, 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.
--- 1,6 ----
! # 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
  # the Free Software Foundation; either version 2 of the License, or
  # (at your option) any later version.
***************
*** 22,108 ****
  # G++ testsuite that uses the `dg.exp' driver.
  
  # Load support procs.
  load_lib g++-dg.exp
  
! ###########
! # conpr-1.C
! ###########
  
! dg-init
! set lines [g++_target_compile "$srcdir/$subdir/conpr-1.C" "$objdir/conpr-1.exe" executable ""]
! if [string match "*init_priority*" $lines] then {
!     xfail "conpr-1.C"
!     file delete $objdir/conpr-1.exe
! } elseif ![string match "" $lines] then {
!     fail "conpr-1.C"
! } else {
!     dg-runtest "$srcdir/$subdir/conpr-1.C" "" "" 
!     file delete $objdir/conpr-1.exe
  }
- dg-finish
- 
- 
- ###########
- # conpr-2.C
- ###########
  
  dg-init
  
! set lines [g++_target_compile "$srcdir/$subdir/conpr-2a.C" "conpr-2a.o" object ""]
! if [string match "*init_priority*" $lines] then {
!     xfail "conpr-2a.o"
! } elseif ![string match "" $lines] then {
!     fail "conpr-2a.o"
! } else {
!     dg-runtest "$srcdir/$subdir/conpr-2.C" "conpr-2a.o" "" 
!     file delete conpr-2a.o
! }
! dg-finish
! 
  
! ###########
! # conpr-3.C
! ###########
! 
! dg-init
! 
! set lines [g++_target_compile "$srcdir/$subdir/conpr-3a.C" "conpr-3a.o" object ""]
! if [string match "*init_priority*" $lines] then {
!     xfail "conpr-3a.o"
! } elseif ![string match "" $lines] then {
!     fail "conpr-3a.o"
! } else {
!     set lines [g++_target_compile "$srcdir/$subdir/conpr-3b.C" "conpr-3b.o" object ""]
!     if ![string match "" $lines] then {
!         fail "conpr-3b.o"
!     } else {
!         # run it with objects both ways around!
!         # This doesn't work on solaris2 for reasons described in PR 6482.
!         if  { ![regexp ".*-solaris2.*" $target_triplet] } {
!             dg-runtest "$srcdir/$subdir/conpr-3.C" "conpr-3a.o conpr-3b.o" ""
!             dg-runtest "$srcdir/$subdir/conpr-3.C" "conpr-3b.o conpr-3a.o" ""
!         }
!         file delete conpr-3a.o conpr-3b.o
!     }
! }
! dg-finish
! 
! ###########
! # initp1.C
! ###########
! 
! dg-init
! set lines [g++_target_compile "$srcdir/$subdir/initp1.C" "$objdir/initp1.exe" executable ""]
! if [string match "*init_priority*" $lines] then {
!     xfail "initp1.C"
!     file delete $objdir/initp1.exe
! } elseif ![string match "" $lines] then {
!     fail "initp1.C"
! } else {
!     dg-runtest "$srcdir/$subdir/initp1.C" "" ""
!     file delete $objdir/initp1.exe
! }
  dg-finish
  
- 
- ### EOF ecos.exp
--- 22,44 ----
  # G++ testsuite that uses the `dg.exp' driver.
  
  # Load support procs.
  load_lib g++-dg.exp
  
! # Test for whether or not __attribute__((init_priority)) is supported
! # by the platform.
  
! set comp_output [g++_target_compile \
! 		"$srcdir/$subdir/initp1.C" "initp1.S" assembly ""]
! if { [string match "*init_priority*" $comp_output] } {
!   return 0
  }
  
+ # Initialize 'dg'.
  dg-init
  
! # Main loop.
! dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] "" ""
  
! # All done.
  dg-finish
  
Index: gcc/testsuite/lib/g++.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/g++.exp,v
retrieving revision 1.29
diff -c -5 -p -r1.29 g++.exp
*** gcc/testsuite/lib/g++.exp	1 May 2003 02:02:32 -0000	1.29
--- gcc/testsuite/lib/g++.exp	12 May 2003 04:54:32 -0000
*************** proc g++_target_compile { source dest ty
*** 311,321 ****
      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]
      }
--- 311,321 ----
      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]
      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]