OpenCores
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] - Blame information for rev 298

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* PR rtl-optimization/23561 */
2
 
3
struct A
4
{
5
  char a1[1];
6
  char a2[5];
7
  char a3[1];
8
  char a4[2048 - 7];
9
} a;
10
 
11
typedef __SIZE_TYPE__ size_t;
12
extern void *memset (void *, int, size_t);
13
extern void *memcpy (void *, const void *, size_t);
14
extern int memcmp (const void *, const void *, size_t);
15
extern void abort (void);
16
 
17
void
18
bar (struct A *x)
19
{
20
  size_t i;
21
  if (memcmp (x, "\1HELLO\1", sizeof "\1HELLO\1"))
22
    abort ();
23
  for (i = 0; i < sizeof (x->a4); i++)
24
    if (x->a4[i])
25
      abort ();
26
}
27
 
28
int
29
foo (void)
30
{
31
  memset (&a, 0, sizeof (a));
32
  a.a1[0] = 1;
33
  memcpy (a.a2, "HELLO", sizeof "HELLO");
34
  a.a3[0] = 1;
35
  bar (&a);
36
  return 0;
37
}
38
 
39
int
40
main (void)
41
{
42
  foo ();
43
  return 0;
44
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.