diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-27 14:51:42 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-09-01 08:43:40 +0200 |
| commit | 86556e1537cb094ddd33e30d1ee451d8930246c6 (patch) | |
| tree | 9652c2374b3e9daaf766436df88665d0179e5e4c /validation/linear | |
| parent | 378ecc473f60f9d40a917dab21a4e8b51e7422c7 (diff) | |
| download | sparse-dev-86556e1537cb094ddd33e30d1ee451d8930246c6.tar.gz | |
add tescase for unreachable label in switch
or more exactly, an unreachable switch statement but containing a
reachable label. This is valid code but is curently wrongly linearized.
So, add a testcase for it.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/linear')
| -rw-r--r-- | validation/linear/unreachable-label0.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/validation/linear/unreachable-label0.c b/validation/linear/unreachable-label0.c new file mode 100644 index 00000000..568ae588 --- /dev/null +++ b/validation/linear/unreachable-label0.c @@ -0,0 +1,20 @@ +static int foo(int a) +{ + goto label; + switch(a) { + default: +label: + break; + } + return 0; +} + +/* + * check-name: unreachable-label0 + * check-command: test-linearize $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: ret\\. + * check-output-excludes: END + */ |
