xref: /llvm-project/llvm/test/CodeGen/SystemZ/args-14.ll (revision 14120227a34365e829d05c1413033d235d7d272c)
1; RUN: llc < %s -mtriple=s390x-linux-gnu -argext-abi-check
2
3; Test that it works to pass structs as outgoing call arguments when the
4; NoExt attribute is given, either in the call instruction or in the
5; prototype of the called function.
6define void @caller() {
7  call void @bar_Struct_32(i32 noext 123)
8  call void @bar_Struct_16(i16 123)
9  call void @bar_Struct_8(i8 noext 123)
10  ret void
11}
12
13declare void @bar_Struct_32(i32 %Arg)
14declare void @bar_Struct_16(i16 noext %Arg)
15declare void @bar_Struct_8(i8 %Arg)
16
17; Test that it works to return values with the NoExt attribute.
18define noext i8 @callee_NoExtRet_i8() {
19  ret i8 -1
20}
21
22define noext i16 @callee_NoExtRet_i16() {
23  ret i16 -1
24}
25
26define noext i32 @callee_NoExtRet_i32() {
27  ret i32 -1
28}
29
30; An internal function is not checked for an extension attribute.
31define internal i32 @callee_NoExtRet_internal(i32 %Arg) {
32  ret i32 %Arg
33}
34
35; A call to an internal function is ok without argument extension.
36define void @caller_internal() {
37  call i32 @callee_NoExtRet_internal(i32 0)
38  ret void
39}
40