blob: e5162596d712b10167e88cde00260ba52f1dbe55 [file] [log] [blame]
NAKAMURA Takumia7246da2013-01-22 01:51:59 +00001// RUN: %clang_cc1 -triple i386-unknown-unknown -O1 -emit-llvm -o - %s | FileCheck %s
2// CHECK: define i32 @f0()
3// CHECK: ret i32 0
4// CHECK: define i32 @f1()
5// CHECK: ret i32 0
6// CHECK: define i32 @f2()
7// CHECK: ret i32 0
Daniel Dunbarf9eede12008-07-30 21:00:24 +00008// <rdar://problem/6113085>
9
10struct s0 {
11 int x, y;
12};
13
14int f0() {
15 struct s0 x = {0};
16 return x.y;
17}
18
Daniel Dunbarf9eede12008-07-30 21:00:24 +000019int f1() {
20 struct s0 x[2] = { {0} };
21 return x[1].x;
22}
Daniel Dunbarf9eede12008-07-30 21:00:24 +000023
24int f2() {
25 int x[2] = { 0 };
26 return x[1];
27}
28