Browse Source
(CXX): Move definition, change from g++ to gcc. (EXPECT, RUNTEST): Copy definitions from top level Makefile.in. (RUNTEST_CC, RUNTEST_CFLAGS): Remove. (RUNTEST_CXX, RUNTEST_CXXFLAGS): Remove. (CC_FOR_TARGET, CXX_FOR_TARGET): Copy from top level Makefile.in. (.cc.o): Comment out. (testdir): Remove. (site.exp): Don't create testdir or set tmpdir. (check): Run checks even if not running native. Use CC_FOR_TARGET instead of RUNTEST_CC, and likewise for CXX. (cdtest targets): Comment out. * config/solaris2.mh (HOSTING_LIBS): Only mention crtend.o once. * cdtest-bar.cc, cdtest-foo.cc, cdtest-foo.h: Remove. * cdtest-main.cc, cdtest.exp: Remove.gdb-4_18-branch
8 changed files with 29 additions and 191 deletions
@ -1,17 +0,0 @@ |
|||
// test program for Class Foo
|
|||
|
|||
#include "cdtest-foo.h" |
|||
|
|||
static Foo static_foo( "static_foo"); |
|||
|
|||
Foo f() |
|||
{ |
|||
Foo x; |
|||
return x; |
|||
} |
|||
|
|||
void g() |
|||
{ |
|||
Foo other_foo1 = Foo( "other_foo1"), other_foo2 = Foo( "other_foo2"); |
|||
other_foo2 = other_foo1; |
|||
} |
|||
@ -1,89 +0,0 @@ |
|||
// Class Foo
|
|||
#pragma implementation |
|||
|
|||
|
|||
// We don't use header files, since we only want to see, whether the
|
|||
// compiler is installed properly.
|
|||
//
|
|||
#if (__GNUG__ == 2) |
|||
typedef __SIZE_TYPE__ size_t; |
|||
#else |
|||
typedef unsigned int size_t; |
|||
#endif |
|||
|
|||
extern "C" { |
|||
char *strncpy (char* dest, const char* dest, size_t len); |
|||
int printf (const char*, ...); |
|||
}; |
|||
|
|||
#include "cdtest-foo.h" |
|||
|
|||
int Foo::foos = 0; |
|||
|
|||
void Foo::init_foo () |
|||
{ |
|||
printf ("BROKENLY calling Foo::init_foo from __init_start; size_of(Foo) = %d\n", sizeof(Foo)); |
|||
foos = FOOLISH_NUMBER; |
|||
} |
|||
|
|||
|
|||
Foo::Foo () |
|||
{ |
|||
i = ++foos; |
|||
strncpy (message, "default-foo", len); |
|||
#ifdef WITH_ADDR |
|||
printf ("Constructing Foo(%d) \"default-foo\" at %08x\n", i, this); |
|||
#else |
|||
printf ("Constructing Foo(%d) \"default-foo\"\n", i); |
|||
#endif |
|||
} |
|||
|
|||
Foo::Foo (char* msg) |
|||
{ |
|||
i = ++foos; |
|||
strncpy( message, msg, len); |
|||
#ifdef WITH_ADDR |
|||
printf ( "Constructing Foo(%d) \"%s\" at %08x\n", i, message, this); |
|||
#else |
|||
printf ( "Constructing Foo(%d) \"%s\"\n", i, message); |
|||
#endif |
|||
} |
|||
|
|||
|
|||
Foo::Foo (const Foo& foo) |
|||
{ |
|||
i = ++foos; |
|||
#ifdef WITH_ADDR |
|||
printf ("Initializing Foo(%d) \"%s\" at %08x with Foo(%d) %08x\n", |
|||
i, foo.message, this, foo.i, &foo); |
|||
#else |
|||
printf ("Initializing Foo(%d) \"%s\" with Foo(%d)\n",i, foo.message, foo.i); |
|||
#endif |
|||
for ( int k = 0; k < FOO_MSG_LEN; k++) message[k] = foo.message[k]; |
|||
} |
|||
|
|||
|
|||
Foo& Foo::operator= (const Foo& foo) |
|||
{ |
|||
#ifdef WITH_ADDR |
|||
printf ("Copying Foo(%d) \"%s\" at %08x to Foo(%d) %08x\n", |
|||
foo.i, foo.message, &foo, i, this); |
|||
#else |
|||
printf ("Copying Foo(%d) \"%s\" to Foo(%d)\n", foo.i, foo.message, i); |
|||
#endif |
|||
for ( int k = 0; k < FOO_MSG_LEN; k++) message[k] = foo.message[k]; |
|||
return *this; |
|||
} |
|||
|
|||
|
|||
Foo::~Foo () |
|||
{ |
|||
foos--; |
|||
#ifdef WITH_ADDR |
|||
printf ("Destructing Foo(%d) \"%s\" at %08x (remaining foos: %d)\n", |
|||
i, message, this, foos); |
|||
#else |
|||
printf ("Destructing Foo(%d) \"%s\" (remaining foos: %d)\n", |
|||
i, message, foos); |
|||
#endif |
|||
} |
|||
@ -1,24 +0,0 @@ |
|||
// Class Foo
|
|||
|
|||
#pragma interface |
|||
|
|||
#define FOOLISH_NUMBER -4711 |
|||
|
|||
#ifndef FOO_MSG_LEN |
|||
#define FOO_MSG_LEN 80 |
|||
#endif |
|||
|
|||
class Foo { |
|||
static int foos; |
|||
int i; |
|||
const len = FOO_MSG_LEN; |
|||
char message[len]; |
|||
public: |
|||
static void init_foo (); |
|||
static int nb_foos() { return foos; } |
|||
Foo(); |
|||
Foo( char* message); |
|||
Foo(const Foo&); |
|||
Foo & operator= (const Foo&); |
|||
~Foo (); |
|||
}; |
|||
@ -1,40 +0,0 @@ |
|||
// main program for Class Foo
|
|||
|
|||
extern "C" { |
|||
// Some <assert.h> implementations (e.g. SUNOS 4.1) are broken,
|
|||
// in that they require <stdio.h>. But, if gcc/g++ is installed
|
|||
// correctly, you should get gcc's assert.h.
|
|||
// If the compile fails, it means the wrong include files are in use!
|
|||
#include <assert.h> |
|||
}; |
|||
#include "cdtest-foo.h" |
|||
|
|||
extern "C" void __init_start(); |
|||
|
|||
extern Foo f(void); |
|||
extern void g(void); |
|||
|
|||
/* This function should *not* be called by the environment. There is
|
|||
no way in C++ to ``run something after the initializers but before main()''. |
|||
The library that depends on this (NIHCL) is broken. -- John Gilmore |
|||
We leave this here to test that future changes to the compiler |
|||
do not re-introduce this losing ``feature''. */ |
|||
void |
|||
__init_start() |
|||
{ |
|||
Foo::init_foo(); |
|||
} |
|||
|
|||
static Foo static_foo( "static_foo"); |
|||
|
|||
main() |
|||
{ |
|||
assert (Foo::nb_foos() == 2); |
|||
Foo automatic_foo( "automatic_foo"); |
|||
Foo bla_foo = f(); |
|||
assert (Foo::nb_foos() == 4); |
|||
g(); |
|||
assert (Foo::nb_foos() == 4); |
|||
// `automatic_foo' and `bla_foo' are destructed here
|
|||
} |
|||
|
|||
@ -1,15 +0,0 @@ |
|||
Constructing Foo(1) "static_foo" |
|||
Constructing Foo(2) "static_foo" |
|||
Constructing Foo(3) "automatic_foo" |
|||
Constructing Foo(4) "default-foo" |
|||
Initializing Foo(5) "default-foo" with Foo(4) |
|||
Destructing Foo(4) "default-foo" (remaining foos: 4) |
|||
Constructing Foo(5) "other_foo1" |
|||
Constructing Foo(6) "other_foo2" |
|||
Copying Foo(5) "other_foo1" to Foo(6) |
|||
Destructing Foo(6) "other_foo1" (remaining foos: 5) |
|||
Destructing Foo(5) "other_foo1" (remaining foos: 4) |
|||
Destructing Foo(5) "default-foo" (remaining foos: 3) |
|||
Destructing Foo(3) "automatic_foo" (remaining foos: 2) |
|||
Destructing Foo(2) "static_foo" (remaining foos: 1) |
|||
Destructing Foo(1) "static_foo" (remaining foos: 0) |
|||
@ -1,4 +1,4 @@ |
|||
# Hosting files for Solaris |
|||
HOSTING_CRT0=`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else gcc -print-libgcc-file-name | sed -e 's/libgcc.a/crt1.o/'; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else gcc -print-libgcc-file-name | sed -e 's/libgcc.a/crti.o/'; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-libgcc-file-name | sed -e 's/libgcc.a/crtbegin.o/'; fi` |
|||
HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-libgcc-file-name | sed -e 's/libgcc.a/crtend.o/'; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else gcc -print-libgcc-file-name | sed -e 's/libgcc.a/crtn.o/'; fi` |
|||
HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-libgcc-file-name | sed -e 's/libgcc.a/crtend.o/'; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else gcc -print-libgcc-file-name | sed -e 's/libgcc.a/crtn.o/'; fi` |
|||
NATIVE_LIB_DIRS=/usr/ccs/lib |
|||
|
|||
Loading…
Reference in new issue