Skip to content

Commit

Permalink
Add a test for homogenous structs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrberry committed Sep 5, 2022
1 parent 8ea88f9 commit ff0d8e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/std/llvm/aarch64_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ class LLVM::ABI
info.arg_types[0].should eq(ArgType.indirect(str, nil))
info.return_type.should eq(ArgType.indirect(str, Attribute::StructRet))
end

test "does with homogeneous structs" do |abi, ctx|
str = ctx.struct([ctx.float, ctx.float, ctx.float, ctx.float])
arg_types = [str]
return_type = str

info = abi.abi_info(arg_types, return_type, true, ctx)
info.arg_types.size.should eq(1)

info.arg_types[0].should eq(ArgType.direct(str, ctx.float.array(4)))
info.return_type.should eq(ArgType.direct(str, ctx.float.array(4)))
end
end
{% end %}
end
Expand Down

0 comments on commit ff0d8e1

Please sign in to comment.