diff options
Diffstat (limited to 'test/Analysis/analyzer-stats.c')
-rw-r--r-- | test/Analysis/analyzer-stats.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/Analysis/analyzer-stats.c b/test/Analysis/analyzer-stats.c index 5a40d196bb1f..b58e862f6c65 100644 --- a/test/Analysis/analyzer-stats.c +++ b/test/Analysis/analyzer-stats.c @@ -1,4 +1,4 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,deadcode.DeadStores,debug.Stats -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,deadcode.DeadStores,debug.Stats -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks -analyzer-max-loop 4 %s int foo(); @@ -12,3 +12,19 @@ int test() { // expected-warning-re{{test -> Total CFGBlocks: {{[0-9]+}} | Unrea a /= 4; return a; } + + +int sink() // expected-warning-re{{sink -> Total CFGBlocks: {{[0-9]+}} | Unreachable CFGBlocks: 1 | Exhausted Block: yes | Empty WorkList: yes}} +{ + for (int i = 0; i < 10; ++i) // expected-warning {{(sink): The analyzer generated a sink at this point}} + ++i; + + return 0; +} + +int emptyConditionLoop() // expected-warning-re{{emptyConditionLoop -> Total CFGBlocks: {{[0-9]+}} | Unreachable CFGBlocks: 0 | Exhausted Block: yes | Empty WorkList: yes}} +{ + int num = 1; + for (;;) + num++; +} |