PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / strlenopt-4gf.c
blob7f261b7d34df13210d7d459d7fcf31385274bbff
1 /* This test needs runtime that provides stpcpy and __*_chk functions. */
2 /* { dg-do run { target *-*-linux* *-*-gnu* } } */
3 /* { dg-options "-O2 -fdump-tree-strlen" } */
5 #define USE_GNU
6 #define FORTIFY_SOURCE 2
7 #include "strlenopt-4.c"
9 /* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
10 /* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 0 "strlen" } } */
11 /* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen" } } */
12 /* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
13 /* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
14 /* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen" } } */
15 /* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
16 /* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
17 /* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
18 /* { dg-final { scan-tree-dump-times "stpcpy \\(" 5 "strlen" } } */