1 ; RUN: llc < %s -mtriple=i686-- | FileCheck %s --check-prefix=CHECK-32
2 ; RUN: llc < %s -mtriple=i686-- -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=CHECK-32
3 ; RUN: llc < %s -mtriple=x86_64-pc-win32 -fast-isel | FileCheck %s --check-prefix=CHECK-W64
4 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=CHECK-64
5 ; RUN: llc < %s -mtriple=x86_64-unknown -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=CHECK-64
6 ; RUN: llc < %s -mtriple=x86_64-gnux32 | FileCheck %s --check-prefix=CHECK-X32ABI
7 ; RUN: llc < %s -mtriple=x86_64-gnux32 -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=CHECK-X32ABI
8 ; RUN: llc < %s -mtriple=x86_64-nacl | FileCheck %s --check-prefix=CHECK-NACL64
9 ; RUN: llc < %s -mtriple=x86_64-nacl -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=CHECK-NACL64
11 define i8* @test1() nounwind {
13 ; CHECK-32-LABEL: test1
15 ; CHECK-32-NEXT: movl %esp, %ebp
16 ; CHECK-32-NEXT: movl %ebp, %eax
19 ; CHECK-W64-LABEL: test1
21 ; CHECK-W64-NEXT: movq %rsp, %rbp
22 ; CHECK-W64-NEXT: movq %rbp, %rax
25 ; CHECK-64-LABEL: test1
27 ; CHECK-64-NEXT: movq %rsp, %rbp
28 ; CHECK-64-NEXT: movq %rbp, %rax
31 ; CHECK-X32ABI-LABEL: test1
32 ; CHECK-X32ABI: pushq %rbp
33 ; CHECK-X32ABI-NEXT: movl %esp, %ebp
34 ; CHECK-X32ABI-NEXT: movl %ebp, %eax
35 ; CHECK-X32ABI-NEXT: popq %rbp
36 ; CHECK-X32ABI-NEXT: ret
37 ; CHECK-NACL64-LABEL: test1
38 ; CHECK-NACL64: pushq %rbp
39 ; CHECK-NACL64-NEXT: movq %rsp, %rbp
40 ; CHECK-NACL64-NEXT: movl %ebp, %eax
41 %0 = tail call i8* @llvm.frameaddress(i32 0)
45 define i8* @test2() nounwind {
47 ; CHECK-32-LABEL: test2
49 ; CHECK-32-NEXT: movl %esp, %ebp
50 ; CHECK-32-NEXT: movl (%ebp), %eax
51 ; CHECK-32-NEXT: movl (%eax), %eax
54 ; CHECK-W64-LABEL: test2
56 ; CHECK-W64-NEXT: movq %rsp, %rbp
57 ; CHECK-W64-NEXT: movq %rbp, %rax
60 ; CHECK-64-LABEL: test2
62 ; CHECK-64-NEXT: movq %rsp, %rbp
63 ; CHECK-64-NEXT: movq (%rbp), %rax
64 ; CHECK-64-NEXT: movq (%rax), %rax
67 ; CHECK-X32ABI-LABEL: test2
68 ; CHECK-X32ABI: pushq %rbp
69 ; CHECK-X32ABI-NEXT: movl %esp, %ebp
70 ; CHECK-X32ABI-NEXT: movl (%ebp), %eax
71 ; CHECK-X32ABI-NEXT: movl (%eax), %eax
72 ; CHECK-X32ABI-NEXT: popq %rbp
73 ; CHECK-X32ABI-NEXT: ret
74 ; CHECK-NACL64-LABEL: test2
75 ; CHECK-NACL64: pushq %rbp
76 ; CHECK-NACL64-NEXT: movq %rsp, %rbp
77 ; CHECK-NACL64-NEXT: movl (%ebp), %eax
78 ; CHECK-NACL64-NEXT: movl (%eax), %eax
79 %0 = tail call i8* @llvm.frameaddress(i32 2)
83 declare i8* @llvm.frameaddress(i32) nounwind readnone