diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-02-04 00:46:59 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-02-04 00:46:59 +0000 |
commit | f0fe1a87fed9e85eb1cf9a684e18a7999253b574 (patch) | |
tree | 42507b2ff4731dba655a0cce5542f0616a12133b /llvm/unittests/Support/Host.cpp | |
parent | 3f37f07c7fc2a78c91394e9a4563afe99f5f5b41 (diff) | |
download | bcm5719-llvm-f0fe1a87fed9e85eb1cf9a684e18a7999253b574.tar.gz bcm5719-llvm-f0fe1a87fed9e85eb1cf9a684e18a7999253b574.zip |
[Support] Simplify triple check in Host CPU test. NFC.
Cleanup the check added in r293990 using the Triple helpers.
llvm-svn: 294073
Diffstat (limited to 'llvm/unittests/Support/Host.cpp')
-rw-r--r-- | llvm/unittests/Support/Host.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/llvm/unittests/Support/Host.cpp b/llvm/unittests/Support/Host.cpp index fdeed878128..10f883e6d2c 100644 --- a/llvm/unittests/Support/Host.cpp +++ b/llvm/unittests/Support/Host.cpp @@ -17,26 +17,17 @@ using namespace llvm; class HostTest : public testing::Test { Triple Host; - SmallVector<std::pair<Triple::ArchType, Triple::OSType>, 4> SupportedArchAndOSs; protected: bool isSupportedArchAndOS() { - if (is_contained(SupportedArchAndOSs, std::make_pair(Host.getArch(), Host.getOS()))) - return true; - - return false; - } - - HostTest() { - Host.setTriple(Triple::normalize(sys::getProcessTriple())); - // Initially this is only testing detection of the number of // physical cores, which is currently only supported/tested for // x86_64 Linux and Darwin. - SupportedArchAndOSs.push_back(std::make_pair(Triple::x86_64, Triple::Linux)); - SupportedArchAndOSs.push_back(std::make_pair(Triple::x86_64, Triple::Darwin)); - SupportedArchAndOSs.push_back(std::make_pair(Triple::x86_64, Triple::MacOSX)); + return (Host.getArch() == Triple::x86_64 && + (Host.isOSDarwin() || Host.getOS() == Triple::Linux)); } + + HostTest() : Host(Triple::normalize(sys::getProcessTriple())) {} }; TEST_F(HostTest, NumPhysicalCores) { |