diff options
author | Tom Care <tcare@apple.com> | 2010-07-30 21:42:31 +0000 |
---|---|---|
committer | Tom Care <tcare@apple.com> | 2010-07-30 21:42:31 +0000 |
commit | d85770b4ef71cf9168deb9a73f6a97d5cff1db29 (patch) | |
tree | eb852d75bc47086ce5eb18bbb2ea8c530ce11339 | |
parent | 216b2015aa44430a497262fe9d6b3641b3a344d1 (diff) |
Test case for PR7763.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109895 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Analysis/idempotent-operations.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Analysis/idempotent-operations.c b/test/Analysis/idempotent-operations.c index 74d31e7239..d10c45f6cd 100644 --- a/test/Analysis/idempotent-operations.c +++ b/test/Analysis/idempotent-operations.c @@ -56,3 +56,17 @@ void floats(float x) { test_f(x * 1.0); // no-warning test_f(x * 1.0F); // no-warning } + +// Ensure that we don't report false poitives on complex loops +void bailout() { + int unused, result = 4; + int numbers[5] = { 0, 32, 'x', 128, 255 }; + + for (int bg = 0; bg < 5; bg ++) { + result += numbers[bg]; // no-warning + + for (int i = 0; i < 256; i++) { + unused = i; + } + } +} |