xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/2008-07-30-implicit-initialization.c (revision 4684ddb6aab0b36791c8099bc705d6140b3d05d0)
1 // RUN: %clang_cc1 -triple i386-unknown-unknown -O1 -emit-llvm -o - %s | FileCheck %s
2 // CHECK-LABEL: define i32 @f0()
3 // CHECK:   ret i32 0
4 // CHECK-LABEL: define i32 @f1()
5 // CHECK:   ret i32 0
6 // CHECK-LABEL: define i32 @f2()
7 // CHECK:   ret i32 0
8 // <rdar://problem/6113085>
9 
10 struct s0 {
11   int x, y;
12 };
13 
14 int f0() {
15   struct s0 x = {0};
16   return x.y;
17 }
18 
19 int f1() {
20   struct s0 x[2] = { {0} };
21   return x[1].x;
22 }
23 
24 int f2() {
25   int x[2] = { 0 };
26   return x[1];
27 }
28 
29