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/] [20050502-2.c] - Rev 297
Compare with Previous | Blame | View Log
/* PR target/21297 */ typedef __SIZE_TYPE__ size_t; extern int memcmp (const char *, const char *, size_t); extern void abort (); void foo (char *x) { int i; for (i = 0; i < 2; i++); x[i + i] = '\0'; } void bar (char *x) { int i; for (i = 0; i < 2; i++); x[i + i + i + i] = '\0'; } int main (void) { char x[] = "IJKLMNOPQR"; foo (x); if (memcmp (x, "IJKL\0NOPQR", sizeof x) != 0) abort (); x[4] = 'M'; bar (x); if (memcmp (x, "IJKLMNOP\0R", sizeof x) != 0) abort (); return 0; }