PR c++/67273
[official-gcc.git] / gcc / testsuite / gcc.target / arm / pr64744-1.c
blob402930351b593b6eee7e63b598fd90ab89504386
1 /* { dg-do compile } */
2 /* { dg-require-effective-target naked_functions } */
3 /* { dg-options "-O0" } */
5 __attribute__((naked))
6 void foo1 ()
8 int aa = 0;
9 int ab = {0};
12 __attribute__((naked))
13 void foo2() {
14 char aa [ ] = {}; /* { dg-error "cannot allocate stack for variable" } */
15 char ab [1] = {};
16 char ac [2] = {}; /* { dg-error "cannot allocate stack for variable" } */
17 char ad [3] = {}; /* { dg-error "cannot allocate stack for variable" } */
20 __attribute__((naked))
21 void foo3() {
22 char aa [1] = {0};
23 char ab [2] = {0}; /* { dg-error "cannot allocate stack for variable" } */
24 char ac [3] = {0}; /* { dg-error "cannot allocate stack for variable" } */
25 char ad [4] = {0}; /* { dg-error "cannot allocate stack for variable" } */
28 __attribute__((naked))
29 void foo4() {
30 char aa [2] = {0,0}; /* { dg-error "cannot allocate stack for variable" } */
32 __attribute__((naked))
33 void foo5() {
34 char aa [3] = {0,0,0}; /* { dg-error "cannot allocate stack for variable" } */
37 __attribute__((naked))
38 void foo6() {
39 char aa [4] = {0,0,0,0}; /* { dg-error "cannot allocate stack for variable" } */