1 /* This test needs runtime that provides stpcpy, mempcpy and __*_chk
3 /* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */
4 /* { dg-options "-O2 -fdump-tree-strlen" } */
5 /* Bionic targets don't have mempcpy */
6 /* { dg-require-effective-target non_bionic } */
8 #define FORTIFY_SOURCE 2
9 #include "strlenopt-14g.c"
11 /* Compared to strlenopt-14gf.c, strcpy_chk with string literal as
12 second argument isn't being optimized by builtins.c into
14 /* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen1" } } */
15 /* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 0 "strlen1" } } */
16 /* { dg-final { scan-tree-dump-times "__mempcpy_chk \\(" 0 "strlen1" } } */
17 /* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen1" } } */
18 /* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen1" } } */
19 /* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen1" } } */
20 /* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen1" } } */
21 /* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen1" } } */
22 /* { dg-final { scan-tree-dump-times "mempcpy \\(" 2 "strlen1" } } */
23 /* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen1" } } */
24 /* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen1" } } */
25 /* { dg-final { scan-tree-dump-times "stpcpy \\(" 2 "strlen1" } } */