xref: /llvm-project/llvm/test/CodeGen/PowerPC/multi-return.ll (revision a538b0f023e858d0f71a1295bb9084e851ddd361)
1*a538b0f0SEhsan Amiri; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O0 < %s | FileCheck %s
2*a538b0f0SEhsan Amiri; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 < %s | FileCheck %s
36b0634b3SUlrich Weigand
46b0634b3SUlrich Weigand; Verify that returning multiple return values in registers works,
56b0634b3SUlrich Weigand; both with fast-isel and regular isel.
66b0634b3SUlrich Weigand
76b0634b3SUlrich Weiganddefine { i32, i32, i32, i32 } @foo() nounwind {
86b0634b3SUlrich Weigand  %A1 = insertvalue { i32, i32, i32, i32 } undef, i32 1, 0
96b0634b3SUlrich Weigand  %A2 = insertvalue { i32, i32, i32, i32 } %A1, i32 2, 1
106b0634b3SUlrich Weigand  %A3 = insertvalue { i32, i32, i32, i32 } %A2, i32 3, 2
116b0634b3SUlrich Weigand  %A4 = insertvalue { i32, i32, i32, i32 } %A3, i32 4, 3
126b0634b3SUlrich Weigand  ret { i32, i32, i32, i32 } %A4
136b0634b3SUlrich Weigand}
146b0634b3SUlrich Weigand
156b0634b3SUlrich Weigand; CHECK-LABEL: foo:
166b0634b3SUlrich Weigand; CHECK: li 3, 1
176b0634b3SUlrich Weigand; CHECK: li 4, 2
186b0634b3SUlrich Weigand; CHECK: li 5, 3
196b0634b3SUlrich Weigand; CHECK: li 6, 4
206b0634b3SUlrich Weigand; CHECK: blr
216b0634b3SUlrich Weigand
22