Skip to content

Commit 35e94c2

Browse files
Update testvalueflow.cpp
1 parent 4569295 commit 35e94c2

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

test/testvalueflow.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class TestValueFlow : public TestFixture {
320320
}
321321

322322
#define testValueOfX(...) testValueOfX_(__FILE__, __LINE__, __VA_ARGS__)
323-
bool testValueOfX_(const char* file, int line, const char code[], unsigned int linenr, int value, const Settings *s = nullptr) {
323+
bool testValueOfX_(const char* file, int line, const char code[], unsigned int linenr, MathLib::bigint value, const Settings *s = nullptr) {
324324
const Settings *settings1 = s ? s : &settings;
325325

326326
// Tokenize..
@@ -3973,6 +3973,14 @@ class TestValueFlow : public TestFixture {
39733973
" return x;\n"
39743974
"}";
39753975
ASSERT_EQUALS(true, testValueOfX(code, 4U, 246));
3976+
3977+
code = "int64_t f() {\n"
3978+
" const int64_t val = 1LL << 33;\n"
3979+
" int64_t x = val;\n"
3980+
" x += val;\n"
3981+
" return x;\n"
3982+
"}";
3983+
ASSERT_EQUALS(true, testValueOfX(code, 5U, 1LL << 34));
39763984
}
39773985

39783986
void valueFlowForwardCorrelatedVariables() {

0 commit comments

Comments
 (0)