diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-18 08:11:39 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-18 08:11:39 +0000 |
| commit | cd3c09a5c2566d674680193042baf6474b6d0976 (patch) | |
| tree | 50276c3de1ee4262eccbddb4240bf4267c04a15f /tests/i/extern-cc-runtime/runtime.cc | |
| parent | 30fced09675acfd2b9ab6db6be8359a70d3f0402 (diff) | |
feat(driver): load the embedded C++ runtime into the JIT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/i/extern-cc-runtime/runtime.cc')
| -rw-r--r-- | tests/i/extern-cc-runtime/runtime.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/i/extern-cc-runtime/runtime.cc b/tests/i/extern-cc-runtime/runtime.cc new file mode 100644 index 0000000..fd57538 --- /dev/null +++ b/tests/i/extern-cc-runtime/runtime.cc @@ -0,0 +1,13 @@ +#include <string> +#include <stdexcept> +extern "C" int string_length() { + std::string text(4096, 'x'); + text += std::to_string(123); + return static_cast<int>(text.size()); +} +extern "C" void string_throw() { + try { throw std::invalid_argument("string failure"); } + catch (const std::exception &e) { + if (std::string(e.what()) == "string failure") throw; + } +} |
