1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-linux-gnueabi | FileCheck %s
3 ; RUN: opt < %s -O3 -S -mtriple=x86_64-linux-gnueabi | FileCheck %s --check-prefix=OPT
5 define i64 @get_frame() #0 {
7 ; CHECK-LABEL: get_frame:
8 ; CHECK: movq %rbp, %rax
9 %sp = call i64 @llvm.read_register.i64(metadata !0)
10 ; OPT: @llvm.read_register.i64
14 define void @set_frame(i64 %val) #0 {
16 ; CHECK-LABEL: set_frame:
17 ; CHECK: movq %rdi, %rbp
18 call void @llvm.write_register.i64(metadata !0, i64 %val)
19 ; OPT: @llvm.write_register.i64
23 declare i64 @llvm.read_register.i64(metadata) nounwind
24 declare void @llvm.write_register.i64(metadata, i64) nounwind
26 ; register unsigned long current_stack_pointer asm("rbp");
27 ; CHECK-NOT: .asciz "rbp"
30 attributes #0 = { nounwind "frame-pointer"="all" }