[llvm-bugs] [Bug 49692] New: Cannot catch exceptions on Apple M1

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 23 02:58:33 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49692

            Bug ID: 49692
           Summary: Cannot catch exceptions on Apple M1
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Generic Execution Engine Support
          Assignee: unassignedbugs at nondot.org
          Reporter: hahnjo at hahnjo.de
                CC: 1101.debian at gmail.com, llvm-bugs at lists.llvm.org

On arm64-apple-darwin20.3.0, consider the following code:
 % cat test.cc
int main() {
  try {
    throw 1;
  } catch (...) { }
}

When compiled into an executable (by either Apple clang or Clang trunk), the
program exits normally:
 % clang++ -O2 throw.cc -o throw
 % ./throw
 % echo $?
0

However, the same code crashes when compiling into LLVM IR and executing via
lli:
 % clang++ -O2 -S -emit-llvm throw.cc
 % lli throw.ll
libc++abi.dylib: terminating with uncaught exception of type int

I've tried all combinations of --jit-kind and --jit-link, none of them worked.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210323/00469ab7/attachment.html>


More information about the llvm-bugs mailing list