Move code

This commit is contained in:
Daniel Marjamäki 2018-01-11 14:27:41 +01:00
parent 6fd157e93b
commit 1b13490ac1
1 changed files with 12 additions and 13 deletions

View File

@ -2017,6 +2017,18 @@ private:
"}\n"; "}\n";
ASSERT_EQUALS(false, testValueOfX(code, 3U, 0)); ASSERT_EQUALS(false, testValueOfX(code, 3U, 0));
// Ticket #7139
// "<<" in third expression of for
code = "void f(void) {\n"
" int bit, x;\n"
" for (bit = 1, x = 0; bit < 128; bit = bit << 1, x++) {\n"
" z = x;\n" // <- known value [0..6]
" }\n"
"}\n";
ASSERT_EQUALS(true, testValueOfX(code, 4U, 0));
ASSERT_EQUALS(true, testValueOfX(code, 4U, 6));
ASSERT_EQUALS(false, testValueOfX(code, 4U, 7));
// && // &&
code = "void foo() {\n" code = "void foo() {\n"
" for (int x = 0; x < 10; x++) {\n" " for (int x = 0; x < 10; x++) {\n"
@ -2610,19 +2622,6 @@ private:
ASSERT_EQUALS(0, value.intvalue); ASSERT_EQUALS(0, value.intvalue);
ASSERT(value.isKnown()); ASSERT(value.isKnown());
// Ticket #7139
// "<<" in third expression of for
code = "void f(void) {\n"
" int bit, x;\n"
" for (bit = 1, x = 0; bit < 128; bit = bit << 1, x++) {\n"
" z = x;\n" // <- known value [0..6]
" }\n"
"}\n";
ASSERT_EQUALS(true, testValueOfX(code, 4U, 0));
ASSERT_EQUALS(true, testValueOfX(code, 4U, 6));
ASSERT_EQUALS(false, testValueOfX(code, 4U, 7));
ASSERT(value.isKnown());
// template parameters are not known // template parameters are not known
code = "template <int X> void f() { a = X; }\n" code = "template <int X> void f() { a = X; }\n"
"f<1>();"; "f<1>();";