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/] [tree-ssa/] [pta-escape-2.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 "-O -fdump-tree-alias-details" } */
3
 
4
int *i;
5
void __attribute__((noinline))
6
foo (void)
7
{
8
  *i = 1;
9
}
10
int __attribute__((noinline))
11
bar(int local_p, int **q)
12
{
13
  int x = 0;
14
  int *j;
15
  int **p;
16
  if (local_p)
17
    p = &j;
18
  else
19
    p = q;
20
  *p = &x;  /* This makes x escape.  */
21
  foo ();
22
  return x;
23
}
24
extern void abort (void);
25
int main()
26
{
27
  int k = 2;
28
  int **q = &i;
29
  i = &k;
30
  if (bar (1, q) != 0 || k != 1)
31
    abort ();
32
  if (bar (0, q) != 1)
33
    abort ();
34
  return 0;
35
}
36
 
37
/* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to vars: { x }" "alias" } } */
38
/* { dg-final { cleanup-tree-dump "alias" } } */

powered by: WebSVN 2.1.0

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