Initial import of libdpf.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
e4e666f459
4563 changed files with 1690372 additions and 0 deletions
32
thirdparty/hedley/test/unreachable.c
vendored
Normal file
32
thirdparty/hedley/test/unreachable.c
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "../hedley.h"
|
||||
|
||||
#if HEDLEY_HAS_WARNING("-Wcovered-switch-default")
|
||||
# pragma clang diagnostic warning "-Wcovered-switch-default"
|
||||
#endif
|
||||
|
||||
enum Foo {
|
||||
FOO_BAR,
|
||||
FOO_BAZ,
|
||||
FOO_QUX,
|
||||
FOO_QUUX
|
||||
};
|
||||
|
||||
static int test_unreachable(enum Foo code) {
|
||||
switch (code) {
|
||||
case FOO_BAR:
|
||||
case FOO_BAZ:
|
||||
case FOO_QUX:
|
||||
return 0;
|
||||
case FOO_QUUX:
|
||||
default:
|
||||
HEDLEY_UNREACHABLE();
|
||||
}
|
||||
|
||||
HEDLEY_UNREACHABLE_RETURN(0);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
test_unreachable(FOO_BAR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue