1 /* PR 85365 - -Wrestrict false positives with -fsanitize=undefined
3 { dg-options "-O2 -Wrestrict -fsanitize=undefined" } */
5 typedef __SIZE_TYPE__
size_t;
7 char *strcpy (char *, const char *);
8 char *strcat (char *, const char *);
10 size_t strlen (char *);
12 extern char a
[], b
[], d
[];
14 size_t t1 (char *g
, int i
)
16 /* The following exercises the handling in gimple-fold.c. */
17 strcpy (g
+ 4, i
? b
: a
); /* { dg-bogus "\\\[-Wrestrict]" } */
18 return strlen (g
+ 4);
21 void t2 (char *g
, int i
)
23 strcpy (g
+ 4, i
? b
: a
); /* { dg-bogus "\\\[-Wrestrict]" } */
27 void t3 (char *g
, int i
)
29 /* The following exercises the handling in gimple-ssa-warn-restrict.c. */
30 strcat (g
+ 4, i
? b
: a
); /* { dg-bogus "\\\[-Wrestrict]" } */
34 void t4 (char *p
, char *q
)
36 strcpy (p
, q
); /* { dg-bogus "\\\[-Wrestrict]" } */