PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dse-1.c
blobbc4e4274b1139ae696afbf4aba25b35066644494
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dse1" } */
4 int
5 foo (int a, int b, int c)
7 int *p;
8 if (c)
9 p = &a;
10 else
11 p = &b;
13 *p = 3;
14 *p = 4;
15 return *p;
19 /* We should eliminate both assignments to *p. */
20 /* { dg-final { scan-tree-dump-times " = 3" 0 "dse1"} } */
21 /* { dg-final { scan-tree-dump-times " = 4" 0 "dse1"} } */
23 /* The return *p should be turned into return 4. */
24 /* { dg-final { scan-tree-dump-times " return 4" 1 "dse1"} } */