URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20050826-1.c] - Rev 297
Compare with Previous | Blame | View Log
/* PR rtl-optimization/23561 */ struct A { char a1[1]; char a2[5]; char a3[1]; char a4[2048 - 7]; } a; typedef __SIZE_TYPE__ size_t; extern void *memset (void *, int, size_t); extern void *memcpy (void *, const void *, size_t); extern int memcmp (const void *, const void *, size_t); extern void abort (void); void bar (struct A *x) { size_t i; if (memcmp (x, "\1HELLO\1", sizeof "\1HELLO\1")) abort (); for (i = 0; i < sizeof (x->a4); i++) if (x->a4[i]) abort (); } int foo (void) { memset (&a, 0, sizeof (a)); a.a1[0] = 1; memcpy (a.a2, "HELLO", sizeof "HELLO"); a.a3[0] = 1; bar (&a); return 0; } int main (void) { foo (); return 0; }