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: no-threads, libcpp-has-thread-api-external
10 
11 // XFAIL: windows
12 
13 // <condition_variable>
14 
15 // class condition_variable;
16 
17 // typedef pthread_cond_t* native_handle_type;
18 // native_handle_type native_handle();
19 
20 #include <cassert>
21 #include <condition_variable>
22 #include <pthread.h>
23 #include <type_traits>
24 
25 #include "test_macros.h"
26 
main(int,char **)27 int main(int, char**)
28 {
29     static_assert((std::is_same<std::condition_variable::native_handle_type,
30                                 pthread_cond_t*>::value), "");
31     std::condition_variable cv;
32     std::condition_variable::native_handle_type h = cv.native_handle();
33     assert(h != nullptr);
34 
35   return 0;
36 }
37