#6667: Added a regression test to testgarbage.

This commit is contained in:
Martin Ettl 2015-09-30 21:55:32 +02:00
parent dc57402887
commit dc051f077d
1 changed files with 13 additions and 0 deletions

View File

@ -166,6 +166,7 @@ private:
TEST_CASE(garbageCode124); // 6948 TEST_CASE(garbageCode124); // 6948
TEST_CASE(garbageCode125); // 6782, 6834 TEST_CASE(garbageCode125); // 6782, 6834
TEST_CASE(garbageCode126); // #6997 TEST_CASE(garbageCode126); // #6997
TEST_CASE(garbageCode127); // #6667
TEST_CASE(garbageValueFlow); TEST_CASE(garbageValueFlow);
TEST_CASE(garbageSymbolDatabase); TEST_CASE(garbageSymbolDatabase);
@ -952,6 +953,18 @@ private:
InternalError); InternalError);
} }
void garbageCode127() { // #6667
checkCode("extern \"C\" int printf(const char* fmt, ...);\n"
"class A {\n"
"public:\n"
" int Var;\n"
" A(int arg) { Var = arg; }\n"
" ~A() { printf(\"A d'tor\\n\"); }\n"
"};\n"
" const A& foo(const A& arg) { return arg; }\n"
" foo(A(12)).Var\n");
}
void garbageValueFlow() { void garbageValueFlow() {
// #6089 // #6089
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n" const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"