From: Aaron Ballman Date: Fri, 7 Dec 2018 17:06:40 +0000 (+0000) Subject: Adding an AST dump test for statement expressions; NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b835dd980dabd432c569f76f4c962d9300ab4ba8;p=clang Adding an AST dump test for statement expressions; NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348613 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/AST/ast-dump-stmt.c b/test/AST/ast-dump-stmt.c index b27451e2d4..8fec31d95a 100644 --- a/test/AST/ast-dump-stmt.c +++ b/test/AST/ast-dump-stmt.c @@ -362,3 +362,14 @@ void TestJumps(void) { // CHECK: ReturnStmt 0x{{[^ ]*}} // CHECK-NEXT: CallExpr 0x{{[^ ]*}} 'void' } + +void TestMiscStmts(void) { + ({int a = 10; a;}); + // CHECK: StmtExpr 0x{{[^ ]*}} 'int' + // CHECK-NEXT: CompoundStmt + // CHECK-NEXT: DeclStmt + // CHECK-NEXT: VarDecl 0x{{[^ ]*}} col:9 used a 'int' cinit + // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 10 + // CHECK-NEXT: ImplicitCastExpr + // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int' lvalue Var 0x{{[^ ]*}} 'a' 'int' +}