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-1.c] - Blame information for rev 695

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
};
8
 
9
void __attribute__((noinline))
10
foo (void *p)
11
{
12
  struct Foo *f = (struct Foo *)p - 1;
13
  *f->p = 0;
14
}
15
 
16
int bar (void)
17
{
18
  struct Foo f;
19
  int i = 1;
20
  f.p = &i;
21
  foo (&f + 1);
22
  return i;
23
}
24
extern void abort (void);
25
int main()
26
{
27
  if (bar () != 0)
28
    abort ();
29
  return 0;
30
}
31
 
32
/* { dg-final { scan-tree-dump "ESCAPED = {\[^\n\}\]* i f \[^\n\}\]*}" "alias" } } */
33
/* { 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.