xref: /llvm-project/clang/test/Analysis/uninit-exhaustive-switch-bug.c (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 // expected-no-diagnostics
3 
4 int rand(void);
5 
test(void)6 void test(void) {
7   int offset = 0;
8   int value;
9   int test = rand();
10   switch (test & 0x1) {
11   case 0:
12   case 1:
13     value = 0;
14     break;
15   }
16 
17   offset += value; // no-warning
18 }
19