https://gcc.gnu.org/g:41c5775b159adb9229ece639cfad613452cb6493
commit r16-6259-g41c5775b159adb9229ece639cfad613452cb6493 Author: Oleg Endo <[email protected]> Date: Sat Oct 26 18:04:25 2024 +0900 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: --- gcc/testsuite/g++.target/sh/torture/pr55212-c413.C | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) 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 000000000000..13eb1ff4d894 --- /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 <typename V> 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); +}
