Added unit test for #4777

This commit is contained in:
PKEuS 2014-08-26 15:30:12 +02:00
parent 6a4319f050
commit 630211ac7d
1 changed files with 16 additions and 0 deletions

View File

@ -303,6 +303,7 @@ private:
TEST_CASE(simplifyTypedef105); // ticket #3616
TEST_CASE(simplifyTypedef106); // ticket #3619
TEST_CASE(simplifyTypedef107); // ticket #3963 - bad code => segmentation fault
TEST_CASE(simplifyTypedef108); // ticket #4777
TEST_CASE(simplifyTypedefFunction1);
TEST_CASE(simplifyTypedefFunction2); // ticket #1685
@ -5709,6 +5710,21 @@ private:
ASSERT_THROW(tok(code), InternalError);
}
void simplifyTypedef108() { // ticket #4777
const char code[] = "typedef long* GEN;\n"
"void sort_factor(GEN *y, long n) {\n"
" GEN a, b;\n"
" foo(a, b);\n"
"}\n";
const char expected[] = "void sort_factor ( long * * y , long n ) { "
"long * a ; long * b ; "
"foo ( a , b ) ; "
"}";
checkSimplifyTypedef(code);
ASSERT_EQUALS(expected, tok(code));
}
void simplifyTypedefFunction1() {
{
const char code[] = "typedef void (*my_func)();\n"