-
Notifications
You must be signed in to change notification settings - Fork 31
Add llvm libunwind callback to suppress exceptions on apple silicon #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -71,9 +71,11 @@ static inline char* GetEnv(const char* Var_Name) { | |||||
#include "llvm/ADT/SmallString.h" | ||||||
#include "llvm/ADT/StringRef.h" | ||||||
#include "llvm/ADT/Twine.h" | ||||||
#include "llvm/BinaryFormat/MachO.h" | ||||||
#include "llvm/Config/llvm-config.h" | ||||||
#include "llvm/ExecutionEngine/JITSymbol.h" | ||||||
#include "llvm/ExecutionEngine/Orc/LLJIT.h" | ||||||
#include "llvm/Object/MachO.h" | ||||||
#include "llvm/Support/Casting.h" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: included header MachO.h is not used directly [misc-include-cleaner]
Suggested change
|
||||||
#include "llvm/Support/Path.h" | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -305,3 +305,25 @@ if (llvm::sys::RunningOnValgrind()) | |||||
delete ExtInterp; | ||||||
#endif | ||||||
} | ||||||
|
||||||
TEST(InterpreterTest, InterpreterExceptions) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function 'TEST' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
Suggested change
|
||||||
Cpp::CreateInterpreter(); | ||||||
EXPECT_TRUE(Cpp::Declare("int f() { throw 1; return 2; }") == 0); | ||||||
EXPECT_TRUE( | ||||||
Cpp::Process( | ||||||
"int ex() { try { f(); return 0; } catch(...){return 1;} }") == 0); | ||||||
EXPECT_EQ(Cpp::Evaluate("ex()"), 1) | ||||||
<< "Failed to catch exceptions in interpreter"; | ||||||
} | ||||||
|
||||||
TEST(InterpreterTest, InterpreterExceptionsCompiledCode) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function 'TEST' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
Suggested change
|
||||||
Cpp::CreateInterpreter(); | ||||||
bool caught = false; | ||||||
try { | ||||||
EXPECT_TRUE(Cpp::Declare("int f() { throw 1; return 2; }") == 0); | ||||||
EXPECT_TRUE(Cpp::Process("int res = f();") == 0); | ||||||
} catch (...) { | ||||||
caught = true; | ||||||
} | ||||||
EXPECT_TRUE(caught) << "Unable to catch exception coming from interpreter"; | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: included header MachO.h is not used directly [misc-include-cleaner]