diff options
Diffstat (limited to 'clang/test/Sema/warn-unused-label.c')
-rw-r--r-- | clang/test/Sema/warn-unused-label.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Sema/warn-unused-label.c b/clang/test/Sema/warn-unused-label.c new file mode 100644 index 0000000..48370a5 --- /dev/null +++ b/clang/test/Sema/warn-unused-label.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -fsyntax-only -Wunused-label -verify %s + +void f() { + a: + goto a; + b: // expected-warning{{unused}} + c: __attribute__((unused)); + d: __attribute__((noreturn)); // expected-warning {{'noreturn' attribute only applies to functions}} + goto d; + return; +} |