Skip to content

Commit 41c5775

Browse files
committed
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.
1 parent 0bd9832 commit 41c5775

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* { dg-additional-options "-std=c++20 -mlra -fpic -w " } */
2+
/* { dg-do compile } */
3+
4+
struct Trans_NS_WTF_HashMap
5+
{
6+
template <typename V> void set(int *, V);
7+
};
8+
9+
struct AscentAndDescent
10+
{
11+
float ascent;
12+
float descent;
13+
};
14+
15+
bool isRubyAnnotationBox();
16+
17+
struct EnclosingAscentDescent
18+
{
19+
float ascent;
20+
float descent;
21+
};
22+
23+
AscentAndDescent primaryFontMetricsForInlineBox();
24+
int adjustInlineBoxHeightsForLineBoxContainIfApplicable___trans_tmp_1;
25+
26+
void adjustInlineBoxHeightsForLineBoxContainIfApplicable()
27+
{
28+
Trans_NS_WTF_HashMap inlineBoxBoundsMap;
29+
auto ensureFontMetricsBasedHeight = [&](auto inlineBox)
30+
{
31+
auto [ascent, descent] = primaryFontMetricsForInlineBox();
32+
auto halfLeading = isRubyAnnotationBox() ? ascent + descent : 0.f;
33+
ascent += halfLeading;
34+
inlineBoxBoundsMap.set(&inlineBox, EnclosingAscentDescent{ascent, descent});
35+
};
36+
ensureFontMetricsBasedHeight(
37+
adjustInlineBoxHeightsForLineBoxContainIfApplicable___trans_tmp_1);
38+
}

0 commit comments

Comments
 (0)