gcc/testsuite/gcc.dg/Wlarger-than3.c
raw| 1 | /* Exercise -Wlarger-than= with a byte-size suffix. |
| 2 | { dg-do compile } |
| 3 | { dg-skip-if "small address space" { "pdp11-*-*" } { "avr-*-*" } } |
| 4 | { dg-options "-Wlarger-than=1MiB" } */ |
| 5 | |
| 6 | #define MB (1000 * 1000) /* MegaByte */ |
| 7 | #define MiB (1024 * 1024) /* MebiByte */ |
| 8 | |
| 9 | char megabyte[MB]; |
| 10 | char membibyte[MiB]; |
| 11 | |
| 12 | char megabyte_plus_1[MB + 1]; |
| 13 | char membibyte_plus_1[MiB + 1]; /* { dg-warning "size of .membibyte_plus_1. 1048577 bytes exceeds maximum object size 1048576" } */ |