testgarbage: add code example from #6361 to testrunner

This commit is contained in:
Matthias Krüger 2015-01-07 16:24:33 +01:00
parent 4248c94d87
commit 0259b4a672
1 changed files with 13 additions and 1 deletions

View File

@ -54,7 +54,7 @@ private:
TEST_CASE(garbageCode11);
TEST_CASE(garbageCode12);
TEST_CASE(garbageCode13); // Ticket #2607 - crash
TEST_CASE(garbageCode14); // TIcket #5595 - crash
TEST_CASE(garbageCode14); // Ticket #5595 - crash
TEST_CASE(garbageCode15); // Ticket #5203
TEST_CASE(garbageCode16);
TEST_CASE(garbageCode17);
@ -64,6 +64,7 @@ private:
TEST_CASE(garbageCode21);
TEST_CASE(garbageCode22);
TEST_CASE(garbageCode23);
TEST_CASE(garbageCode24); // Ticket #6361 - crash
TEST_CASE(garbageValueFlow);
TEST_CASE(garbageSymbolDatabase);
@ -328,6 +329,17 @@ private:
ASSERT_EQUALS("", errout.str());
}
void garbageCode24() {
// don't crash (example from #6361)
checkCode("float buffer[64];\n"
"main (void)\n"
"{\n"
" char *cptr;\n"
" cptr = (char *)buffer;\n"
" cptr += (-(long int) buffer & (16 * sizeof (float) - 1));\n"
"}\n");
}
void garbageValueFlow() {
// #6089
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"