summaryrefslogtreecommitdiff
path: root/test/CodeGen/CellSPU/arg_ret.ll
blob: db8ff104660c4486c35da370e7fce34077e557ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
; Test parameter passing and return values
;RUN: llc --march=cellspu %s -o - | FileCheck %s

; this fits into registers r3-r74
%paramstruct = type { i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,
                      i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,
                      i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,
                      i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,
                      i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,
                      i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32}
define ccc i32 @test_regs( %paramstruct %prm )
{
;CHECK:	lr	$3, $74
;CHECK:	bi	$lr
  %1 = extractvalue %paramstruct %prm, 71
  ret i32 %1
}

define ccc i32 @test_regs_and_stack( %paramstruct %prm, i32 %stackprm )
{
;CHECK-NOT:	a	$3, $74, $75
  %1 = extractvalue %paramstruct %prm, 71
  %2 = add i32 %1, %stackprm
  ret i32 %2
}

define ccc %paramstruct @test_return( i32 %param,  %paramstruct %prm )
{
;CHEKC: 	lqd	$75, 80($sp)
;CHECK:  lr    $3, $4
  ret %paramstruct %prm
}