diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index b161be3a07752..a4b61b9074d91 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -711,13 +711,6 @@ Bug Fixes in This Version - Fix a hang on valid C code passing a function type as an argument to ``typeof`` to form a function declaration. (`#64713 _`) -- Fixed an issue where accesses to the local variables of a coroutine during - ``await_suspend`` could be misoptimized, including accesses to the awaiter - object itself. - (`#56301 `_) - The current solution may bring performance regressions if the awaiters have - non-static data members. See - `#64945 `_ for details. - Clang now correctly diagnoses ``function_needs_feature`` when always_inline callee has incompatible target features with caller. - Removed the linking of libraries when ``-r`` is passed to the driver on AIX. @@ -1008,7 +1001,7 @@ CUDA Support AIX Support ^^^^^^^^^^^ -- Enabled ThinLTO support. Minimum OS requirement is AIX 7.2 TL5 SP6 or +- Enabled ThinLTO support. Minimum OS requirement is AIX 7.2 TL5 SP7 or the upcoming AIX 7.3 TL2. - Enabled integrated assembler (``-f[no-]integrated-as``) for LTO. LTO now diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 0d1e9ad439b7d..6b8af9bf18c1f 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -5487,30 +5487,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, Attrs.addFnAttribute(getLLVMContext(), llvm::Attribute::AlwaysInline); } - // The await_suspend call performed by co_await is essentially asynchronous - // to the execution of the coroutine. Inlining it normally into an unsplit - // coroutine can cause miscompilation because the coroutine CFG misrepresents - // the true control flow of the program: things that happen in the - // await_suspend are not guaranteed to happen prior to the resumption of the - // coroutine, and things that happen after the resumption of the coroutine - // (including its exit and the potential deallocation of the coroutine frame) - // are not guaranteed to happen only after the end of await_suspend. - // - // The short-term solution to this problem is to mark the call as uninlinable. - // But we don't want to do this if the call is known to be trivial, which is - // very common. - // - // The long-term solution may introduce patterns like: - // - // call @llvm.coro.await_suspend(ptr %awaiter, ptr %handle, - // ptr @awaitSuspendFn) - // - // Then it is much easier to perform the safety analysis in the middle end. - // If it is safe to inline the call to awaitSuspend, we can replace it in the - // CoroEarly pass. Otherwise we could replace it in the CoroSplit pass. - if (inSuspendBlock() && mayCoroHandleEscape()) - Attrs = Attrs.addFnAttribute(getLLVMContext(), llvm::Attribute::NoInline); - // Disable inlining inside SEH __try blocks. if (isSEHTryScope()) { Attrs = Attrs.addFnAttribute(getLLVMContext(), llvm::Attribute::NoInline); diff --git a/clang/lib/CodeGen/CGCoroutine.cpp b/clang/lib/CodeGen/CGCoroutine.cpp index 810ae7d51ec10..8437cda79beb2 100644 --- a/clang/lib/CodeGen/CGCoroutine.cpp +++ b/clang/lib/CodeGen/CGCoroutine.cpp @@ -139,36 +139,6 @@ static bool memberCallExpressionCanThrow(const Expr *E) { return true; } -/// Return true when the coroutine handle may escape from the await-suspend -/// (`awaiter.await_suspend(std::coroutine_handle)` expression). -/// Return false only when the coroutine wouldn't escape in the await-suspend -/// for sure. -/// -/// While it is always safe to return true, return falses can bring better -/// performances. -/// -/// See https://github.com/llvm/llvm-project/issues/56301 and -/// https://reviews.llvm.org/D157070 for the example and the full discussion. -/// -/// FIXME: It will be much better to perform such analysis in the middle end. -/// See the comments in `CodeGenFunction::EmitCall` for example. -static bool MayCoroHandleEscape(CoroutineSuspendExpr const &S) { - CXXRecordDecl *Awaiter = - S.getCommonExpr()->getType().getNonReferenceType()->getAsCXXRecordDecl(); - - // Return true conservatively if the awaiter type is not a record type. - if (!Awaiter) - return true; - - // In case the awaiter type is empty, the suspend wouldn't leak the coroutine - // handle. - // - // TODO: We can improve this by looking into the implementation of - // await-suspend and see if the coroutine handle is passed to foreign - // functions. - return !Awaiter->field_empty(); -} - // Emit suspend expression which roughly looks like: // // auto && x = CommonExpr(); @@ -229,11 +199,8 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Co auto *SaveCall = Builder.CreateCall(CoroSave, {NullPtr}); CGF.CurCoro.InSuspendBlock = true; - CGF.CurCoro.MayCoroHandleEscape = MayCoroHandleEscape(S); auto *SuspendRet = CGF.EmitScalarExpr(S.getSuspendExpr()); CGF.CurCoro.InSuspendBlock = false; - CGF.CurCoro.MayCoroHandleEscape = false; - if (SuspendRet != nullptr && SuspendRet->getType()->isIntegerTy(1)) { // Veto suspension if requested by bool returning await_suspend. BasicBlock *RealSuspendBlock = diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 28ec2b9700721..8722fd4550e4a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -334,7 +334,6 @@ class CodeGenFunction : public CodeGenTypeCache { struct CGCoroInfo { std::unique_ptr Data; bool InSuspendBlock = false; - bool MayCoroHandleEscape = false; CGCoroInfo(); ~CGCoroInfo(); }; @@ -348,10 +347,6 @@ class CodeGenFunction : public CodeGenTypeCache { return isCoroutine() && CurCoro.InSuspendBlock; } - bool mayCoroHandleEscape() const { - return isCoroutine() && CurCoro.MayCoroHandleEscape; - } - /// CurGD - The GlobalDecl for the current function being compiled. GlobalDecl CurGD; diff --git a/clang/test/CodeGenCoroutines/coro-awaiter-noinline-suspend.cpp b/clang/test/CodeGenCoroutines/coro-awaiter-noinline-suspend.cpp deleted file mode 100644 index f935e256d9db9..0000000000000 --- a/clang/test/CodeGenCoroutines/coro-awaiter-noinline-suspend.cpp +++ /dev/null @@ -1,207 +0,0 @@ -// Tests that we can mark await-suspend as noinline correctly. -// -// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s \ -// RUN: -disable-llvm-passes | FileCheck %s - -#include "Inputs/coroutine.h" - -struct Task { - struct promise_type { - struct FinalAwaiter { - bool await_ready() const noexcept { return false; } - template - std::coroutine_handle<> await_suspend(std::coroutine_handle h) noexcept { - return h.promise().continuation; - } - void await_resume() noexcept {} - }; - - Task get_return_object() noexcept { - return std::coroutine_handle::from_promise(*this); - } - - std::suspend_always initial_suspend() noexcept { return {}; } - FinalAwaiter final_suspend() noexcept { return {}; } - void unhandled_exception() noexcept {} - void return_void() noexcept {} - - std::coroutine_handle<> continuation; - }; - - Task(std::coroutine_handle handle); - ~Task(); - -private: - std::coroutine_handle handle; -}; - -struct StatefulAwaiter { - int value; - bool await_ready() const noexcept { return false; } - template - void await_suspend(std::coroutine_handle h) noexcept {} - void await_resume() noexcept {} -}; - -typedef std::suspend_always NoStateAwaiter; -using AnotherStatefulAwaiter = StatefulAwaiter; - -template -struct TemplatedAwaiter { - T value; - bool await_ready() const noexcept { return false; } - template - void await_suspend(std::coroutine_handle h) noexcept {} - void await_resume() noexcept {} -}; - - -class Awaitable {}; -StatefulAwaiter operator co_await(Awaitable) { - return StatefulAwaiter{}; -} - -StatefulAwaiter GlobalAwaiter; -class Awaitable2 {}; -StatefulAwaiter& operator co_await(Awaitable2) { - return GlobalAwaiter; -} - -Task testing() { - co_await std::suspend_always{}; - co_await StatefulAwaiter{}; - co_await AnotherStatefulAwaiter{}; - - // Test lvalue case. - StatefulAwaiter awaiter; - co_await awaiter; - - // The explicit call to await_suspend is not considered suspended. - awaiter.await_suspend(std::coroutine_handle::from_address(nullptr)); - - co_await TemplatedAwaiter{}; - TemplatedAwaiter TemplatedAwaiterInstace; - co_await TemplatedAwaiterInstace; - - co_await Awaitable{}; - co_await Awaitable2{}; -} - -// CHECK-LABEL: @_Z7testingv - -// Check `co_await __promise__.initial_suspend();` Since it returns std::suspend_always, -// which is an empty class, we shouldn't generate optimization blocker for it. -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZNSt14suspend_always13await_suspendESt16coroutine_handleIvE{{.*}}#[[NORMAL_ATTR:[0-9]+]] - -// Check the `co_await std::suspend_always{};` expression. We shouldn't emit the optimization -// blocker for it since it is an empty class. -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZNSt14suspend_always13await_suspendESt16coroutine_handleIvE{{.*}}#[[NORMAL_ATTR]] - -// Check `co_await StatefulAwaiter{};`. We need to emit the optimization blocker since -// the awaiter is not empty. -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZN15StatefulAwaiter13await_suspendIN4Task12promise_typeEEEvSt16coroutine_handleIT_E{{.*}}#[[NOINLINE_ATTR:[0-9]+]] - -// Check `co_await AnotherStatefulAwaiter{};` to make sure that we can handle TypedefTypes. -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZN15StatefulAwaiter13await_suspendIN4Task12promise_typeEEEvSt16coroutine_handleIT_E{{.*}}#[[NOINLINE_ATTR]] - -// Check `co_await awaiter;` to make sure we can handle lvalue cases. -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZN15StatefulAwaiter13await_suspendIN4Task12promise_typeEEEvSt16coroutine_handleIT_E{{.*}}#[[NOINLINE_ATTR]] - -// Check `awaiter.await_suspend(...)` to make sure the explicit call the await_suspend won't be marked as noinline -// CHECK: call void @_ZN15StatefulAwaiter13await_suspendIvEEvSt16coroutine_handleIT_E{{.*}}#[[NORMAL_ATTR]] - -// Check `co_await TemplatedAwaiter{};` to make sure we can handle specialized template -// type. -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZN16TemplatedAwaiterIiE13await_suspendIN4Task12promise_typeEEEvSt16coroutine_handleIT_E{{.*}}#[[NOINLINE_ATTR]] - -// Check `co_await TemplatedAwaiterInstace;` to make sure we can handle the lvalue from -// specialized template type. -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZN16TemplatedAwaiterIiE13await_suspendIN4Task12promise_typeEEEvSt16coroutine_handleIT_E{{.*}}#[[NOINLINE_ATTR]] - -// Check `co_await Awaitable{};` to make sure we can handle awaiter returned by -// `operator co_await`; -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZN15StatefulAwaiter13await_suspendIN4Task12promise_typeEEEvSt16coroutine_handleIT_E{{.*}}#[[NOINLINE_ATTR]] - -// Check `co_await Awaitable2{};` to make sure we can handle awaiter returned by -// `operator co_await` which returns a reference; -// CHECK: call token @llvm.coro.save -// CHECK: call void @_ZN15StatefulAwaiter13await_suspendIN4Task12promise_typeEEEvSt16coroutine_handleIT_E{{.*}}#[[NOINLINE_ATTR]] - -// Check `co_await __promise__.final_suspend();`. We don't emit an blocker here since it is -// empty. -// CHECK: call token @llvm.coro.save -// CHECK: call ptr @_ZN4Task12promise_type12FinalAwaiter13await_suspendIS0_EESt16coroutine_handleIvES3_IT_E{{.*}}#[[NORMAL_ATTR]] - -struct AwaitTransformTask { - struct promise_type { - struct FinalAwaiter { - bool await_ready() const noexcept { return false; } - template - std::coroutine_handle<> await_suspend(std::coroutine_handle h) noexcept { - return h.promise().continuation; - } - void await_resume() noexcept {} - }; - - AwaitTransformTask get_return_object() noexcept { - return std::coroutine_handle::from_promise(*this); - } - - std::suspend_always initial_suspend() noexcept { return {}; } - FinalAwaiter final_suspend() noexcept { return {}; } - void unhandled_exception() noexcept {} - void return_void() noexcept {} - - template - auto await_transform(Awaitable &&awaitable) { - return awaitable; - } - - std::coroutine_handle<> continuation; - }; - - AwaitTransformTask(std::coroutine_handle handle); - ~AwaitTransformTask(); - -private: - std::coroutine_handle handle; -}; - -struct awaitableWithGetAwaiter { - bool await_ready() const noexcept { return false; } - template - void await_suspend(std::coroutine_handle h) noexcept {} - void await_resume() noexcept {} -}; - -AwaitTransformTask testingWithAwaitTransform() { - co_await awaitableWithGetAwaiter{}; -} - -// CHECK-LABEL: @_Z25testingWithAwaitTransformv - -// Init suspend -// CHECK: call token @llvm.coro.save -// CHECK-NOT: call void @llvm.coro.opt.blocker( -// CHECK: call void @_ZNSt14suspend_always13await_suspendESt16coroutine_handleIvE{{.*}}#[[NORMAL_ATTR]] - -// Check `co_await awaitableWithGetAwaiter{};`. -// CHECK: call token @llvm.coro.save -// CHECK-NOT: call void @llvm.coro.opt.blocker( -// Check call void @_ZN23awaitableWithGetAwaiter13await_suspendIN18AwaitTransformTask12promise_typeEEEvSt16coroutine_handleIT_E{{.*}}#[[NORMAL_ATTR]] - -// Final suspend -// CHECK: call token @llvm.coro.save -// CHECK-NOT: call void @llvm.coro.opt.blocker( -// CHECK: call ptr @_ZN18AwaitTransformTask12promise_type12FinalAwaiter13await_suspendIS0_EESt16coroutine_handleIvES3_IT_E{{.*}}#[[NORMAL_ATTR]] - -// CHECK-NOT: attributes #[[NORMAL_ATTR]] = noinline -// CHECK: attributes #[[NOINLINE_ATTR]] = {{.*}}noinline diff --git a/clang/test/CodeGenCoroutines/pr56301.cpp b/clang/test/CodeGenCoroutines/pr56301.cpp deleted file mode 100644 index cd851c0b815db..0000000000000 --- a/clang/test/CodeGenCoroutines/pr56301.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// An end-to-end test to make sure things get processed correctly. -// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s -O3 | \ -// RUN: FileCheck %s - -#include "Inputs/coroutine.h" - -struct SomeAwaitable { - // Resume the supplied handle once the awaitable becomes ready, - // returning a handle that should be resumed now for the sake of symmetric transfer. - // If the awaitable is already ready, return an empty handle without doing anything. - // - // Defined in another translation unit. Note that this may contain - // code that synchronizees with another thread. - std::coroutine_handle<> Register(std::coroutine_handle<>); -}; - -// Defined in another translation unit. -void DidntSuspend(); - -struct Awaiter { - SomeAwaitable&& awaitable; - bool suspended; - - bool await_ready() { return false; } - - std::coroutine_handle<> await_suspend(const std::coroutine_handle<> h) { - // Assume we will suspend unless proven otherwise below. We must do - // this *before* calling Register, since we may be destroyed by another - // thread asynchronously as soon as we have registered. - suspended = true; - - // Attempt to hand off responsibility for resuming/destroying the coroutine. - const auto to_resume = awaitable.Register(h); - - if (!to_resume) { - // The awaitable is already ready. In this case we know that Register didn't - // hand off responsibility for the coroutine. So record the fact that we didn't - // actually suspend, and tell the compiler to resume us inline. - suspended = false; - return h; - } - - // Resume whatever Register wants us to resume. - return to_resume; - } - - void await_resume() { - // If we didn't suspend, make note of that fact. - if (!suspended) { - DidntSuspend(); - } - } -}; - -struct MyTask{ - struct promise_type { - MyTask get_return_object() { return {}; } - std::suspend_never initial_suspend() { return {}; } - std::suspend_always final_suspend() noexcept { return {}; } - void unhandled_exception(); - - Awaiter await_transform(SomeAwaitable&& awaitable) { - return Awaiter{static_cast(awaitable)}; - } - }; -}; - -MyTask FooBar() { - co_await SomeAwaitable(); -} - -// CHECK-LABEL: @_Z6FooBarv -// CHECK: %[[to_resume:.*]] = {{.*}}call ptr @_ZN13SomeAwaitable8RegisterESt16coroutine_handleIvE -// CHECK-NEXT: %[[to_bool:.*]] = icmp eq ptr %[[to_resume]], null -// CHECK-NEXT: br i1 %[[to_bool]], label %[[then:.*]], label %[[else:.*]] - -// CHECK: [[then]]: -// We only access the coroutine frame conditionally as the sources did. -// CHECK: store i8 0, -// CHECK-NEXT: br label %[[else]] - -// CHECK: [[else]]: -// No more access to the coroutine frame until suspended. -// CHECK-NOT: store -// CHECK: } diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp index abb8e6377aabd..5f2911e9a7ada 100644 --- a/clang/unittests/Interpreter/InterpreterTest.cpp +++ b/clang/unittests/Interpreter/InterpreterTest.cpp @@ -244,7 +244,7 @@ TEST(IncrementalProcessing, FindMangledNameSymbol) { // FIXME: Re-enable when we investigate the way we handle dllimports on Win. #ifndef _WIN32 - EXPECT_EQ((unsigned long long)&printf, Addr->getValue()); + EXPECT_EQ((uintptr_t)&printf, Addr->getValue()); #endif // _WIN32 } diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index 7f00391d1dceb..d62fa0432e2a5 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -567,7 +567,7 @@ endif() foreach(pat cas swp ldadd ldclr ldeor ldset) foreach(size 1 2 4 8 16) - foreach(model 1 2 3 4) + foreach(model 1 2 3 4 5) if(pat STREQUAL "cas" OR NOT size STREQUAL "16") set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S") list(APPEND lse_builtins "${helper_asm}") diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index 5dc0d5320b5ab..1fe18f4a46819 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -7,7 +7,7 @@ // Out-of-line LSE atomics helpers. Ported from libgcc library. // N = {1, 2, 4, 8} // M = {1, 2, 4, 8, 16} -// ORDER = {'relax', 'acq', 'rel', 'acq_rel'} +// ORDER = {'relax', 'acq', 'rel', 'acq_rel', 'sync'} // Routines implemented: // // iM __aarch64_casM_ORDER(iM expected, iM desired, iM *ptr) @@ -35,8 +35,8 @@ HIDDEN(___aarch64_have_lse_atomics) #endif // Generate mnemonics for -// L_cas: SIZE: 1,2,4,8,16 MODEL: 1,2,3,4 -// L_swp L_ldadd L_ldclr L_ldeor L_ldset: SIZE: 1,2,4,8 MODEL: 1,2,3,4 +// L_cas: SIZE: 1,2,4,8,16 MODEL: 1,2,3,4,5 +// L_swp L_ldadd L_ldclr L_ldeor L_ldset: SIZE: 1,2,4,8 MODEL: 1,2,3,4,5 #if SIZE == 1 #define S b @@ -64,24 +64,44 @@ HIDDEN(___aarch64_have_lse_atomics) #define L #define M 0x000000 #define N 0x000000 +#define BARRIER #elif MODEL == 2 #define SUFF _acq #define A a #define L #define M 0x400000 #define N 0x800000 +#define BARRIER #elif MODEL == 3 #define SUFF _rel #define A #define L l #define M 0x008000 #define N 0x400000 +#define BARRIER #elif MODEL == 4 #define SUFF _acq_rel #define A a #define L l #define M 0x408000 #define N 0xc00000 +#define BARRIER +#elif MODEL == 5 +#define SUFF _sync +#ifdef L_swp +// swp has _acq semantics. +#define A a +#define L +#define M 0x400000 +#define N 0x800000 +#else +// All other _sync functions have _seq semantics. +#define A a +#define L l +#define M 0x408000 +#define N 0xc00000 +#endif +#define BARRIER dmb ish #else #error #endif // MODEL @@ -96,7 +116,12 @@ HIDDEN(___aarch64_have_lse_atomics) #endif #define NAME(BASE) GLUE4(__aarch64_, BASE, SIZE, SUFF) +#if MODEL == 5 +// Drop A for _sync functions. +#define LDXR GLUE3(ld, xr, S) +#else #define LDXR GLUE4(ld, A, xr, S) +#endif #define STXR GLUE4(st, L, xr, S) // Define temporary registers. @@ -136,9 +161,15 @@ DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(cas)) STXR w(tmp1), s(1), [x2] cbnz w(tmp1), 0b 1: + BARRIER ret #else +#if MODEL == 5 +// Drop A for _sync functions. +#define LDXP GLUE2(ld, xp) +#else #define LDXP GLUE3(ld, A, xp) +#endif #define STXP GLUE3(st, L, xp) #ifdef HAS_ASM_LSE #define CASP GLUE3(casp, A, L) x0, x1, x2, x3, [x4] @@ -159,6 +190,7 @@ DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(cas)) STXP w(tmp2), x2, x3, [x4] cbnz w(tmp2), 0b 1: + BARRIER ret #endif END_COMPILERRT_OUTLINE_FUNCTION(NAME(cas)) @@ -180,6 +212,7 @@ DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(swp)) LDXR s(0), [x1] STXR w(tmp1), s(tmp0), [x1] cbnz w(tmp1), 0b + BARRIER ret END_COMPILERRT_OUTLINE_FUNCTION(NAME(swp)) #endif // L_swp @@ -224,6 +257,7 @@ DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(LDNM)) OP s(tmp1), s(0), s(tmp0) STXR w(tmp2), s(tmp1), [x1] cbnz w(tmp2), 0b + BARRIER ret END_COMPILERRT_OUTLINE_FUNCTION(NAME(LDNM)) #endif // L_ldadd L_ldclr L_ldeor L_ldset diff --git a/flang/runtime/command.cpp b/flang/runtime/command.cpp index 6c4f611daaa7c..b81a0791c5e57 100644 --- a/flang/runtime/command.cpp +++ b/flang/runtime/command.cpp @@ -107,9 +107,13 @@ static void StoreLengthToDescriptor( } template struct FitsInIntegerKind { - bool operator()(std::int64_t value) { - return value <= std::numeric_limits>::max(); + bool operator()([[maybe_unused]] std::int64_t value) { + if constexpr (KIND >= 8) { + return true; + } else { + return value <= std::numeric_limits>::max(); + } } }; diff --git a/flang/runtime/io-api.cpp b/flang/runtime/io-api.cpp index 2c17f10e77693..f9d60fecb149a 100644 --- a/flang/runtime/io-api.cpp +++ b/flang/runtime/io-api.cpp @@ -1484,7 +1484,9 @@ static enum Iostat CheckUnitNumberInRangeImpl(INT unit, bool handleError, // Only provide the bad unit number in the message if SignalError can print // it accurately. Otherwise, the generic IostatUnitOverflow message will be // used. - if (static_cast(unit) == unit) { + if constexpr (sizeof(INT) > sizeof(std::intmax_t)) { + errorHandler.SignalError(IostatUnitOverflow); + } else if (static_cast(unit) == unit) { errorHandler.SignalError(IostatUnitOverflow, "UNIT number %jd is out of range", static_cast(unit)); } else { diff --git a/flang/runtime/numeric.cpp b/flang/runtime/numeric.cpp index 5376bcb569fbe..21ee91a8681ee 100644 --- a/flang/runtime/numeric.cpp +++ b/flang/runtime/numeric.cpp @@ -306,7 +306,7 @@ CppTypeFor RTNAME(Ceiling4_8)( CppTypeFor x) { return Ceiling>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Ceiling4_16)( CppTypeFor x) { return Ceiling>(x); @@ -328,7 +328,7 @@ CppTypeFor RTNAME(Ceiling8_8)( CppTypeFor x) { return Ceiling>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Ceiling8_16)( CppTypeFor x) { return Ceiling>(x); @@ -351,7 +351,7 @@ CppTypeFor RTNAME(Ceiling10_8)( CppTypeFor x) { return Ceiling>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Ceiling10_16)( CppTypeFor x) { return Ceiling>(x); @@ -374,7 +374,7 @@ CppTypeFor RTNAME(Ceiling16_8)( CppTypeFor x) { return Ceiling>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Ceiling16_16)( CppTypeFor x) { return Ceiling>(x); @@ -434,7 +434,7 @@ CppTypeFor RTNAME(Floor4_8)( CppTypeFor x) { return Floor>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Floor4_16)( CppTypeFor x) { return Floor>(x); @@ -456,7 +456,7 @@ CppTypeFor RTNAME(Floor8_8)( CppTypeFor x) { return Floor>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Floor8_16)( CppTypeFor x) { return Floor>(x); @@ -479,7 +479,7 @@ CppTypeFor RTNAME(Floor10_8)( CppTypeFor x) { return Floor>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Floor10_16)( CppTypeFor x) { return Floor>(x); @@ -502,7 +502,7 @@ CppTypeFor RTNAME(Floor16_8)( CppTypeFor x) { return Floor>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Floor16_16)( CppTypeFor x) { return Floor>(x); @@ -710,7 +710,7 @@ CppTypeFor RTNAME(Nint4_8)( CppTypeFor x) { return Nint>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Nint4_16)( CppTypeFor x) { return Nint>(x); @@ -732,7 +732,7 @@ CppTypeFor RTNAME(Nint8_8)( CppTypeFor x) { return Nint>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Nint8_16)( CppTypeFor x) { return Nint>(x); @@ -755,7 +755,7 @@ CppTypeFor RTNAME(Nint10_8)( CppTypeFor x) { return Nint>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Nint10_16)( CppTypeFor x) { return Nint>(x); @@ -778,7 +778,7 @@ CppTypeFor RTNAME(Nint16_8)( CppTypeFor x) { return Nint>(x); } -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T CppTypeFor RTNAME(Nint16_16)( CppTypeFor x) { return Nint>(x); diff --git a/flang/runtime/tools.h b/flang/runtime/tools.h index d22093a2ada07..72d14982ce44b 100644 --- a/flang/runtime/tools.h +++ b/flang/runtime/tools.h @@ -131,7 +131,7 @@ inline RT_API_ATTRS RESULT ApplyType( return FUNC{}(std::forward(x)...); case 8: return FUNC{}(std::forward(x)...); -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T case 16: return FUNC{}(std::forward(x)...); #endif @@ -230,7 +230,7 @@ inline RT_API_ATTRS RESULT ApplyIntegerKind( return FUNC<4>{}(std::forward(x)...); case 8: return FUNC<8>{}(std::forward(x)...); -#ifdef __SIZEOF_INT128__ +#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T case 16: return FUNC<16>{}(std::forward(x)...); #endif @@ -310,6 +310,11 @@ std::optional> inline constexpr GetResultType( return std::make_pair(TypeCategory::Integer, maxKind); case TypeCategory::Real: case TypeCategory::Complex: +#if !(defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T) + if (xKind == 16) { + break; + } +#endif return std::make_pair(yCat, yKind); default: break; @@ -318,6 +323,11 @@ std::optional> inline constexpr GetResultType( case TypeCategory::Real: switch (yCat) { case TypeCategory::Integer: +#if !(defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T) + if (yKind == 16) { + break; + } +#endif return std::make_pair(TypeCategory::Real, xKind); case TypeCategory::Real: case TypeCategory::Complex: @@ -329,6 +339,11 @@ std::optional> inline constexpr GetResultType( case TypeCategory::Complex: switch (yCat) { case TypeCategory::Integer: +#if !(defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T) + if (yKind == 16) { + break; + } +#endif return std::make_pair(TypeCategory::Complex, xKind); case TypeCategory::Real: case TypeCategory::Complex: diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 0cf49d151bb96..b8ac536588d3c 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -48,6 +48,10 @@ include(CMakeDependentOption) include(HandleCompilerRT) # Basic options --------------------------------------------------------------- +option(LIBCXX_ENABLE_ASSERTIONS + "Enable assertions inside the compiled library, and at the same time make it the + default when compiling user code. Note that assertions can be enabled or disabled + by users in their own code regardless of this option." OFF) option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON) option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON) option(LIBCXX_ENABLE_FILESYSTEM @@ -747,6 +751,11 @@ config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION) config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE) config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS) config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) +if (LIBCXX_ENABLE_ASSERTIONS) + config_define(1 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT) +else() + config_define(0 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT) +endif() if (LIBCXX_HARDENING_MODE STREQUAL "hardened") config_define(1 _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT) config_define(0 _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT) @@ -757,11 +766,6 @@ elseif (LIBCXX_HARDENING_MODE STREQUAL "unchecked") config_define(0 _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT) config_define(0 _LIBCPP_ENABLE_DEBUG_MODE_DEFAULT) endif() -# TODO(LLVM 18): Remove this after branching for LLVM 17, this is a simple -# courtesy for vendors to be notified about this change. -if (LIBCXX_ENABLE_ASSERTIONS) - message(FATAL_ERROR "LIBCXX_ENABLE_ASSERTIONS has been replaced by LIBCXX_HARDENING_MODE=hardened") -endif() if (LIBCXX_PSTL_CPU_BACKEND STREQUAL "serial") config_define(1 _LIBCPP_PSTL_CPU_BACKEND_SERIAL) diff --git a/libcxx/cmake/caches/Generic-assertions.cmake b/libcxx/cmake/caches/Generic-assertions.cmake new file mode 100644 index 0000000000000..a1d348ea9b331 --- /dev/null +++ b/libcxx/cmake/caches/Generic-assertions.cmake @@ -0,0 +1,2 @@ +set(LIBCXX_ENABLE_ASSERTIONS ON CACHE BOOL "") +set(LIBCXXABI_ENABLE_ASSERTIONS ON CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-debug-mode.cmake b/libcxx/cmake/caches/Generic-debug-mode.cmake index 1d401ba69ab80..188d34b4ed1e6 100644 --- a/libcxx/cmake/caches/Generic-debug-mode.cmake +++ b/libcxx/cmake/caches/Generic-debug-mode.cmake @@ -1 +1,2 @@ set(LIBCXX_HARDENING_MODE "debug" CACHE STRING "") +set(LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-hardened-mode.cmake b/libcxx/cmake/caches/Generic-hardened-mode.cmake index 66c18741d198b..163a7166f9e6c 100644 --- a/libcxx/cmake/caches/Generic-hardened-mode.cmake +++ b/libcxx/cmake/caches/Generic-hardened-mode.cmake @@ -1 +1,2 @@ set(LIBCXX_HARDENING_MODE "hardened" CACHE STRING "") +set(LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "") diff --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst index f62b0ba7a0465..3a4e4790631b4 100644 --- a/libcxx/docs/BuildingLibcxx.rst +++ b/libcxx/docs/BuildingLibcxx.rst @@ -211,6 +211,15 @@ libc++ specific options Toggle the installation of the libc++ headers. +.. option:: LIBCXX_ENABLE_ASSERTIONS:BOOL + + **Default**: ``OFF`` + + Build libc++ with assertions enabled in the compiled library, and enable assertions + by default when building user code as well. Assertions can be turned off by users + by defining ``_LIBCPP_ENABLE_ASSERTIONS=0``. For details, see + :ref:`the documentation `. + .. option:: LIBCXX_ENABLE_SHARED:BOOL **Default**: ``ON`` diff --git a/libcxx/docs/Hardening.rst b/libcxx/docs/Hardening.rst deleted file mode 100644 index c006c1f86ecf7..0000000000000 --- a/libcxx/docs/Hardening.rst +++ /dev/null @@ -1,54 +0,0 @@ -============= -Hardened Mode -============= - -.. contents:: - :local: - -.. _using-hardened-mode: - -Using the hardened mode -======================= - -The hardened mode enables a set of security-critical assertions that prevent -undefined behavior caused by violating preconditions of the standard library. -These assertions can be done with relatively little overhead in constant time -and are intended to be used in production. - -In addition to the hardened mode, libc++ also provides the debug mode which -contains all the checks from the hardened mode and additionally more expensive -checks that may affect the complexity of algorithms. The debug mode is intended -to be used for testing, not in production. - -Vendors can set the default hardening mode by using the -``LIBCXX_HARDENING_MODE`` variable at CMake configuration time. Setting -``LIBCXX_HARDENING_MODE`` to ``hardened`` enables the hardened mode, and -similarly setting the variable to ``debug`` enables the debug mode. The default -value is ``unchecked`` which doesn't enable any hardening. - -When hardening is enabled, the compiled library is built with the corresponding -mode enabled, **and** user code will be built with the same mode enabled by -default. If the mode is set to "unchecked" at the CMake configuration time, the -compiled library will not contain any assertions and the default when building -user code will be to have assertions disabled. As a user, you can consult your -vendor to know which level of hardening is enabled by default. - -Furthermore, independently of any vendor-selected default, users can always -control which level of hardening is enabled in their code by defining -``_LIBCPP_ENABLE_HARDENED_MODE=0|1`` (or ``_LIBCPP_ENABLE_DEBUG_MODE=0|1``) -before including any libc++ header (we recommend passing -``-D_LIBCPP_ENABLE_HARDENED_MODE=X`` or ``-D_LIBCPP_ENABLE_DEBUG_MODE=X`` to the -compiler). Note that if the compiled library was built by the vendor in the -unchecked mode, functions compiled inside the static or shared library won't -have any hardening enabled even if the user compiles with hardening enabled (the -same is true for the inverse case where the static or shared library was -compiled **with** hardening enabled but the user tries to disable it). However, -most of the code in libc++ is in the headers, so the user-selected value for -``_LIBCPP_ENABLE_HARDENED_MODE`` or ``_LIBCPP_ENABLE_DEBUG_MODE`` (if any) will -usually be respected. - -Enabling hardening has no impact on the ABI. - -Iterator bounds checking ------------------------- -TODO(hardening) diff --git a/libcxx/docs/ReleaseNotes/17.rst b/libcxx/docs/ReleaseNotes/17.rst index dac4c3c633246..763dc3494ebfc 100644 --- a/libcxx/docs/ReleaseNotes/17.rst +++ b/libcxx/docs/ReleaseNotes/17.rst @@ -87,9 +87,6 @@ Improvements and New Features ``std::ranges::find`` are now forwarding to ``std::memcmp`` for trivially equality comparable types, which can lead up to 40x performance improvements. -- ``std::string_view`` now provides iterators that check for out-of-bounds accesses when the safe - libc++ mode is enabled. - - The performance of ``dynamic_cast`` on its hot paths is greatly improved and is as efficient as the ``libsupc++`` implementation. Note that the performance improvements are shipped in ``libcxxabi``. @@ -105,19 +102,6 @@ Improvements and New Features Anything that does not rely on having an actual filesystem available will now work, such as ``std::filesystem::path``, ``std::filesystem::perms`` and similar classes. -- The library now provides a hardened mode under which common cases of library undefined behavior will be turned into - a reliable program termination. Vendors can configure whether the hardened mode is enabled by default with the - ``LIBCXX_HARDENING_MODE`` variable at CMake configuration time. Users can control whether the hardened mode is - enabled on a per translation unit basis using the ``-D_LIBCPP_ENABLE_HARDENED_MODE=1`` macro. See - ``libcxx/docs/Hardening.rst`` for more details. - -- The library now provides a debug mode which is a superset of the hardened mode, additionally enabling more expensive - checks that are not suitable to be used in production. This replaces the legacy debug mode that was removed in this - release. Unlike the legacy debug mode, this doesn't affect the ABI and doesn't require locking. Vendors can configure - whether the debug mode is enabled by default with the ``LIBCXX_HARDENING_MODE`` variable at CMake configuration time. - Users can control whether the debug mode is enabled on a per translation unit basis using the - ``-D_LIBCPP_ENABLE_DEBUG_MODE=1`` macro. See ``libcxx/docs/Hardening.rst`` for more details. - - ASan container annotations have been extended to cover all allocators in ``std::vector``. - ASan annotations have been added to the ``std::deque`` container, to detect container overflows. @@ -128,14 +112,8 @@ Improvements and New Features Deprecations and Removals ------------------------- -- The "safe" mode is replaced by the hardened mode in this release. The ``LIBCXX_ENABLE_ASSERTIONS`` CMake variable is - deprecated and setting it will trigger an error; use ``LIBCXX_HARDENING_MODE`` instead. Similarly, the - ``_LIBCPP_ENABLE_ASSERTIONS`` macro is deprecated and setting it to ``1`` now enables the hardened mode. See - ``libcxx/docs/Hardening.rst`` for more details. - -- The legacy debug mode has been removed in this release. Setting the macro ``_LIBCPP_ENABLE_DEBUG_MODE`` to ``1`` now - enables the new debug mode which is part of hardening (see the "Improvements and New Features" section above). The - ``LIBCXX_ENABLE_DEBUG_MODE`` CMake variable has been removed. For additional context, refer to the `Discourse post +- The legacy debug mode has been removed in this release. The ``LIBCXX_ENABLE_DEBUG_MODE`` CMake variable has been + removed. For additional context, refer to the `Discourse post `_. - The ```` header has been removed in this release. The ```` header diff --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst index dea4ab53d2030..cc79153d45e84 100644 --- a/libcxx/docs/UsingLibcxx.rst +++ b/libcxx/docs/UsingLibcxx.rst @@ -138,17 +138,50 @@ IWYU, you should run the tool like so: If you would prefer to not use that flag, then you can replace ``/path/to/include-what-you-use/share/libcxx.imp``` file with the libc++-provided ``libcxx.imp`` file. +.. _assertions-mode: + +Enabling the "safe libc++" mode +=============================== + +Libc++ contains a number of assertions whose goal is to catch undefined behavior in the +library, usually caused by precondition violations. Those assertions do not aim to be +exhaustive -- instead they aim to provide a good balance between safety and performance. +In particular, these assertions do not change the complexity of algorithms. However, they +might, in some cases, interfere with compiler optimizations. + +By default, these assertions are turned off. Vendors can decide to turn them on while building +the compiled library by defining ``LIBCXX_ENABLE_ASSERTIONS=ON`` at CMake configuration time. +When ``LIBCXX_ENABLE_ASSERTIONS`` is used, the compiled library will be built with assertions +enabled, **and** user code will be built with assertions enabled by default. If +``LIBCXX_ENABLE_ASSERTIONS=OFF`` at CMake configure time, the compiled library will not contain +assertions and the default when building user code will be to have assertions disabled. +As a user, you can consult your vendor to know whether assertions are enabled by default. + +Furthermore, independently of any vendor-selected default, users can always control whether +assertions are enabled in their code by defining ``_LIBCPP_ENABLE_ASSERTIONS=0|1`` before +including any libc++ header (we recommend passing ``-D_LIBCPP_ENABLE_ASSERTIONS=X`` to the +compiler). Note that if the compiled library was built by the vendor without assertions, +functions compiled inside the static or shared library won't have assertions enabled even +if the user defines ``_LIBCPP_ENABLE_ASSERTIONS=1`` (the same is true for the inverse case +where the static or shared library was compiled **with** assertions but the user tries to +disable them). However, most of the code in libc++ is in the headers, so the user-selected +value for ``_LIBCPP_ENABLE_ASSERTIONS`` (if any) will usually be respected. + +When an assertion fails, the program is aborted through a special verbose termination function. This +behavior is customizable; see the :ref:`Overriding the default termination handler +` section for more information. + .. _termination-handler: Overriding the default termination handler ========================================== -When the library wants to terminate due to an unforeseen condition (such as a hardening assertion -failure), the program is aborted through a special verbose termination function. The library provides -a default function that prints an error message and calls ``std::abort()``. Note that this function is -provided by the static or shared library, so it is only available when deploying to a platform where -the compiled library is sufficiently recent. On older platforms, the program will terminate in an -unspecified unsuccessful manner, but the quality of diagnostics won't be great. +When the library wants to terminate due to an unforeseen condition (such as an assertion failure), +the program is aborted through a special verbose termination function. The library provides +a default function that prints an error message and calls ``std::abort()``. Note that this function +is provided by the static or shared library, so it is only available when deploying to a platform +where the compiled library is sufficiently recent. On older platforms, the program will terminate in +an unspecified unsuccessful manner, but the quality of diagnostics won't be great. However, users can also override that mechanism at two different levels. First, the mechanism can be overridden at compile time by defining the ``_LIBCPP_VERBOSE_ABORT(format, args...)`` variadic macro. @@ -191,7 +224,7 @@ and ``operator delete``. For example: int main() { std::vector v; - int& x = v[0]; // Your termination function will be called here if hardening is enabled. + int& x = v[0]; // Your termination function will be called here if _LIBCPP_ENABLE_ASSERTIONS=1 } Also note that the verbose termination function should never return. Since assertions in libc++ @@ -206,7 +239,7 @@ Libc++ Configuration Macros =========================== Libc++ provides a number of configuration macros which can be used to enable -or disable extended libc++ behavior, including enabling hardening or thread +or disable extended libc++ behavior, including enabling the safe mode or thread safety annotations. **_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS**: @@ -214,12 +247,6 @@ safety annotations. ``std::mutex`` and ``std::lock_guard``. By default, these annotations are disabled and must be manually enabled by the user. -**_LIBCPP_ENABLE_HARDENED_MODE**: - This macro is used to enable the :ref:`hardened mode `. - -**_LIBCPP_ENABLE_DEBUG_MODE**: - This macro is used to enable the :ref:`debug mode `. - **_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS**: This macro is used to disable all visibility annotations inside libc++. Defining this macro and then building libc++ with hidden visibility gives a diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst index fbe39d823ed5c..44ce82b76ef8d 100644 --- a/libcxx/docs/index.rst +++ b/libcxx/docs/index.rst @@ -40,7 +40,6 @@ Getting Started with libc++ TestingLibcxx Contributing Modules - Hardening ReleaseProcedure Status/Cxx14 Status/Cxx17 diff --git a/libcxx/include/__config b/libcxx/include/__config index 9759d3b9e8e06..43f8a20031fff 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -208,19 +208,16 @@ // HARDENING { -// TODO(hardening): remove this in LLVM 18. -// This is for backward compatibility -- make enabling `_LIBCPP_ENABLE_ASSERTIONS` (which predates hardening modes) -// equivalent to setting the hardened mode. -# ifdef _LIBCPP_ENABLE_ASSERTIONS -# warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_HARDENED_MODE instead." -# if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1 -# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1" -# endif -# if _LIBCPP_ENABLE_ASSERTIONS -# define _LIBCPP_ENABLE_HARDENED_MODE 1 -# endif +# ifndef _LIBCPP_ENABLE_ASSERTIONS +# define _LIBCPP_ENABLE_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS_DEFAULT +# endif +# if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1 +# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1" # endif +// NOTE: These modes are experimental and are not stable yet in LLVM 17. Please refrain from using them and use the +// documented libc++ "safe" mode instead. +// // Enables the hardened mode which consists of all checks intended to be used in production. Hardened mode prioritizes // security-critical checks that can be done with relatively little overhead in constant time. Mutually exclusive with // `_LIBCPP_ENABLE_DEBUG_MODE`. @@ -275,6 +272,11 @@ # error "Only one of _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE can be enabled." # endif +# if _LIBCPP_ENABLE_ASSERTIONS && (_LIBCPP_ENABLE_HARDENED_MODE || _LIBCPP_ENABLE_DEBUG_MODE) +# error \ + "_LIBCPP_ENABLE_ASSERTIONS is mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE." +# endif + // Hardened mode checks. // clang-format off @@ -303,6 +305,18 @@ # define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSERT(expression, message) # define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message) +// Safe mode checks. + +# elif _LIBCPP_ENABLE_ASSERTIONS + +// All checks enabled. +# define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSERT(expression, message) +# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message) + // Disable all checks if hardening is not enabled. # else diff --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in index 8ec3722eafc51..c0ea981098fd2 100644 --- a/libcxx/include/__config_site.in +++ b/libcxx/include/__config_site.in @@ -27,6 +27,7 @@ #cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE #cmakedefine _LIBCPP_HAS_NO_LOCALIZATION #cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS +#cmakedefine01 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT // PSTL backends #cmakedefine _LIBCPP_PSTL_CPU_BACKEND_SERIAL diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt index 54cc485470a51..306d610567fee 100644 --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -24,6 +24,10 @@ if (NOT LIBCXX_ENABLE_RTTI) serialize_lit_param(enable_rtti False) endif() +if (LIBCXX_ENABLE_ASSERTIONS) + serialize_lit_param(enable_assertions True) +endif() + serialize_lit_param(hardening_mode "\"${LIBCXX_HARDENING_MODE}\"") if (CMAKE_CXX_COMPILER_TARGET) diff --git a/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp b/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp index 8c6d731f716be..3583b94fe4ea9 100644 --- a/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp +++ b/libcxx/test/libcxx/algorithms/alg.sorting/assert.min.max.pass.cpp @@ -10,7 +10,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/assertions/assertions_disabled.pass.cpp b/libcxx/test/libcxx/assertions/assertions_disabled.pass.cpp new file mode 100644 index 0000000000000..2e36e03b1cda3 --- /dev/null +++ b/libcxx/test/libcxx/assertions/assertions_disabled.pass.cpp @@ -0,0 +1,25 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Test that _LIBCPP_ASSERT doesn't do anything when assertions are disabled. +// We need to use -Wno-macro-redefined because the test suite defines +// _LIBCPP_ENABLE_ASSERTIONS=1 under some configurations. + +// XFAIL: libcpp-has-hardened-mode, libcpp-has-debug-mode +// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_ASSERTIONS=0 + +#include + +bool executed_condition = false; +bool f() { executed_condition = true; return false; } + +int main(int, char**) { + _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(f(), "message"); // should not execute anything + assert(!executed_condition); // really make sure we did not execute anything at all + return 0; +} diff --git a/libcxx/test/libcxx/assertions/modes/debug.pass.cpp b/libcxx/test/libcxx/assertions/modes/debug.pass.cpp index 7134c4bab9465..5634fbd8edfd8 100644 --- a/libcxx/test/libcxx/assertions/modes/debug.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/debug.pass.cpp @@ -9,7 +9,7 @@ // This test ensures that assertions trigger without the user having to do anything when the debug mode has been enabled // by default. -// UNSUPPORTED: !libcpp-has-debug-mode +// REQUIRES: libcpp-has-debug-mode // `check_assertion.h` is only available starting from C++11. // UNSUPPORTED: c++03 // `check_assertion.h` requires Unix headers. diff --git a/libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp b/libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp index 5e7314e1093f2..6834cf23629c5 100644 --- a/libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/debug_mode_disabled_in_tu.pass.cpp @@ -8,7 +8,7 @@ // This test ensures that we can disable the debug mode on a per-TU basis regardless of how the library was built. -// UNSUPPORTED: libcpp-has-hardened-mode +// REQUIRES: libcpp-has-debug-mode // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_DEBUG_MODE=0 #include diff --git a/libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp b/libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp index 131836dd20f01..28fb46612bbc3 100644 --- a/libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/debug_mode_enabled_in_tu.pass.cpp @@ -9,7 +9,7 @@ // This test ensures that we can enable the debug mode on a per-TU basis regardless of how the library was built. // Hardened mode would additionally trigger the error that hardened and debug modes are mutually exclusive. -// UNSUPPORTED: libcpp-has-hardened-mode +// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode, libcpp-has-assertions // `check_assertion.h` is only available starting from C++11 and requires Unix headers. // UNSUPPORTED: c++03, !has-unix-headers // The ability to set a custom abort message is required to compare the assertion message. diff --git a/libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp b/libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp index d4f542a6b4a77..da1fbcf00d561 100644 --- a/libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp +++ b/libcxx/test/libcxx/assertions/modes/debug_mode_not_1_or_0.verify.cpp @@ -9,7 +9,7 @@ // This test verifies that setting the debug mode to a value other than `0` or `1` triggers a compile-time error. // Hardened mode would additionally trigger the error that hardened and debug modes are mutually exclusive. -// UNSUPPORTED: libcpp-has-hardened-mode +// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode, libcpp-has-assertions // Modules build produces a different error ("Could not build module 'std'"). // UNSUPPORTED: modules-build // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_DEBUG_MODE=2 diff --git a/libcxx/test/libcxx/assertions/modes/enable_assertions_and_debug_mutually_exclusive.verify.cpp b/libcxx/test/libcxx/assertions/modes/enable_assertions_and_debug_mutually_exclusive.verify.cpp new file mode 100644 index 0000000000000..385a2174b42a8 --- /dev/null +++ b/libcxx/test/libcxx/assertions/modes/enable_assertions_and_debug_mutually_exclusive.verify.cpp @@ -0,0 +1,18 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// This test verifies that `_LIBCPP_ENABLE_ASSERTIONS` and `_LIBCPP_ENABLE_DEBUG_MODE` are mutually exclusive. + +// UNSUPPORTED: libcpp-has-hardened-mode +// Modules build produces a different error ("Could not build module 'std'"). +// UNSUPPORTED: modules-build +// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_ENABLE_DEBUG_MODE=1 + +#include + +// expected-error@*:* {{_LIBCPP_ENABLE_ASSERTIONS is mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE.}} diff --git a/libcxx/test/libcxx/assertions/modes/enable_assertions_and_hardened_mutually_exclusive.verify.cpp b/libcxx/test/libcxx/assertions/modes/enable_assertions_and_hardened_mutually_exclusive.verify.cpp new file mode 100644 index 0000000000000..0b17555dcd970 --- /dev/null +++ b/libcxx/test/libcxx/assertions/modes/enable_assertions_and_hardened_mutually_exclusive.verify.cpp @@ -0,0 +1,18 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// This test verifies that `_LIBCPP_ENABLE_ASSERTIONS` and `_LIBCPP_ENABLE_HARDENED_MODE` are mutually exclusive. + +// UNSUPPORTED: libcpp-has-debug-mode +// Modules build produces a different error ("Could not build module 'std'"). +// UNSUPPORTED: modules-build +// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_ASSERTIONS=1 -D_LIBCPP_ENABLE_HARDENED_MODE=1 + +#include + +// expected-error@*:* {{_LIBCPP_ENABLE_ASSERTIONS is mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE.}} diff --git a/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_hardened_mode.pass.cpp b/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_hardened_mode.pass.cpp deleted file mode 100644 index c0e80dac38b9b..0000000000000 --- a/libcxx/test/libcxx/assertions/modes/enabling_assertions_enables_hardened_mode.pass.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// TODO(hardening): remove in LLVM 18. -// This test ensures that enabling assertions now enables the hardened mode. - -// `check_assertion.h` is only available starting from C++11 and requires Unix headers. -// UNSUPPORTED: c++03, !has-unix-headers -// The ability to set a custom abort message is required to compare the assertion message. -// XFAIL: availability-verbose_abort-missing -// Debug mode is mutually exclusive with hardened mode. -// UNSUPPORTED: libcpp-has-debug-mode -// Ignore the warning about `_LIBCPP_ENABLE_ASSERTIONS` being deprecated. -// ADDITIONAL_COMPILE_FLAGS: -Wno-error -D_LIBCPP_ENABLE_ASSERTIONS=1 - -#include -#include "check_assertion.h" - -int main(int, char**) { - static_assert(_LIBCPP_ENABLE_HARDENED_MODE == 1, "Hardened mode should be implicitly enabled"); - - _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(true, "Should not fire"); - TEST_LIBCPP_ASSERT_FAILURE([] { - _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(false, "Should fire"); - }(), "Should fire"); - - return 0; -} diff --git a/libcxx/test/libcxx/assertions/modes/hardened.pass.cpp b/libcxx/test/libcxx/assertions/modes/hardened.pass.cpp index a8adce27f7adf..b913ba956e65f 100644 --- a/libcxx/test/libcxx/assertions/modes/hardened.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened.pass.cpp @@ -9,7 +9,7 @@ // This test ensures that assertions trigger without the user having to do anything when the hardened mode has been // enabled by default. -// UNSUPPORTED: !libcpp-has-hardened-mode +// REQUIRES: libcpp-has-hardened-mode // `check_assertion.h` is only available starting from C++11. // UNSUPPORTED: c++03 // `check_assertion.h` requires Unix headers. diff --git a/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp b/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp index 3e31d1d476bb1..997e7b6bb25cb 100644 --- a/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened_and_debug_mutually_exclusive.verify.cpp @@ -8,6 +8,8 @@ // This test verifies that `_LIBCPP_ENABLE_HARDENED_MODE` and `_LIBCPP_ENABLE_DEBUG_MODE` are mutually exclusive. +// If `_LIBCPP_ENABLE_ASSERTIONS` is defined, it would additionally produce a different error. +// UNSUPPORTED: libcpp-has-assertions // Modules build produces a different error ("Could not build module 'std'"). // UNSUPPORTED: modules-build // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_HARDENED_MODE=1 -D_LIBCPP_ENABLE_DEBUG_MODE=1 diff --git a/libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp b/libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp index 50cbbe87e25a1..7a513833c5e79 100644 --- a/libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened_mode_disabled_in_tu.pass.cpp @@ -8,7 +8,7 @@ // This test ensures that we can disable the hardened mode on a per-TU basis regardless of how the library was built. -// UNSUPPORTED: libcpp-has-debug-mode +// REQUIRES: libcpp-has-hardened-mode // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_HARDENED_MODE=0 #include diff --git a/libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp b/libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp index 31d6c06574237..68c74c8c97a27 100644 --- a/libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened_mode_enabled_in_tu.pass.cpp @@ -9,7 +9,7 @@ // This test ensures that we can enable the hardened mode on a per-TU basis regardless of how the library was built. // Debug mode would additionally trigger the error that hardened and debug modes are mutually exclusive. -// UNSUPPORTED: libcpp-has-debug-mode +// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode, libcpp-has-assertions // `check_assertion.h` is only available starting from C++11. // UNSUPPORTED: c++03 // `check_assertion.h` requires Unix headers. diff --git a/libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp b/libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp index 99dab47bfb9c2..a8c928c6d25f0 100644 --- a/libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp +++ b/libcxx/test/libcxx/assertions/modes/hardened_mode_not_1_or_0.verify.cpp @@ -9,7 +9,7 @@ // This test verifies that setting the hardened mode to a value other than `0` or `1` triggers a compile-time error. // Debug mode would additionally trigger the error that hardened and debug modes are mutually exclusive. -// UNSUPPORTED: libcpp-has-debug-mode +// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode, libcpp-has-assertions // Modules build produces a different error ("Could not build module 'std'"). // UNSUPPORTED: modules-build // ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_ENABLE_HARDENED_MODE=2 diff --git a/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp b/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp index a8ebaf2801b05..fe3e178b1cdff 100644 --- a/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp +++ b/libcxx/test/libcxx/assertions/modes/unchecked.pass.cpp @@ -9,7 +9,7 @@ // This test checks that if no hardening mode is defined (i.e., in the unchecked mode), by default assertions aren't // triggered. -// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode +// UNSUPPORTED: libcpp-has-hardened-mode, libcpp-has-debug-mode, libcpp-has-assertions #include diff --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp index 331f5ad7dfcfd..ceb49a6dbf0fe 100644 --- a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // test that array::back() triggers an assertion diff --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp index 6bf1390b9871b..88f625fe1f0fc 100644 --- a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // test that array::back() triggers an assertion diff --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp index d4ea030955ca8..c64299d059866 100644 --- a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // test that array::operator[] triggers an assertion diff --git a/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp index 8be0b3e5b11a0..6f6c9e317b371 100644 --- a/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp index dd41f2d250fae..4f39639d8dbf2 100644 --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp index 8d1a069d04b14..5c30284c8af76 100644 --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp index e59c03077c767..9431e009c6503 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp index 45e1d590e95e3..373924214ba8b 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp index 6ea0719539679..76e0c9a6c8c11 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp index 4a04df1c0bf26..2195f3dcb8852 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp index e0b18bb453503..90453cf2620be 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp index 480b6a311c871..2aa3e64f60b8d 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp index 54f08dcd5a563..4a8c02211061d 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp index 2a79d9af3a124..2dd2189f494ea 100644 --- a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp index 9f90818ae760c..464dfb5b894b5 100644 --- a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp index d1a8d722cbe0c..87a0e6eb1033c 100644 --- a/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp index 578594688bcd9..22f5ab39f6eba 100644 --- a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp index 7c42355fee48f..e67dfb08d836a 100644 --- a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp index a10aac6548fee..f5a2313d8c2ba 100644 --- a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp index eae96c2d87056..fb52da4ce62ca 100644 --- a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp index bcce2558574a5..1d7e39333a0a7 100644 --- a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp index 4da2245c726dc..1947e72bd1fe5 100644 --- a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp index ac2883fff0f15..25969c027d676 100644 --- a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp index e7df567a7d212..4f2bb64d38e08 100644 --- a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp @@ -16,7 +16,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp index bd24e0f92075b..69d8f6d814f3d 100644 --- a/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp @@ -17,7 +17,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp index 3496f69d5dc89..891eac9563ff1 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp index bef448aa609ed..669294d46bbf6 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp index 17c29707a5137..510dbe24aef50 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp index 785720bf9b890..749d66136b9f4 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // Test construction from span: diff --git a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp index e20146f9ea518..a1a9f11e9eb1a 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp index d4aea962f19a0..8654b7d6e7572 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp index 4a122e0904084..4bab8f54dcd77 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp index 3750d71bd6dcc..3a34e1b38cde1 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp index 47fb858b1b4e0..5daf2d28b82e2 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp index 6fe792d5170fd..2addf167dedca 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp index d44598b6282df..8b81a6dd4b414 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp index a460a3a27b943..243f0b54bf5c2 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp index 5f437e22b208a..2694bf9fbbdfd 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp index f45d4b72ede4d..71ae0f802ef43 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp index 01b2891d93d77..8e89b4969b710 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp index d62c91ddc8b1c..69130c8ed232a 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp index 073b7f3ed8092..fa1f7f78c15e5 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp index a43ae5cefe986..4d1b80928484b 100644 --- a/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp +++ b/libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp @@ -6,7 +6,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp index bfcf7cbddf938..b5035ba2530af 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_sent.pass.cpp @@ -19,7 +19,7 @@ // Check that we ensure that `[it, sent)` is a valid range. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp index ae7594c473309..2537a1abb83e8 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.iter_size.pass.cpp @@ -16,7 +16,7 @@ // dynamic_extent version. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp index 09a743f3f5d23..cfd9a70c99794 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.other_span.pass.cpp @@ -14,7 +14,7 @@ // Check that we ensure `other.size() == Extent`. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp index 3ba57546a8b25..d6ccd45f377dd 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.cons/assert.range.pass.cpp @@ -14,7 +14,7 @@ // Check that we ensure `size(r) == Extent`. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp index e0c8f04e3a617..d8e8bb63b546c 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.back.pass.cpp @@ -14,7 +14,7 @@ // Make sure that accessing a span out-of-bounds triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp index 27b5940d65a1a..d09992226bc08 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.front.pass.cpp @@ -14,7 +14,7 @@ // Make sure that accessing a span out-of-bounds triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp index 659e1ff97bae4..716fb2b5c57df 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp @@ -14,7 +14,7 @@ // Make sure that accessing a span out-of-bounds triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp index 4a960667e8f19..a8777124b0484 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp @@ -14,7 +14,7 @@ // Make sure that creating a sub-span with an incorrect number of elements triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp index 113bcfddf2fdd..a3747aadbd5b8 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp @@ -14,7 +14,7 @@ // Make sure that creating a sub-span with an incorrect number of elements triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp index 7f0728b131704..39ac5639a1359 100644 --- a/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp +++ b/libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp @@ -22,7 +22,7 @@ // Make sure that creating a sub-span with an incorrect number of elements triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp index 55b7360f52145..75817bd9351e5 100644 --- a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp +++ b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp @@ -14,7 +14,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS diff --git a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp index 8df44fd786725..887088d126158 100644 --- a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp +++ b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp @@ -14,7 +14,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS diff --git a/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp index 6f9d281ba70f4..fd086fba245e3 100644 --- a/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp +++ b/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.advance.pass.cpp b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp index a3fb913aead19..e94563768d843 100644 --- a/libcxx/test/libcxx/iterators/assert.advance.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.next.pass.cpp b/libcxx/test/libcxx/iterators/assert.next.pass.cpp index 3daf7347f436b..565b1411f13b1 100644 --- a/libcxx/test/libcxx/iterators/assert.next.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.next.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/assert.prev.pass.cpp b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp index 5969506c24677..b19332815ad5d 100644 --- a/libcxx/test/libcxx/iterators/assert.prev.pass.cpp +++ b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp b/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp index 51a5eab842c92..83042bb42ce3f 100644 --- a/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp +++ b/libcxx/test/libcxx/iterators/bounded_iter/dereference.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp index 673bb23e8612f..a5237d41c759f 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-exceptions -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp index 51c9898f5a39e..b452b788a277d 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp index 714936ebcb2a6..3b85e6416f031 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp b/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp index 7177cfc9a5510..b3c1088567b93 100644 --- a/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.piecewise.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // REQUIRES: has-unix-headers // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp b/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp index 571f943b5be15..71497a48c3ac1 100644 --- a/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.factories/range.repeat.view/ctor.value.bound.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // REQUIRES: has-unix-headers // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp index 3e5d5b2f14162..531b00c88447c 100644 --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp index 45415b988c66d..660e893dbe3da 100644 --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp index e4c7fe9935f07..59d0aa5f68840 100644 --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp index d9d3230f905cb..87fd445f31e18 100644 --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp index a09dea537a144..66c2f96259377 100644 --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp index 2660bf42d2b15..e2660fbed3048 100644 --- a/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp index 7622b653271cb..c4cb21195ea3b 100644 --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp index a67ea588149d7..2e8525d18bd31 100644 --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp @@ -12,7 +12,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp b/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp index 9a40ddc14988c..b313d7fc411cd 100644 --- a/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp +++ b/libcxx/test/libcxx/strings/string.view/assert.ctor.length.pass.cpp @@ -9,7 +9,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // Construct a string_view from an invalid length diff --git a/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp b/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp index b63128f6e9b29..a8adf9a0a018a 100644 --- a/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp +++ b/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // Construct a string_view from a null pointer diff --git a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp index e71e170367454..180a65d9c258e 100644 --- a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp +++ b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, no-threads -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp index 03958876331e8..2f8bd4bf29f57 100644 --- a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp +++ b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, no-threads -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp b/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp index 9fed976b4b067..3c4037e51813b 100644 --- a/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.barrier/assert.arrive.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: no-threads // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp b/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp index eb6f85f5b657c..c785c57bc4ca8 100644 --- a/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.barrier/assert.ctor.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: no-threads // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp b/libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp index 933fedd384e91..5340627d97a5d 100644 --- a/libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.latch/assert.arrive_and_wait.pass.cpp @@ -17,7 +17,7 @@ // Make sure that calling arrive_and_wait with a negative value triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp b/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp index 85686c5ff8fcc..e8bb7874fe4c6 100644 --- a/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.latch/assert.count_down.pass.cpp @@ -18,7 +18,7 @@ // higher than the internal counter triggers an assertion. // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp b/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp index f5f160a66675f..ed5042a1a309c 100644 --- a/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.latch/assert.ctor.pass.cpp @@ -17,7 +17,7 @@ // Make sure that calling latch with a negative value triggers an assertion // REQUIRES: has-unix-headers -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp b/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp index 20b142129a685..626b93807503e 100644 --- a/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.semaphore/assert.ctor.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: no-threads // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp b/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp index c17075d4488a6..c9153c92e5cc2 100644 --- a/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.semaphore/assert.release.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: no-threads // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing diff --git a/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp b/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp index 2a8059d48d014..f6dfe6cb31699 100644 --- a/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp +++ b/libcxx/test/libcxx/utilities/assert.exception_guard.no_exceptions.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // ADDITIONAL_COMPILE_FLAGS: -fno-exceptions diff --git a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp index fc065a4591357..22f938c1490b1 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.arrow.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr const T* operator->() const noexcept; diff --git a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp index 4b36f8bf7f915..c739051b9657e 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.deref.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr const T& operator*() const & noexcept; diff --git a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp index af9c02a32f555..3fdfd63f9bc05 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/assert.error.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr const E& error() const & noexcept; diff --git a/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp index 574c2d828391f..58bc1b9fd183b 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.void/assert.deref.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr void operator*() const noexcept; diff --git a/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp b/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp index 43eb517858490..955e0b30408a7 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.void/assert.error.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // constexpr const E& error() const & noexcept; diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp index 75be42ae9be8f..ea0efc5a81e2b 100644 --- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp +++ b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp @@ -15,7 +15,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp index 96a8da00ad4ae..529d880114f1a 100644 --- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp +++ b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp @@ -13,7 +13,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp index ed1206ccc24b9..57277926e5e9e 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.clamp/assert.ranges_clamp.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp index 55ee590b21384..3f1dbb9043286 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.pop_heap.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp index 76f1a8c341928..682c2ff9042f8 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/assert.ranges_pop_heap.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // diff --git a/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp b/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp index af9193445de53..3fc384d14893a 100644 --- a/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp +++ b/libcxx/test/std/utilities/utility/utility.unreachable/assert.unreachable.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 -// UNSUPPORTED: !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing // Make sure that reaching std::unreachable() with assertions enabled triggers an assertion. diff --git a/libcxx/test/support/test.support/test_check_assertion.pass.cpp b/libcxx/test/support/test.support/test_check_assertion.pass.cpp index cb622ada344b9..65fff6432f64b 100644 --- a/libcxx/test/support/test.support/test_check_assertion.pass.cpp +++ b/libcxx/test/support/test.support/test_check_assertion.pass.cpp @@ -8,7 +8,7 @@ // REQUIRES: has-unix-headers // UNSUPPORTED: c++03 -// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode +// UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode && !libcpp-has-assertions // XFAIL: availability-verbose_abort-missing #include diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml index ccf4b5e552bab..174022087daf0 100644 --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -468,6 +468,24 @@ steps: limit: 2 timeout_in_minutes: 120 + - label: "Assertions enabled" + command: "libcxx/utils/ci/run-buildbot generic-assertions" + artifact_paths: + - "**/test-results.xml" + - "**/*.abilist" + env: + CC: "clang-${LLVM_HEAD_VERSION}" + CXX: "clang++-${LLVM_HEAD_VERSION}" + ENABLE_CLANG_TIDY: "On" + agents: + queue: "libcxx-builders" + os: "linux" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + - label: "Hardened mode" command: "libcxx/utils/ci/run-buildbot generic-hardened-mode" artifact_paths: @@ -912,6 +930,21 @@ steps: # limit: 2 # timeout_in_minutes: 120 + - label: "Apple back-deployment with assertions enabled" + command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-assertions-11.0" + artifact_paths: + - "**/test-results.xml" + - "**/*.abilist" + agents: + queue: "libcxx-builders" + os: "macos" + arch: "x86_64" # TODO: Remove this once we are able to run back-deployment on arm64 again, since this isn't x86_64 specific + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + - label: "Apple back-deployment with hardening enabled" command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-hardened-11.0" artifact_paths: diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot index e70a7d3dc7139..307c16071edac 100755 --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -382,6 +382,12 @@ generic-merged) -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-merged.cfg.in" check-runtimes ;; +generic-assertions) + clean + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" + check-runtimes + check-abi-list +;; generic-hardened-mode) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardened-mode.cmake" @@ -489,6 +495,44 @@ apple-system) # TODO: It would be better to run the tests against the fake-installed version of libc++ instead xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist ;; +apple-system-backdeployment-assertions-*) + clean + + if [[ "${OSX_ROOTS}" == "" ]]; then + echo "--- Downloading previous macOS dylibs" + PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz" + OSX_ROOTS="${BUILD_DIR}/macos-roots" + mkdir -p "${OSX_ROOTS}" + curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}" + fi + + DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-assertions-}" + + # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib, + # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the + # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib. + cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \ + "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib" + cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \ + "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib" + + arch="$(uname -m)" + PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}" + PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}" + PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}" + PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}" + PARAMS+=";enable_assertions=True" + + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ + -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \ + -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \ + -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \ + -DLIBCXX_TEST_PARAMS="${PARAMS}" \ + -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \ + -DLIBUNWIND_TEST_PARAMS="${PARAMS}" + + check-runtimes +;; apple-system-backdeployment-hardened-*) clean diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py index f1401d7afc635..41b44690ce7ac 100644 --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -299,6 +299,18 @@ def getModuleFlag(cfg, enable_modules): help="Whether to enable tests that take longer to run. This can be useful when running on a very slow device.", actions=lambda enabled: [] if not enabled else [AddFeature("long_tests")], ), + Parameter( + name="enable_assertions", + choices=[True, False], + type=bool, + default=False, + help="Whether to enable assertions when compiling the test suite. This is only meaningful when " + "running the tests against libc++.", + actions=lambda assertions: [] if not assertions else [ + AddCompileFlag("-D_LIBCPP_ENABLE_ASSERTIONS=1"), + AddFeature("libcpp-has-assertions"), + ], + ), Parameter( name="hardening_mode", choices=["unchecked", "hardened", "debug"], diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst index 0cb7a6266f1ab..f08a5d8a65d12 100644 --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -78,7 +78,9 @@ Changes to the LLVM IR Changes to LLVM infrastructure ------------------------------ -* The legacy optimization pipeline has been removed. +* The legacy optimization pipeline (``PassManagerBuilder.h``) has been removed. + See the `new pass manager docs `_ + for how to use the new pass manager APIs. * Alloca merging in the inliner has been removed, since it only worked with the legacy inliner pass. Backend stack coloring should handle cases alloca diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 111d4d30aab96..39ab48b4a48e1 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -6833,7 +6833,7 @@ const ConstantRange &ScalarEvolution::getRangeRef( if (llvm::isKnownNonZero(V, DL)) MinVal = Align; ConservativeResult = ConservativeResult.intersectWith( - {MinVal, MaxVal + 1}, RangeType); + ConstantRange::getNonEmpty(MinVal, MaxVal + 1), RangeType); } } diff --git a/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp b/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp index 952f454f8f6a2..7979ac9a5fb79 100644 --- a/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp +++ b/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp @@ -1424,7 +1424,17 @@ bool ComplexDeinterleavingGraph::identifyNodes(Instruction *RootI) { // CompositeNode we should choose only one either Real or Imag instruction to // use as an anchor for generating complex instruction. auto It = RootToNode.find(RootI); - if (It != RootToNode.end() && It->second->Real == RootI) { + if (It != RootToNode.end()) { + auto RootNode = It->second; + assert(RootNode->Operation == + ComplexDeinterleavingOperation::ReductionOperation); + // Find out which part, Real or Imag, comes later, and only if we come to + // the latest part, add it to OrderedRoots. + auto *R = cast(RootNode->Real); + auto *I = cast(RootNode->Imag); + auto *ReplacementAnchor = R->comesBefore(I) ? I : R; + if (ReplacementAnchor != RootI) + return false; OrderedRoots.push_back(RootI); return true; } diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.td b/llvm/lib/Target/ARM/ARMInstrInfo.td index 471b706cc408a..fde386188cd81 100644 --- a/llvm/lib/Target/ARM/ARMInstrInfo.td +++ b/llvm/lib/Target/ARM/ARMInstrInfo.td @@ -4854,7 +4854,7 @@ class AI_crc32 sz, string suffix, SDPatternOperator builtin> : AInoP<(outs GPRnopc:$Rd), (ins GPRnopc:$Rn, GPRnopc:$Rm), MiscFrm, NoItinerary, !strconcat("crc32", suffix), "\t$Rd, $Rn, $Rm", [(set GPRnopc:$Rd, (builtin GPRnopc:$Rn, GPRnopc:$Rm))]>, - Requires<[IsARM, HasV8, HasCRC]> { + Requires<[IsARM, HasCRC]> { bits<4> Rd; bits<4> Rn; bits<4> Rm; diff --git a/llvm/lib/Target/ARM/ARMInstrThumb2.td b/llvm/lib/Target/ARM/ARMInstrThumb2.td index 610a71d68ec8c..f68f73523ba17 100644 --- a/llvm/lib/Target/ARM/ARMInstrThumb2.td +++ b/llvm/lib/Target/ARM/ARMInstrThumb2.td @@ -3448,7 +3448,7 @@ class T2I_crc32 sz, string suffix, SDPatternOperator builtin> : T2ThreeRegNoP<(outs rGPR:$Rd), (ins rGPR:$Rn, rGPR:$Rm), NoItinerary, !strconcat("crc32", suffix, "\t$Rd, $Rn, $Rm"), [(set rGPR:$Rd, (builtin rGPR:$Rn, rGPR:$Rm))]>, - Requires<[IsThumb2, HasV8, HasCRC]> { + Requires<[IsThumb2, HasCRC]> { let Inst{31-27} = 0b11111; let Inst{26-21} = 0b010110; let Inst{20} = C; diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index d3a9a41aef153..bd7ab7c987817 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -6051,8 +6051,9 @@ SwitchLookupTable::SwitchLookupTable( bool LinearMappingPossible = true; APInt PrevVal; APInt DistToPrev; - // When linear map is monotonic, we can attach nsw. - bool Wrapped = false; + // When linear map is monotonic and signed overflow doesn't happen on + // maximum index, we can attach nsw on Add and Mul. + bool NonMonotonic = false; assert(TableSize >= 2 && "Should be a SingleValue table."); // Check if there is the same distance between two consecutive values. for (uint64_t I = 0; I < TableSize; ++I) { @@ -6072,7 +6073,7 @@ SwitchLookupTable::SwitchLookupTable( LinearMappingPossible = false; break; } - Wrapped |= + NonMonotonic |= Dist.isStrictlyPositive() ? Val.sle(PrevVal) : Val.sgt(PrevVal); } PrevVal = Val; @@ -6080,7 +6081,10 @@ SwitchLookupTable::SwitchLookupTable( if (LinearMappingPossible) { LinearOffset = cast(TableContents[0]); LinearMultiplier = ConstantInt::get(M.getContext(), DistToPrev); - LinearMapValWrapped = Wrapped; + bool MayWrap = false; + APInt M = LinearMultiplier->getValue(); + (void)M.smul_ov(APInt(M.getBitWidth(), TableSize - 1), MayWrap); + LinearMapValWrapped = NonMonotonic || MayWrap; Kind = LinearMapKind; ++NumLinearMaps; return; diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index d7e40e8ef978c..b603bbe55dc9a 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -3781,10 +3781,44 @@ void InnerLoopVectorizer::fixCrossIterationPHIs(VPTransformState &State) { // the incoming edges. VPBasicBlock *Header = State.Plan->getVectorLoopRegion()->getEntryBasicBlock(); + + // Gather all VPReductionPHIRecipe and sort them so that Intermediate stores + // sank outside of the loop would keep the same order as they had in the + // original loop. + SmallVector ReductionPHIList; for (VPRecipeBase &R : Header->phis()) { if (auto *ReductionPhi = dyn_cast(&R)) - fixReduction(ReductionPhi, State); - else if (auto *FOR = dyn_cast(&R)) + ReductionPHIList.emplace_back(ReductionPhi); + } + stable_sort(ReductionPHIList, [this](const VPReductionPHIRecipe *R1, + const VPReductionPHIRecipe *R2) { + auto *IS1 = R1->getRecurrenceDescriptor().IntermediateStore; + auto *IS2 = R2->getRecurrenceDescriptor().IntermediateStore; + + // If neither of the recipes has an intermediate store, keep the order the + // same. + if (!IS1 && !IS2) + return false; + + // If only one of the recipes has an intermediate store, then move it + // towards the beginning of the list. + if (IS1 && !IS2) + return true; + + if (!IS1 && IS2) + return false; + + // If both recipes have an intermediate store, then the recipe with the + // later store should be processed earlier. So it should go to the beginning + // of the list. + return DT->dominates(IS2, IS1); + }); + + for (VPReductionPHIRecipe *ReductionPhi : ReductionPHIList) + fixReduction(ReductionPhi, State); + + for (VPRecipeBase &R : Header->phis()) { + if (auto *FOR = dyn_cast(&R)) fixFixedOrderRecurrence(FOR, State); } } diff --git a/llvm/test/Analysis/ScalarEvolution/malloc.ll b/llvm/test/Analysis/ScalarEvolution/malloc.ll index 80d1d65c7981d..578220cf5c37c 100644 --- a/llvm/test/Analysis/ScalarEvolution/malloc.ll +++ b/llvm/test/Analysis/ScalarEvolution/malloc.ll @@ -23,4 +23,15 @@ define ptr @f2() { ret ptr %alloc } +define ptr @undefined_max() { +; CHECK-LABEL: 'undefined_max' +; CHECK-NEXT: Classifying expressions for: @undefined_max +; CHECK-NEXT: %alloc = call nonnull ptr @malloc(i64 -1) +; CHECK-NEXT: --> %alloc U: full-set S: full-set +; CHECK-NEXT: Determining loop execution counts for: @undefined_max +; + %alloc = call nonnull ptr @malloc(i64 -1) + ret ptr %alloc +} + declare noalias noundef ptr @malloc(i64 noundef) allockind("alloc,uninitialized") allocsize(0) diff --git a/llvm/test/CodeGen/AArch64/complex-deinterleaving-crash.ll b/llvm/test/CodeGen/AArch64/complex-deinterleaving-crash.ll new file mode 100644 index 0000000000000..68cb29f8f5c8f --- /dev/null +++ b/llvm/test/CodeGen/AArch64/complex-deinterleaving-crash.ll @@ -0,0 +1,31 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2 +; RUN: llc %s --mattr=+complxnum -o - | FileCheck %s + +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-ni:1-p2:32:8:8:32-ni:2" +target triple = "aarch64-none-linux-gnu" + +; Check that deinterleaving pass doesn't generate broken IR +define void @check_deinterleave_crash() #0 { +; CHECK-LABEL: check_deinterleave_crash: +; CHECK: // %bb.0: // %bb +; CHECK-NEXT: mov x8, xzr +; CHECK-NEXT: str wzr, [x8] +bb: + br label %bb173 + +bb173: ; preds = %bb173, %bb + %phi177 = phi <2 x i32> [ %add190, %bb173 ], [ zeroinitializer, %bb ] + %phi178 = phi <2 x i32> [ %add187, %bb173 ], [ zeroinitializer, %bb ] + %add185 = add <2 x i32> %phi178, + %add186 = add <2 x i32> %phi177, + %shufflevector = shufflevector <2 x i32> zeroinitializer, <2 x i32> zeroinitializer, <2 x i32> zeroinitializer + %add187 = add <2 x i32> %add185, %shufflevector + %shufflevector189 = shufflevector <2 x i32> zeroinitializer, <2 x i32> zeroinitializer, <2 x i32> zeroinitializer + %add190 = add <2 x i32> %add186, %shufflevector189 + br i1 poison, label %bb193, label %bb173 + +bb193: ; preds = %bb173 + %add194 = or <2 x i32> %add190, %add187 + store volatile i32 0, ptr null, align 4 + unreachable +} diff --git a/llvm/test/CodeGen/ARM/crc32.ll b/llvm/test/CodeGen/ARM/crc32.ll index cc94330ce6541..50641d922d8df 100644 --- a/llvm/test/CodeGen/ARM/crc32.ll +++ b/llvm/test/CodeGen/ARM/crc32.ll @@ -1,4 +1,7 @@ +; RUN: llc -mtriple=thumbv7 -mattr=+crc -o - %s | FileCheck %s ; RUN: llc -mtriple=thumbv8 -o - %s | FileCheck %s +; RUN: llc -mtriple=armv7 -mattr=+crc -o - %s | FileCheck %s +; RUN: llc -mtriple=armv8 -o - %s | FileCheck %s define i32 @test_crc32b(i32 %cur, i8 %next) { ; CHECK-LABEL: test_crc32b: diff --git a/llvm/test/MC/ARM/crc32-thumb.s b/llvm/test/MC/ARM/crc32-thumb.s index 3a0e7a9229a9a..df24a5e5bc55a 100644 --- a/llvm/test/MC/ARM/crc32-thumb.s +++ b/llvm/test/MC/ARM/crc32-thumb.s @@ -8,9 +8,9 @@ @ CHECK: crc32b r0, r1, r2 @ encoding: [0xc1,0xfa,0x82,0xf0] @ CHECK: crc32h r0, r1, r2 @ encoding: [0xc1,0xfa,0x92,0xf0] @ CHECK: crc32w r0, r1, r2 @ encoding: [0xc1,0xfa,0xa2,0xf0] -@ CHECK-V7: error: instruction requires: crc armv8 -@ CHECK-V7: error: instruction requires: crc armv8 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc +@ CHECK-V7: error: instruction requires: crc +@ CHECK-V7: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @@ -22,9 +22,9 @@ @ CHECK: crc32cb r0, r1, r2 @ encoding: [0xd1,0xfa,0x82,0xf0] @ CHECK: crc32ch r0, r1, r2 @ encoding: [0xd1,0xfa,0x92,0xf0] @ CHECK: crc32cw r0, r1, r2 @ encoding: [0xd1,0xfa,0xa2,0xf0] -@ CHECK-V7: error: instruction requires: crc armv8 -@ CHECK-V7: error: instruction requires: crc armv8 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc +@ CHECK-V7: error: instruction requires: crc +@ CHECK-V7: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc diff --git a/llvm/test/MC/ARM/crc32.s b/llvm/test/MC/ARM/crc32.s index 45a1f0ccadb68..66c7369909b88 100644 --- a/llvm/test/MC/ARM/crc32.s +++ b/llvm/test/MC/ARM/crc32.s @@ -8,9 +8,9 @@ @ CHECK: crc32b r0, r1, r2 @ encoding: [0x42,0x00,0x01,0xe1] @ CHECK: crc32h r0, r1, r2 @ encoding: [0x42,0x00,0x21,0xe1] @ CHECK: crc32w r0, r1, r2 @ encoding: [0x42,0x00,0x41,0xe1] -@ CHECK-V7: error: instruction requires: crc armv8 -@ CHECK-V7: error: instruction requires: crc armv8 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc +@ CHECK-V7: error: instruction requires: crc +@ CHECK-V7: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @@ -22,9 +22,9 @@ @ CHECK: crc32cb r0, r1, r2 @ encoding: [0x42,0x02,0x01,0xe1] @ CHECK: crc32ch r0, r1, r2 @ encoding: [0x42,0x02,0x21,0xe1] @ CHECK: crc32cw r0, r1, r2 @ encoding: [0x42,0x02,0x41,0xe1] -@ CHECK-V7: error: instruction requires: crc armv8 -@ CHECK-V7: error: instruction requires: crc armv8 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc +@ CHECK-V7: error: instruction requires: crc +@ CHECK-V7: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc @ CHECK-NOCRC: error: instruction requires: crc diff --git a/llvm/test/MC/ARM/directive-arch_extension-crc.s b/llvm/test/MC/ARM/directive-arch_extension-crc.s index 1359b1f649ace..9b8aa1db5c6c7 100644 --- a/llvm/test/MC/ARM/directive-arch_extension-crc.s +++ b/llvm/test/MC/ARM/directive-arch_extension-crc.s @@ -15,18 +15,18 @@ .type crc,%function crc: crc32b r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc crc32h r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc crc32w r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc crc32cb r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc crc32ch r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc crc32cw r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc .arch_extension nocrc @ CHECK-V7: error: architectural extension 'crc' is not allowed for the current base architecture @@ -36,22 +36,22 @@ crc: .type nocrc,%function nocrc: crc32b r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc @ CHECK-V8: error: instruction requires: crc crc32h r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc @ CHECK-V8: error: instruction requires: crc crc32w r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc @ CHECK-V8: error: instruction requires: crc crc32cb r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc @ CHECK-V8: error: instruction requires: crc crc32ch r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc @ CHECK-V8: error: instruction requires: crc crc32cw r0, r1, r2 -@ CHECK-V7: error: instruction requires: crc armv8 +@ CHECK-V7: error: instruction requires: crc @ CHECK-V8: error: instruction requires: crc diff --git a/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll b/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll index b953e215fa0a3..98e7bd9482ea2 100644 --- a/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll +++ b/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll @@ -559,3 +559,122 @@ exit: ; preds = %for.body %add.lcssa = phi i32 [ %add, %for.body ] ret i32 %add.lcssa } + +; Make sure that if there are several reductions in the loop, the order of invariant stores sank outside of the loop is preserved +; See https://github.com/llvm/llvm-project/issues/64047 +define void @reduc_add_mul_store_same_ptr(ptr %dst, ptr readonly %src) { +; CHECK-LABEL: define void @reduc_add_mul_store_same_ptr +; CHECK: middle.block: +; CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> [[TMP1:%.*]]) +; CHECK-NEXT: store i32 [[TMP2]], ptr %dst, align 4 +; CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> [[TMP3:%.*]]) +; CHECK-NEXT: store i32 [[TMP4]], ptr %dst, align 4 +; +entry: + br label %for.body + +for.body: + %sum = phi i32 [ 0, %entry ], [ %sum.next, %for.body ] + %mul = phi i32 [ 1, %entry ], [ %mul.next, %for.body ] + %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] + %gep.src = getelementptr inbounds i32, ptr %src, i64 %iv + %0 = load i32, ptr %gep.src, align 4 + %sum.next = add nsw i32 %sum, %0 + store i32 %sum.next, ptr %dst, align 4 + %mul.next = mul nsw i32 %mul, %0 + store i32 %mul.next, ptr %dst, align 4 + %iv.next = add nuw nsw i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, 1000 + br i1 %exitcond, label %exit, label %for.body + +exit: + ret void +} + +define void @reduc_mul_add_store_same_ptr(ptr %dst, ptr readonly %src) { +; CHECK-LABEL: define void @reduc_mul_add_store_same_ptr +; CHECK: middle.block: +; CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> [[TMP1:%.*]]) +; CHECK-NEXT: store i32 [[TMP2]], ptr %dst, align 4 +; CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> [[TMP3:%.*]]) +; CHECK-NEXT: store i32 [[TMP4]], ptr %dst, align 4 +; +entry: + br label %for.body + +for.body: + %sum = phi i32 [ 0, %entry ], [ %sum.next, %for.body ] + %mul = phi i32 [ 1, %entry ], [ %mul.next, %for.body ] + %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] + %gep.src = getelementptr inbounds i32, ptr %src, i64 %iv + %0 = load i32, ptr %gep.src, align 4 + %mul.next = mul nsw i32 %mul, %0 + store i32 %mul.next, ptr %dst, align 4 + %sum.next = add nsw i32 %sum, %0 + store i32 %sum.next, ptr %dst, align 4 + %iv.next = add nuw nsw i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, 1000 + br i1 %exitcond, label %exit, label %for.body + +exit: + ret void +} + +; Same as above but storing is done to two different pointers and they can be aliased +define void @reduc_add_mul_store_different_ptr(ptr %dst1, ptr %dst2, ptr readonly %src) { +; CHECK-LABEL: define void @reduc_add_mul_store_different_ptr +; CHECK: middle.block: +; CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> [[TMP1:%.*]]) +; CHECK-NEXT: store i32 [[TMP2]], ptr %dst1, align 4 +; CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> [[TMP3:%.*]]) +; CHECK-NEXT: store i32 [[TMP4]], ptr %dst2, align 4 +; +entry: + br label %for.body + +for.body: + %sum = phi i32 [ 0, %entry ], [ %sum.next, %for.body ] + %mul = phi i32 [ 1, %entry ], [ %mul.next, %for.body ] + %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] + %gep.src = getelementptr inbounds i32, ptr %src, i64 %iv + %0 = load i32, ptr %gep.src, align 4 + %sum.next = add nsw i32 %sum, %0 + store i32 %sum.next, ptr %dst1, align 4 + %mul.next = mul nsw i32 %mul, %0 + store i32 %mul.next, ptr %dst2, align 4 + %iv.next = add nuw nsw i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, 1000 + br i1 %exitcond, label %exit, label %for.body + +exit: + ret void +} + +define void @reduc_mul_add_store_different_ptr(ptr %dst1, ptr %dst2, ptr readonly %src) { +; CHECK-LABEL: define void @reduc_mul_add_store_different_ptr +; CHECK: middle.block: +; CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> [[TMP1:%.*]]) +; CHECK-NEXT: store i32 [[TMP2]], ptr %dst1, align 4 +; CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> [[TMP3:%.*]]) +; CHECK-NEXT: store i32 [[TMP4]], ptr %dst2, align 4 +; +entry: + br label %for.body + +for.body: + %sum = phi i32 [ 0, %entry ], [ %sum.next, %for.body ] + %mul = phi i32 [ 1, %entry ], [ %mul.next, %for.body ] + %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] + %gep.src = getelementptr inbounds i32, ptr %src, i64 %iv + %0 = load i32, ptr %gep.src, align 4 + %mul.next = mul nsw i32 %mul, %0 + store i32 %mul.next, ptr %dst1, align 4 + %sum.next = add nsw i32 %sum, %0 + store i32 %sum.next, ptr %dst2, align 4 + %iv.next = add nuw nsw i64 %iv, 1 + %exitcond = icmp eq i64 %iv.next, 1000 + br i1 %exitcond, label %exit, label %for.body + +exit: + ret void +} diff --git a/llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll b/llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll index 962757f03eff2..731ca4644044c 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll @@ -2039,3 +2039,32 @@ return: %x = phi i8 [ 3, %sw.default ], [ 124, %sw.bb3 ], [ -99, %sw.bb2 ], [ -66, %sw.bb1 ], [ -33, %entry ] ret i8 %x } + +define i8 @linearmap_dec_wrapped_mon(i3 %0) { +; CHECK-LABEL: @linearmap_dec_wrapped_mon( +; CHECK-NEXT: entry: +; CHECK-NEXT: [[SWITCH_TABLEIDX:%.*]] = sub i3 [[TMP0:%.*]], -2 +; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i3 [[SWITCH_TABLEIDX]], -4 +; CHECK-NEXT: [[SWITCH_IDX_MULT:%.*]] = mul i3 [[SWITCH_TABLEIDX]], 2 +; CHECK-NEXT: [[SWITCH_OFFSET:%.*]] = add i3 [[SWITCH_IDX_MULT]], -4 +; CHECK-NEXT: [[COND:%.*]] = select i1 [[TMP1]], i3 [[SWITCH_OFFSET]], i3 2 +; CHECK-NEXT: [[CONV:%.*]] = sext i3 [[COND]] to i8 +; CHECK-NEXT: ret i8 [[CONV]] +; +entry: + switch i3 %0, label %cond.end [ + i3 -1, label %cond.false + i3 -2, label %cond.false + i3 1, label %cond.false + i3 0, label %cond.false + ] + +cond.false: ; preds = %entry, %entry, %entry, %entry + %mul = shl nsw i3 %0, 1 + br label %cond.end + +cond.end: ; preds = %entry, %cond.false + %cond = phi i3 [ %mul, %cond.false ], [ 2, %entry ] + %conv = sext i3 %cond to i8 + ret i8 %conv +} diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 3b5250d56707f..e2fff69dae20a 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -1200,18 +1200,32 @@ Expected> launchRemote() { // For real JIT uses, the real compiler support libraries should be linked // in, somehow; this is a workaround to let tests pass. // +// We need to make sure that this symbol actually is linked in when we +// try to export it; if no functions allocate a large enough stack area, +// nothing would reference it. Therefore, manually declare it and add a +// reference to it. (Note, the declarations of _alloca/___chkstk_ms/__chkstk +// are somewhat bogus, these functions use a different custom calling +// convention.) +// // TODO: Move this into libORC at some point, see // https://github.com/llvm/llvm-project/issues/56603. #ifdef __MINGW32__ // This is a MinGW version of #pragma comment(linker, "...") that doesn't // require compiling with -fms-extensions. #if defined(__i386__) +#undef _alloca +extern "C" void _alloca(void); +static __attribute__((used)) void (*const ref_func)(void) = _alloca; static __attribute__((section(".drectve"), used)) const char export_chkstk[] = "-export:_alloca"; #elif defined(__x86_64__) +extern "C" void ___chkstk_ms(void); +static __attribute__((used)) void (*const ref_func)(void) = ___chkstk_ms; static __attribute__((section(".drectve"), used)) const char export_chkstk[] = "-export:___chkstk_ms"; #else +extern "C" void __chkstk(void); +static __attribute__((used)) void (*const ref_func)(void) = __chkstk; static __attribute__((section(".drectve"), used)) const char export_chkstk[] = "-export:__chkstk"; #endif