public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-7951] testsuite: Add further zero size elt passing tests [PR102024] Date: Fri, 1 Apr 2022 09:50:13 +0000 (GMT) [thread overview] Message-ID: <20220401095013.734773858D28@sourceware.org> (raw) https://gcc.gnu.org/g:e0ce885851dfd926c0cfe6f23a2debc87ea2bb9d commit r12-7951-ge0ce885851dfd926c0cfe6f23a2debc87ea2bb9d Author: Jakub Jelinek <jakub@redhat.com> Date: Fri Apr 1 11:49:40 2022 +0200 testsuite: Add further zero size elt passing tests [PR102024] As discussed in PR102024, zero width bitfields might not be the only ones causing ABI issues at least on mips, zero size arrays or (in C only) zero sized (empty) structures can be problematic too. The following patch adds some coverage for it too. Tested on x86_64-linux with make check-gcc check-g++ RUNTESTFLAGS='ALT_CC_UNDER_TEST=gcc ALT_CXX_UNDER_TEST=g++ --target_board=unix\{-m32,-m64\} compat.exp=pr102024*' make check-gcc check-g++ RUNTESTFLAGS='ALT_CC_UNDER_TEST=clang ALT_CXX_UNDER_TEST=clang++ --target_board=unix\{-m32,-m64\} compat.exp=pr102024*' with gcc/g++ 10.3 and clang 11. Everything but (expectedly) FAIL: gcc.dg/compat/pr102024 c_compat_x_tst.o-c_compat_y_alt.o execute FAIL: gcc.dg/compat/pr102024 c_compat_x_alt.o-c_compat_y_tst.o execute for -m64 ALT_CC_UNDER_TEST=gcc passes. 2022-04-01 Jakub Jelinek <jakub@redhat.com> PR target/102024 * gcc.dg/compat/pr102024_test.h: Add further tests with zero sized structures and arrays. * g++.dg/compat/pr102024_test.h: Add further tests with zero sized arrays. Diff: --- gcc/testsuite/g++.dg/compat/pr102024_test.h | 6 ++++++ gcc/testsuite/gcc.dg/compat/pr102024_test.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/testsuite/g++.dg/compat/pr102024_test.h b/gcc/testsuite/g++.dg/compat/pr102024_test.h index d8f4103f63c..488a8ea188a 100644 --- a/gcc/testsuite/g++.dg/compat/pr102024_test.h +++ b/gcc/testsuite/g++.dg/compat/pr102024_test.h @@ -4,3 +4,9 @@ T(2,int:0;float a;,F(2,a,2.25f,16.5f)) T(3,double a;long long:0;double b;,F(3,a,42.0,43.125)F(3,b,-17.5,35.75)) T(4,double a;long long:0;,F(4,a,1.0,17.125)) T(5,long long:0;double a;,F(5,a,2.25,16.5)) +T(6,float a;struct{}b[0];float c;,F(6,a,42.0f,43.125f)F(6,c,-17.5f,35.75f)) +T(7,float a;struct{}b[0];;,F(7,a,1.0f,17.125f)) +T(8,int a[0];float b;,F(8,b,2.25f,16.5f)) +T(9,double a;long long b[0];double c;,F(9,a,42.0,43.125)F(9,c,-17.5,35.75)) +T(10,double a;struct{}b[0];,F(10,a,1.0,17.125)) +T(11,struct{}a[0];double b;,F(11,b,2.25,16.5)) diff --git a/gcc/testsuite/gcc.dg/compat/pr102024_test.h b/gcc/testsuite/gcc.dg/compat/pr102024_test.h index d8f4103f63c..d610dbdf54f 100644 --- a/gcc/testsuite/gcc.dg/compat/pr102024_test.h +++ b/gcc/testsuite/gcc.dg/compat/pr102024_test.h @@ -4,3 +4,9 @@ T(2,int:0;float a;,F(2,a,2.25f,16.5f)) T(3,double a;long long:0;double b;,F(3,a,42.0,43.125)F(3,b,-17.5,35.75)) T(4,double a;long long:0;,F(4,a,1.0,17.125)) T(5,long long:0;double a;,F(5,a,2.25,16.5)) +T(6,float a;struct{}b;float c;,F(6,a,42.0f,43.125f)F(6,c,-17.5f,35.75f)) +T(7,float a;struct{}b[0];;,F(7,a,1.0f,17.125f)) +T(8,int a[0];float b;,F(8,b,2.25f,16.5f)) +T(9,double a;long long b[0];double c;,F(9,a,42.0,43.125)F(9,c,-17.5,35.75)) +T(10,double a;struct{}b;,F(10,a,1.0,17.125)) +T(11,struct{}a[0];double b;,F(11,b,2.25,16.5))
reply other threads:[~2022-04-01 9:50 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=20220401095013.734773858D28@sourceware.org \ --to=jakub@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: linkBe 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).