1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -frame-pointer=all -mtriple=i686-- | FileCheck %s --check-prefix=i686
3 ; RUN: llc < %s -frame-pointer=all -mtriple=x86_64-- | FileCheck %s --check-prefix=x86_64
5 define ptr @h() nounwind readnone optsize {
7 ; i686: # %bb.0: # %entry
8 ; i686-NEXT: pushl %ebp
9 ; i686-NEXT: movl %esp, %ebp
10 ; i686-NEXT: movl (%ebp), %eax
11 ; i686-NEXT: movl (%eax), %eax
12 ; i686-NEXT: movl 4(%eax), %eax
13 ; i686-NEXT: popl %ebp
17 ; x86_64: # %bb.0: # %entry
18 ; x86_64-NEXT: pushq %rbp
19 ; x86_64-NEXT: movq %rsp, %rbp
20 ; x86_64-NEXT: movq (%rbp), %rax
21 ; x86_64-NEXT: movq (%rax), %rax
22 ; x86_64-NEXT: movq 8(%rax), %rax
23 ; x86_64-NEXT: popq %rbp
26 %0 = tail call ptr @llvm.returnaddress(i32 2) ; <ptr> [#uses=1]
30 declare ptr @llvm.returnaddress(i32) nounwind readnone
32 define ptr @g() nounwind readnone optsize {
34 ; i686: # %bb.0: # %entry
35 ; i686-NEXT: pushl %ebp
36 ; i686-NEXT: movl %esp, %ebp
37 ; i686-NEXT: movl (%ebp), %eax
38 ; i686-NEXT: movl 4(%eax), %eax
39 ; i686-NEXT: popl %ebp
43 ; x86_64: # %bb.0: # %entry
44 ; x86_64-NEXT: pushq %rbp
45 ; x86_64-NEXT: movq %rsp, %rbp
46 ; x86_64-NEXT: movq (%rbp), %rax
47 ; x86_64-NEXT: movq 8(%rax), %rax
48 ; x86_64-NEXT: popq %rbp
51 %0 = tail call ptr @llvm.returnaddress(i32 1) ; <ptr> [#uses=1]
55 define ptr @f() nounwind readnone optsize {
57 ; i686: # %bb.0: # %entry
58 ; i686-NEXT: pushl %ebp
59 ; i686-NEXT: movl %esp, %ebp
60 ; i686-NEXT: movl 4(%ebp), %eax
61 ; i686-NEXT: popl %ebp
65 ; x86_64: # %bb.0: # %entry
66 ; x86_64-NEXT: pushq %rbp
67 ; x86_64-NEXT: movq %rsp, %rbp
68 ; x86_64-NEXT: movq 8(%rbp), %rax
69 ; x86_64-NEXT: popq %rbp
72 %0 = tail call ptr @llvm.returnaddress(i32 0) ; <ptr> [#uses=1]