Commit d2b51b10 by Zack Weinberg Committed by Zack Weinberg

Relative to g++.dg/special:

	* conpr-1.C, conpr-2.C, conpr-3.C: Include stdlib.h.

	Relative to g++.old-deja:
	* g++.brendan/complex1.C, g++.jason/optimize2.C,
	g++.mike/p9732b.C, g++.other/addrof1.C, g++.other/dyncast5.C,
	g++.other/init5.C, g++.other/init7.C, g++.other/union2.C,
	g++.pt/vbase1.C, g++.robertl/eb14.C, g++.robertl/eh990323-1.C,
	g++.robertl/eh990323-2.C, g++.robertl/eh990323-3.C,
	g++.robertl/eh990323-4.C, g++.robertl/eh990323-5.C,
	g++.robertl/ice990323-2.C: Prototype exit and/or abort.

	* g++.brendan/nest21.C, g++.eh/rethrow3.C, g++.jason/init3.C,
	g++.law/arm15.C, g++.law/cvt2.C, g++.law/visibility17.C,
	g++.mike/eh23.C, g++.mike/eh25.C, g++.mike/eh34.C,
	g++.mike/eh48.C, g++.mike/eh55.C, g++.mike/p2736.C,
	g++.oliva/new1.C, g++.other/align.C, g++.robertl/eb39.C,
	g++.robertl/eb54.C, g++.robertl/eb63.C: Include stdlib.h
	and/or string.h.

	* g++.other/goto1.C: Update expectations for error messages.

From-SVN: r34226
parent e087aeb2
2000-05-27 Zack Weinberg <zack@wolery.cumb.org>
Relative to g++.dg/special:
* conpr-1.C, conpr-2.C, conpr-3.C: Include stdlib.h.
Relative to g++.old-deja:
* g++.brendan/complex1.C, g++.jason/optimize2.C,
g++.mike/p9732b.C, g++.other/addrof1.C, g++.other/dyncast5.C,
g++.other/init5.C, g++.other/init7.C, g++.other/union2.C,
g++.pt/vbase1.C, g++.robertl/eb14.C, g++.robertl/eh990323-1.C,
g++.robertl/eh990323-2.C, g++.robertl/eh990323-3.C,
g++.robertl/eh990323-4.C, g++.robertl/eh990323-5.C,
g++.robertl/ice990323-2.C: Prototype exit and/or abort.
* g++.brendan/nest21.C, g++.eh/rethrow3.C, g++.jason/init3.C,
g++.law/arm15.C, g++.law/cvt2.C, g++.law/visibility17.C,
g++.mike/eh23.C, g++.mike/eh25.C, g++.mike/eh34.C,
g++.mike/eh48.C, g++.mike/eh55.C, g++.mike/p2736.C,
g++.oliva/new1.C, g++.other/align.C, g++.robertl/eb39.C,
g++.robertl/eb54.C, g++.robertl/eb63.C: Include stdlib.h
and/or string.h.
* g++.other/goto1.C: Update expectations for error messages.
2000-05-25 Alexandre Oliva <aoliva@cygnus.com> 2000-05-25 Alexandre Oliva <aoliva@cygnus.com>
* gcc.c-torture/compile/20000523-1.c: New test. * gcc.c-torture/compile/20000523-1.c: New test.
......
/* { dg-do run } */ /* { dg-do run } */
#include <stdlib.h>
class foo_t { class foo_t {
int x; int x;
public: public:
......
/* { dg-do run } */ /* { dg-do run } */
#include <stdlib.h>
class foo_t { class foo_t {
int x; int x;
static int count; static int count;
......
/* { dg-do run } */ /* { dg-do run } */
#include <stdlib.h>
class foo_t { class foo_t {
int x; int x;
static int count; static int count;
......
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
// a bug where the compiler was not converting the integer `90' to a // a bug where the compiler was not converting the integer `90' to a
// complex number, unless you did `90.0'. Fixed 10/1/1997. // complex number, unless you did `90.0'. Fixed 10/1/1997.
extern "C" int printf (const char *, ...); extern "C" {
int printf (const char *, ...);
void exit (int);
};
__complex__ double cd; __complex__ double cd;
......
// GROUPS passed nested-classes // GROUPS passed nested-classes
#include <iostream.h> #include <iostream.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
static char output[1024]; static char output[1024];
......
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <exception> #include <exception>
static void static void
......
// PRMS Id: 5652 // PRMS Id: 5652
// Bug: strings does not get initialized. // Bug: strings does not get initialized.
extern "C" void * memcpy (void *, const void *, __SIZE_TYPE__); #include <string.h>
extern "C" int strcmp (const char *, const char *);
class My_string { class My_string {
char *str; char *str;
......
// Used to crash on the alpha with optimization. // Used to crash on the alpha with optimization.
// Special g++ Options: -w // Special g++ Options: -w
extern "C" void abort (void);
struct Fix { struct Fix {
unsigned short l; unsigned short l;
}; };
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// Message-ID: <9310211510.AA14943@holden.lulea.trab.se> // Message-ID: <9310211510.AA14943@holden.lulea.trab.se>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
int state = 0; int state = 0;
......
// GROUPS passed conversions // GROUPS passed conversions
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <iostream.h> #include <iostream.h>
#include <fstream.h> #include <fstream.h>
extern "C" {
int strncmp (const char *, const char *, size_t);
}
class cvec { class cvec {
public: public:
~cvec(){ delete s; } ~cvec(){ delete s; }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// Subject: Access to private constructor. // Subject: Access to private constructor.
// Message-ID: <9308060023.AA10283@neptune.caere.com> // Message-ID: <9308060023.AA10283@neptune.caere.com>
#include <iostream.h> #include <iostream.h>
#include <string.h>
class Base class Base
{ {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* // excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception> #include <exception>
#include <stdlib.h>
struct double_fault { }; struct double_fault { };
int fault_now; int fault_now;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* // excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception> #include <exception>
#include <stdlib.h>
void my_terminate() { void my_terminate() {
exit (0); // Double faults should call terminate exit (0); // Double faults should call terminate
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* // excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception> #include <exception>
#include <stdlib.h>
void my_unexpected() { void my_unexpected() {
exit (0); exit (0);
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* // excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception> #include <exception>
#include <stdlib.h>
using std::uncaught_exception; using std::uncaught_exception;
class A { class A {
public: public:
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-* // excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception> #include <exception>
#include <stdlib.h>
void my_terminate_handler() { void my_terminate_handler() {
exit(0); exit(0);
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// statics are destroyed at the right time. See PR 2736 for details. // statics are destroyed at the right time. See PR 2736 for details.
// prms-id: 2736 // prms-id: 2736
#include <stdlib.h>
int count; int count;
struct A { struct A {
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
int count; int count;
int bail = 0; int bail = 0;
extern "C" void abort (void);
extern "C" void _exit (int); extern "C" void _exit (int);
struct base { struct base {
base () { ++count; } base () { ++count; }
~base () { --count; } ~base () { --count; }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// execution test // execution test
#include <new> #include <new>
#include <stdlib.h>
struct A { struct A {
A() { throw 0; } A() { throw 0; }
......
extern "C" void abort ();
typedef struct st { typedef struct st {
unsigned char a; unsigned char a;
unsigned char b; unsigned char b;
......
// Build don't link: // Build don't link:
#include <string.h>
class bar { class bar {
public: public:
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
// dynamic cast can only cast to public unambiguous bases // dynamic cast can only cast to public unambiguous bases
extern "C" void abort ();
struct A {virtual ~A(){} int m; }; struct A {virtual ~A(){} int m; };
struct B {virtual ~B(){} int m; }; struct B {virtual ~B(){} int m; };
......
...@@ -10,12 +10,12 @@ struct S ...@@ -10,12 +10,12 @@ struct S
void f () void f ()
{ {
{ {
S s1; S s1; // ERROR - skips initialization
t: t: // ERROR - jump to label
S s2; S s2;
; ;
} }
goto t; // ERROR - jump avoids initialization of `s1' goto t; // ERROR - from here
} }
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Original test attributed to James Kanze <jkanze@otelo.ibmmail.com> // Original test attributed to James Kanze <jkanze@otelo.ibmmail.com>
// execution test - XFAIL *-*-* // execution test - XFAIL *-*-*
extern "C" void abort ();
static int cnt; static int cnt;
class A { class A {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// The initialization of a static local variable must be retried if a // The initialization of a static local variable must be retried if a
// previous try finished by throwing an exception [stmt.dcl]/4 // previous try finished by throwing an exception [stmt.dcl]/4
extern "C" void abort ();
struct foo { struct foo {
foo() { throw true; } foo() { throw true; }
}; };
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Bug: gcc and g++ didn't zero unions with empty initializers. // Bug: gcc and g++ didn't zero unions with empty initializers.
// Submitted by J"orn Rennecke <amylaar@cygnus.co.uk> // Submitted by J"orn Rennecke <amylaar@cygnus.co.uk>
extern "C" void exit (int);
typedef union u typedef union u
{ {
union u *up; union u *up;
......
// Check that template classes handle inherited virtual bases // Check that template classes handle inherited virtual bases
// properly, initializing them before direct non-virtual bases. // properly, initializing them before direct non-virtual bases.
extern "C" void exit (int);
int aflag; int aflag;
struct A struct A
......
extern "C" void abort ();
template<int N> template<int N>
struct I { struct I {
}; };
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
// #include <streambuf.h> // #include <streambuf.h>
#include <libio.h> #include <libio.h>
#include <strstream.h> #include <strstream.h>
#include <string.h>
extern bool foo2 (ostream &out, istream &in); extern bool foo2 (ostream &out, istream &in);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// friend function, the non-template function does // friend function, the non-template function does
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <iostream.h> #include <iostream.h>
template <class T> template <class T>
......
#include <iomanip.h> #include <iomanip.h>
#include <stdlib.h>
int main() int main()
{ {
......
//Special g++ Options: //Special g++ Options:
//This uses GNU extensions, so disable -ansi //This uses GNU extensions, so disable -ansi
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
class A { class A {
public: public:
......
// check cleanup of template temporaries // check cleanup of template temporaries
extern "C" void abort ();
extern "C" void exit (int);
int ctor = 0; int ctor = 0;
int dtor = 0; int dtor = 0;
......
// check MI and VBC offsets on throw // check MI and VBC offsets on throw
extern "C" void abort ();
extern "C" void exit (int);
struct A { struct A {
int x[23]; int x[23];
......
// try throwing 0 cast to a class object // try throwing 0 cast to a class object
extern "C" void abort ();
extern "C" void exit (int);
struct A {}; struct A {};
......
// check MI and VBC offsets on throw // check MI and VBC offsets on throw
extern "C" void abort ();
extern "C" void exit (int);
struct A { struct A {
int x[23]; int x[23];
......
// check cleanup of partial array objects // check cleanup of partial array objects
extern "C" void abort (void);
extern "C" void exit (int);
int ctor = 0; int ctor = 0;
int dtor = 0; int dtor = 0;
......
// check EH with templates // check EH with templates
extern "C" void abort ();
extern "C" void exit (int);
template <class T, int n, class U> struct A { template <class T, int n, class U> struct A {
A() {} A() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment