Added basic psuedoconstant checking in IdempotentOperationChecker and fixed some test cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111190 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/idempotent-operations.c b/test/Analysis/idempotent-operations.c
index 23401e8..a54a3aa 100644
--- a/test/Analysis/idempotent-operations.c
+++ b/test/Analysis/idempotent-operations.c
@@ -74,12 +74,14 @@
// 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();