1// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t
2// RUN: grep "ret i32" %t | count 2
3// RUN: grep "ret i32 0" %t | count 2
4// <rdar://problem/6113085>
5
6struct s0 {
7  int x, y;
8};
9
10int f0() {
11  struct s0 x = {0};
12  return x.y;
13}
14
15#if 0
16/* Optimizer isn't smart enough to reduce this since we use
17   memset. Hrm. */
18int f1() {
19  struct s0 x[2] = { {0} };
20  return x[1].x;
21}
22#endif
23
24int f2() {
25  int x[2] = { 0 };
26  return x[1];
27}
28
29