summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/ms_abi.c
diff options
context:
space:
mode:
authorAlexander Ivchenko <alexander.ivchenko@intel.com>2018-02-08 11:15:21 +0000
committerAlexander Ivchenko <alexander.ivchenko@intel.com>2018-02-08 11:15:21 +0000
commit4b20b3c80c5561040f0c0e7358b88fe8f97cf3c6 (patch)
treefb6b8c502f4b863bbc0f24358f3b8002cf20492c /clang/test/CodeGen/ms_abi.c
parent1db3ca9ab1cc4b35fb1029575ea6bd6d663c7543 (diff)
downloadbcm5719-llvm-4b20b3c80c5561040f0c0e7358b88fe8f97cf3c6.tar.gz
bcm5719-llvm-4b20b3c80c5561040f0c0e7358b88fe8f97cf3c6.zip
Fix for #31362 - ms_abi is implemented incorrectly for values >=16 bytes.
Summary: This patch is a fix for following issue: https://bugs.llvm.org/show_bug.cgi?id=31362 The problem was caused by front end lowering C calling conventions without taking into account calling conventions enforced by attribute. In this case win64cc was no correctly lowered on targets other than Windows. Reviewed By: rnk (Reid Kleckner) Differential Revision: https://reviews.llvm.org/D43016 Author: belickim <mateusz.belicki@intel.com> llvm-svn: 324594
Diffstat (limited to 'clang/test/CodeGen/ms_abi.c')
-rw-r--r--clang/test/CodeGen/ms_abi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ms_abi.c b/clang/test/CodeGen/ms_abi.c
index 407087e4091..7486166c78d 100644
--- a/clang/test/CodeGen/ms_abi.c
+++ b/clang/test/CodeGen/ms_abi.c
@@ -146,3 +146,16 @@ void __attribute__((sysv_abi)) f6(__builtin_ms_va_list ap) {
// WIN64: %[[AP_VAL:.*]] = load i8*, i8** %[[AP]]
// WIN64-NEXT: store i8* %[[AP_VAL]], i8** %[[AP2:.*]]
}
+
+// This test checks if structs are passed according to Win64 calling convention
+// when it's enforced by __attribute((ms_abi)).
+struct i128 {
+ unsigned long long a;
+ unsigned long long b;
+};
+
+__attribute__((ms_abi)) struct i128 f7(struct i128 a) {
+ // WIN64: define void @f7(%struct.i128* noalias sret %agg.result, %struct.i128* %a)
+ // FREEBSD: define win64cc void @f7(%struct.i128* noalias sret %agg.result, %struct.i128* %a)
+ return a;
+}
OpenPOWER on IntegriCloud