]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Adjust btf-bitfields-1.c for default_packed
authorDimitar Dimitrov <dimitar@dinux.eu>
Fri, 22 Apr 2022 17:27:22 +0000 (20:27 +0300)
committerDimitar Dimitrov <dimitar@dinux.eu>
Sun, 26 Jun 2022 17:32:19 +0000 (20:32 +0300)
If target packs structures by default, the bitfield offset which the
test validates must be adjusted to not include padding.

gcc/testsuite/ChangeLog:

* gcc.dg/debug/btf/btf-bitfields-1.c: Adjust the checked offsets
for targets which pack structures by default.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c

index 3ee07ddbd818672680fcf15b4ffdca1799888074..793b4c8db8259f976b825ee75d47c410a52c7d6b 100644 (file)
@@ -5,7 +5,8 @@
      (bit_size << 24) | bit_offset
      - (0xa  << 24) | 0x20
      - (0x7  << 24) | 0x2a
-     - (0x13 << 24) | 0x40 - note that this is aligned to 0x40.  */
+     - (0x13 << 24) | 0x40 - note that this is aligned to 0x40.
+     - (0x13 << 24) | 0x31 - in case structures are packed.  */
 
 /* { dg-do compile )  */
 /* { dg-options "-O0 -gbtf -dA" } */
@@ -15,7 +16,8 @@
 
 /* { dg-final { scan-assembler-times "\[\t \]0xa000020\[\t \]+\[^\n\]*btm_offset" 1 } } */
 /* { dg-final { scan-assembler-times "\[\t \]0x700002a\[\t \]+\[^\n\]*btm_offset" 1 } } */
-/* { dg-final { scan-assembler-times "\[\t \]0x13000040\[\t \]+\[^\n\]*btm_offset" 1 } } */
+/* { dg-final { scan-assembler-times "\[\t \]0x13000040\[\t \]+\[^\n\]*btm_offset" 1 { target { ! default_packed } } } } */
+/* { dg-final { scan-assembler-times "\[\t \]0x13000031\[\t \]+\[^\n\]*btm_offset" 1 { target { default_packed } } } } */
 
 struct bitt {
   int a;