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:
parent
79ec81a37b
commit
259c26f452
1 changed files with 15 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue