New tests.

From-SVN: r37187
This commit is contained in:
Richard Henderson 2000-11-01 02:31:02 -08:00 committed by Richard Henderson
parent f0de0c5d17
commit 6a16a7f0c8
4 changed files with 68 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2000-11-01 Richard Henderson <rth@redhat.com>
* g++.old-deja/g++.ext/namedret1.C: New.
* g++.old-deja/g++.ext/namedret2.C: New.
* g++.old-deja/g++.ext/namedret3.C: New.
2000-10-31 Geoffrey Keating <geoffk@cygnus.com>
* gcc.c-torture/compile/920501-7.c: Remove 'CYGNUS LOCAL' markers.

View file

@ -0,0 +1,12 @@
// Special g++ Options: -Wno-deprecated
int f(int x) return y(x) { }
extern "C" void abort ();
int main()
{
if (f(1) != 1 || f(2) != 2 || f(3) != 3)
abort ();
return 0;
}

View file

@ -0,0 +1,20 @@
// Skip if not target: alpha*-*-*
// Special g++ Options: -Wno-deprecated
// This test verifies that return type promotion is working correctly.
// The Alpha ABI specifies that 32-bit return values have bit 31 propagated,
// i.e. the value is sign-extended even if the unpromoted type is unsigned.
unsigned int f(unsigned int x) return y(x) { }
extern "C" void abort ();
int main()
{
typedef long (*long_func)(long);
long_func g = reinterpret_cast<long_func>(f);
if (g(-1L) != -1L)
abort ();
return 0;
}

View file

@ -0,0 +1,30 @@
// Special g++ Options: -Wno-deprecated
extern "C" void abort();
int f2(int *x)
{
*x = 1;
return 2;
}
int f1() return x
{
f2(&x);
}
void g()
{
int scratch[100];
int i;
for (i = 0; i < 100; ++i)
scratch[i] = 0;
}
int main()
{
g();
if (f1() != 1)
abort ();
return 0;
}