OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pr19633-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2" } */
3
 
4
extern void abort (void);
5
 
6
struct S
7
{
8
  int w, x, y, z;
9
};
10
 
11
struct T
12
{
13
  int r;
14
  struct S s;
15
};
16
 
17
struct S bar (struct S x, struct S *y)
18
{
19
  y->w = 4;
20
  return *y;
21
}
22
 
23
void
24
foo (int a, struct T b)
25
{
26
  struct S x;
27
  struct S *c = &x;
28
  if (a)
29
    c = &b.s;
30
  b.s.w = 3;
31
  /* This call should be marked as clobbering 'x' and 'b'.  */
32
  *c = bar (*c, c);
33
  if (b.s.w == 3)
34
    abort ();
35
}
36
 
37
float Y;
38
 
39
struct S bar1 (struct S x, struct S y)
40
{
41
  Y = 4;
42
  return x;
43
}
44
 
45
void
46
foo1 (int a, struct T b)
47
{
48
  struct S x;
49
  struct S *c = &x;
50
  float z, *k = &z;
51
  if (a)
52
    c = &b.s;
53
  b.s.w = 3;
54
  /* This call should NOT be marked as clobbering 'x' and 'b'.  */
55
  x = bar1 (*c, *c);
56
  if (b.s.w != 3)
57
    link_error ();
58
}
59
 
60
int main ()
61
{
62
  struct T b;
63
  foo (3, b);
64
  foo1 (3, b);
65
  return 0;
66
}

powered by: WebSVN 2.1.0

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