diff options
author | Sergio Afonso <safonsof@amd.com> | 2025-01-09 10:28:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-09 10:28:16 +0000 |
commit | b79ed8729b3d6d5482481c41a7de2cd75b0f61df (patch) | |
tree | b601c65c78741d191ac23f34de23b23f8362fe60 /clang/test/AST/ByteCode/builtin-functions.cpp | |
parent | 659cd2a48a25ec4deabf4c7937acbaec588a2724 (diff) | |
download | llvm-b79ed8729b3d6d5482481c41a7de2cd75b0f61df.zip llvm-b79ed8729b3d6d5482481c41a7de2cd75b0f61df.tar.gz llvm-b79ed8729b3d6d5482481c41a7de2cd75b0f61df.tar.bz2 |
[OpenMP][OMPIRBuilder] Handle non-failing calls properly (#115863)
The preprocessor definition used to enable asserts and the one that
`llvm::Error` and `llvm::Expected` use to ensure all created instances are
checked are not the same. By making these checks inside of an `assert` in cases
where errors are not expected, certain build configurations would trigger
runtime failures (e.g. `-DLLVM_ENABLE_ASSERTIONS=OFF
-DLLVM_UNREACHABLE_OPTIMIZE=ON`).
The `llvm::cantFail()` function, which was intended for this use case, is used
by this patch in place of `assert` to prevent these runtime failures. In tests,
new preprocessor definitions based on `ASSERT_THAT_EXPECTED` and
`EXPECT_THAT_EXPECTED` are used instead, to avoid silent failures in release
builds.
Diffstat (limited to 'clang/test/AST/ByteCode/builtin-functions.cpp')
0 files changed, 0 insertions, 0 deletions