Commit 15336b9e by David Daney Committed by David Daney

20010124-1.c: Removed and split into two new files which are ...

2005-09-09  David Daney <ddaney@avtrex.com>

	* gcc.c-torture/execute/20010124-1.c:  Removed and split into two new
	files which are ...
	* gcc.c-torture/execute/builtins/20010124-1: ... here and ...
	* gcc.c-torture/execute/builtins/20010124-1-lib.c: ... here.

From-SVN: r104116
parent a30efae8
2005-09-09 David Daney <ddaney@avtrex.com>
* gcc.c-torture/execute/20010124-1.c: Removed and split into two new
files which are ...
* gcc.c-torture/execute/builtins/20010124-1: ... here and ...
* gcc.c-torture/execute/builtins/20010124-1-lib.c: ... here.
2005-09-09 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* gfortran.dg/iostat_2.f90: New test.
......@@ -2,6 +2,7 @@
overlapping objects. */
extern void abort (void);
extern int inside_main;
typedef __SIZE_TYPE__ size_t;
struct S {
......@@ -18,33 +19,32 @@ union U {
int space;
} b;
};
static struct S f(struct S *);
static void g(union U *);
int main()
{
union U u;
u.b.s = f(&u.a.s);
u.a.s = f(&u.b.s);
g(&u);
return 0;
}
static struct S f(struct S *p)
struct S f(struct S *p)
{
return *p;
}
static void g(union U *p)
void g(union U *p)
{
}
static void *memcpy(void *a, const void *b, size_t len)
void *memcpy(void *a, const void *b, size_t len)
{
if (a < b && a+len > b)
abort ();
if (b < a && b+len > a)
abort ();
return a;
if (inside_main)
{
if (a < b && a+len > b)
abort ();
if (b < a && b+len > a)
abort ();
return a;
}
else
{
char *dst = (char *) a;
const char *src = (const char *) b;
while (len--)
*dst++ = *src++;
return a;
}
}
/* Verify that structure return doesn't invoke memcpy on
overlapping objects. */
extern void abort (void);
struct S {
char stuff[1024];
};
union U {
struct {
int space;
struct S s;
} a;
struct {
struct S s;
int space;
} b;
};
struct S f(struct S *);
void g(union U *);
void main_test(void)
{
union U u;
u.b.s = f(&u.a.s);
u.a.s = f(&u.b.s);
g(&u);
}
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