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
3
4; CHECK-LABEL: main:
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
14; CHECK-NEXT:	ret
15
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
24
25@.str = private unnamed_addr constant [7 x i8] c"hello\0A\00"
26
27define i32 @main() nounwind ssp {
28entry:
29  %retval = alloca i32, align 4
30  store i32 0, i32* %retval
31  %call = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0))
32  ret i32 %call
33}
34
35declare i32 @puts(i8*)
36