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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr49279.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 688 jeremybenn
/* PR tree-optimization/49279 */
2
extern void abort (void);
3
 
4
struct S { int a; int *__restrict p; };
5
 
6
__attribute__((noinline, noclone))
7
struct S *bar (struct S *p)
8
{
9
  struct S *r;
10
  asm volatile ("" : "=r" (r) : "0" (p) : "memory");
11
  return r;
12
}
13
 
14
__attribute__((noinline, noclone))
15
int
16
foo (int *p, int *q)
17
{
18
  struct S s, *t;
19
  s.a = 1;
20
  s.p = p;
21
  t = bar (&s);
22
  t->p = q;
23
  s.p[0] = 0;
24
  t->p[0] = 1;
25
  return s.p[0];
26
}
27
 
28
int
29
main ()
30
{
31
  int a, b;
32
  if (foo (&a, &b) != 1)
33
    abort ();
34
  return 0;
35
}

powered by: WebSVN 2.1.0

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