gcc/testsuite/g++.dg/opt/pr78901.C
raw| 1 | // PR middle-end/78901 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-O2 -Wno-stringop-overflow" } |
| 4 | |
| 5 | extern "C" int __snprintf_chk (char *, __SIZE_TYPE__, int, __SIZE_TYPE__, const char *, ...); |
| 6 | |
| 7 | int |
| 8 | foo (char *c) |
| 9 | { |
| 10 | try |
| 11 | { |
| 12 | return __snprintf_chk (c, 64, 0, 32, "%s", "abcdefghijklmnopq"); |
| 13 | } |
| 14 | catch (...) |
| 15 | { |
| 16 | return -1; |
| 17 | } |
| 18 | } |