diff mbox series

[committed] testsuite: Annotate Wattributes-8.c for default_packed

Message ID 20220503190015.300440-3-dimitar@dinux.eu
State Committed
Commit 0a7c4d6b67f15d6c51fbc71325d9d2f31d96f794
Headers show
Series [committed] testsuite: Annotate Wattributes-8.c for default_packed | expand

Commit Message

Dimitar Dimitrov May 3, 2022, 7 p.m. UTC
Place markers in test case to handle targets which pack structures by
default. Validated on pru-none-elf.

Committed as obvious.

gcc/testsuite/ChangeLog:

	* gcc.dg/Wattributes-8.c: Add annotations for default_packed
	targets.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/testsuite/gcc.dg/Wattributes-8.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/Wattributes-8.c b/gcc/testsuite/gcc.dg/Wattributes-8.c
index a4b4c00c08f..8f5483e2d7a 100644
--- a/gcc/testsuite/gcc.dg/Wattributes-8.c
+++ b/gcc/testsuite/gcc.dg/Wattributes-8.c
@@ -24,8 +24,10 @@  int c ATTR ((aligned (2)));           // okay (reduces alignment)
 ASSERT (_Alignof (c) == 2);
 
 struct {
-  int a ATTR ((packed, aligned (2)));   /* { dg-bogus "\\\[-Wattributes" } */
-  int b ATTR ((aligned (2), packed));   /* { dg-bogus "\\\[-Wattributes" } */
+  int a ATTR ((packed, aligned (2)));   /* { dg-bogus "\\\[-Wattributes" "" { target { ! default_packed } } } */
+  /* { dg-warning "attribute ignored" "" { target { default_packed } } .-1 } */
+  int b ATTR ((aligned (2), packed));   /* { dg-bogus "\\\[-Wattributes" "" { target { ! default_packed } } } */
+  /* { dg-warning "attribute ignored" "" { target { default_packed } } .-1 } */
 
   /* Avoid exercising this since the attribute has no effect yet
      there is no warning.