aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c
blob: b102a7a52e728ac7baa4d758528cdb2e25ae2596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized -fno-strict-aliasing" } */
/* Test with fixed address */
static int *foo =  (int *) (unsigned long) 0x7800000;

int func(void) __attribute__ ((noinline));

extern int bar(void);

int func(void)
{
   if (*foo) {
      return 1;
   }
   return 0;

}

int foobar(void)
{

   if (func()) {
      *foo = 1;
   }
   return func();
}

/* { dg-final { scan-tree-dump-times "= func" 2 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */