[PATCH] D107049: [clang-repl] Re-implement clang-interpreter as a test case.

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 1 05:36:48 PDT 2021


v.g.vassilev added a comment.

In D107049#2976603 <https://reviews.llvm.org/D107049#2976603>, @thakis wrote:

> The test fails for me on macOS (normal cmake build):
>
>   % tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
>   [==========] Running 1 test from 1 test suite.
>   [----------] Global test environment set-up.
>   [----------] 1 test from InterpreterTest
>   [ RUN      ] InterpreterTest.CatchException
>   In file included from <<< inputs >>>:1:
>   input_line_0:2:10: fatal error: 'stdexcept' file not found
>   #include <stdexcept>
>            ^~~~~~~~~~~
>
> The reason is probably that C++ stdlib headers are part of the toolchain, not the sysroot, on macOS. So self-built clang can't include libc++(abi) headers without some hoops.
>
> Tests should generally be standalone though anyways. Can we remove these includes and just throw some basic type?

Good point. I think I can avoid including stdexcept.

> Finally, hardcoding the path between unit test binary and the rest of the build dir is fairly unusual. Can't this be a lit-style test that uses the normal substitution logic we use in lit?

I did not find a good way to 'find back' the clang resource-dir and it seems to be put in a constant place. The test needs to have a compiled and interpreted parts -- it throws an exception from the interpreter land and expects a compiled binary to be able to catch it. I am not sure if I know how to do that in lit.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107049/new/

https://reviews.llvm.org/D107049



More information about the cfe-commits mailing list