NAKAMURA Takumi | a7246da | 2013-01-22 01:51:59 +0000 | [diff] [blame] | 1 | // 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 Dunbar | f9eede1 | 2008-07-30 21:00:24 +0000 | [diff] [blame] | 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 | |
Daniel Dunbar | f9eede1 | 2008-07-30 21:00:24 +0000 | [diff] [blame] | 19 | int f1() { |
| 20 | struct s0 x[2] = { {0} }; |
| 21 | return x[1].x; |
| 22 | } |
Daniel Dunbar | f9eede1 | 2008-07-30 21:00:24 +0000 | [diff] [blame] | 23 | |
| 24 | int f2() { |
| 25 | int x[2] = { 0 }; |
| 26 | return x[1]; |
| 27 | } |
| 28 | |