~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/CodeGen/ARM/2013-05-02-AAPCS-ByVal-Structs-C4-C5-VFP.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;Check AAPCS, 5.5 Parameters Passing, C4 and C5 rules.
 
2
;Check case when NSAA != 0, and NCRN < R4, NCRN+ParamSize < R4
 
3
;RUN: llc -mtriple=thumbv7-linux-gnueabihf -float-abi=hard < %s | FileCheck %s
 
4
 
 
5
%st_t = type { i32, i32 }
 
6
@static_val = constant %st_t { i32 777, i32 888}
 
7
 
 
8
declare void @fooUseStruct(%st_t*)
 
9
 
 
10
define void @foo(double %vfp0,     ; --> D0,     NSAA=SP
 
11
                 double %vfp1,     ; --> D1,     NSAA=SP
 
12
                 double %vfp2,     ; --> D2,     NSAA=SP
 
13
                 double %vfp3,     ; --> D3,     NSAA=SP
 
14
                 double %vfp4,     ; --> D4,     NSAA=SP
 
15
                 double %vfp5,     ; --> D5,     NSAA=SP
 
16
                 double %vfp6,     ; --> D6,     NSAA=SP
 
17
                 double %vfp7,     ; --> D7,     NSAA=SP
 
18
                 double %vfp8,     ; --> SP,     NSAA=SP+8 (!)
 
19
                 i32 %p0,          ; --> R0,     NSAA=SP+8 
 
20
                 %st_t* byval %p1, ; --> R1, R2, NSAA=SP+8
 
21
                 i32 %p2,          ; --> R3,     NSAA=SP+8 
 
22
                 i32 %p3) #0 {     ; --> SP+4,   NSAA=SP+12
 
23
entry:
 
24
  ;CHECK: sub sp, #12
 
25
  ;CHECK: push {r7, lr}
 
26
  ;CHECK: sub sp, #4
 
27
  ;CHECK: add r0, sp, #12
 
28
  ;CHECK: strd r1, r2, [sp, #12]
 
29
  ;CHECK: bl  fooUseStruct
 
30
  call void @fooUseStruct(%st_t* %p1)
 
31
  ret void
 
32
}
 
33
 
 
34
define void @doFoo() {
 
35
entry:
 
36
  call void @foo(double 23.0,
 
37
                 double 23.1,
 
38
                 double 23.2,
 
39
                 double 23.3,
 
40
                 double 23.4,
 
41
                 double 23.5,
 
42
                 double 23.6,
 
43
                 double 23.7,
 
44
                 double 23.8,
 
45
                 i32 0, %st_t* byval @static_val, i32 1, i32 2)
 
46
  ret void
 
47
}
 
48