Add a test case for compound assignments that lazily symbolicate the value of the LHS when the computation type is an integer of more bits.

llvm-svn: 59352
This commit is contained in:
Ted Kremenek 2008-11-15 04:44:13 +00:00
parent 4413714946
commit 3ebd7dea7e
1 changed files with 20 additions and 0 deletions

View File

@ -114,3 +114,23 @@ int f9b(unsigned len) {
return *p++; // no-warning
}
int* f10(int* p, signed char x, int y) {
// This line tests symbolication with compound assignments where the
// LHS and RHS have different bitwidths. The new symbolic value
// for 'x' should have a bitwidth of 8.
x &= y;
// This tests that our symbolication worked, and that we correctly test
// x against 0 (with the same bitwidth).
if (!x) {
if (!p) return;
*p = 10;
}
else p = 0;
if (!x)
*p = 5; // no-warning
return p;
}