PR tree-optimization/83369 - Missing diagnostics during inlining
[official-gcc.git] / gcc / testsuite / gcc.dg / stack-usage-2.c
blob1a9e7f3598b10ab293ff745d0f8cbb5774e422fe
1 /* { dg-do compile } */
2 /* { dg-options "-Wstack-usage=512" } */
3 /* { dg-require-effective-target untyped_assembly } */
5 int foo1 (void) /* { dg-bogus "stack usage" } */
7 char arr[16];
8 arr[0] = 1;
9 return 0;
12 int foo2 (void) /* { dg-warning "stack usage is \[0-9\]* bytes" } */
14 char arr[1024];
15 arr[0] = 1;
16 return 0;
19 /* The actual warning depends on whether stack space is allocated dynamically
20 or statically. */
21 int foo3 (void) /* { dg-warning "stack usage (might be)|(is) \[0-9\]* bytes" } */
23 char arr[1024] __attribute__((aligned (512)));
24 arr[0] = 1;
25 /* Force dynamic realignment of argument pointer. */
26 __builtin_apply ((void (*)()) foo2, 0, 0);
27 return 0;
30 int foo4 (int n) /* { dg-warning "stack usage might be unbounded" } */
32 char arr[n];
33 arr[0] = 1;
34 return 0;