From 4bd0dec5885e171d5055d980d3121c1d8115655b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 7 Dec 2018 00:08:14 +0000 Subject: [PATCH] Add test for InitListExpr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348553 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/AST/ast-dump-stmt.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 + + +} -- 2.40.0