PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / opt / stack2.C
blob8468e1a68832f3dd1831506cae836778fec224ba
1 // PR c++/51060
2 // { dg-options "-Os -Wframe-larger-than=2000 -Werror" }
4 // Shows a problem of not re-using stack space:
5 // Compile as: g++ -c test_stack_reuse.cpp -o /dev/null -Wframe-larger-than=2048 -Werror -Os
6 // Result: warning: the frame size of 10240 bytes is larger than 2048 bytes [-Wframe-larger-than=]
7 //
9 struct StackObject
11   StackObject();
12   char buffer[1024];
15 void Test()
17 #define TEST_SUB() \
18   StackObject();
20 #define TEST() \
21         TEST_SUB() \
22         TEST_SUB() \
23         TEST_SUB() \
24         TEST_SUB() \
25         TEST_SUB() \
26         TEST_SUB() \
27         TEST_SUB() \
28         TEST_SUB() \
29         TEST_SUB() \
30         TEST_SUB()
32   TEST()