Home | History | Annotate | Download | only in ARM
      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, #8
     25   ;CHECK: push.w {r11, lr}
     26   ;CHECK: add r0, sp, #16
     27   ;CHECK: str r2, [sp, #20]
     28   ;CHECK: str r1, [sp, #16]
     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 
     49