diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
| commit | 268a53de823a6750d6256ee1fb1e7707b4b45740 (patch) | |
| tree | 42c1799a9a82b2f7d9790ee9fe181d72a7274751 /support/valdiag/tests/funcdec.c | |
| download | sdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz | |
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'support/valdiag/tests/funcdec.c')
| -rw-r--r-- | support/valdiag/tests/funcdec.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/support/valdiag/tests/funcdec.c b/support/valdiag/tests/funcdec.c new file mode 100644 index 0000000..c2e10bb --- /dev/null +++ b/support/valdiag/tests/funcdec.c @@ -0,0 +1,48 @@ + +#ifdef TEST1 +void foo(void); /* IGNORE */ +int foo(void) { } /* ERROR */ +#endif + +#ifdef TEST2 +void foo(void); /* IGNORE */ +void foo(int a) {a; } /* ERROR */ +#endif + + +#ifdef TEST3 +void foo(int); /* IGNORE */ +void foo(int a, int b) {a;b; } /* ERROR */ +#endif + +#ifdef TEST4 +void foo(int, int); /* IGNORE */ +void foo(int a) {a; } /* ERROR */ +#endif + +#if defined(__SDCC) && defined(__has_reentrant) +#define REENTRANT __reentrant +#define HAS_REENTRANT 1 +#else +#define REENTRANT +#define HAS_REENTRANT 0 +#endif + +#ifdef TEST5 +void foo(int, int) REENTRANT; /* IGNORE */ +#if HAS_REENTRANT +void foo(int a, int b) {a; b;} /* ERROR(SDCC && __has_reentrant && !SDCC_STACK_AUTO) */ +#endif +#endif + +#ifdef TEST6 +void foo(int a=1) /* ERROR */ +{ +} +#endif + +#ifdef TEST7 +void foo(static int a) /* ERROR */ +{ +} +#endif |
