From: Hans-Peter Nilsson Date: Wed, 1 Feb 2023 13:56:47 +0000 (+0100) Subject: libstdc++ testsuite: Correct S0 in std/time/hh_mm_ss/1.cc X-Git-Tag: basepoints/gcc-14~1574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a939dd835798efd40b78f7c0070177616e3f36d3;p=thirdparty%2Fgcc.git libstdc++ testsuite: Correct S0 in std/time/hh_mm_ss/1.cc For targets where the ABI mandates structure layout that has no padding, like cris-elf, this test started failing when introduced as an add-on to the existing 1.cc, thereby effectively causing a regression in testsuite results. Adding an empty structure to S0, corresponds better to the layout of hh_mm_ss. PR testsuite/108632 * testsuite/std/time/hh_mm_ss/1.cc (size): Add empty struct at end of S0. --- diff --git a/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc b/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc index d97a9057f472..f8a3e115af39 100644 --- a/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc +++ b/libstdc++-v3/testsuite/std/time/hh_mm_ss/1.cc @@ -103,7 +103,7 @@ size() { using namespace std::chrono; - struct S0 { long long h; char m; char s; bool neg; }; + struct S0 { long long h; char m; char s; bool neg; struct { } empty; }; static_assert(sizeof(hh_mm_ss) == sizeof(S0)); struct S1 { long long h; char m; char s; bool neg; char ss; }; static_assert(sizeof(hh_mm_ss>) == sizeof(S1));