xref: /aosp_15_r20/external/clang/test/CodeGen/2008-07-30-implicit-initialization.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
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 
f0()14 int f0() {
15   struct s0 x = {0};
16   return x.y;
17 }
18 
f1()19 int f1() {
20   struct s0 x[2] = { {0} };
21   return x[1].x;
22 }
23 
f2()24 int f2() {
25   int x[2] = { 0 };
26   return x[1];
27 }
28 
29