public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-6405] testsuite: Fix g++.dg/ext/attr-copy-2.C for default_packed targets
Date: Thu,  2 Mar 2023 01:16:42 +0000 (GMT)	[thread overview]
Message-ID: <20230302011642.BFE093858D3C@sourceware.org> (raw)

https://gcc.gnu.org/g:4ea6bfedc8759cef739ae42eee162989112bd85a

commit r13-6405-g4ea6bfedc8759cef739ae42eee162989112bd85a
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Wed Mar 1 18:55:27 2023 +0100

    testsuite: Fix g++.dg/ext/attr-copy-2.C for default_packed targets
    
    For targets where the byte-wise structure element layout is
    the same as for attribute-packed, you get a warning when
    that's specified.  Thus, expect a warning for such targets.
    Note the exclusion of bitfields.
    
            * g++.dg/ext/attr-copy-2.C: Fix for default_packed targets.

Diff:
---
 gcc/testsuite/g++.dg/ext/attr-copy-2.C | 60 +++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/gcc/testsuite/g++.dg/ext/attr-copy-2.C b/gcc/testsuite/g++.dg/ext/attr-copy-2.C
index 7776959d9f6..ffd6f22ef56 100644
--- a/gcc/testsuite/g++.dg/ext/attr-copy-2.C
+++ b/gcc/testsuite/g++.dg/ext/attr-copy-2.C
@@ -27,51 +27,51 @@ extern B &rb;
 
 typedef struct C
 {
-  ATTR (copy ((struct A *)0)) short m_pa_0;
-  ATTR (copy ((struct A *)(1, 0))) int m_pa_1_0;
-  ATTR (copy ((struct A *)(0, 1))) long m_pa_0_1;
+  ATTR (copy ((struct A *)0)) short m_pa_0; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy ((struct A *)(1, 0))) int m_pa_1_0; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy ((struct A *)(0, 1))) long m_pa_0_1; // { dg-warning "attribute ignored" "" { target default_packed } }
 
-  ATTR (copy (*(struct A *)0)) short m_xpa_0;
-  ATTR (copy (*(struct A *)(1, 0))) int m_xpa_1_0;
-  ATTR (copy (*(struct A *)(0, 1))) long m_xpa_0_1;
+  ATTR (copy (*(struct A *)0)) short m_xpa_0; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (*(struct A *)(1, 0))) int m_xpa_1_0; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (*(struct A *)(0, 1))) long m_xpa_0_1; // { dg-warning "attribute ignored" "" { target default_packed } }
 
-  ATTR (copy (((struct A *)0)[0])) short m_arpa_0;
-  ATTR (copy (((struct A *)(1, 0))[0])) int m_arpa_1_0;
-  ATTR (copy (((struct A *)(0, 1))[0])) long m_arpa_0_1;
+  ATTR (copy (((struct A *)0)[0])) short m_arpa_0; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (((struct A *)(1, 0))[0])) int m_arpa_1_0; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (((struct A *)(0, 1))[0])) long m_arpa_0_1; // { dg-warning "attribute ignored" "" { target default_packed } }
 
-  ATTR (copy (a)) short m_a;
-  ATTR (copy (b.a)) int m_b_a;
-  ATTR (copy (b.pa)) long m_b_pa;
-  ATTR (copy (b.ra)) long m_b_ra;
+  ATTR (copy (a)) short m_a; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (b.a)) int m_b_a; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (b.pa)) long m_b_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (b.ra)) long m_b_ra; // { dg-warning "attribute ignored" "" { target default_packed } }
 
-  ATTR (copy (&a)) short m_ara;
-  ATTR (copy (&b.a)) int m_arb_a;
-  ATTR (copy (*b.pa)) long m_xb_pa;
-  ATTR (copy (b.pa[0])) long m_arb_pa;
+  ATTR (copy (&a)) short m_ara; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (&b.a)) int m_arb_a; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (*b.pa)) long m_xb_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (b.pa[0])) long m_arb_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
 
-  ATTR (copy (*pa)) short m_xpa;
-  ATTR (copy (pa[0])) short m_arpa;
+  ATTR (copy (*pa)) short m_xpa; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (pa[0])) short m_arpa; // { dg-warning "attribute ignored" "" { target default_packed } }
 
-  ATTR (copy (ra)) short m_ra;
+  ATTR (copy (ra)) short m_ra; // { dg-warning "attribute ignored" "" { target default_packed } }
 
-  ATTR (copy (ab[0].a)) int m_arab_a;
-  ATTR (copy (ab[1].pa)) long m_arab_pa;
-  ATTR (copy (*ab[2].pa)) int m_xarab_pa;
+  ATTR (copy (ab[0].a)) int m_arab_a; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (ab[1].pa)) long m_arab_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (*ab[2].pa)) int m_xarab_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
   ATTR (copy (ab[3].pa->bf)) unsigned int m_arab_pa_bf: 1;
   ATTR (copy (ab[4].ra.bf)) unsigned int m_arab_ra_bf: 1;
 
-  ATTR (copy (pb->a)) int m_pb_a;
-  ATTR (copy (pb->pa)) long m_pb_pa;
-  ATTR (copy (*pb->pa)) int m_xpb_pa;
+  ATTR (copy (pb->a)) int m_pb_a; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (pb->pa)) long m_pb_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (*pb->pa)) int m_xpb_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
   ATTR (copy (pb->pa->bf)) unsigned int m_pb_pa_bf: 1;
   ATTR (copy (pb->ra.bf)) unsigned int m_pb_ra_bf: 1;
 
-  ATTR (copy (rb.a)) int m_rb_a;
-  ATTR (copy (rb.pa)) long m_rb_pa;
-  ATTR (copy (*rb.pa)) int m_xrb_pa;
+  ATTR (copy (rb.a)) int m_rb_a; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (rb.pa)) long m_rb_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
+  ATTR (copy (*rb.pa)) int m_xrb_pa; // { dg-warning "attribute ignored" "" { target default_packed } }
   ATTR (copy (rb.pa->bf)) unsigned int m_rb_pa_bf: 1;
 
-  ATTR (aligned (4), copy ((struct A *)(0))) short m_a4_pa_0;
+  ATTR (aligned (4), copy ((struct A *)(0))) short m_a4_pa_0; // { dg-warning "attribute ignored" "" { target default_packed } }
 } C;

                 reply	other threads:[~2023-03-02  1:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230302011642.BFE093858D3C@sourceware.org \
    --to=hp@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).