llvm/llvm/test/CodeGen/ARM/struct-byval-loop.ll

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
; RUN: llc -mtriple=arm--none-eabi < %s | FileCheck %s

%type_80 = type [20 x i32]

declare void @func_80(ptr, ptr byval(%type_80))

define void @test_80() {
; CHECK-LABEL: test_80:
; CHECK:       @ %bb.0:
; CHECK-NEXT:    .save {r11, lr}
; CHECK-NEXT:    push {r11, lr}
; CHECK-NEXT:    .pad #152
; CHECK-NEXT:    sub sp, sp, #152
; CHECK-NEXT:    add r0, sp, #72
; CHECK-NEXT:    ldr r1, .LCPI0_0
; CHECK-NEXT:    add r0, r0, #12
; CHECK-NEXT:    mov r2, sp
; CHECK-NEXT:  .LBB0_1: @ =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    ldr r3, [r0], #4
; CHECK-NEXT:    subs r1, r1, #4
; CHECK-NEXT:    str r3, [r2], #4
; CHECK-NEXT:    bne .LBB0_1
; CHECK-NEXT:  @ %bb.2:
; CHECK-NEXT:    add r3, sp, #72
; CHECK-NEXT:    mov r0, #0
; CHECK-NEXT:    ldm r3, {r1, r2, r3}
; CHECK-NEXT:    bl func_80
; CHECK-NEXT:    add sp, sp, #152
; CHECK-NEXT:    pop {r11, lr}
; CHECK-NEXT:    mov pc, lr
; CHECK-NEXT:    .p2align 2
; CHECK-NEXT:  @ %bb.3:
; CHECK-NEXT:  .LCPI0_0:
; CHECK-NEXT:    .long 68 @ 0x44
  %a = alloca %type_80
  call void @func_80(ptr null, ptr %a)
  ret void
}

%type_4000 = type [1000 x i32]

declare void @func_4000(ptr, ptr byval(%type_4000))

define void @test_4000() {
; CHECK-LABEL: test_4000:
; CHECK:       @ %bb.0:
; CHECK-NEXT:    .save {r11, lr}
; CHECK-NEXT:    push {r11, lr}
; CHECK-NEXT:    .pad #4000
; CHECK-NEXT:    sub sp, sp, #4000
; CHECK-NEXT:    sub sp, sp, #920
; CHECK-NEXT:    sub sp, sp, #3072
; CHECK-NEXT:    add lr, sp, #3072
; CHECK-NEXT:    ldr r1, .LCPI1_0
; CHECK-NEXT:    add r0, lr, #920
; CHECK-NEXT:    mov r2, sp
; CHECK-NEXT:    add r0, r0, #12
; CHECK-NEXT:  .LBB1_1: @ =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    ldr r3, [r0], #4
; CHECK-NEXT:    subs r1, r1, #4
; CHECK-NEXT:    str r3, [r2], #4
; CHECK-NEXT:    bne .LBB1_1
; CHECK-NEXT:  @ %bb.2:
; CHECK-NEXT:    ldr r1, [sp, #3992]
; CHECK-NEXT:    mov r0, #0
; CHECK-NEXT:    ldr r2, [sp, #3996]
; CHECK-NEXT:    ldr r3, [sp, #4000]
; CHECK-NEXT:    bl func_4000
; CHECK-NEXT:    add sp, sp, #920
; CHECK-NEXT:    add sp, sp, #3072
; CHECK-NEXT:    add sp, sp, #4000
; CHECK-NEXT:    pop {r11, lr}
; CHECK-NEXT:    mov pc, lr
; CHECK-NEXT:    .p2align 2
; CHECK-NEXT:  @ %bb.3:
; CHECK-NEXT:  .LCPI1_0:
; CHECK-NEXT:    .long 3988 @ 0xf94
  %a = alloca %type_4000
  call void @func_4000(ptr null, ptr %a)
  ret void
}