Files
llvm/clang/test/CodeGen/2006-05-19-SingleEltReturn.c
Erik Pilkington de98cf92e3 [CodeGen] Add an alignment attribute to all sret parameters
This fixes a miscompile when the parameter is actually underaligned.
rdar://58316406

Differential revision: https://reviews.llvm.org/D74183
2020-03-24 15:31:57 -04:00

31 lines
583 B
C

// Test returning a single element aggregate value containing a double.
// RUN: %clang_cc1 -triple i686-linux %s -emit-llvm -o - | FileCheck %s --check-prefix=X86_32
// RUN: %clang_cc1 %s -emit-llvm -o -
struct X {
double D;
};
struct Y {
struct X x;
};
struct Y bar();
void foo(struct Y *P) {
*P = bar();
}
struct Y bar() {
struct Y a;
a.x.D = 0;
return a;
}
// X86_32: define void @foo(%struct.Y* %P)
// X86_32: call void @bar(%struct.Y* sret align 4 %{{[^),]*}})
// X86_32: define void @bar(%struct.Y* noalias sret align 4 %{{[^,)]*}})
// X86_32: ret void