bolt/deps/llvm-18.1.8/clang/test/Sema/warn-unreachable-fallthrough.c
2025-02-14 19:21:04 +01:00

13 lines
597 B
C

// RUN: %clang_cc1 -fsyntax-only -verify -std=c2x -Wunreachable-code-fallthrough %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c2x -Wunreachable-code %s
// RUN: %clang_cc1 -fsyntax-only -verify=code -std=c2x -Wunreachable-code -Wno-unreachable-code-fallthrough %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c2x -Wno-unreachable-code -Wunreachable-code-fallthrough %s
int n;
void f(void){
switch (n){
[[fallthrough]]; // expected-warning{{fallthrough annotation in unreachable code}}
// code-warning@-1{{never be executed}}
case 1:;
}
}