r348613 - Adding an AST dump test for statement expressions; NFC.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 7 09:06:40 PST 2018


Author: aaronballman
Date: Fri Dec  7 09:06:40 2018
New Revision: 348613

URL: http://llvm.org/viewvc/llvm-project?rev=348613&view=rev
Log:
Adding an AST dump test for statement expressions; NFC.

Modified:
    cfe/trunk/test/AST/ast-dump-stmt.c

Modified: cfe/trunk/test/AST/ast-dump-stmt.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/AST/ast-dump-stmt.c?rev=348613&r1=348612&r2=348613&view=diff
==============================================================================
--- cfe/trunk/test/AST/ast-dump-stmt.c (original)
+++ cfe/trunk/test/AST/ast-dump-stmt.c Fri Dec  7 09:06:40 2018
@@ -362,3 +362,14 @@ void TestJumps(void) {
   // CHECK: ReturnStmt 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:22>
   // CHECK-NEXT: CallExpr 0x{{[^ ]*}} <col:10, col:22> 'void'
 }
+
+void TestMiscStmts(void) {
+  ({int a = 10; a;});
+  // CHECK: StmtExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:20> 'int'
+  // CHECK-NEXT: CompoundStmt
+  // CHECK-NEXT: DeclStmt
+  // CHECK-NEXT: VarDecl 0x{{[^ ]*}} <col:5, col:13> col:9 used a 'int' cinit
+  // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:13> 'int' 10
+  // CHECK-NEXT: ImplicitCastExpr
+  // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} <col:17> 'int' lvalue Var 0x{{[^ ]*}} 'a' 'int'
+}




More information about the cfe-commits mailing list