Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / uninit-bug-first-iteration-init.c
bloba37743ce48a69a62bfa863341a97a40ab68d4d81
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 // expected-no-diagnostics
4 int foo(void);
6 int gTotal;
8 double bar(int start, int end) {
9 int i, cnt, processed, size;
10 double result, inc;
12 result = 0;
13 processed = start;
14 size = gTotal * 2;
15 cnt = (end - start + 1) * size;
17 for (i = 0; i < cnt; i += 2) {
18 if ((i % size) == 0) {
19 inc = foo();
20 processed++;
22 result += inc * inc; // no-warning
24 return result;