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: c++03, c++11, c++14, c++17
11 // REQUIRES: has-unix-headers
12 // UNSUPPORTED: libcpp-hardening-mode=none
13 // XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing
15 // Test the precondition check in iota_view(value, bound) that `bound` is reachable from `value`.
19 #include "check_assertion.h"
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"); }