fixup! riscv: Implement large addend for global address
[tinycc.git] / tests / asm-c-connect-2.c
blob654db0e33adc57840f57160296cc93411ee9d9f5
1 #include <stdio.h>
3 #if (defined _WIN32 || defined __APPLE__) && (!defined __TINYC__ || defined __leading_underscore)
4 # define _ "_"
5 #else
6 # define _
7 #endif
9 #ifdef __clang__
10 /* clang needs some help tp not throw functions away even at -O0 */
11 #define __USED __attribute__((__used__))
12 #else
13 #define __USED
14 #endif
16 int x3(void)
18 printf(" x3");
19 return 3;
22 /* That callx4 is defined globally (as if ".globl callx4")
23 is a TCC extension. GCC doesn't behave like this. */
24 void callx4(void);
25 #if __i386__
26 __asm__(_"callx4: call "_"x4; ret;"
27 #else
28 /* Keep stack aligned */
29 __asm__(_"callx4: sub $8,%rsp; call "_"x4; add $8,%rsp; ret;"
30 #endif
31 #ifndef __TINYC__
32 " .global "_"callx4"
33 #endif
36 extern void x5(void);
38 void callx5_again(void);
39 void callx5_again(void)
41 x5();
42 asm("call "_"x6");
45 static void __USED x6()
47 printf(" x6-2");