summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/constant-folding.c
diff options
context:
space:
mode:
authorTom Care <tcare@apple.com>2010-07-16 20:41:41 +0000
committerTom Care <tcare@apple.com>2010-07-16 20:41:41 +0000
commit826e6b40231e3932a802e19f9429337dc7e121cc (patch)
treed8155de320d8029b083373b452c13813cb0fd351 /clang/test/Analysis/constant-folding.c
parentfee4dafbd049fe23c72129f44f70cc6414aab0fd (diff)
downloadbcm5719-llvm-826e6b40231e3932a802e19f9429337dc7e121cc.tar.gz
bcm5719-llvm-826e6b40231e3932a802e19f9429337dc7e121cc.zip
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
Diffstat (limited to 'clang/test/Analysis/constant-folding.c')
-rw-r--r--clang/test/Analysis/constant-folding.c10
1 files changed, 5 insertions, 5 deletions
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<a) WARN;
- if (b-a) WARN;
+ if (b-a) WARN; // expected-warning{{idempotent operation}}
}
OpenPOWER on IntegriCloud