summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitar Dimitrov <dimitar@dinux.eu>2022-05-14 21:40:11 +0300
committerDimitar Dimitrov <dimitar@dinux.eu>2022-05-21 21:27:28 +0300
commitbad2999ab2b910c2e6b4494c772163de2b7e90e5 (patch)
tree2bf7bcb608e2dc800570b6ca868f7505a65f40e8
parentDaily bump. (diff)
downloadgcc-bad2999ab2b910c2e6b4494c772163de2b7e90e5.tar.gz
gcc-bad2999ab2b910c2e6b4494c772163de2b7e90e5.tar.bz2
gcc-bad2999ab2b910c2e6b4494c772163de2b7e90e5.tar.xz
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.c6
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 da179a2c0f5..5cae8566209 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)
238 238
239static void warn_a1_local_buf (struct A1 *p) 239static void warn_a1_local_buf (struct A1 *p)
240{ 240{
241 p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3; 241 p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2;
242 242
243 p->a1[3] = 3; // { dg-warning "\\\[-Warray-bounds" "" { target default_packed } }
243 p->a1[4] = 4; // { dg-warning "\\\[-Warray-bounds" } 244 p->a1[4] = 4; // { dg-warning "\\\[-Warray-bounds" }
244} 245}
245 246
246static void warn_a1_extern_buf (struct A1 *p) 247static void warn_a1_extern_buf (struct A1 *p)
247{ 248{
248 p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3; p->a1[4] = 4; 249 p->a1[0] = 0; p->a1[1] = 1; p->a1[2] = 2; p->a1[3] = 3;
249 250
251 p->a1[4] = 4; // { dg-warning "\\\[-Warray-bounds" "" { target default_packed } }
250 p->a1[5] = 5; // { dg-warning "\\\[-Warray-bounds" } 252 p->a1[5] = 5; // { dg-warning "\\\[-Warray-bounds" }
251} 253}
252 254