27 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++1710 11// REQUIRES: has-unix-headers12// UNSUPPORTED: libcpp-hardening-mode=none13// XFAIL: libcpp-hardening-mode=debug && availability-verbose_abort-missing14 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 21int 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