This is a test case that fell out from our work to make the SH backend work
with LRA. The test case might currently fail, but should eventually pass
after the other SH LRA patches are in and the switch has been flipped.
Best regards,
Oleg Endo
gcc/testsuite/ChangeLog:
PR target/55212
* g++.target/sh/torture/pr55212-c413.C: New.
From 41c5775b159adb9229ece639cfad613452cb6493 Mon Sep 17 00:00:00 2001
From: Oleg Endo <[email protected]>
Date: Sat, 26 Oct 2024 18:04:25 +0900
Subject: [PATCH] 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.
---
gcc/testsuite/g++.target/sh/torture/pr55212-c413.C | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 gcc/testsuite/g++.target/sh/torture/pr55212-c413.C
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 0000000..13eb1ff
--- /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);
+}
--
libgit2 1.9.0