summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c
blob: ed3b2f7840fb0df74b6c461005cb08173d070daf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-rtl-expand-details" } */

/* Verify we PRE the strlen call, as strlen("") folds to zero.  */

extern __SIZE_TYPE__ strlen (const char *);

__SIZE_TYPE__ mystrlen (const char *s)
{
  if (!s)
    s = "";
  return strlen(s);
}

/* { dg-final { scan-rtl-dump "PART.. = 0" "expand" } } */
/* { dg-final { cleanup-rtl-dump "expand" } } */