summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c
blob: 1a6e36df8f10d24bf46ac9b2cfaa8d8cf547984b (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 link } */
/* { dg-options "-O2" } */

/* Test to check whether global variables are being
   constant propagated. */

extern void link_error (void);

int G;

void
foo (int i)
{
   if (i > 0)
     G = 3;
   else
     G = 3;

   if (G != 3)
     link_error ();
}

int
main ()
{
   foo (0);
   return 0;
}