public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Adjust btf-bitfields-1.c for default_packed
@ 2022-06-23 21:21 Dimitar Dimitrov
  2022-06-26 16:04 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Dimitar Dimitrov @ 2022-06-23 21:21 UTC (permalink / raw)
  To: gcc-patches

If target packs structures by default, the bitfield offset which the
tests validates must be adjusted to not include padding.

Ok for trunk?

gcc/testsuite/ChangeLog:

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

CC: Jose E. Marchesi <jose.marchesi@oracle.com>
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c
index c6bf52130dc..4cb7ee84f83 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c
@@ -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" } */
@@ -14,7 +15,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;
-- 
2.36.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite: Adjust btf-bitfields-1.c for default_packed
  2022-06-23 21:21 [PATCH] testsuite: Adjust btf-bitfields-1.c for default_packed Dimitar Dimitrov
@ 2022-06-26 16:04 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2022-06-26 16:04 UTC (permalink / raw)
  To: gcc-patches



On 6/23/2022 3:21 PM, Dimitar Dimitrov wrote:
> If target packs structures by default, the bitfield offset which the
> tests validates must be adjusted to not include padding.
>
> Ok for trunk?
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.dg/debug/btf/btf-bitfields-1.c: Adjust the checked offsets
> 	for targets which pack structures by default.
OK
jeff


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-26 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 21:21 [PATCH] testsuite: Adjust btf-bitfields-1.c for default_packed Dimitar Dimitrov
2022-06-26 16:04 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).