2017-11-22 19:57:43 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2017-12-12 19:57:20 +03:00
|
|
|
#if defined _WIN32 && !defined __TINYC__
|
|
|
|
# define _ "_"
|
|
|
|
#else
|
|
|
|
# define _
|
|
|
|
#endif
|
|
|
|
|
2017-11-22 19:57:43 +03:00
|
|
|
int x3(void)
|
|
|
|
{
|
2017-12-12 19:57:20 +03:00
|
|
|
printf(" x3");
|
2017-11-22 19:57:43 +03:00
|
|
|
return 3;
|
|
|
|
}
|
2017-11-27 06:03:03 +03:00
|
|
|
|
2017-12-04 05:51:14 +03:00
|
|
|
/* That callx4 is defined globally (as if ".globl callx4")
|
|
|
|
is a TCC extension. GCC doesn't behave like this. */
|
2017-11-27 06:03:03 +03:00
|
|
|
void callx4(void);
|
2017-12-12 19:57:20 +03:00
|
|
|
__asm__(_"callx4: call "_"x4; ret;"
|
|
|
|
#ifndef __TINYC__
|
|
|
|
" .global "_"callx4"
|
|
|
|
#endif
|
|
|
|
);
|
2017-12-04 05:51:14 +03:00
|
|
|
|
|
|
|
extern void x5(void);
|
2017-12-12 19:57:20 +03:00
|
|
|
|
2017-12-04 05:51:14 +03:00
|
|
|
void callx5_again(void);
|
|
|
|
void callx5_again(void)
|
|
|
|
{
|
|
|
|
x5();
|
2017-12-12 19:57:20 +03:00
|
|
|
asm("call "_"x6");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void x6()
|
|
|
|
{
|
|
|
|
printf(" x6-2");
|
2017-12-04 05:51:14 +03:00
|
|
|
}
|