diff options
Diffstat (limited to 'test/Analysis/bitwise-ops.c')
-rw-r--r-- | test/Analysis/bitwise-ops.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/Analysis/bitwise-ops.c b/test/Analysis/bitwise-ops.c index fe546580be3d..fcd3d7dbc7cf 100644 --- a/test/Analysis/bitwise-ops.c +++ b/test/Analysis/bitwise-ops.c @@ -8,9 +8,8 @@ void testPersistentConstraints(int x, int y) { CHECK(x); // expected-warning{{TRUE}} CHECK(x & 1); // expected-warning{{TRUE}} - // False positives due to SValBuilder giving up on certain kinds of exprs. - CHECK(1 - x); // expected-warning{{UNKNOWN}} - CHECK(x & y); // expected-warning{{UNKNOWN}} + CHECK(1 - x); // expected-warning{{TRUE}} + CHECK(x & y); // expected-warning{{TRUE}} } int testConstantShifts_PR18073(int which) { @@ -51,3 +50,9 @@ int testNegativeLeftShift(int a) { } return 0; } + +int testUnrepresentableLeftShift(int a) { + if (a == 8) + return a << 30; // expected-warning{{The result of the left shift is undefined due to shifting '8' by '30', which is unrepresentable in the unsigned version of the return type 'int'}} + return 0; +} |