diff options
Diffstat (limited to 'validation/label-scope2.c')
-rw-r--r-- | validation/label-scope2.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/validation/label-scope2.c b/validation/label-scope2.c new file mode 100644 index 00000000..44864752 --- /dev/null +++ b/validation/label-scope2.c @@ -0,0 +1,31 @@ +static void ok_lvl2(void) +{ + __label__ l; + + { + l: + goto l; + } +} + +static void ko_expr2(void) +{ + { + __label__ a; + + ({ +a: + 0; + }); + goto a; + } +} + +/* + * check-name: label-scope2 + * + * check-error-start +label-scope2.c:20:17: error: label 'a' used outside statement expression +label-scope2.c:17:1: label 'a' defined here + * check-error-end + */ |