brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1022 B · 13d1bfc Raw
37 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: no-threads, libcpp-has-thread-api-external10 11// XFAIL: windows12 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 27int 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