diff options
| author | Reid Kleckner <rnk@google.com> | 2015-09-10 00:25:23 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2015-09-10 00:25:23 +0000 |
| commit | 787839120885519d4cbff64ad59e179bdf3744fa (patch) | |
| tree | dd894b990329961d9452bd1f672fe38c263c7100 /llvm/test/CodeGen | |
| parent | 60f3e1f466c9dfa834ab9e71ae4fe0589a42774f (diff) | |
| download | bcm5719-llvm-787839120885519d4cbff64ad59e179bdf3744fa.tar.gz bcm5719-llvm-787839120885519d4cbff64ad59e179bdf3744fa.zip | |
[WinEH] Add codegen support for cleanuppad and cleanupret
All of the complexity is in cleanupret, and it mostly follows the same
codepaths as catchret, except it doesn't take a return value in RAX.
This small example now compiles and executes successfully on win32:
extern "C" int printf(const char *, ...) noexcept;
struct Dtor {
~Dtor() { printf("~Dtor\n"); }
};
void has_cleanup() {
Dtor o;
throw 42;
}
int main() {
try {
has_cleanup();
} catch (int) {
printf("caught it\n");
}
}
Don't try to put the cleanup in the same function as the catch, or Bad
Things will happen.
llvm-svn: 247219
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/win-catchpad-csrs.ll | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/win-catchpad.ll | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/X86/win-catchpad-csrs.ll b/llvm/test/CodeGen/X86/win-catchpad-csrs.ll index f765207d19d..6e72268432a 100644 --- a/llvm/test/CodeGen/X86/win-catchpad-csrs.ll +++ b/llvm/test/CodeGen/X86/win-catchpad-csrs.ll @@ -63,7 +63,7 @@ catchendblock: ; preds = %catch, ; X86: movl $0, -{{[0-9]+}}(%ebp) ; X86: movl $1, (%esp) ; X86: calll _f -; X86: [[contbb:LBB0_[0-9]+]]: +; X86: [[contbb:Ltmp[0-9]+]]: # Block address taken ; X86: movl -{{[0-9]+}}(%ebp), %esp ; X86: addl ${{[0-9]+}}, %esp ; X86: popl %esi @@ -111,7 +111,7 @@ catchendblock: ; preds = %catch, ; X64: callq useints ; X64: movl $1, %ecx ; X64: callq f -; X64: [[contbb:\.LBB0_[0-9]+]]: +; X64: [[contbb:.Ltmp[0-9]+]]: # Block address taken ; X64: addq $40, %rsp ; X64: popq %rbp ; X64: retq diff --git a/llvm/test/CodeGen/X86/win-catchpad.ll b/llvm/test/CodeGen/X86/win-catchpad.ll index 12a58be6dea..c41087a4deb 100644 --- a/llvm/test/CodeGen/X86/win-catchpad.ll +++ b/llvm/test/CodeGen/X86/win-catchpad.ll @@ -71,7 +71,7 @@ catchendblock: ; preds = %catch, %catch.2, %c ; X86-DAG: movl %[[addr_reg]], 4(%esp) ; X86-DAG: movl $1, (%esp) ; X86: calll _f -; X86: [[contbb:LBB0_[0-9]+]]: +; X86: [[contbb:Ltmp[0-9]+]]: # Block address taken ; X86: movl -{{[0-9]+}}(%ebp), %esp ; X86: retl @@ -120,7 +120,7 @@ catchendblock: ; preds = %catch, %catch.2, %c ; X64-DAG: leaq -[[local_offs:[0-9]+]](%rbp), %rdx ; X64-DAG: movl $1, %ecx ; X64: callq f -; X64: [[contbb:\.LBB0_[0-9]+]]: +; X64: [[contbb:.Ltmp[0-9]+]]: # Block address taken ; X64: addq $48, %rsp ; X64: popq %rbp ; X64: retq |

