r348553 - Add test for InitListExpr

Stephen Kelly via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 6 16:08:14 PST 2018


Author: steveire
Date: Thu Dec  6 16:08:14 2018
New Revision: 348553

URL: http://llvm.org/viewvc/llvm-project?rev=348553&view=rev
Log:
Add test for InitListExpr

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

Modified: cfe/trunk/test/AST/ast-dump-stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/AST/ast-dump-stmt.cpp?rev=348553&r1=348552&r2=348553&view=diff
==============================================================================
--- cfe/trunk/test/AST/ast-dump-stmt.cpp (original)
+++ cfe/trunk/test/AST/ast-dump-stmt.cpp Thu Dec  6 16:08:14 2018
@@ -81,3 +81,21 @@ void TestDependentScopeMemberExpr() {
 // CHECK: FunctionTemplateDecl {{.*}} TestDependentScopeMemberExpr
 // CHECK: CXXDependentScopeMemberExpr {{.*}} lvalue .member
 // CHECK: CXXDependentScopeMemberExpr {{.*}} lvalue ->member
+
+union U {
+  int i;
+  long l;
+};
+
+void TestUnionInitList()
+{
+  U us[3] = {1};
+// Check: VarDecl {{.+}} <col:3, col:18> col:5 us 'U [3]' cinit
+// Check-NEXT: `-InitListExpr {{.+}} <col:13, col:18> 'U [3]'
+// Check-NEXT:   |-array filler
+// Check-NEXT:   | `-InitListExpr {{.+}} <col:18> 'U' field Field {{.+}} 'i' 'int'
+// Check-NEXT:   |-InitListExpr {{.+}} <col:14> 'U' field Field {{.+}} 'i' 'int'
+// Check-NEXT:   | `-IntegerLiteral {{.+}} <col:14> 'int' 1
+
+
+}




More information about the cfe-commits mailing list