#3763 Added regression test
This commit is contained in:
parent
9786f1c34b
commit
6fd916a90f
|
@ -131,6 +131,7 @@ private:
|
||||||
TEST_CASE(array_index_48); // #9478
|
TEST_CASE(array_index_48); // #9478
|
||||||
TEST_CASE(array_index_49); // #8653
|
TEST_CASE(array_index_49); // #8653
|
||||||
TEST_CASE(array_index_50);
|
TEST_CASE(array_index_50);
|
||||||
|
TEST_CASE(array_index_51); // #3763
|
||||||
TEST_CASE(array_index_multidim);
|
TEST_CASE(array_index_multidim);
|
||||||
TEST_CASE(array_index_switch_in_for);
|
TEST_CASE(array_index_switch_in_for);
|
||||||
TEST_CASE(array_index_for_in_for); // FP: #2634
|
TEST_CASE(array_index_for_in_for); // FP: #2634
|
||||||
|
@ -1525,6 +1526,14 @@ private:
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void array_index_51() {
|
||||||
|
check("void f(void){\n"
|
||||||
|
" int k=0, dd, d[1U] = {1};\n"
|
||||||
|
" for (dd=d[k]; k<10; dd=d[++k]){;}\n"
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("[test.cpp:3]: (error) Array 'd[1]' accessed at index 1, which is out of bounds.\n", errout.str());
|
||||||
|
}
|
||||||
|
|
||||||
void array_index_multidim() {
|
void array_index_multidim() {
|
||||||
check("void f()\n"
|
check("void f()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
|
Loading…
Reference in New Issue