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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [ssa-ccp-17.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O -fdump-tree-ccp1" } */
3
 
4
int foo(void)
5
{
6
  int i = 0;
7
  char *p = (char *)&i;
8
  return *(int *)p;
9
}
10
 
11
struct Foo {
12
  int i;
13
} f;
14
 
15
int bar(void)
16
{
17
  char *p = (char *)&f;
18
  return ((struct Foo *)p)->i;
19
}
20
 
21
const struct Foo g;
22
 
23
int foobar(void)
24
{
25
  struct Foo *p = (struct Foo *)&g;
26
  return ((const struct Foo *)p)->i;
27
}
28
 
29
/* { dg-final { scan-tree-dump "= i;" "ccp1" } } */
30
/* { dg-final { scan-tree-dump "= f.i;" "ccp1" } } */
31
/* { dg-final { scan-tree-dump "= g.i;" "ccp1" } } */
32
/* { dg-final { cleanup-tree-dump "ccp1" } } */

powered by: WebSVN 2.1.0

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