]> granicus.if.org Git - clang/commitdiff
Test case for PR7763.
authorTom Care <tcare@apple.com>
Fri, 30 Jul 2010 21:42:31 +0000 (21:42 +0000)
committerTom Care <tcare@apple.com>
Fri, 30 Jul 2010 21:42:31 +0000 (21:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109895 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/idempotent-operations.c

index 74d31e72396c5aef321c55d473ad29ac85e2fe4b..d10c45f6cd946b3631a1e432366be347813973a4 100644 (file)
@@ -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;
+    }
+  }
+}