1 ; Test 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 define { i64, i64, i64, i64 } @f1() {
13 ret { i64, i64, i64, i64 } { i64 0, i64 1, i64 2, i64 3 }
16 ; More than four integer return values use sret.
17 define { i64, i64, i64, i64, i64 } @f2() {
19 ; CHECK: mvghi 32(%r2), 4
20 ; CHECK: mvghi 24(%r2), 3
21 ; CHECK: mvghi 16(%r2), 2
22 ; CHECK: mvghi 8(%r2), 1
23 ; CHECK: mvghi 0(%r2), 0
25 ret { i64, i64, i64, i64, i64 } { i64 0, i64 1, i64 2, i64 3, i64 4 }
28 ; Up to four floating-point return values fit into FPRs.
29 define { double, double, double, double } @f3() {
31 ; CHECK: larl [[TMP:%r[0-5]]], .LCPI
32 ; CHECK: ldeb %f0, 0([[TMP]])
33 ; CHECK: larl [[TMP:%r[0-5]]], .LCPI
34 ; CHECK: ldeb %f2, 0([[TMP]])
35 ; CHECK: larl [[TMP:%r[0-5]]], .LCPI
36 ; CHECK: ldeb %f4, 0([[TMP]])
37 ; CHECK: larl [[TMP:%r[0-5]]], .LCPI
38 ; CHECK: ldeb %f6, 0([[TMP]])
40 ret { double, double, double, double }
41 { double 1.0, double 2.0, double 3.0, double 4.0 }
44 ; More than four floating-point return values use sret.
45 define { double, double, double, double, double } @f4() {
47 ; CHECK: llihh [[TMP:%r[0-5]]], 16404
48 ; CHECK: stg [[TMP]], 32(%r2)
49 ; CHECK: llihh [[TMP:%r[0-5]]], 16400
50 ; CHECK: stg [[TMP]], 24(%r2)
51 ; CHECK: llihh [[TMP:%r[0-5]]], 16392
52 ; CHECK: stg [[TMP]], 16(%r2)
53 ; CHECK: llihh [[TMP:%r[0-5]]], 16384
54 ; CHECK: stg [[TMP]], 8(%r2)
55 ; CHECK: llihh [[TMP:%r[0-5]]], 16368
56 ; CHECK: stg [[TMP]], 0(%r2)
58 ret { double, double, double, double, double }
59 { double 1.0, double 2.0, double 3.0, double 4.0, double 5.0 }