Add test for InitListExpr

llvm-svn: 348553
This commit is contained in:
Stephen Kelly 2018-12-07 00:08:14 +00:00
parent c6441c8547
commit 8609e12b37
1 changed files with 18 additions and 0 deletions

View File

@ -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
}