diff options
author | Lang Hames <lhames@gmail.com> | 2016-01-14 22:02:03 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-01-14 22:02:03 +0000 |
commit | 52c472416535ae31309009f9fc565506b38b2e17 (patch) | |
tree | d8c08a02ea5f85b28101e590e5fd89aa5d7b8864 /llvm/test/ExecutionEngine | |
parent | 0d11212f004c9193dd1cb2b01a80d6934b5fb5f9 (diff) | |
download | bcm5719-llvm-52c472416535ae31309009f9fc565506b38b2e17.tar.gz bcm5719-llvm-52c472416535ae31309009f9fc565506b38b2e17.zip |
[Orc] Add support for EH-frame registration to the Orc Remote Target utility
classes.
OrcRemoteTargetClient::RCMemoryManager will now register EH frames with the
server automatically. This allows remote-execution of code that uses exceptions.
llvm-svn: 257816
Diffstat (limited to 'llvm/test/ExecutionEngine')
-rw-r--r-- | llvm/test/ExecutionEngine/MCJIT/remote/eh.ll | 32 | ||||
-rw-r--r-- | llvm/test/ExecutionEngine/OrcMCJIT/remote/eh.ll | 32 |
2 files changed, 64 insertions, 0 deletions
diff --git a/llvm/test/ExecutionEngine/MCJIT/remote/eh.ll b/llvm/test/ExecutionEngine/MCJIT/remote/eh.ll new file mode 100644 index 00000000000..f772e1c03e6 --- /dev/null +++ b/llvm/test/ExecutionEngine/MCJIT/remote/eh.ll @@ -0,0 +1,32 @@ +; RUN: %lli -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s +; XFAIL: arm, cygwin, win32, mingw +declare i8* @__cxa_allocate_exception(i64) +declare void @__cxa_throw(i8*, i8*, i8*) +declare i32 @__gxx_personality_v0(...) +declare void @__cxa_end_catch() +declare i8* @__cxa_begin_catch(i8*) + +@_ZTIi = external constant i8* + +define void @throwException() { + %exception = tail call i8* @__cxa_allocate_exception(i64 4) + call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) + unreachable +} + +define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +entry: + invoke void @throwException() + to label %try.cont unwind label %lpad + +lpad: + %p = landingpad { i8*, i32 } + catch i8* bitcast (i8** @_ZTIi to i8*) + %e = extractvalue { i8*, i32 } %p, 0 + call i8* @__cxa_begin_catch(i8* %e) + call void @__cxa_end_catch() + br label %try.cont + +try.cont: + ret i32 0 +} diff --git a/llvm/test/ExecutionEngine/OrcMCJIT/remote/eh.ll b/llvm/test/ExecutionEngine/OrcMCJIT/remote/eh.ll new file mode 100644 index 00000000000..f772e1c03e6 --- /dev/null +++ b/llvm/test/ExecutionEngine/OrcMCJIT/remote/eh.ll @@ -0,0 +1,32 @@ +; RUN: %lli -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s +; XFAIL: arm, cygwin, win32, mingw +declare i8* @__cxa_allocate_exception(i64) +declare void @__cxa_throw(i8*, i8*, i8*) +declare i32 @__gxx_personality_v0(...) +declare void @__cxa_end_catch() +declare i8* @__cxa_begin_catch(i8*) + +@_ZTIi = external constant i8* + +define void @throwException() { + %exception = tail call i8* @__cxa_allocate_exception(i64 4) + call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) + unreachable +} + +define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +entry: + invoke void @throwException() + to label %try.cont unwind label %lpad + +lpad: + %p = landingpad { i8*, i32 } + catch i8* bitcast (i8** @_ZTIi to i8*) + %e = extractvalue { i8*, i32 } %p, 0 + call i8* @__cxa_begin_catch(i8* %e) + call void @__cxa_end_catch() + br label %try.cont + +try.cont: + ret i32 0 +} |