1 ; RUN: llc < %s -march=x86 | FileCheck %s --check-prefix=CHECK-32
2 ; RUN: llc < %s -march=x86 -fast-isel -fast-isel-abort | FileCheck %s --check-prefix=CHECK-32
3 ; RUN: llc < %s -march=x86-64 | FileCheck %s --check-prefix=CHECK-64
4 ; RUN: llc < %s -march=x86-64 -fast-isel -fast-isel-abort | FileCheck %s --check-prefix=CHECK-64
5 ; RUN: llc < %s -mtriple=x86_64-gnux32 | FileCheck %s --check-prefix=CHECK-X32ABI
6 ; RUN: llc < %s -mtriple=x86_64-gnux32 -fast-isel -fast-isel-abort | FileCheck %s --check-prefix=CHECK-X32ABI
7 ; RUN: llc < %s -mtriple=x86_64-nacl | FileCheck %s --check-prefix=CHECK-NACL64
8 ; RUN: llc < %s -mtriple=x86_64-nacl -fast-isel -fast-isel-abort | FileCheck %s --check-prefix=CHECK-NACL64
10 define i8* @test1() nounwind {
12 ; CHECK-32-LABEL: test1
14 ; CHECK-32-NEXT: movl %esp, %ebp
15 ; CHECK-32-NEXT: movl %ebp, %eax
18 ; CHECK-64-LABEL: test1
20 ; CHECK-64-NEXT: movq %rsp, %rbp
21 ; CHECK-64-NEXT: movq %rbp, %rax
24 ; CHECK-X32ABI-LABEL: test1
25 ; CHECK-X32ABI: pushq %rbp
26 ; CHECK-X32ABI-NEXT: movl %esp, %ebp
27 ; CHECK-X32ABI-NEXT: movl %ebp, %eax
28 ; CHECK-X32ABI-NEXT: popq %rbp
29 ; CHECK-X32ABI-NEXT: ret
30 ; CHECK-NACL64-LABEL: test1
31 ; CHECK-NACL64: pushq %rbp
32 ; CHECK-NACL64-NEXT: movq %rsp, %rbp
33 ; CHECK-NACL64-NEXT: movl %ebp, %eax
34 %0 = tail call i8* @llvm.frameaddress(i32 0)
38 define i8* @test2() nounwind {
40 ; CHECK-32-LABEL: test2
42 ; CHECK-32-NEXT: movl %esp, %ebp
43 ; CHECK-32-NEXT: movl (%ebp), %eax
44 ; CHECK-32-NEXT: movl (%eax), %eax
47 ; CHECK-64-LABEL: test2
49 ; CHECK-64-NEXT: movq %rsp, %rbp
50 ; CHECK-64-NEXT: movq (%rbp), %rax
51 ; CHECK-64-NEXT: movq (%rax), %rax
54 ; CHECK-X32ABI-LABEL: test2
55 ; CHECK-X32ABI: pushq %rbp
56 ; CHECK-X32ABI-NEXT: movl %esp, %ebp
57 ; CHECK-X32ABI-NEXT: movl (%ebp), %eax
58 ; CHECK-X32ABI-NEXT: movl (%eax), %eax
59 ; CHECK-X32ABI-NEXT: popq %rbp
60 ; CHECK-X32ABI-NEXT: ret
61 ; CHECK-NACL64-LABEL: test2
62 ; CHECK-NACL64: pushq %rbp
63 ; CHECK-NACL64-NEXT: movq %rsp, %rbp
64 ; CHECK-NACL64-NEXT: movl (%ebp), %eax
65 ; CHECK-NACL64-NEXT: movl (%eax), %eax
66 %0 = tail call i8* @llvm.frameaddress(i32 2)
70 declare i8* @llvm.frameaddress(i32) nounwind readnone