1 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -disable-post-ra -frame-pointer=all | FileCheck %s
2 ; RUN: llc < %s -mtriple=arm64-linux-gnu -disable-post-ra | FileCheck %s --check-prefix=CHECK-LINUX
5 ; CHECK: sub sp, sp, #32
6 ; CHECK-NEXT: stp x29, x30, [sp, #16]
7 ; CHECK-NEXT: add x29, sp, #16
8 ; CHECK-NEXT: stur wzr, [x29, #-4]
9 ; CHECK: adrp x0, l_.str@PAGE
10 ; CHECK: add x0, x0, l_.str@PAGEOFF
11 ; CHECK-NEXT: bl _puts
12 ; CHECK-NEXT: ldp x29, x30, [sp, #16]
13 ; CHECK-NEXT: add sp, sp, #32
16 ; CHECK-LINUX-LABEL: main:
17 ; CHECK-LINUX: str x30, [sp, #-16]!
18 ; CHECK-LINUX-NEXT: str wzr, [sp, #12]
19 ; CHECK-LINUX: adrp x0, .L.str
20 ; CHECK-LINUX: add x0, x0, :lo12:.L.str
21 ; CHECK-LINUX-NEXT: bl puts
22 ; CHECK-LINUX-NEXT: ldr x30, [sp], #16
23 ; CHECK-LINUX-NEXT: ret
25 @.str = private unnamed_addr constant [7 x i8] c"hello\0A\00"
27 define i32 @main() nounwind ssp {
29 %retval = alloca i32, align 4
30 store i32 0, ptr %retval
31 %call = call i32 @puts(ptr @.str)
35 declare i32 @puts(ptr)