Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-2.c @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 /* PR target/93047 */ | |
2 /* Originator: Andrew Church <gcczilla@achurch.org> */ | |
3 /* { dg-do run } */ | |
4 /* { dg-additional-options "-O3 -frename-registers" } */ | |
5 /* { dg-require-effective-target untyped_assembly } */ | |
6 | |
7 #ifdef __MMIX__ | |
8 /* No parameters on stack for bar. */ | |
9 #define STACK_ARGUMENTS_SIZE 0 | |
10 #else | |
11 #define STACK_ARGUMENTS_SIZE 64 | |
12 #endif | |
13 | |
14 extern void abort(void); | |
15 | |
16 int foo(int n) | |
17 { | |
18 return n+1; | |
19 } | |
20 | |
21 int bar(int n) | |
22 { | |
23 __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(), | |
24 STACK_ARGUMENTS_SIZE)); | |
25 } | |
26 | |
27 int main(void) | |
28 { | |
29 /* Allocate 64 bytes on the stack to make sure that __builtin_apply | |
30 can read at least 64 bytes above the return address. */ | |
31 char dummy[64]; | |
32 | |
33 __asm__ ("" : : "" (dummy)); | |
34 | |
35 if (bar(1) != 2) | |
36 abort(); | |
37 | |
38 return 0; | |
39 } | |
40 |