testsuite: i386: adapt to -std=gnu23 default change
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / frame-addr2.c
blobf6f9687a0ad5039c82ff48c4edcac116f8d175c0
1 /* builtin_frame_address(n) with n>0 has always been troublesome. */
3 /* { dg-do run } */
4 /* { dg-options "-O3 -fno-optimize-sibling-calls -mbackchain" } */
6 #ifdef __s390x__
7 #define SAVE_AREA_SIZE 160
8 #else
9 #define SAVE_AREA_SIZE 96
10 #endif
11 extern void abort(void);
13 #define EXPAND_CHECK(n) \
14 void __attribute__((noinline)) \
15 foo1_##n (void *p) \
16 { \
17 if (p - __builtin_frame_address (n) != SAVE_AREA_SIZE) \
18 abort (); \
19 } \
20 void __attribute__((noinline)) \
21 foo2_##n (void *p) \
22 { \
23 if (p - __builtin_frame_address (n) != SAVE_AREA_SIZE) \
24 abort (); \
25 foo1_##n (__builtin_frame_address (n)); \
26 } \
27 void __attribute__((noinline)) \
28 foo3_##n () \
29 { \
30 foo2_##n (__builtin_frame_address (n)); \
31 } \
32 void __attribute__((noinline)) \
33 foo4_##n () \
34 { \
35 foo3_##n (); \
38 EXPAND_CHECK (0)
39 EXPAND_CHECK (1)
40 EXPAND_CHECK (2)
42 int
43 main ()
45 foo4_0 ();
46 foo4_1 ();
47 foo4_2 ();
49 return 0;