blob: be53026415d7f2818f9a4515b7d3432fddcaefc7 [file] [log] [blame]
Teresa Johnson2bd812c2016-10-14 00:13:59 +00001//===- unittests/Threading.cpp - Thread tests -----------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/Support/Threading.h"
11#include "llvm/Support/thread.h"
12#include "gtest/gtest.h"
13
14using namespace llvm;
15
16namespace {
17
18TEST(Threading, PhysicalConcurrency) {
Teresa Johnsonc0ef9e42016-10-17 14:56:53 +000019 auto Num = heavyweight_hardware_concurrency();
Teresa Johnson2bd812c2016-10-14 00:13:59 +000020 // Since Num is unsigned this will also catch us trying to
21 // return -1.
22 ASSERT_LE(Num, thread::hardware_concurrency());
23}
24
25} // end anon namespace