From 826e6b40231e3932a802e19f9429337dc7e121cc Mon Sep 17 00:00:00 2001 From: Tom Care Date: Fri, 16 Jul 2010 20:41:41 +0000 Subject: Improved false positive rate for the idempotent operations checker and moved it into the default path-sensitive analysis options. - Added checks for static local variables, self assigned parameters, and truncating/extending self assignments - Removed command line option (now default with --analyze) - Updated test cases to pass with idempotent operation warnings llvm-svn: 108550 --- clang/test/Analysis/constant-folding.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'clang/test/Analysis/constant-folding.c') diff --git a/clang/test/Analysis/constant-folding.c b/clang/test/Analysis/constant-folding.c index 6ed2b390cf7..5a7e6be1dc1 100644 --- a/clang/test/Analysis/constant-folding.c +++ b/clang/test/Analysis/constant-folding.c @@ -18,10 +18,10 @@ void testComparisons (int a) { } void testSelfOperations (int a) { - if ((a|a) != a) WARN; - if ((a&a) != a) WARN; - if ((a^a) != 0) WARN; - if ((a-a) != 0) WARN; + if ((a|a) != a) WARN; // expected-warning{{idempotent operation}} + if ((a&a) != a) WARN; // expected-warning{{idempotent operation}} + if ((a^a) != 0) WARN; // expected-warning{{idempotent operation}} + if ((a-a) != 0) WARN; // expected-warning{{idempotent operation}} } void testIdempotent (int a) { @@ -68,5 +68,5 @@ void testLocations (char *a) { if (b!=a) WARN; if (b>a) WARN; if (b