Debian Codegraph @

gcc/testsuite/gcc.dg/pr113596.c

raw
1 /* PR middle-end/113596 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
4
5 __attribute__((noipa)) void
6 bar (char *p, int n)
7 {
8 p[0] = 1;
9 p[n - 1] = 2;
10 }
11
12 static inline __attribute__((always_inline)) void
13 foo (int n)
14 {
15 char *p = __builtin_alloca (n);
16 bar (p, n);
17 }
18
19 #if defined __AVR__
20 /* For AVR devices, AVRtest assigns 8 KiB of stack, which is not quite
21 enough for this test case. Thus request less memory on AVR. */
22 #define ALLOC 6000
23 #else
24 #define ALLOC 8192
25 #endif
26
27 int
28 main ()
29 {
30 for (int i = 2; i < ALLOC; ++i)
31 foo (i);
32 }