mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-03 04:30:08 +08:00
26 lines
635 B
C
26 lines
635 B
C
|
/* Check semantics of various constructs to generate renamed symbols. */
|
||
|
extern int printf (const char *, ...);
|
||
|
void target(void);
|
||
|
void target(void) {
|
||
|
printf("in target function\n");
|
||
|
}
|
||
|
|
||
|
void alias_for_target(void) __attribute__((alias("target")));
|
||
|
void asm_for_target(void) __asm__("target");
|
||
|
|
||
|
/* This is not supposed to compile, alias targets must be defined in the
|
||
|
same unit. In TCC they even must be defined before the reference
|
||
|
void alias_for_undef(void) __attribute__((alias("undefined")));
|
||
|
*/
|
||
|
|
||
|
extern void inunit2(void);
|
||
|
|
||
|
int main(void)
|
||
|
{
|
||
|
target();
|
||
|
alias_for_target();
|
||
|
asm_for_target();
|
||
|
inunit2();
|
||
|
return 0;
|
||
|
}
|