diff options
| author | Reid Kleckner <rnk@google.com> | 2015-09-29 23:32:01 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2015-09-29 23:32:01 +0000 |
| commit | a13dfd539b2498c64feabad2bffb98202465dd29 (patch) | |
| tree | 0fecaf173fda392007e00ebc86a92b08e08afd7c /llvm/test/CodeGen | |
| parent | e3fbc89c44f4f3a9fbf26994792916c08e3134da (diff) | |
| download | bcm5719-llvm-a13dfd539b2498c64feabad2bffb98202465dd29.tar.gz bcm5719-llvm-a13dfd539b2498c64feabad2bffb98202465dd29.zip | |
[WinEH] Setup RBP correctly in Win64 funclet prologues
Previously local variable captures just didn't work in 64-bit. Now we
can access local variables more or less correctly.
llvm-svn: 248857
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/win-catchpad-csrs.ll | 8 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/win-catchpad.ll | 15 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/win-cleanuppad.ll | 18 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/win-funclet-cfi.ll | 10 |
4 files changed, 30 insertions, 21 deletions
diff --git a/llvm/test/CodeGen/X86/win-catchpad-csrs.ll b/llvm/test/CodeGen/X86/win-catchpad-csrs.ll index 4a745121cc4..b9f99e61669 100644 --- a/llvm/test/CodeGen/X86/win-catchpad-csrs.ll +++ b/llvm/test/CodeGen/X86/win-catchpad-csrs.ll @@ -75,8 +75,8 @@ catchendblock: ; preds = %catch, ; X86: LBB0_[[catch1bb]]: # %catch{{$}} ; X86: pushl %ebp ; X86-NOT: pushl -; X86: addl $12, %ebp ; X86: subl $16, %esp +; X86: addl $12, %ebp ; X86: movl $1, -{{[0-9]+}}(%ebp) ; X86: movl $2, (%esp) ; X86: calll _f @@ -105,6 +105,7 @@ catchendblock: ; preds = %catch, ; X64: .seh_stackalloc 40 ; X64: leaq 32(%rsp), %rbp ; X64: .seh_setframe 5, 32 +; X64: .seh_endprologue ; X64: callq getint ; X64: callq getint ; X64: callq getint @@ -121,8 +122,11 @@ catchendblock: ; preds = %catch, ; X64: LBB0_[[catch1bb]]: # %catch{{$}} ; X64: movq %rdx, 16(%rsp) ; X64: pushq %rbp -; X64: movq %rdx, %rbp +; X64: .seh_pushreg 5 ; X64: subq $32, %rsp +; X64: .seh_stackalloc 32 +; X64: leaq 32(%rdx), %rbp +; X64: .seh_endprologue ; X64: movl $2, %ecx ; X64: callq f ; X64: leaq [[contbb]](%rip), %rax diff --git a/llvm/test/CodeGen/X86/win-catchpad.ll b/llvm/test/CodeGen/X86/win-catchpad.ll index 5a700b444f2..2c05fbe22f1 100644 --- a/llvm/test/CodeGen/X86/win-catchpad.ll +++ b/llvm/test/CodeGen/X86/win-catchpad.ll @@ -87,8 +87,8 @@ catchendblock: ; preds = %catch, %catch.2, %c ; X86: "?catch$[[catch1bb:[0-9]+]]@?0?try_catch_catch@4HA": ; X86: LBB0_[[catch1bb]]: # %catch{{$}} ; X86: pushl %ebp -; X86: addl $12, %ebp ; X86: subl $8, %esp +; X86: addl $12, %ebp ; X86: movl -32(%ebp), %[[e_reg:[a-z]+]] ; X86: movl $1, -{{[0-9]+}}(%ebp) ; X86: leal -[[local_offs]](%ebp), %[[addr_reg:[a-z]+]] @@ -103,8 +103,8 @@ catchendblock: ; preds = %catch, %catch.2, %c ; X86: "?catch$[[catch2bb:[0-9]+]]@?0?try_catch_catch@4HA": ; X86: LBB0_[[catch2bb]]: # %catch.2{{$}} ; X86: pushl %ebp -; X86: addl $12, %ebp ; X86: subl $8, %esp +; X86: addl $12, %ebp ; X86: movl $1, -{{[0-9]+}}(%ebp) ; X86: leal -[[local_offs]](%ebp), %[[addr_reg:[a-z]+]] ; X86-DAG: movl %[[addr_reg]], 4(%esp) @@ -134,6 +134,7 @@ catchendblock: ; preds = %catch, %catch.2, %c ; X64: .seh_stackalloc 48 ; X64: leaq 48(%rsp), %rbp ; X64: .seh_setframe 5, 48 +; X64: .seh_endprologue ; X64: .Ltmp0 ; X64-DAG: leaq -[[local_offs:[0-9]+]](%rbp), %rdx ; X64-DAG: movl $1, %ecx @@ -147,8 +148,11 @@ catchendblock: ; preds = %catch, %catch.2, %c ; X64: LBB0_[[catch1bb]]: # %catch{{$}} ; X64: movq %rdx, 16(%rsp) ; X64: pushq %rbp -; X64: movq %rdx, %rbp +; X64: .seh_pushreg 5 ; X64: subq $32, %rsp +; X64: .seh_stackalloc 32 +; X64: leaq 48(%rdx), %rbp +; X64: .seh_endprologue ; X64-DAG: .Ltmp4 ; X64-DAG: leaq -[[local_offs]](%rbp), %rdx ; X64-DAG: movl [[e_addr:[-0-9]+]](%rbp), %ecx @@ -162,8 +166,11 @@ catchendblock: ; preds = %catch, %catch.2, %c ; X64: LBB0_[[catch2bb]]: # %catch.2{{$}} ; X64: movq %rdx, 16(%rsp) ; X64: pushq %rbp -; X64: movq %rdx, %rbp +; X64: .seh_pushreg 5 ; X64: subq $32, %rsp +; X64: .seh_stackalloc 32 +; X64: leaq 48(%rdx), %rbp +; X64: .seh_endprologue ; X64-DAG: leaq -[[local_offs]](%rbp), %rdx ; X64-DAG: movl $3, %ecx ; X64: callq f diff --git a/llvm/test/CodeGen/X86/win-cleanuppad.ll b/llvm/test/CodeGen/X86/win-cleanuppad.ll index 02ead25603f..4190b5c5181 100644 --- a/llvm/test/CodeGen/X86/win-cleanuppad.ll +++ b/llvm/test/CodeGen/X86/win-cleanuppad.ll @@ -99,18 +99,18 @@ cleanup.outer: ; preds = %invoke.cont.1, %c ; X64-LABEL: nested_cleanup: ; X64: .Lfunc_begin1: -; X64: .Ltmp14: +; X64: .Ltmp13: ; X64: movl $1, %ecx ; X64: callq f -; X64: .Ltmp16: +; X64: .Ltmp15: ; X64: movl $2, %ecx ; X64: callq f -; X64: .Ltmp17: +; X64: .Ltmp16: ; X64: callq "??1Dtor@@QAE@XZ" -; X64: .Ltmp18: +; X64: .Ltmp17: ; X64: movl $3, %ecx ; X64: callq f -; X64: .Ltmp19: +; X64: .Ltmp18: ; X64: "?dtor$[[cleanup_inner:[0-9]+]]@?0?nested_cleanup@4HA": ; X64: LBB1_[[cleanup_inner]]: # %cleanup.inner{{$}} @@ -155,13 +155,13 @@ cleanup.outer: ; preds = %invoke.cont.1, %c ; X64: $ip2state$nested_cleanup: ; X64-NEXT: .long .Lfunc_begin1@IMGREL ; X64-NEXT: .long -1 -; X64-NEXT: .long .Ltmp14@IMGREL +; X64-NEXT: .long .Ltmp13@IMGREL ; X64-NEXT: .long 0 -; X64-NEXT: .long .Ltmp16@IMGREL +; X64-NEXT: .long .Ltmp15@IMGREL ; X64-NEXT: .long 1 -; X64-NEXT: .long .Ltmp18@IMGREL +; X64-NEXT: .long .Ltmp17@IMGREL ; X64-NEXT: .long 0 -; X64-NEXT: .long .Ltmp19@IMGREL+1 +; X64-NEXT: .long .Ltmp18@IMGREL+1 ; X64-NEXT: .long -1 attributes #0 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } diff --git a/llvm/test/CodeGen/X86/win-funclet-cfi.ll b/llvm/test/CodeGen/X86/win-funclet-cfi.ll index 63a81d81551..63be4f26afa 100644 --- a/llvm/test/CodeGen/X86/win-funclet-cfi.ll +++ b/llvm/test/CodeGen/X86/win-funclet-cfi.ll @@ -51,9 +51,8 @@ declare i32 @__CxxFrameHandler3(...) ; CHECK: subq $32, %rsp ; CHECK: .seh_stackalloc 32 -; FIXME: This looks wrong... -; CHECK: leaq 32(%rsp), %rbp -; CHECK: .seh_setframe 5, 32 +; CHECK: leaq 48(%rdx), %rbp +; CHECK-NOT: .seh_setframe ; Prologue is done, emit the .seh_endprologue directive. ; CHECK: .seh_endprologue @@ -82,9 +81,8 @@ declare i32 @__CxxFrameHandler3(...) ; CHECK: subq $32, %rsp ; CHECK: .seh_stackalloc 32 -; FIXME: This looks wrong... -; CHECK: leaq 32(%rsp), %rbp -; CHECK: .seh_setframe 5, 32 +; CHECK: leaq 48(%rdx), %rbp +; CHECK-NOT: .seh_setframe ; Prologue is done, emit the .seh_endprologue directive. ; CHECK: .seh_endprologue |

