]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
SH: Add test case from PR55212 c#405 / c#413 / att. 59442
authorOleg Endo <olegendo@gcc.gnu.org>
Sat, 26 Oct 2024 09:04:25 +0000 (18:04 +0900)
committerOleg Endo <olegendo@gcc.gnu.org>
Fri, 19 Dec 2025 01:02:15 +0000 (10:02 +0900)
gcc/testsuite/ChangeLog:

PR target/55212
* g++.target/sh/torture/pr55212-c413.C: New.

gcc/testsuite/g++.target/sh/torture/pr55212-c413.C [new file with mode: 0644]

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 (file)
index 0000000..13eb1ff
--- /dev/null
@@ -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);
+}