[cfe-commits] r109895 - /cfe/trunk/test/Analysis/idempotent-operations.c
Tom Care
tcare at apple.com
Fri Jul 30 14:42:31 PDT 2010
Author: tcare
Date: Fri Jul 30 16:42:31 2010
New Revision: 109895
URL: http://llvm.org/viewvc/llvm-project?rev=109895&view=rev
Log:
Test case for PR7763.
Modified:
cfe/trunk/test/Analysis/idempotent-operations.c
Modified: cfe/trunk/test/Analysis/idempotent-operations.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/idempotent-operations.c?rev=109895&r1=109894&r2=109895&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/idempotent-operations.c (original)
+++ cfe/trunk/test/Analysis/idempotent-operations.c Fri Jul 30 16:42:31 2010
@@ -56,3 +56,17 @@
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;
+ }
+ }
+}
More information about the cfe-commits
mailing list