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 // <algorithm>
10 
11 // REQUIRES: has-unix-headers
12 // UNSUPPORTED: c++03, c++11, c++14, c++17, libcpp-has-no-incomplete-ranges
13 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1
14 
15 #include <algorithm>
16 #include <array>
17 
18 #include "check_assertion.h"
19 
20 int main(int, char**) {
21   std::initializer_list<int> init_list{};
22   TEST_LIBCPP_ASSERT_FAILURE(std::ranges::minmax(init_list),
23                              "initializer_list has to contain at least one element");
24 
25   TEST_LIBCPP_ASSERT_FAILURE(std::ranges::minmax(std::array<int, 0>{}),
26                              "range has to contain at least one element");
27 
28   return 0;
29 }
30