From: Stephen Kelly Date: Fri, 7 Dec 2018 00:08:14 +0000 (+0000) Subject: Add test for InitListExpr X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bd0dec5885e171d5055d980d3121c1d8115655b;p=clang Add test for InitListExpr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348553 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/AST/ast-dump-stmt.cpp b/test/AST/ast-dump-stmt.cpp index 55b9b5fa95..8497a609dc 100644 --- a/test/AST/ast-dump-stmt.cpp +++ b/test/AST/ast-dump-stmt.cpp @@ -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:5 us 'U [3]' cinit +// Check-NEXT: `-InitListExpr {{.+}} 'U [3]' +// Check-NEXT: |-array filler +// Check-NEXT: | `-InitListExpr {{.+}} 'U' field Field {{.+}} 'i' 'int' +// Check-NEXT: |-InitListExpr {{.+}} 'U' field Field {{.+}} 'i' 'int' +// Check-NEXT: | `-IntegerLiteral {{.+}} 'int' 1 + + +}