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
5 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-only -verify -DFAIL4 %s
7 struct A
{ int x
; int y
[]; };
9 // CHECK: @a ={{.*}} global { i32, [2 x i32] } { i32 1, [2 x i32] [i32 7, i32 11] }
11 A b
= { 1, { 13, 15 } };
12 // CHECK: @b ={{.*}} global { i32, [2 x i32] } { i32 1, [2 x i32] [i32 13, i32 15] }
16 A c
= { f(), { f(), f() } }; // expected-error {{cannot compile this flexible array initializer yet}}
20 static A d
= { f(), { f(), f() } }; // expected-error {{cannot compile this flexible array initializer yet}}
24 struct B
{ int x
; char y
; char z
[]; };
25 B e
= {f(), f(), f(), f()}; // expected-error {{cannot compile this flexible array initializer yet}}
28 union { char a
[]; } z
= {};
29 union { char a
[]; } z0
= {z
.a
[0]}; // expected-error {{cannot compile this flexible array initializer yet}}
30 char keep() { return z0
.a
[0]; }
33 namespace zero_initializer
{
34 A a0
{0, 0}, a1
{0, {0, 0}};
35 // CHECK: @_ZN16zero_initializer2a0E = global { i32, [1 x i32] } zeroinitializer,
36 // CHECK: @_ZN16zero_initializer2a1E = global { i32, [2 x i32] } zeroinitializer,
38 struct S
{ int x
[]; };
41 // CHECK: @_ZN16zero_initializer1sE = global { [1 x i32] } zeroinitializer,