[X86, Win64] Use a frame pointer if pushf is emitted
[oota-llvm.git] / test / CodeGen / X86 / pr11415.ll
1 ; RUN: llc -mtriple=x86_64-pc-linux %s -o - -regalloc=fast -optimize-regalloc=0 | FileCheck %s
2
3 ; We used to consider the early clobber in the second asm statement as
4 ; defining %0 before it was read. This caused us to omit the
5 ; movq  -8(%rsp), %rdx
6
7 ; CHECK: pushq  %rax
8 ; CHECK:        #APP
9 ; CHECK-NEXT:   #NO_APP
10 ; CHECK-NEXT:   movq    %rcx, %rax
11 ; CHECK-NEXT:   movq    %rax, (%rsp)
12 ; CHECK-NEXT:   movq    (%rsp), %rdx
13 ; CHECK-NEXT:   #APP
14 ; CHECK-NEXT:   #NO_APP
15 ; CHECK-NEXT:   movq    %rdx, %rax
16 ; CHECK-NEXT:   movq    %rdx, (%rsp)
17 ; CHECK-NEXT:   popq    %rcx
18 ; CHECK-NEXT:   ret
19
20 define i64 @foo() {
21 entry:
22   %0 = tail call i64 asm "", "={cx}"() nounwind
23   %1 = tail call i64 asm "", "=&r,0,r,~{rax}"(i64 %0, i64 %0) nounwind
24   ret i64 %1
25 }