1 /* PR tree-optimization/83519 - missing -Wrestrict on an overlapping
2 strcpy to a non-member array
4 { dg-options "-O2 -Wall -Wrestrict" } */
6 extern char* stpcpy (char*, const char*); // work around bug 82429
8 struct S
{ char a
[17]; };
10 void f (struct S
*p
, const char *s
)
12 __builtin_strcpy (p
->a
, "0123456789abcdef");
14 __builtin_strcpy (p
->a
, p
->a
+ 4); /* { dg-warning "\\\[-Wrestrict]" } */
19 void g (const char *s
)
21 __builtin_strcpy (a
, "0123456789abcdef");
23 __builtin_strcpy (a
, a
+ 4); /* { dg-warning "\\\[-Wrestrict]" } */
26 void h (const char *s
)
30 __builtin_strcpy (a
, "0123456789abcdef");
32 __builtin_strcpy (a
, a
+ 4); /* { dg-warning "\\\[-Wrestrict]" } */
34 extern void sink (void*);