2019-11-27 12:28:52 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-unknown-unknown -O2 -emit-llvm -o - %s | FileCheck %s
|
2020-12-31 16:27:11 +08:00
|
|
|
// CHECK-LABEL: define{{.*}} i32 @f0()
|
2013-01-22 09:51:59 +08:00
|
|
|
// CHECK: ret i32 0
|
2020-12-31 16:27:11 +08:00
|
|
|
// CHECK-LABEL: define{{.*}} i32 @f1()
|
2013-01-22 09:51:59 +08:00
|
|
|
// CHECK: ret i32 0
|
2020-12-31 16:27:11 +08:00
|
|
|
// CHECK-LABEL: define{{.*}} i32 @f2()
|
2013-01-22 09:51:59 +08:00
|
|
|
// CHECK: ret i32 0
|
2008-07-31 05:00:24 +08:00
|
|
|
// <rdar://problem/6113085>
|
|
|
|
|
|
|
|
struct s0 {
|
|
|
|
int x, y;
|
|
|
|
};
|
|
|
|
|
2022-02-13 21:02:46 +08:00
|
|
|
int f0(void) {
|
2008-07-31 05:00:24 +08:00
|
|
|
struct s0 x = {0};
|
|
|
|
return x.y;
|
|
|
|
}
|
|
|
|
|
2022-02-13 21:02:46 +08:00
|
|
|
int f1(void) {
|
2008-07-31 05:00:24 +08:00
|
|
|
struct s0 x[2] = { {0} };
|
|
|
|
return x[1].x;
|
|
|
|
}
|
|
|
|
|
2022-02-13 21:02:46 +08:00
|
|
|
int f2(void) {
|
2008-07-31 05:00:24 +08:00
|
|
|
int x[2] = { 0 };
|
|
|
|
return x[1];
|
|
|
|
}
|
|
|
|
|