diff mbox series

[avr,applied] Make gcc.dg/pr113596.c work on AVR

Message ID 4277e3a8-3577-4a4c-a034-51472460a574@gjlay.de
State New
Headers show
Series [avr,applied] Make gcc.dg/pr113596.c work on AVR | expand

Commit Message

Georg-Johann Lay Oct. 2, 2024, 4:47 p.m. UTC
gcc.dg/pr113596.c alloca'tes  up to 8 KiB on stack,
which is too much for AVR.  This patch requests less
memory on AVR.

Johann

--

     AVR: Make gcc.dg/pr113596.c work.

     gcc/testsuite/
             * gcc.dg/pr113596.c: Require less memory so it works on AVR.
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/pr113596.c 
b/gcc/testsuite/gcc.dg/pr113596.c
index 19e0ab6dc46..3655ffef3f9 100644
--- a/gcc/testsuite/gcc.dg/pr113596.c
+++ b/gcc/testsuite/gcc.dg/pr113596.c
@@ -16,9 +16,17 @@  foo (int n)
    bar (p, n);
  }

+#if defined __AVR__
+/* For AVR devices, AVRtest assigns 8 KiB of stack, which is not quite
+   enough for this test case.  Thus request less memory on AVR.  */
+#define ALLOC 6000
+#else
+#define ALLOC 8192
+#endif
+
  int
  main ()
  {
-  for (int i = 2; i < 8192; ++i)
+  for (int i = 2; i < ALLOC; ++i)
      foo (i);
  }