bolt/deps/llvm-18.1.8/clang/test/Analysis/uninit-exhaustive-switch-bug.c
2025-02-14 19:21:04 +01:00

18 lines
286 B
C

// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
// expected-no-diagnostics
int rand(void);
void test(void) {
int offset = 0;
int value;
int test = rand();
switch (test & 0x1) {
case 0:
case 1:
value = 0;
break;
}
offset += value; // no-warning
}