mirror of
https://github.com/mirror/tinycc.git
synced 2026-09-05 12:14:52 +08:00
Fix function types
various cases of function type uses were broken by recent attribute refactoring, this fixes and adds testcases for them.
This commit is contained in:
@@ -44,4 +44,22 @@ extern const int cb[1][2][3];
|
||||
extern B b;
|
||||
extern int b[1][2][3];
|
||||
|
||||
/* Funny but valid function declaration. */
|
||||
typedef int functype (int);
|
||||
extern functype func;
|
||||
int func(int i)
|
||||
{
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
/* Even funnier function decl and definition using typeof. */
|
||||
int set_anon_super(void);
|
||||
int set_anon_super(void)
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
typedef int sas_type (void);
|
||||
extern typeof(set_anon_super) set_anon_super;
|
||||
extern sas_type set_anon_super;
|
||||
|
||||
/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
|
||||
|
||||
@@ -11,4 +11,9 @@ typedef union __attribute__((packed)) Unaligned16b {
|
||||
uint8_t b[2];
|
||||
} Unaligned16b;
|
||||
|
||||
extern void foo (void) __attribute__((stdcall));
|
||||
void __attribute__((stdcall)) foo (void)
|
||||
{
|
||||
}
|
||||
|
||||
int main () { return 0; }
|
||||
|
||||
Reference in New Issue
Block a user