1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

testcase for bug 84276

This commit is contained in:
Markus Schorn 2008-05-30 13:56:12 +00:00
parent 79ec81a37b
commit 259c26f452

View file

@ -4795,4 +4795,19 @@ public class AST2Tests extends AST2BaseTest {
assertEquals(IBasicType.t_void, ((IBasicType)pt).getType());
}
}
// #define str(s) # s
//
// void foo() {
// printf(str(this is a // this should go away
// string));
// }
public void testCommentInExpansion_Bug84276() throws Exception {
IASTTranslationUnit tu= parseAndCheckBindings(getAboveComment());
IASTFunctionDefinition func= (IASTFunctionDefinition) tu.getDeclarations()[0];
IASTFunctionCallExpression fcall= (IASTFunctionCallExpression) ((IASTExpressionStatement)((IASTCompoundStatement) func.getBody()).getStatements()[0]).getExpression();
IASTLiteralExpression lit= (IASTLiteralExpression) fcall.getParameterExpression();
assertEquals("\"this is a string\"", lit.toString());
}
}