diff options
Diffstat (limited to 'validation/linear/label-stmt-dropped.c')
-rw-r--r-- | validation/linear/label-stmt-dropped.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/validation/linear/label-stmt-dropped.c b/validation/linear/label-stmt-dropped.c new file mode 100644 index 00000000..74e0f2e6 --- /dev/null +++ b/validation/linear/label-stmt-dropped.c @@ -0,0 +1,26 @@ +/* + * Verify that the statement following an unused label + * is not discarded with the label. + */ + +static int bad(int a, int b) +{ + int r = 0; + +start: + r += a; + r += b; + + if (!r) + goto start; + return r; +} + +/* + * check-name: label-stmt-dropped + * check-command: test-linearize $file + * + * check-output-ignore + * check-output-contains: add + * check-output-contains: %arg1 + */ |