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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pta-ptrarith-2.c] - Blame information for rev 754

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-fdump-tree-alias" } */
3
/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
4
 
5
struct Foo {
6
  int **p;
7
  int **q;
8
};
9
 
10
int __attribute__((noinline))
11
bar (void)
12
{
13
  struct Foo f;
14
  int j, i = 1;
15
  char *p;
16
  int *x = &i;
17
  int *y = &j;
18
  f.p = &y;
19
  f.q = &x;
20
  p = (char *)&f;
21
  for (j = 0; j < sizeof (int *); ++j)
22
    p++;
23
  return ***(int ***)p;
24
}
25
extern void abort (void);
26
int main()
27
{
28
  if (bar () != 1)
29
    abort ();
30
  return 0;
31
}
32
 
33
/* In theory = { i } is the correct solution.  But it's not easy to scan
34
   for that reliably, so just use what we create now.  */
35
/* { dg-final { scan-tree-dump "= { i j }" "alias" } } */
36
/* { 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.