blob: 8c719bb63cc39a3df13f21f432f69b21fc07b287 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: grep "ret i32" %t | count 2
Daniel Dunbarf9eede12008-07-30 21:00:24 +00003// 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