summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-11-16 18:47:25 +0000
committerReid Kleckner <rnk@google.com>2015-11-16 18:47:25 +0000
commitc397b26790871ea0be6fa7dfdd860c2584560e8f (patch)
treeffc26fac02511eae255c56e5825bfde9ab6073db /llvm/test/CodeGen
parent4255b04e7bfa3197fdae6b042b7ccbf8f86be061 (diff)
downloadbcm5719-llvm-c397b26790871ea0be6fa7dfdd860c2584560e8f.tar.gz
bcm5719-llvm-c397b26790871ea0be6fa7dfdd860c2584560e8f.zip
[WinEH] Don't let UnwindHelp alias the return address
On top of that, don't bother allocating and initializing UnwindHelp if we don't have any funclets. Currently we always use RBP as our frame pointer when funclets are present, so this change makes it impossible to come here without any fixed stack objects. Fixes PR25533. llvm-svn: 253245
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/win-cleanuppad.ll30
-rw-r--r--llvm/test/CodeGen/X86/wineh-no-ehpads.ll20
2 files changed, 50 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/win-cleanuppad.ll b/llvm/test/CodeGen/X86/win-cleanuppad.ll
index aed410f79b1..27bb6e2abed 100644
--- a/llvm/test/CodeGen/X86/win-cleanuppad.ll
+++ b/llvm/test/CodeGen/X86/win-cleanuppad.ll
@@ -19,6 +19,36 @@ ehcleanup: ; preds = %entry
cleanupret %0 unwind to caller
}
+; CHECK: simple_cleanup: # @simple_cleanup
+; CHECK: pushq %rbp
+; CHECK: subq $48, %rsp
+; CHECK: leaq 48(%rsp), %rbp
+; CHECK: movq $-2, -8(%rbp)
+; CHECK: movl $1, %ecx
+; CHECK: callq f
+; CHECK: callq "??1Dtor@@QAE@XZ"
+; CHECK: nop
+; CHECK: addq $48, %rsp
+; CHECK: popq %rbp
+; CHECK: retq
+
+; CHECK: "?dtor$2@?0?simple_cleanup@4HA":
+; CHECK: callq "??1Dtor@@QAE@XZ"
+; CHECK: retq
+
+; CHECK: $cppxdata$simple_cleanup:
+; CHECK-NEXT: .long 429065506
+; CHECK-NEXT: .long 1
+; CHECK-NEXT: .long ($stateUnwindMap$simple_cleanup)@IMGREL
+; CHECK-NEXT: .long 0
+; CHECK-NEXT: .long 0
+; CHECK-NEXT: .long 3
+; CHECK-NEXT: .long ($ip2state$simple_cleanup)@IMGREL
+; UnwindHelp offset should match the -2 store above
+; CHECK-NEXT: .long 40
+; CHECK-NEXT: .long 0
+; CHECK-NEXT: .long 1
+
declare void @f(i32) #0
declare i32 @__CxxFrameHandler3(...)
diff --git a/llvm/test/CodeGen/X86/wineh-no-ehpads.ll b/llvm/test/CodeGen/X86/wineh-no-ehpads.ll
new file mode 100644
index 00000000000..fd6798f2e08
--- /dev/null
+++ b/llvm/test/CodeGen/X86/wineh-no-ehpads.ll
@@ -0,0 +1,20 @@
+; RUN: llc < %s | FileCheck %s
+
+target triple = "x86_64-pc-windows-msvc"
+
+declare void @g()
+declare i32 @__CxxFrameHandler3(...)
+
+define void @personality_no_ehpad() personality i32 (...)* @__CxxFrameHandler3 {
+ call void @g()
+ ret void
+}
+
+; CHECK-LABEL: personality_no_ehpad: # @personality_no_ehpad
+; CHECK-NOT: movq $-2,
+; CHECK: callq g
+; CHECK: nop
+; CHECK: retq
+
+; Shouldn't have any LSDA either.
+; CHECK-NOT: cppxdata
OpenPOWER on IntegriCloud