Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / utility / utility.unreachable / unreachable.pass.cpp
blob290c61f41c52063903c655b67141ecddb4e3e42c
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
11 // Make sure we can use `std::unreachable()`. We can't actually execute it cause that would be
12 // UB, but we can make sure that it doesn't cause a linker error or something like that.
14 #include <cassert>
15 #include <type_traits>
16 #include <utility>
18 int main(int argc, char**) {
19 assert(argc == 1);
20 if (argc != 1) {
21 std::unreachable();
24 static_assert(std::is_same_v<decltype(std::unreachable()), void>);
26 return 0;