diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-04-04 03:20:02 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-05-19 13:35:28 +0200 |
| commit | 73d53c98dea2b5e1f972d8cadcf4e0f75bed30e4 (patch) | |
| tree | 593a8b6d40c1d004b7195ebef8cf46fe5d0c9b51 /validation/preprocessor | |
| parent | 4605e11d7eed1a94e3c802081e58d1e45c707f82 (diff) | |
| download | sparse-dev-73d53c98dea2b5e1f972d8cadcf4e0f75bed30e4.tar.gz | |
let -dD report macro definitions
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/preprocessor')
| -rw-r--r-- | validation/preprocessor/dump-macros-empty.c | 7 | ||||
| -rw-r--r-- | validation/preprocessor/dump-macros-multi.c | 7 | ||||
| -rw-r--r-- | validation/preprocessor/dump-macros.c | 18 |
3 files changed, 32 insertions, 0 deletions
diff --git a/validation/preprocessor/dump-macros-empty.c b/validation/preprocessor/dump-macros-empty.c new file mode 100644 index 00000000..672c66c7 --- /dev/null +++ b/validation/preprocessor/dump-macros-empty.c @@ -0,0 +1,7 @@ +/* + * check-name: dump-macros with empty file + * check-command: sparse -E -dD empty-file + * + * check-output-ignore +check-output-pattern-1-times: #define __CHECKER__ 1 + */ diff --git a/validation/preprocessor/dump-macros-multi.c b/validation/preprocessor/dump-macros-multi.c new file mode 100644 index 00000000..2f6e8d04 --- /dev/null +++ b/validation/preprocessor/dump-macros-multi.c @@ -0,0 +1,7 @@ +/* + * check-name: dump-macros with multiple files + * check-command: sparse -E -dD empty-file $file + * + * check-output-ignore +check-output-pattern-2-times: #define __CHECKER__ 1 + */ diff --git a/validation/preprocessor/dump-macros.c b/validation/preprocessor/dump-macros.c new file mode 100644 index 00000000..79f3de6a --- /dev/null +++ b/validation/preprocessor/dump-macros.c @@ -0,0 +1,18 @@ +#define ABC abc +#undef ABC + +#define DEF def +#undef DEF +#define DEF xyz + +#define NYDEF ydef +/* + * check-name: dump-macros + * check-command: sparse -E -dD -DIJK=ijk -UNDEF -UNYDEF $file + * + * check-output-ignore +check-output-pattern-1-times: #define __CHECKER__ 1 +check-output-contains: #define IJK ijk +check-output-contains: #define DEF xyz +check-output-contains: #define NYDEF ydef + */ |
