diff options
author | Hans Wennborg <hans@hanshq.net> | 2018-02-09 09:01:30 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2018-02-09 09:01:30 +0000 |
commit | 1d5b6bd0b8ee0cad2a92f45245b5fbbf23c48ef3 (patch) | |
tree | 044c70cda4d63ec775dfff0a6ef66b597fb79154 /test | |
parent | 9524f2ccfe02886a6c211a475c66ebf82f1fbcad (diff) |
Merging r324594:
------------------------------------------------------------------------
r324594 | aivchenk | 2018-02-08 12:15:21 +0100 (Thu, 08 Feb 2018) | 17 lines
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>
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_60@324718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/ms_abi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/ms_abi.c b/test/CodeGen/ms_abi.c index 407087e409..7486166c78 100644 --- a/test/CodeGen/ms_abi.c +++ b/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; +} |