PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / pr78768.c
blob72ac3f871294698bd3099f1d38c5ecc0cbff61c9
1 /* PR c/78768 - -Walloca-larger-than and -Wformat-overflow warnings disabled
2 by -flto
3 { dg-do link }
4 { dg-require-effective-target lto }
5 { dg-require-linker-plugin "" }
6 { dg-options "-O2 -Walloca-larger-than=10 -Wformat -Wformat-overflow -flto" } */
8 int main (void)
10 char *d = (char *)__builtin_alloca (12); /* { dg-warning "argument to .alloca. is too large" } */
12 __builtin_sprintf (d, "%32s", "x"); /* { dg-warning "directive writing 32 bytes into a region of size 12" "-Wformat-overflow" } */
14 return 0;