diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c4011100dacf1faa93b86c36f54dcc94b499cc31..7771c26a1d51c0c7d3895929110032d729ce998b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2002-12-24 Joseph S. Myers <jsm@polyomino.org.uk> + + * g++.dg/init/new1.C, g++.dg/template/alignof1.C, + gcc.c-torture/compile/20021015-1.c, + gcc.c-torture/compile/20021015-2.c, + gcc.c-torture/compile/20021123-1.c, + gcc.c-torture/compile/20021123-2.c, + gcc.c-torture/compile/20021123-3.c, + gcc.c-torture/compile/20021123-4.c, + gcc.c-torture/execute/20021024-1.c: Add tests previously added + only to 3.1 or 3.2 branch. + 2002-12-23 Mark Mitchell <mark@codesourcery.com> * testsuite/gcc.dg/i386-bitfield3.c: New test. diff --git a/gcc/testsuite/g++.dg/init/new1.C b/gcc/testsuite/g++.dg/init/new1.C new file mode 100644 index 0000000000000000000000000000000000000000..24b60d3c409971c0ce82a2d2feceb37db18748ac --- /dev/null +++ b/gcc/testsuite/g++.dg/init/new1.C @@ -0,0 +1,20 @@ +// Origin: asharji@uwaterloo.ca + +// { dg-do compile } +// { dg-options "-fvolatile" } + +typedef __SIZE_TYPE__ size_t; + +class bar { + int i; + public : + void * operator new ( size_t , void * storage ); +}; + +class foo { + int storage[ 5 ]; + public: + void mem ( ) { + bar *s = new ( ( void * ) & storage ) bar; + } +}; diff --git a/gcc/testsuite/g++.dg/template/alignof1.C b/gcc/testsuite/g++.dg/template/alignof1.C new file mode 100644 index 0000000000000000000000000000000000000000..50a32183cfc74a702b71c127927c0767ffddef0b --- /dev/null +++ b/gcc/testsuite/g++.dg/template/alignof1.C @@ -0,0 +1,13 @@ +template<typename T> +int my_alignof() +{ + return __alignof__(T); +} + +template<typename> +struct X { }; + +int main() +{ + return my_alignof<X<void> >(); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021015-1.c b/gcc/testsuite/gcc.c-torture/compile/20021015-1.c new file mode 100644 index 0000000000000000000000000000000000000000..789b8a8b176fa929c8c5ae42193c23e981568fd0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20021015-1.c @@ -0,0 +1,12 @@ +/* PR target/7370. */ + +int g (int *x, int *y); + +void f () +{ + int x, y; + char a[4000]; + + g (&x, &y); + x = x/y + x; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021015-2.c b/gcc/testsuite/gcc.c-torture/compile/20021015-2.c new file mode 100644 index 0000000000000000000000000000000000000000..6b158c5bdc8b1d10ed3958f216a0837b287ca931 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20021015-2.c @@ -0,0 +1,7 @@ +/* PR target/8232. */ + +int f (char *p, char *q, int i) +{ + return bcmp (p, q, i); +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-1.c b/gcc/testsuite/gcc.c-torture/compile/20021123-1.c new file mode 100644 index 0000000000000000000000000000000000000000..dd2aa7e09dd141c364b76462a32e483efb5f022d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20021123-1.c @@ -0,0 +1,10 @@ +/* PR c/8439 */ +/* Verify that GCC properly handles null increments. */ + +struct empty { +}; + +void foo(struct empty *p) +{ + p++; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-2.c b/gcc/testsuite/gcc.c-torture/compile/20021123-2.c new file mode 100644 index 0000000000000000000000000000000000000000..423f8ec1964b3a4fc0723bac61256f6d8dfad47f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20021123-2.c @@ -0,0 +1,9 @@ +/* PR c/8518 */ +/* Contributed by Volker Reichelt. */ + +/* Verify that GCC doesn't get confused by the + redefinition of an extern inline function. */ + +extern int inline foo () { return 0; } +extern int inline bar () { return 0; } +static int inline bar () { return foo(); } diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-3.c b/gcc/testsuite/gcc.c-torture/compile/20021123-3.c new file mode 100644 index 0000000000000000000000000000000000000000..51f0e257dfdd1971fd3e2d7517eaa3b50a1a2122 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20021123-3.c @@ -0,0 +1,9 @@ +/* PR c/8518 */ +/* Contributed by Volker Reichelt. */ + +/* Verify that GCC doesn't get confused by the + redefinition of an extern inline function. */ + +extern int inline foo () { return 0; } +extern int inline bar () { return 0; } +static int bar () { return foo(); } diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-4.c b/gcc/testsuite/gcc.c-torture/compile/20021123-4.c new file mode 100644 index 0000000000000000000000000000000000000000..d4306b89b999f485385c2099818f8fc64a81bca5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20021123-4.c @@ -0,0 +1,11 @@ +/* PR c/8588 */ +/* Contributed by Volker Reichelt. */ + +/* Verify that GCC converts integer constants + in shift operations. */ + +void foo() +{ + unsigned int i, j; + j = (i >> 0xf0); +} diff --git a/gcc/testsuite/gcc.c-torture/execute/20021024-1.c b/gcc/testsuite/gcc.c-torture/execute/20021024-1.c new file mode 100644 index 0000000000000000000000000000000000000000..f7d98e929a26fbdd1b819caa1c287193379355bf --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20021024-1.c @@ -0,0 +1,43 @@ +/* Origin: PR target/6981 from Mattias Engdegaard <mattias@virtutech.se>. */ + +void exit (int); +void abort (void); + +unsigned long long *cp, m; + +void foo (void) +{ +} + +void bar (unsigned rop, unsigned long long *r) +{ + unsigned rs1, rs2, rd; + +top: + rs2 = (rop >> 23) & 0x1ff; + rs1 = (rop >> 9) & 0x1ff; + rd = rop & 0x1ff; + + *cp = 1; + m = r[rs1] + r[rs2]; + *cp = 2; + foo(); + if (!rd) + goto top; + r[rd] = 1; +} + +int main(void) +{ + static unsigned long long r[64]; + unsigned long long cr; + cp = &cr; + + r[4] = 47; + r[8] = 11; + bar((8 << 23) | (4 << 9) | 15, r); + + if (m != 47 + 11) + abort (); + exit (0); +}