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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr51466.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/51466 */
2
 
3
extern void abort (void);
4
 
5
__attribute__((noinline, noclone)) int
6
foo (int i)
7
{
8
  volatile int v[4];
9
  int *p;
10
  v[i] = 6;
11
  p = (int *) &v[i];
12
  return *p;
13
}
14
 
15
__attribute__((noinline, noclone)) int
16
bar (int i)
17
{
18
  volatile int v[4];
19
  int *p;
20
  v[i] = 6;
21
  p = (int *) &v[i];
22
  *p = 8;
23
  return v[i];
24
}
25
 
26
__attribute__((noinline, noclone)) int
27
baz (int i)
28
{
29
  volatile int v[4];
30
  int *p;
31
  v[i] = 6;
32
  p = (int *) &v[0];
33
  *p = 8;
34
  return v[i];
35
}
36
 
37
int
38
main ()
39
{
40
  if (foo (3) != 6 || bar (2) != 8 || baz (0) != 8 || baz (1) != 6)
41
    abort ();
42
  return 0;
43
}

powered by: WebSVN 2.1.0

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