testsuite: Annotate Wattributes-8.c for default_packed
authorDimitar Dimitrov <dimitar@dinux.eu>
Sun, 3 Apr 2022 09:27:16 +0000 (12:27 +0300)
committerDimitar Dimitrov <dimitar@dinux.eu>
Tue, 3 May 2022 18:56:15 +0000 (21:56 +0300)
Place markers in test case to handle targets which pack structures by
default. Validated on pru-none-elf.

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

index a4b4c00..8f5483e 100644 (file)
@@ -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.