Home | History | Annotate | Download | only in Support
      1 //===- 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 
     14 using namespace llvm;
     15 
     16 namespace {
     17 
     18 TEST(Threading, PhysicalConcurrency) {
     19   auto Num = heavyweight_hardware_concurrency();
     20   // 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
     26