]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add testcase for already fixed PR [PR118560]
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 Jan 2025 15:53:14 +0000 (16:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 21 Jan 2025 15:53:14 +0000 (16:53 +0100)
The fix for this PR has been committed without a testcase.
The following testcase would take at least 15 minutes to compile
on a fast machine (powerpc64-linux both -m32 or -m64), now it takes
100ms.

2025-01-21  Jakub Jelinek  <jakub@redhat.com>

PR target/118560
* gcc.dg/dfp/pr118560.c: New test.

gcc/testsuite/gcc.dg/dfp/pr118560.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/dfp/pr118560.c b/gcc/testsuite/gcc.dg/dfp/pr118560.c
new file mode 100644 (file)
index 0000000..2409a1a
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR target/118560 */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+struct { _Decimal32 a; } b;
+void foo (int, _Decimal32);
+
+#define B(n) \
+void                           \
+bar##n (int, _Decimal32 d)     \
+{                              \
+  foo (n, 1);                  \
+  b.a = d;                     \
+}
+
+#define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) B(n##5) B(n##6) B(n##7) B(n##8) B(n##9)
+C(1) C(2) C(3) C(4) C(5)