Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / strlenopt-29.c
blobfb4b4c9cc71c671f5f84ca83ec6c5376736ac245
1 /* PR tree-optimization/71707 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -fdump-tree-strlen" } */
5 #include "strlenopt.h"
7 char a[32];
8 size_t b;
10 __attribute__((noinline, noclone)) char *
11 foo (void)
13 char *p = memcpy (a, "a", 2) + 1;
14 memcpy (&a[1], "b", 2);
15 b = strlen (a) + strlen (&a[1]) + strlen (p);
16 return p;
19 int
20 main ()
22 if (foo () != &a[1] || b != 4)
23 abort ();
24 return 0;
27 /* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */