fix: respect CFLAGS from environment, or set defaults
[tinycc.git] / tests / tests2 / 120_alias.c
blob35bd44f8cf1742376b83aa24bdc004675bc89fef
1 /* Check semantics of various constructs to generate renamed symbols. */
3 extern int printf (const char *, ...);
4 void target(void);
5 void target(void) {
6 printf("in target function\n");
8 void alias_for_target(void) __attribute__((alias("target")));
10 int g_int = 34;
11 int alias_int __attribute__((alias("g_int")));
13 #ifdef __leading_underscore
14 # define _ "_"
15 #else
16 # define _
17 #endif
19 void asm_for_target(void) __asm__(_"target");
20 int asm_int __asm__(_"g_int");
22 /* This is not supposed to compile, alias targets must be defined in the
23 same unit. In TCC they even must be defined before the reference
24 void alias_for_undef(void) __attribute__((alias("undefined")));
27 extern void inunit2(void);
29 int main(void)
31 target();
32 alias_for_target();
33 asm_for_target();
34 printf("g_int = %d\nalias_int = %d\nasm_int = %d\n", g_int, alias_int, asm_int);
35 inunit2();
36 return 0;