From: Oleg Endo Date: Sat, 26 Oct 2024 09:04:25 +0000 (+0900) Subject: SH: Add test case from PR55212 c#405 / c#413 / att. 59442 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41c5775b159adb9229ece639cfad613452cb6493;p=thirdparty%2Fgcc.git SH: Add test case from PR55212 c#405 / c#413 / att. 59442 gcc/testsuite/ChangeLog: PR target/55212 * g++.target/sh/torture/pr55212-c413.C: New. --- diff --git a/gcc/testsuite/g++.target/sh/torture/pr55212-c413.C b/gcc/testsuite/g++.target/sh/torture/pr55212-c413.C new file mode 100644 index 00000000000..13eb1ff4d89 --- /dev/null +++ b/gcc/testsuite/g++.target/sh/torture/pr55212-c413.C @@ -0,0 +1,38 @@ +/* { dg-additional-options "-std=c++20 -mlra -fpic -w " } */ +/* { dg-do compile } */ + +struct Trans_NS_WTF_HashMap +{ + template void set(int *, V); +}; + +struct AscentAndDescent +{ + float ascent; + float descent; +}; + +bool isRubyAnnotationBox(); + +struct EnclosingAscentDescent +{ + float ascent; + float descent; +}; + +AscentAndDescent primaryFontMetricsForInlineBox(); +int adjustInlineBoxHeightsForLineBoxContainIfApplicable___trans_tmp_1; + +void adjustInlineBoxHeightsForLineBoxContainIfApplicable() +{ + Trans_NS_WTF_HashMap inlineBoxBoundsMap; + auto ensureFontMetricsBasedHeight = [&](auto inlineBox) + { + auto [ascent, descent] = primaryFontMetricsForInlineBox(); + auto halfLeading = isRubyAnnotationBox() ? ascent + descent : 0.f; + ascent += halfLeading; + inlineBoxBoundsMap.set(&inlineBox, EnclosingAscentDescent{ascent, descent}); + }; + ensureFontMetricsBasedHeight( + adjustInlineBoxHeightsForLineBoxContainIfApplicable___trans_tmp_1); +}