Commit 40aa9d95 by Joseph Myers Committed by Joseph Myers

new1.C, [...]: Add tests previously added only to 3.1 or 3.2 branch.

	* 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.

From-SVN: r60479
parent 4fbf9d4a
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> 2002-12-23 Mark Mitchell <mark@codesourcery.com>
* testsuite/gcc.dg/i386-bitfield3.c: New test. * testsuite/gcc.dg/i386-bitfield3.c: New test.
......
// 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;
}
};
template<typename T>
int my_alignof()
{
return __alignof__(T);
}
template<typename>
struct X { };
int main()
{
return my_alignof<X<void> >();
}
/* PR target/7370. */
int g (int *x, int *y);
void f ()
{
int x, y;
char a[4000];
g (&x, &y);
x = x/y + x;
}
/* PR target/8232. */
int f (char *p, char *q, int i)
{
return bcmp (p, q, i);
}
/* PR c/8439 */
/* Verify that GCC properly handles null increments. */
struct empty {
};
void foo(struct empty *p)
{
p++;
}
/* 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(); }
/* 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(); }
/* 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);
}
/* 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);
}
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