2011-07-27 06:17:02 +08:00
|
|
|
// Test returning a single element aggregate value containing a double.
|
2017-04-11 07:31:05 +08:00
|
|
|
// RUN: %clang_cc1 -triple i686-linux %s -emit-llvm -o - | FileCheck %s --check-prefix=X86_32
|
2011-07-27 06:17:02 +08:00
|
|
|
// RUN: %clang_cc1 %s -emit-llvm -o -
|
|
|
|
|
|
|
|
struct X {
|
|
|
|
double D;
|
|
|
|
};
|
|
|
|
|
2017-04-11 07:31:05 +08:00
|
|
|
struct Y {
|
|
|
|
struct X x;
|
2011-07-27 06:17:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Y bar();
|
|
|
|
|
|
|
|
void foo(struct Y *P) {
|
|
|
|
*P = bar();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Y bar() {
|
|
|
|
struct Y a;
|
|
|
|
a.x.D = 0;
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2017-04-11 07:31:05 +08:00
|
|
|
|
2020-02-04 02:09:39 +08:00
|
|
|
// X86_32: define void @foo(%struct.Y* %P)
|
2020-03-25 00:36:19 +08:00
|
|
|
// X86_32: call void @bar(%struct.Y* sret align 4 %{{[^),]*}})
|
2017-04-11 07:31:05 +08:00
|
|
|
|
2020-03-25 00:36:19 +08:00
|
|
|
// X86_32: define void @bar(%struct.Y* noalias sret align 4 %{{[^,)]*}})
|
2017-04-11 07:31:05 +08:00
|
|
|
// X86_32: ret void
|