diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-09-15 11:09:23 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-11-13 14:16:51 +0100 |
| commit | 22eaf158a163d38f724df20efdf8a5e5ee68c58e (patch) | |
| tree | e4120d75fd6ae857371ca26adfc0a8b3680c4dad /validation | |
| parent | 49c9826c0fd56accf19fa3090a7ad4acaef95017 (diff) | |
| download | sparse-dev-22eaf158a163d38f724df20efdf8a5e5ee68c58e.tar.gz | |
add testcase for return & inline
The linearization of 'return' statements must correctly take
in account some implementation details of the inlining.
As such, it deserves its own testcase.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/linear/inline-return.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/validation/linear/inline-return.c b/validation/linear/inline-return.c new file mode 100644 index 00000000..b1e4d844 --- /dev/null +++ b/validation/linear/inline-return.c @@ -0,0 +1,24 @@ +static inline int def(void) +{ + return 1; +} + +int foo(void) +{ + return def(); +} + +int bar(void) +{ + return def(); + return 0; +} + +/* + * check-name: inline-return.c + * check-command: test-linearize -fdump-ir=linearize -Wno-decl $file + * + * check-output-ignore + * check-output-contains: ret\\..*\\$1 + * check-output-excludes: ret\\..*\\$0 + */ |
