builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gcc.dg / strlenopt-14gf.c
blob8b126fcb7eafbf593f30eff0ec90f6a4858e5425
1 /* This test needs runtime that provides stpcpy, mempcpy and __*_chk
2 functions. */
3 /* { dg-do run { target *-*-linux* *-*-gnu* } } */
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
13 memcpy. */
14 /* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
15 /* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 0 "strlen" } } */
16 /* { dg-final { scan-tree-dump-times "__mempcpy_chk \\(" 0 "strlen" } } */
17 /* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen" } } */
18 /* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
19 /* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
20 /* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen" } } */
21 /* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */
22 /* { dg-final { scan-tree-dump-times "mempcpy \\(" 2 "strlen" } } */
23 /* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
24 /* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
25 /* { dg-final { scan-tree-dump-times "stpcpy \\(" 2 "strlen" } } */