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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pta-structcopy-1.c] - Blame information for rev 801

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-ealias -Wno-attributes" } */
3
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
4
 
5
struct X
6
{
7
  long l1;
8
  struct Y
9
    {
10
      long l2;
11
      int *p;
12
    } y;
13
};
14
int i;
15
static int __attribute__((always_inline))
16
foo (struct X *x)
17
{
18
  struct Y y = x->y;
19
  /* In the inlined instance the dereferenced pointer needs to point to i.  */
20
  *y.p = 0;
21
  i = 1;
22
  return *y.p;
23
}
24
extern void abort (void);
25
int main()
26
{
27
  struct X x;
28
  x.y.p = &i;
29
  if (foo(&x) != 1)
30
    abort ();
31
  return 0;
32
}
33
 
34
/* { dg-final { scan-tree-dump "points-to vars: { i }" "ealias" } } */
35
/* { dg-final { cleanup-tree-dump "ealias" } } */

powered by: WebSVN 2.1.0

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