From 8609e12b3769ecffce8de7600aedd278c4edd56d 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 llvm-svn: 348553 --- clang/test/AST/ast-dump-stmt.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/clang/test/AST/ast-dump-stmt.cpp b/clang/test/AST/ast-dump-stmt.cpp index 55b9b5f..8497a60 100644 --- a/clang/test/AST/ast-dump-stmt.cpp +++ b/clang/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.7.4