1 # AC_CHECK_FASTCALL([if-ok],[if-notok])
2 # Test if the compiler recognizes __attribute__((regparm(3))) - we don't
3 # currently check if it actually works correctly, but probably should...
4 # -----------------------
5 AC_DEFUN([AC_CHECK_FASTCALL], [
6 AC_MSG_CHECKING([support for fastcall calling conventions]);
9 int __attribute__((regparm(3))) foo(int a, int b) { return a+b; }
11 int main(int argc, char *argv[])
13 return foo( 1, 2 ) == 3 ? 0 : 1;
21 # AC_CHECK_FRAME_ADDRESS([if-ok],[if-notok])
22 # Test if the compiler will let us modify the return address on the stack
23 # via __builtin_frame_address()
24 # -----------------------
25 AC_DEFUN([AC_CHECK_FRAME_ADDRESS], [
26 AC_MSG_CHECKING([if we have a working __builtin_frame_address()]);
29 void * __attribute__((noinline)) first_arg( void *x, void *y ) { return x; }
30 int __attribute__((noinline)) foo( int arg, void *exc )
33 *(((void **)__builtin_frame_address(0))+1) = exc;
38 int main(int argc, char *argv[])
40 goto *first_arg(&&start, &&except);
43 return foo( argc, &&except ) + 1;
.