1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_trampoline_setup
9 * Tests nested functions
10 * The ppc and aarch64 compilers generates a call to __trampoline_setup
11 * The i386 and x86_64 compilers generate a call to ___enable_execute_stack
15 * Note that, nested functions are not ISO C and are not supported in Clang.
18 #if !defined(__clang__)
20 typedef int (*nested_func_t
)(int x
);
29 /* Define a nested function: */
30 int bar(int x
) { return x
*5 + c
*d
; };
32 /* Assign global to point to nested function
33 * (really points to trampoline). */
36 /* Invoke nested function: */
38 if ( (*proc
)(3) != 43 )
41 if ( (*proc
)(4) != 40 )