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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr33136-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* PR tree-optimization/33136 */
2
/* { dg-do run } */
3
/* { dg-options "-O2" } */
4
 
5
extern void abort (void);
6
 
7
struct S
8
{
9
  struct S *a;
10
  int b;
11
  float f;
12
};
13
 
14
static struct S s;
15
 
16
static int *
17
__attribute__((noinline, const))
18
foo (void)
19
{
20
  return &s.b;
21
}
22
 
23
float
24
__attribute__((noinline))
25
bar (float *f)
26
{
27
  s.f = 1.0;
28
  *f = 4.0;
29
  return s.f;
30
}
31
 
32
int
33
__attribute__((noinline))
34
baz (int *x)
35
{
36
  s.b = 1;
37
  *x = 4;
38
  return s.b;
39
}
40
 
41
int
42
t (void)
43
{
44
  float f = 8.0;
45
  return bar (&f) + baz (foo ());
46
}
47
 
48
int
49
main (void)
50
{
51
  if (t () != 5)
52
    abort ();
53
  return 0;
54
}

powered by: WebSVN 2.1.0

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