llvm/llvm/unittests/Support/Threading.cpp

//===- unittests/Threading.cpp - Thread tests -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/Support/Threading.h"
#include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_THREADS
#include "llvm/Support/thread.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/Triple.h"
#include "gtest/gtest.h"

#include <atomic>
#include <condition_variable>

usingnamespacellvm;

namespace {

static bool isThreadingSupportedArchAndOS() {}

TEST(Threading, PhysicalConcurrency) {}

TEST(Threading, NumPhysicalCoresSupported) {}

TEST(Threading, NumPhysicalCoresUnsupported) {}

#if LLVM_ENABLE_THREADS

class Notification {};

TEST(Threading, RunOnThreadSyncAsync) {}

TEST(Threading, RunOnThreadSync) {}

#if defined(__APPLE__)
TEST(Threading, AppleStackSize) {
  llvm::thread Thread([] {
    volatile unsigned char Var[8 * 1024 * 1024 - 10240];
    Var[0] = 0xff;
    ASSERT_EQ(Var[0], 0xff);
  });
  Thread.join();
}
#endif
#endif

} // namespace