This commit is contained in:
chrchr-github 2022-05-25 23:28:54 +02:00 committed by GitHub
parent eefa04c7af
commit 2b611709e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -189,6 +189,7 @@ private:
TEST_CASE(array_index_62); // #7684
TEST_CASE(array_index_63); // #10979
TEST_CASE(array_index_64); // #10878
TEST_CASE(array_index_65); // #11066
TEST_CASE(array_index_multidim);
TEST_CASE(array_index_switch_in_for);
TEST_CASE(array_index_for_in_for); // FP: #2634
@ -1822,6 +1823,18 @@ private:
TODO_ASSERT_EQUALS("[test.cpp:3]: (error) Array 'x[10]' accessed at index 10, which is out of bounds.\n", "", errout.str());
}
void array_index_65() // #11066
{
check("char P[] = { 2, 1 };\n"
"char f[2];\n"
"void e(char* c) {\n"
" register j;\n"
" for (j = 0; j < 2; j++)\n"
" c[j] = f[P[j] - 1];\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void array_index_multidim() {
check("void f()\n"
"{\n"