summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/idempotent-operations.c
diff options
context:
space:
mode:
authorTom Care <tom.care@uqconnect.edu.au>2010-08-16 21:43:52 +0000
committerTom Care <tom.care@uqconnect.edu.au>2010-08-16 21:43:52 +0000
commitc129cc18f0e90af148620b9deefdb46fa3407e76 (patch)
tree05398002e78c5bfe999e6a2c8db3ee352166e297 /clang/test/Analysis/idempotent-operations.c
parente85c619980c09c420cae3ebd20d91febff3f381d (diff)
downloadbcm5719-llvm-c129cc18f0e90af148620b9deefdb46fa3407e76.tar.gz
bcm5719-llvm-c129cc18f0e90af148620b9deefdb46fa3407e76.zip
Added basic psuedoconstant checking in IdempotentOperationChecker and fixed some test cases.
llvm-svn: 111190
Diffstat (limited to 'clang/test/Analysis/idempotent-operations.c')
-rw-r--r--clang/test/Analysis/idempotent-operations.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/test/Analysis/idempotent-operations.c b/clang/test/Analysis/idempotent-operations.c
index 23401e8cdb8..a54a3aae081 100644
--- a/clang/test/Analysis/idempotent-operations.c
+++ b/clang/test/Analysis/idempotent-operations.c
@@ -74,12 +74,14 @@ void bailout() {
// False positive tests
unsigned false1() {
- return (5 - 2 - 3); // no-warning
+ int a = 10;
+ return a * (5 - 2 - 3); // no-warning
}
enum testenum { enum1 = 0, enum2 };
unsigned false2() {
- return enum1; // no-warning
+ int a = 1234;
+ return enum1 + a; // no-warning
}
extern unsigned foo();
OpenPOWER on IntegriCloud