gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / strlenopt-25.c
blob4862156546eb59fe62f3edb11180573a9dad4f0b
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fdump-tree-strlen" } */
4 #include "strlenopt.h"
6 int
7 main ()
9 char p[] = "foobar";
10 int len, len2;
11 len = strlen (p);
12 p[0] = 'O';
13 len2 = strlen (p);
14 return len - len2;
17 /* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
18 /* { dg-final { cleanup-tree-dump "strlen" } } */