PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-ccp-28.c
blob99ebbd35ab84021c89f792e0cb41d96155f668d6
1 /* { dg-do run } */
2 /* { dg-options "-O -fdump-tree-ccp1" } */
4 extern void abort (void);
6 static int g[1];
8 static int * const p = &g[0];
9 static int * const q = &g[0];
11 int main(void)
13 g[0] = 1;
14 *p = 0;
15 *p = *q;
16 if (g[0] != 0)
17 abort ();
18 return 0;
21 /* We should have replaced all loads from p and q with the constant
22 initial value. */
24 /* { dg-final { scan-tree-dump-times "= p;" 0 "ccp1" } } */
25 /* { dg-final { scan-tree-dump-times "= q;" 0 "ccp1" } } */