summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/constant-folding.c
diff options
context:
space:
mode:
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