1  /* { dg-do run } */
       2  /* { dg-options "-O2 -fdump-tree-strlen" } */
       3  
       4  #include "strlenopt.h"
       5  
       6  __attribute__((noinline, noclone)) size_t
       7  fn1 (char *p)
       8  {
       9    strcpy (p, "foobar");
      10    return strlen (p + 2); // This strlen should be optimized into 4.
      11  }
      12  
      13  int
      14  main (void)
      15  {
      16    char p[] = "barfoo";
      17    if (fn1 (p) != 4)
      18      abort ();
      19    return 0;
      20  }
      21  
      22  /* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen1" } } */