From fe1a4944b18b702249115935234155047a4798c4 Mon Sep 17 00:00:00 2001 From: Tom Care Date: Fri, 30 Jul 2010 21:42:31 +0000 Subject: [PATCH] Test case for PR7763. llvm-svn: 109895 --- clang/test/Analysis/idempotent-operations.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/clang/test/Analysis/idempotent-operations.c b/clang/test/Analysis/idempotent-operations.c index 74d31e72396c..d10c45f6cd94 100644 --- a/clang/test/Analysis/idempotent-operations.c +++ b/clang/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; + } + } +}