[libc++] Fix atomic test for _BitInt

In 6c75ab5f66, Clang deprecated _ExtInt in favor of _BitInt, which
made this test fail. This patch disables the test on older compilers
and uses the new _BitInt type instead.

Differential Revision: https://reviews.llvm.org/D115194
This commit is contained in:
Louis Dionne 2021-12-06 18:09:47 -05:00
parent 420300c0d8
commit c49a13a45a
1 changed files with 6 additions and 4 deletions

View File

@ -8,11 +8,13 @@
// <atomic>
// Make sure that `std::atomic` doesn't work with `_ExtInt`. The intent is to
// Make sure that `std::atomic` doesn't work with `_BitInt`. The intent is to
// disable them for now until their behavior can be designed better later.
// See https://reviews.llvm.org/D84049 for details.
// UNSUPPORTED: apple-clang-12
// TODO(ldionne): Re-enable the test on clang-14 once 6c75ab5f66b4 lands in the CI.
// UNSUPPORTED: apple-clang-12, apple-clang-13
// UNSUPPORTED: clang-12, clang-13, clang-14
// UNSUPPORTED: c++03
@ -20,8 +22,8 @@
int main(int, char**)
{
// expected-error@atomic:*1 {{_Atomic cannot be applied to integer type '_ExtInt(32)'}}
std::atomic<_ExtInt(32)> x(42);
// expected-error@atomic:*1 {{_Atomic cannot be applied to integer type '_BitInt(32)'}}
std::atomic<_BitInt(32)> x(42);
return 0;
}