llvm/test/CodeGen/X86/cleanuppad-large-codemodel.ll
David Majnemer b46bb541f5 [WinEH] Use operand bundles to describe call sites
SimplifyCFG allows tail merging with code which terminates in
unreachable which, in turn, makes it possible for an invoke to end up in
a funclet which it was not originally part of.

Using operand bundles on invokes allows us to determine whether or not
an invoke was part of a funclet in the source program.

Furthermore, it allows us to unambiguously answer questions about the
legality of inlining into call sites which the personality may have
trouble with.

Differential Revision: http://reviews.llvm.org/D15517

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255674 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 21:27:27 +00:00

28 lines
669 B
LLVM

; RUN: llc -mtriple=x86_64-pc-windows-msvc -code-model=large -o - < %s | FileCheck %s
declare i32 @__CxxFrameHandler3(...)
declare void @bar()
define void @foo() personality i32 (...)* @__CxxFrameHandler3 {
entry:
invoke void @bar()
to label %exit unwind label %cleanup
cleanup:
%c = cleanuppad within none []
call void @bar() [ "funclet"(token %c) ]
cleanupret from %c unwind to caller
exit:
ret void
}
; CHECK: foo: # @foo
; CHECK: movabsq $bar, %[[reg:[^ ]*]]
; CHECK: callq *%[[reg]]
; CHECK: retq
; CHECK: "?dtor$2@?0?foo@4HA":
; CHECK: movabsq $bar, %[[reg:[^ ]*]]
; CHECK: callq *%[[reg]]
; CHECK: retq # CLEANUPRET