diff options
Diffstat (limited to 'clang/test/Sema/labeled-break-continue.c')
| -rw-r--r-- | clang/test/Sema/labeled-break-continue.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/clang/test/Sema/labeled-break-continue.c b/clang/test/Sema/labeled-break-continue.c index 78f81c4..6b4adc2 100644 --- a/clang/test/Sema/labeled-break-continue.c +++ b/clang/test/Sema/labeled-break-continue.c @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -std=c2y -verify -fsyntax-only -fblocks %s -// RUN: %clang_cc1 -std=c23 -verify -fsyntax-only -fblocks -fnamed-loops %s -// RUN: %clang_cc1 -x c++ -verify -fsyntax-only -fblocks -fnamed-loops %s +// RUN: %clang_cc1 -std=c2y -verify -Wunused -fsyntax-only -fblocks %s +// RUN: %clang_cc1 -std=c23 -verify -Wunused -fsyntax-only -fblocks -fnamed-loops %s +// RUN: %clang_cc1 -x c++ -verify -Wunused -fsyntax-only -fblocks -fnamed-loops %s void f1() { l1: while (true) { @@ -159,3 +159,15 @@ void f7() { continue d; // expected-error {{'continue' label does not name an enclosing loop}} } } + +void f8() { + l1: // no-warning + while (true) { + break l1; + } + + l2: // no-warning + while (true) { + continue l2; + } +} |
