summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@quicinc.com>2019-05-03 21:12:24 +0000
committerMandeep Singh Grang <mgrang@quicinc.com>2019-05-03 21:12:24 +0000
commit85a0f8fe6c5c8ab35790c40d078d4fa103a5a54a (patch)
treea4ecb78dedd4a06c5badd2834d43cb3441dc2faa /clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
parent090a5b29b8815116dc9bc6925146a537ef7db123 (diff)
downloadbcm5719-llvm-85a0f8fe6c5c8ab35790c40d078d4fa103a5a54a.tar.gz
bcm5719-llvm-85a0f8fe6c5c8ab35790c40d078d4fa103a5a54a.zip
[COFF, ARM64] Fix ABI implementation of struct returns
Summary: Related llvm patch: D60348. Patch co-authored by Sanjin Sijaric. Reviewers: rnk, efriedma, TomTan, ssijaric, ostannard Reviewed By: efriedma Subscribers: dmajor, richard.townsend.arm, ostannard, javed.absar, kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60349 llvm-svn: 359932
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp')
-rw-r--r--clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp b/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
index a910a2d7f73..ad4073099ce 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
@@ -69,6 +69,11 @@ struct BaseNoByval : Small {
int bb;
};
+struct SmallWithPrivate {
+private:
+ int i;
+};
+
// WIN32: declare dso_local void @"{{.*take_bools_and_chars.*}}"
// WIN32: (<{ i8, [3 x i8], i8, [3 x i8], %struct.SmallWithDtor,
// WIN32: i8, [3 x i8], i8, [3 x i8], i32, i8, [3 x i8] }>* inalloca)
@@ -165,7 +170,7 @@ void small_arg_with_dtor(SmallWithDtor s) {}
// WIN64: call void @"??1SmallWithDtor@@QEAA@XZ"
// WIN64: }
// WOA64: define dso_local void @"?small_arg_with_dtor@@YAXUSmallWithDtor@@@Z"(i64 %s.coerce) {{.*}} {
-// WOA64: call void @"??1SmallWithDtor@@QEAA@XZ"
+// WOA64: call void @"??1SmallWithDtor@@QEAA@XZ"(%struct.SmallWithDtor* %s)
// WOA64: }
// FIXME: MSVC incompatible!
@@ -173,6 +178,12 @@ void small_arg_with_dtor(SmallWithDtor s) {}
// WOA: call arm_aapcs_vfpcc void @"??1SmallWithDtor@@QAA@XZ"(%struct.SmallWithDtor* %s)
// WOA: }
+
+// Test that the eligible non-aggregate is passed directly, but returned
+// indirectly on ARM64 Windows.
+// WOA64: define dso_local void @"?small_arg_with_private_member@@YA?AUSmallWithPrivate@@U1@@Z"(%struct.SmallWithPrivate* inreg noalias sret %agg.result, i64 %s.coerce) {{.*}} {
+SmallWithPrivate small_arg_with_private_member(SmallWithPrivate s) { return s; }
+
void call_small_arg_with_dtor() {
small_arg_with_dtor(SmallWithDtor());
}
OpenPOWER on IntegriCloud