2016-03-03 01:58:31 +08:00
|
|
|
; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -disable-post-ra -disable-fp-elim | FileCheck %s
|
2015-12-21 22:43:45 +08:00
|
|
|
; RUN: llc < %s -mtriple=arm64-linux-gnu -disable-post-ra | FileCheck %s --check-prefix=CHECK-LINUX
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: main:
|
2014-04-09 22:43:59 +08:00
|
|
|
; CHECK: stp x29, x30, [sp, #-16]!
|
2014-04-09 22:43:50 +08:00
|
|
|
; CHECK-NEXT: mov x29, sp
|
2014-03-29 18:18:08 +08:00
|
|
|
; CHECK-NEXT: sub sp, sp, #16
|
2014-04-09 22:43:50 +08:00
|
|
|
; CHECK-NEXT: stur wzr, [x29, #-4]
|
2014-03-29 18:18:08 +08:00
|
|
|
; CHECK: adrp x0, L_.str@PAGE
|
|
|
|
; CHECK: add x0, x0, L_.str@PAGEOFF
|
|
|
|
; CHECK-NEXT: bl _puts
|
2016-03-15 02:17:41 +08:00
|
|
|
; CHECK-NEXT: add sp, sp, #16
|
2014-04-09 22:43:59 +08:00
|
|
|
; CHECK-NEXT: ldp x29, x30, [sp], #16
|
2014-03-29 18:18:08 +08:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
|
|
|
|
; CHECK-LINUX-LABEL: main:
|
2016-03-03 01:58:31 +08:00
|
|
|
; CHECK-LINUX: str x30, [sp, #-16]!
|
2014-03-29 18:18:08 +08:00
|
|
|
; CHECK-LINUX-NEXT: sub sp, sp, #16
|
2016-03-03 01:58:31 +08:00
|
|
|
; CHECK-LINUX-NEXT: str wzr, [sp, #12]
|
2014-03-29 18:18:08 +08:00
|
|
|
; CHECK-LINUX: adrp x0, .L.str
|
|
|
|
; CHECK-LINUX: add x0, x0, :lo12:.L.str
|
|
|
|
; CHECK-LINUX-NEXT: bl puts
|
2016-03-03 01:58:31 +08:00
|
|
|
; CHECK-LINUX-NEXT: add sp, sp, #16
|
|
|
|
; CHECK-LINUX-NEXT: ldr x30, [sp], #16
|
2014-03-29 18:18:08 +08:00
|
|
|
; CHECK-LINUX-NEXT: ret
|
|
|
|
|
|
|
|
@.str = private unnamed_addr constant [7 x i8] c"hello\0A\00"
|
|
|
|
|
|
|
|
define i32 @main() nounwind ssp {
|
|
|
|
entry:
|
|
|
|
%retval = alloca i32, align 4
|
|
|
|
store i32 0, i32* %retval
|
2015-03-14 02:20:45 +08:00
|
|
|
%call = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0))
|
2014-03-29 18:18:08 +08:00
|
|
|
ret i32 %call
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @puts(i8*)
|