diff options
| author | Michael Matz <matz@suse.de> | 2017-07-14 17:42:48 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2017-07-14 17:42:48 +0200 |
| commit | 04418c7addb757e80b09c94eb3553b131bcf4de8 (patch) | |
| tree | 6ce677b8e0f40ca982fd7a98e3344bf0da09dae2 /tests/tests2 | |
| parent | 2acb04f7f2077a4cff103421d79ceee48441918a (diff) | |
| download | tinycc-04418c7addb757e80b09c94eb3553b131bcf4de8.tar.gz tinycc-04418c7addb757e80b09c94eb3553b131bcf4de8.tar.bz2 | |
Fix function types
various cases of function type uses were broken by recent
attribute refactoring, this fixes and adds testcases for them.
Diffstat (limited to 'tests/tests2')
| -rw-r--r-- | tests/tests2/39_typedef.c | 18 | ||||
| -rw-r--r-- | tests/tests2/82_attribs_position.c | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/tests2/39_typedef.c b/tests/tests2/39_typedef.c index 3878b9c..da73f71 100644 --- a/tests/tests2/39_typedef.c +++ b/tests/tests2/39_typedef.c @@ -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 :*/ diff --git a/tests/tests2/82_attribs_position.c b/tests/tests2/82_attribs_position.c index 45039b3..7c9f987 100644 --- a/tests/tests2/82_attribs_position.c +++ b/tests/tests2/82_attribs_position.c @@ -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; } |
