1 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-only -verify -DFAIL1 %s
3 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-only -verify -DFAIL2 %s
4 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-only -verify -DFAIL3 %s
6 struct A
{ int x
; int y
[]; };
8 // CHECK: @a ={{.*}} global { i32, [2 x i32] } { i32 1, [2 x i32] [i32 7, i32 11] }
10 A b
= { 1, { 13, 15 } };
11 // CHECK: @b ={{.*}} global { i32, [2 x i32] } { i32 1, [2 x i32] [i32 13, i32 15] }
15 A c
= { f(), { f(), f() } }; // expected-error {{cannot compile this flexible array initializer yet}}
19 static A d
= { f(), { f(), f() } }; // expected-error {{cannot compile this flexible array initializer yet}}
23 struct B
{ int x
; char y
; char z
[]; };
24 B e
= {f(), f(), f(), f()}; // expected-error {{cannot compile this flexible array initializer yet}}
27 namespace zero_initializer
{
28 A a0
{0, 0}, a1
{0, {0, 0}};
29 // CHECK: @_ZN16zero_initializer2a0E = global { i32, [1 x i32] } zeroinitializer,
30 // CHECK: @_ZN16zero_initializer2a1E = global { i32, [2 x i32] } zeroinitializer,
32 struct S
{ int x
[]; };
35 // CHECK: @_ZN16zero_initializer1sE = global { [1 x i32] } zeroinitializer,