brintos

brintos / llvm-project-archived public Read only

0
0
Text · 898 B · 6dea99d Raw
32 lines · cpp
1//===-- Tests for pthread_join-- ------------------------------------------===//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#include "src/pthread/pthread_create.h"10#include "src/pthread/pthread_join.h"11 12#include "test/IntegrationTest/test.h"13 14#include <errno.h>15#include <pthread.h>16 17static void *simpleFunc(void *) { return nullptr; }18static void nullJoinTest() {19  pthread_t Tid;20  ASSERT_EQ(LIBC_NAMESPACE::pthread_create(&Tid, nullptr, simpleFunc, nullptr),21            0);22  ASSERT_ERRNO_SUCCESS();23  ASSERT_EQ(LIBC_NAMESPACE::pthread_join(Tid, nullptr), 0);24  ASSERT_ERRNO_SUCCESS();25}26 27TEST_MAIN() {28  errno = 0;29  nullJoinTest();30  return 0;31}32