1 ; Test calling functions with multiple return values (LLVM ABI extension)
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 ; Up to four integer return values fit into GPRs.
6 declare { i64, i64, i64, i64 } @bar1()
10 ; CHECK: brasl %r14, bar1
13 %mret = call { i64, i64, i64, i64 } @bar1()
14 %ret = extractvalue { i64, i64, i64, i64 } %mret, 3
18 ; More than four integer return values use sret.
19 declare { i64, i64, i64, i64, i64 } @bar2()
23 ; CHECK: la %r2, 160(%r15)
24 ; CHECK: brasl %r14, bar2
25 ; CHECK: lg %r2, 192(%r15)
27 %mret = call { i64, i64, i64, i64, i64 } @bar2()
28 %ret = extractvalue { i64, i64, i64, i64, i64 } %mret, 4
32 ; Up to four floating-point return values fit into GPRs.
33 declare { double, double, double, double } @bar3()
37 ; CHECK: brasl %r14, bar3
40 %mret = call { double, double, double, double } @bar3()
41 %ret = extractvalue { double, double, double, double } %mret, 3
45 ; More than four integer return values use sret.
46 declare { double, double, double, double, double } @bar4()
50 ; CHECK: la %r2, 160(%r15)
51 ; CHECK: brasl %r14, bar4
52 ; CHECK: ld %f0, 192(%r15)
54 %mret = call { double, double, double, double, double } @bar4()
55 %ret = extractvalue { double, double, double, double, double } %mret, 4