Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / thread / futures / futures.overview / future_errc.pass.cpp
blob49e2bcbbc8511f55690939d56bb5283686e0048a
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // UNSUPPORTED: no-threads
11 // UNSUPPORTED: c++03
12 // Libc++'s enum class emulation does not allow static_cast<Enum>(0) to work.
14 // <future>
16 // enum class future_errc
17 // {
18 // broken_promise = implementation-defined,
19 // future_already_retrieved = implementation-defined,
20 // promise_already_satisfied = implementation-defined,
21 // no_state = implementation-defined
22 // };
24 #include <future>
26 #include "test_macros.h"
28 int main(int, char**)
30 static_assert(std::future_errc::broken_promise != std::future_errc::future_already_retrieved, "");
31 static_assert(std::future_errc::broken_promise != std::future_errc::promise_already_satisfied, "");
32 static_assert(std::future_errc::broken_promise != std::future_errc::no_state, "");
33 static_assert(std::future_errc::future_already_retrieved != std::future_errc::promise_already_satisfied, "");
34 static_assert(std::future_errc::future_already_retrieved != std::future_errc::no_state, "");
35 static_assert(std::future_errc::promise_already_satisfied != std::future_errc::no_state, "");
37 static_assert(std::future_errc::broken_promise != static_cast<std::future_errc>(0), "");
38 static_assert(std::future_errc::future_already_retrieved != static_cast<std::future_errc>(0), "");
39 static_assert(std::future_errc::promise_already_satisfied != static_cast<std::future_errc>(0), "");
40 static_assert(std::future_errc::no_state != static_cast<std::future_errc>(0), "");
42 return 0;