PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-return-1.c
blobedcec9767a7b60de9b06b9b0389e8bde8dbe25f5
1 /* PR middle-end/11151 */
2 /* Originator: Andrew Church <gcczilla@achurch.org> */
3 /* { dg-do run } */
4 /* { dg-xfail-run-if "PR36571 untyped return is char register" { "avr-*-*" } } */
5 /* { dg-require-effective-target untyped_assembly } */
6 /* This used to fail on SPARC because the (undefined) return
7 value of 'bar' was overwriting that of 'foo'. */
9 extern void abort(void);
11 int foo(int n)
13 return n+1;
16 int bar(int n)
18 __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(), 64));
21 char *g;
23 int main(void)
25 /* Allocate 64 bytes on the stack to make sure that __builtin_apply
26 can read at least 64 bytes above the return address. */
27 char dummy[64];
29 g = dummy;
31 if (bar(1) != 2)
32 abort();
34 return 0;