LLVM: fix when sret and isByRef ret_ty disagree

This can happen functions use the C ABI.
This commit is contained in:
Andrew Kelley
2022-03-01 13:30:25 -07:00
parent 18e42661dc
commit 1b194931b0
2 changed files with 56 additions and 27 deletions

View File

@@ -833,12 +833,13 @@ test "packed struct with fp fields" {
}
test "fn with C calling convention returns struct by value" {
if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
const S = struct {
fn entry() !void {
var x = makeBar(10);
try expectEqual(@as(i32, 10), x.handle);
try expect(@as(i32, 10) == x.handle);
}
const ExternBar = extern struct {