diff options
author | Dimitar Dimitrov <dimitar@dinux.eu> | 2022-05-14 21:40:11 +0300 |
---|---|---|
committer | Dimitar Dimitrov <dimitar@dinux.eu> | 2022-05-21 21:27:28 +0300 |
commit | bad2999ab2b910c2e6b4494c772163de2b7e90e5 (patch) | |
tree | 2bf7bcb608e2dc800570b6ca868f7505a65f40e8 | |
parent | 57f2ce6a87802906826501b8843013ff2b50713b (diff) | |
download | gcc-bad2999ab2b910c2e6b4494c772163de2b7e90e5.zip gcc-bad2999ab2b910c2e6b4494c772163de2b7e90e5.tar.gz gcc-bad2999ab2b910c2e6b4494c772163de2b7e90e5.tar.bz2 |
testsuite: Mark extra warnings for default_packed
If the target uses packed structs by default, there are no trailing
padding bytes allocated. Hence extra warnings are emitted.
gcc/testsuite/ChangeLog:
* gcc.dg/Warray-bounds-48-novec.c: Add expected warnings
if target packs the structs by default.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
-rw-r--r-- | gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c b/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c index da179a2..5cae856 100644 --- a/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c +++ b/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c @@ -238,15 +238,17 @@ static void warn_a1_init (struct A1 *p) static void warn_a1_local_buf (struct A1 *p) { - p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3; + p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; + p->a1[3] = 3; // { dg-warning "\\\[-Warray-bounds" "" { target default_packed } } p->a1[4] = 4; // { dg-warning "\\\[-Warray-bounds" } } static void warn_a1_extern_buf (struct A1 *p) { - p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3; p->a1[4] = 4; + p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3; + p->a1[4] = 4; // { dg-warning "\\\[-Warray-bounds" "" { target default_packed } } p->a1[5] = 5; // { dg-warning "\\\[-Warray-bounds" } } |