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: c++03, c++11, c++14, c++17
10
11 // REQUIRES: has-unix-headers
12 // UNSUPPORTED: libcpp-hardening-mode=none
13 // XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing
14
15 // Test the precondition check in iota_view(value, bound) that `bound` is reachable from `value`.
16
17 #include <ranges>
18
19 #include "check_assertion.h"
20
main(int,char **)21 int main(int, char**) {
22 { TEST_LIBCPP_ASSERT_FAILURE(std::ranges::iota_view(5, 0), "iota_view: bound must be reachable from value"); }
23 { TEST_LIBCPP_ASSERT_FAILURE(std::ranges::iota_view(10, 5), "iota_view: bound must be reachable from value"); }
24
25 return 0;
26 }
27