OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20070919-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* PR c/33238 */
2
 
3
typedef __SIZE_TYPE__ size_t;
4
int memcmp (const void *, const void *, size_t);
5
void abort (void);
6
 
7
void
8
__attribute__((noinline))
9
bar (void *x, void *y)
10
{
11
  struct S { char w[8]; } *p = x, *q = y;
12
  if (memcmp (p->w, "zyxwvut", 8) != 0)
13
    abort ();
14
  if (memcmp (q[0].w, "abcdefg", 8) != 0)
15
    abort ();
16
  if (memcmp (q[1].w, "ABCDEFG", 8) != 0)
17
    abort ();
18
  if (memcmp (q[2].w, "zyxwvut", 8) != 0)
19
    abort ();
20
  if (memcmp (q[3].w, "zyxwvut", 8) != 0)
21
    abort ();
22
}
23
 
24
void
25
__attribute__((noinline))
26
foo (void *x, int y)
27
{
28
  struct S { char w[y]; } *p = x, a;
29
  int i;
30
  a = ({ struct S b; b = p[2]; p[3] = b; });
31
  bar (&a, x);
32
}
33
 
34
int
35
main (void)
36
{
37
  struct S { char w[8]; } p[4]
38
    = { "abcdefg", "ABCDEFG", "zyxwvut", "ZYXWVUT" };
39
  foo (p, 8);
40
  return 0;
41
}

powered by: WebSVN 2.1.0

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