diff options
author | pommicket <pommicket@gmail.com> | 2022-02-18 12:36:57 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-02-18 12:36:57 -0500 |
commit | 826d1afd58c2e064a9c8fdb09eda1b08469de1a8 (patch) | |
tree | b4fedc589a1944f6cf3f451a9db976b431e89b25 /05/tcc-0.9.27/tests/asm-c-connect-2.c | |
parent | c42c5d94b8944e19cd17a5b540e4c70013c62b92 (diff) |
newer version of tcc almost working
Diffstat (limited to '05/tcc-0.9.27/tests/asm-c-connect-2.c')
-rw-r--r-- | 05/tcc-0.9.27/tests/asm-c-connect-2.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/05/tcc-0.9.27/tests/asm-c-connect-2.c b/05/tcc-0.9.27/tests/asm-c-connect-2.c new file mode 100644 index 0000000..3440b40 --- /dev/null +++ b/05/tcc-0.9.27/tests/asm-c-connect-2.c @@ -0,0 +1,36 @@ +#include <stdio.h> + +#if defined _WIN32 && !defined __TINYC__ +# define _ "_" +#else +# define _ +#endif + +int x3(void) +{ + printf(" x3"); + return 3; +} + +/* That callx4 is defined globally (as if ".globl callx4") + is a TCC extension. GCC doesn't behave like this. */ +void callx4(void); +__asm__(_"callx4: call "_"x4; ret;" +#ifndef __TINYC__ + " .global "_"callx4" +#endif +); + +extern void x5(void); + +void callx5_again(void); +void callx5_again(void) +{ + x5(); + asm("call "_"x6"); +} + +static void x6() +{ + printf(" x6-2"); +} |