PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-15.c
blob67ec3100dacf106ac729bc3f0d5052002bef8604
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-rtl-expand-details" } */
4 /* Verify we PRE the strlen call, as strlen("") folds to zero. */
6 extern __SIZE_TYPE__ strlen (const char *);
8 __SIZE_TYPE__ mystrlen (const char *s)
10 if (!s)
11 s = "";
12 return strlen(s);
15 /* { dg-final { scan-rtl-dump "PART.. = 0" "expand" } } */