1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
17 // any = async | deferred /* EXTENSION */
23 #include "test_macros.h"
28 LIBCPP_STATIC_ASSERT(static_cast<int>(std::launch::any
) ==
29 (static_cast<int>(std::launch::async
) | static_cast<int>(std::launch::deferred
)), "");
31 LIBCPP_STATIC_ASSERT(std::launch::any
== (std::launch::async
| std::launch::deferred
), "");
32 static_assert(std::launch(0) == (std::launch::async
& std::launch::deferred
), "");
33 LIBCPP_STATIC_ASSERT(std::launch::any
== (std::launch::async
^ std::launch::deferred
), "");
34 LIBCPP_STATIC_ASSERT(std::launch::deferred
== ~std::launch::async
, "");
35 std::launch x
= std::launch::async
;
36 x
&= std::launch::deferred
;
37 assert(x
== std::launch(0));
38 x
= std::launch::async
;
39 x
|= std::launch::deferred
;
40 LIBCPP_ASSERT(x
== std::launch::any
);
41 x
^= std::launch::deferred
;
42 assert(x
== std::launch::async
);
44 static_assert(static_cast<int>(std::launch::async
) == 1, "");
45 static_assert(static_cast<int>(std::launch::deferred
) == 2, "");