1 /* PR tree-optimization/85259 - Missing -Wstringop-overflow= since r256683
3 { dg-options "-O2 -Wstringop-overflow" } */
5 extern char* strcpy (char*, const char*);
6 extern char* strcat (char*, const char*);
17 /* Verify that at least one instance of -Wstringop-overflow is issued
18 for each pair of strcpy/strcat calls. */
20 void test_strcpy_strcat_1 (void)
22 strcpy (a1
, "1"), strcat (a1
, "2"); /* { dg-warning "\\\[-Wstringop-overflow=]" } */
25 void test_strcpy_strcat_2 (void)
27 strcpy (a2
, "12"), strcat (a2
, "3"); /* { dg-warning "\\\[-Wstringop-overflow=]" } */
30 void test_strcpy_strcat_3 (void)
32 strcpy (a3
, "123"), strcat (a3
, "4"); /* { dg-warning "\\\[-Wstringop-overflow=]" } */
35 void test_strcpy_strcat_4 (void)
37 strcpy (a4
, "1234"), strcat (a4
, "5"); /* { dg-warning "\\\[-Wstringop-overflow=]" } */
40 void test_strcpy_strcat_5 (void)
42 strcpy (a5
, "12345"), strcat (a5
, "6"); /* { dg-warning "\\\[-Wstringop-overflow=]" } */
45 void test_strcpy_strcat_6 (void)
47 strcpy (a6
, "123456"), strcat (a6
, "7"); /* { dg-warning "\\\[-Wstringop-overflow=]" } */
50 void test_strcpy_strcat_7 (void)
52 strcpy (a7
, "1234567"), strcat (a7
, "8"); /* { dg-warning "\\\[-Wstringop-overflow=]" } */
55 void test_strcpy_strcat_8 (void)
57 strcpy (a8
, "12345678"), strcat (a8
, "9"); /* { dg-warning "\\\[-Wstringop-overflow=]" } */