xref: /llvm-project/libcxx/test/std/thread/thread.semaphore/ctor.verify.cpp (revision 9bb9ec380ace81d040d3a0a0a2ae9a75733ab330)
142a024faSEdoardo Sanguineti //===----------------------------------------------------------------------===//
242a024faSEdoardo Sanguineti //
342a024faSEdoardo Sanguineti // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
442a024faSEdoardo Sanguineti // See https://llvm.org/LICENSE.txt for license information.
542a024faSEdoardo Sanguineti // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
642a024faSEdoardo Sanguineti //
742a024faSEdoardo Sanguineti //===----------------------------------------------------------------------===//
842a024faSEdoardo Sanguineti //
942a024faSEdoardo Sanguineti // UNSUPPORTED: no-threads
1042a024faSEdoardo Sanguineti // UNSUPPORTED: c++03, c++11, c++14, c++17
1142a024faSEdoardo Sanguineti 
1242a024faSEdoardo Sanguineti // <semaphore>
1342a024faSEdoardo Sanguineti 
1442a024faSEdoardo Sanguineti #include <semaphore>
1542a024faSEdoardo Sanguineti 
not_positive()1642a024faSEdoardo Sanguineti void not_positive() {
17*9bb9ec38SLouis Dionne   std::counting_semaphore<-1> s(2); // expected-error-re@*:* {{static assertion failed{{.*}}The least maximum value must be a positive number}}
1842a024faSEdoardo Sanguineti   (void)s;
1942a024faSEdoardo Sanguineti }
20