aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/idempotent-operations.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/idempotent-operations.c')
-rw-r--r--test/Analysis/idempotent-operations.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/test/Analysis/idempotent-operations.c b/test/Analysis/idempotent-operations.c
index 94e972c551..74d31e7239 100644
--- a/test/Analysis/idempotent-operations.c
+++ b/test/Analysis/idempotent-operations.c
@@ -9,47 +9,47 @@ void basic() {
int x = 10, zero = 0, one = 1;
// x op x
- x = x; // expected-warning {{idempotent operation; both operands are always equal in value}}
- test(x - x); // expected-warning {{idempotent operation; both operands are always equal in value}}
- x -= x; // expected-warning {{idempotent operation; both operands are always equal in value}}
+ x = x; // expected-warning {{Assigned value is always the same as the existing value}}
+ test(x - x); // expected-warning {{Both operands to '-' always have the same value}}
+ x -= x; // expected-warning {{Both operands to '-=' always have the same value}}
x = 10; // no-warning
- test(x / x); // expected-warning {{idempotent operation; both operands are always equal in value}}
- x /= x; // expected-warning {{idempotent operation; both operands are always equal in value}}
+ test(x / x); // expected-warning {{Both operands to '/' always have the same value}}
+ x /= x; // expected-warning {{Both operands to '/=' always have the same value}}
x = 10; // no-warning
- test(x & x); // expected-warning {{idempotent operation; both operands are always equal in value}}
- x &= x; // expected-warning {{idempotent operation; both operands are always equal in value}}
- test(x | x); // expected-warning {{idempotent operation; both operands are always equal in value}}
- x |= x; // expected-warning {{idempotent operation; both operands are always equal in value}}
+ test(x & x); // expected-warning {{Both operands to '&' always have the same value}}
+ x &= x; // expected-warning {{Both operands to '&=' always have the same value}}
+ test(x | x); // expected-warning {{Both operands to '|' always have the same value}}
+ x |= x; // expected-warning {{Both operands to '|=' always have the same value}}
// x op 1
- test(x * one); // expected-warning {{idempotent operation; the right operand is always 1}}
- x *= one; // expected-warning {{idempotent operation; the right operand is always 1}}
- test(x / one); // expected-warning {{idempotent operation; the right operand is always 1}}
- x /= one; // expected-warning {{idempotent operation; the right operand is always 1}}
+ test(x * one); // expected-warning {{The right operand to '*' is always 1}}
+ x *= one; // expected-warning {{The right operand to '*=' is always 1}}
+ test(x / one); // expected-warning {{The right operand to '/' is always 1}}
+ x /= one; // expected-warning {{The right operand to '/=' is always 1}}
// 1 op x
- test(one * x); // expected-warning {{idempotent operation; the left operand is always 1}}
+ test(one * x); // expected-warning {{The left operand to '*' is always 1}}
// x op 0
- test(x + zero); // expected-warning {{idempotent operation; the right operand is always 0}}
- test(x - zero); // expected-warning {{idempotent operation; the right operand is always 0}}
- test(x * zero); // expected-warning {{idempotent operation; the right operand is always 0}}
- test(x & zero); // expected-warning {{idempotent operation; the right operand is always 0}}
- test(x | zero); // expected-warning {{idempotent operation; the right operand is always 0}}
- test(x ^ zero); // expected-warning {{idempotent operation; the right operand is always 0}}
- test(x << zero); // expected-warning {{idempotent operation; the right operand is always 0}}
- test(x >> zero); // expected-warning {{idempotent operation; the right operand is always 0}}
+ test(x + zero); // expected-warning {{The right operand to '+' is always 0}}
+ test(x - zero); // expected-warning {{The right operand to '-' is always 0}}
+ test(x * zero); // expected-warning {{The right operand to '*' is always 0}}
+ test(x & zero); // expected-warning {{The right operand to '&' is always 0}}
+ test(x | zero); // expected-warning {{The right operand to '|' is always 0}}
+ test(x ^ zero); // expected-warning {{The right operand to '^' is always 0}}
+ test(x << zero); // expected-warning {{The right operand to '<<' is always 0}}
+ test(x >> zero); // expected-warning {{The right operand to '>>' is always 0}}
// 0 op x
- test(zero + x); // expected-warning {{idempotent operation; the left operand is always 0}}
- test(zero - x); // expected-warning {{idempotent operation; the left operand is always 0}}
- test(zero / x); // expected-warning {{idempotent operation; the left operand is always 0}}
- test(zero * x); // expected-warning {{idempotent operation; the left operand is always 0}}
- test(zero & x); // expected-warning {{idempotent operation; the left operand is always 0}}
- test(zero | x); // expected-warning {{idempotent operation; the left operand is always 0}}
- test(zero ^ x); // expected-warning {{idempotent operation; the left operand is always 0}}
- test(zero << x); // expected-warning {{idempotent operation; the left operand is always 0}}
- test(zero >> x); // expected-warning {{idempotent operation; the left operand is always 0}}
+ test(zero + x); // expected-warning {{The left operand to '+' is always 0}}
+ test(zero - x); // expected-warning {{The left operand to '-' is always 0}}
+ test(zero / x); // expected-warning {{The left operand to '/' is always 0}}
+ test(zero * x); // expected-warning {{The left operand to '*' is always 0}}
+ test(zero & x); // expected-warning {{The left operand to '&' is always 0}}
+ test(zero | x); // expected-warning {{The left operand to '|' is always 0}}
+ test(zero ^ x); // expected-warning {{The left operand to '^' is always 0}}
+ test(zero << x); // expected-warning {{The left operand to '<<' is always 0}}
+ test(zero >> x); // expected-warning {{The left operand to '>>' is always 0}}
}
void floats(float x) {