forked from OSchip/llvm-project
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:
parent
4413714946
commit
3ebd7dea7e
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue