File: 2012-10-18-PR14099-ByvalFrameAddress.ll

package info (click to toggle)
llvm-toolchain-3.7 1%3A3.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 345,556 kB
  • ctags: 362,199
  • sloc: cpp: 2,156,381; ansic: 458,339; objc: 91,547; python: 89,988; asm: 86,305; sh: 21,479; makefile: 6,853; perl: 5,601; ml: 5,458; pascal: 3,933; lisp: 2,429; xml: 686; cs: 239; php: 202; csh: 117
file content (30 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (6)
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
; RUN: llc < %s -mtriple=armv7-linux-gnueabi | FileCheck %s

%struct.s = type { [4 x i32] }
@v = constant %struct.s zeroinitializer; 

declare void @f(%struct.s* %p);

; CHECK-LABEL: t:
define void @t(i32 %a, %struct.s* byval %s) nounwind {
entry:

; Here we need to only check proper start address of restored %s argument.
; CHECK:      sub     sp, sp, #12
; CHECK:      push    {r11, lr}
; CHECK:      sub     sp, sp, #4
; CHECK:      add     r0, sp, #12
; CHECK:      stm     r0, {r1, r2, r3}
; CHECK:      add     r0, sp, #12
; CHECK-NEXT: bl f
  call void @f(%struct.s* %s)
  ret void
}

; CHECK-LABEL: caller:
define void @caller() {

; CHECK:      ldm     r0, {r1, r2, r3}
  call void @t(i32 0, %struct.s* @v);
  ret void
}