diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Analysis/identical-expressions.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Analysis/identical-expressions.cpp b/clang/test/Analysis/identical-expressions.cpp index 950cdd93ff4..e1f51af7c6f 100644 --- a/clang/test/Analysis/identical-expressions.cpp +++ b/clang/test/Analysis/identical-expressions.cpp @@ -1287,6 +1287,17 @@ void test_identical_branches_while(bool b) { } } +void test_identical_branches_while_2(bool b) { + int i = 10; + if (b) { // no-warning + while (func()) + i--; + } else { + while (func()) + i++; + } +} + void test_identical_branches_do_while(bool b) { int i = 10; if (b) { // expected-warning {{true and false branches are identical}} |