1 /* PR tree-optimization/84526 - ICE in generic_overlap
3 { dg-options "-O2 -Wrestrict" } */
5 typedef __SIZE_TYPE__
size_t;
7 extern void* memcpy (void* restrict
, const void* restrict
, size_t);
8 extern char* strcat (char* restrict
, const char* restrict
);
9 extern char* strcpy (char* restrict
, const char* restrict
);
10 extern char* strncat (char* restrict
, const char* restrict
, size_t);
11 extern char* strncpy (char* restrict
, const char* restrict
, size_t);
21 void __attribute__ ((noclone
, noinline
))
22 test_arr_memcpy_1 (void)
24 memcpy (&b
.a
[i
], b
.a
, n
);
27 void __attribute__ ((noclone
, noinline
))
28 test_arr_memcpy_2 (void)
30 memcpy (b
.a
, &b
.a
[i
], n
);
33 void __attribute__ ((noclone
, noinline
))
34 test_arr_strcat_1 (void)
36 strcat (&b
.a
[i
], b
.a
); /* { dg-warning "\\\[-Wrestrict" } */
39 void __attribute__ ((noclone
, noinline
))
40 test_arr_strcat_2 (void)
42 /* This probably deserves a warning. */
43 strcpy (b
.a
, &b
.a
[i
]);
46 void __attribute__ ((noclone
, noinline
))
47 test_arr_strncat_1 (void)
49 strncat (&b
.a
[i
], b
.a
, n
); /* { dg-warning "\\\[-Wrestrict" } */
52 void __attribute__ ((noclone
, noinline
))
53 test_arr_strncat_2 (void)
55 strncat (b
.a
, &b
.a
[i
], n
); /* { dg-warning "\\\[-Wrestrict" } */
58 void __attribute__ ((noclone
, noinline
))
59 test_arr_strcpy_1 (void)
61 strcpy (&b
.a
[i
], b
.a
); /* { dg-warning "\\\[-Wrestrict" } */
64 void __attribute__ ((noclone
, noinline
))
65 test_arr_strcpy_2 (void)
67 strcpy (b
.a
, &b
.a
[i
]);
76 void __attribute__ ((noclone
, noinline
))
77 test_obj_memcpy_1 (void)
79 memcpy (d
.b
, (char *) &d
, n
);
82 void __attribute__ ((noclone
, noinline
))
83 test_obj_memcpy_2 (void)
85 memcpy ((char *) &d
, d
.b
, n
);
88 void __attribute__ ((noclone
, noinline
))
89 test_obj_strcpy_1 (void)
91 strcpy (d
.b
, (char *) &d
);
94 void __attribute__ ((noclone
, noinline
))
95 test_obj_strcpy_2 (void)
97 strcpy ((char *) &d
, d
.b
);
100 void __attribute__ ((noclone
, noinline
))
101 test_obj_strncat_1 (void)
103 strncat (d
.b
, (char *) &d
, n
); /* { dg-warning "\\\[-Wrestrict" } */
106 void __attribute__ ((noclone
, noinline
))
107 test_obj_strncat_2 (void)
109 strncat ((char *) &d
, d
.b
, n
); /* { dg-warning "\\\[-Wrestrict" } */
112 void __attribute__ ((noclone
, noinline
))
113 test_obj_strncpy_1 (void)
115 strncpy (d
.b
, (char *) &d
, n
);
118 void test_obj_strncpy_2 (void)
120 strncpy ((char *) &d
, d
.b
, n
);