aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Care <tcare@apple.com>2010-07-30 21:42:31 +0000
committerTom Care <tcare@apple.com>2010-07-30 21:42:31 +0000
commitd85770b4ef71cf9168deb9a73f6a97d5cff1db29 (patch)
treeeb852d75bc47086ce5eb18bbb2ea8c530ce11339
parent216b2015aa44430a497262fe9d6b3641b3a344d1 (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.c14
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;
+ }
+ }
+}