From 17495274fd746ae61e6688cc47b4cf0e8f735506 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 3 Feb 2016 21:41:24 +0000 Subject: [PATCH] [unittests] Move TargetRegistry test from Support to MC This removes the dependency from SupportTests to all of the LLVM backends, and makes it link faster. llvm-svn: 259705 --- llvm/unittests/MC/CMakeLists.txt | 1 + llvm/unittests/{Support => MC}/TargetRegistry.cpp | 6 +++++- llvm/unittests/Support/CMakeLists.txt | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) rename llvm/unittests/{Support => MC}/TargetRegistry.cpp (83%) diff --git a/llvm/unittests/MC/CMakeLists.txt b/llvm/unittests/MC/CMakeLists.txt index 9d68e783a553..7c39f4398230 100644 --- a/llvm/unittests/MC/CMakeLists.txt +++ b/llvm/unittests/MC/CMakeLists.txt @@ -9,5 +9,6 @@ add_llvm_unittest(MCTests Disassembler.cpp DwarfLineTables.cpp StringTableBuilderTest.cpp + TargetRegistry.cpp YAMLTest.cpp ) diff --git a/llvm/unittests/Support/TargetRegistry.cpp b/llvm/unittests/MC/TargetRegistry.cpp similarity index 83% rename from llvm/unittests/Support/TargetRegistry.cpp rename to llvm/unittests/MC/TargetRegistry.cpp index ae89c8b64930..eb46b22f06c1 100644 --- a/llvm/unittests/Support/TargetRegistry.cpp +++ b/llvm/unittests/MC/TargetRegistry.cpp @@ -1,4 +1,4 @@ -//===- unittests/Support/TargetRegistry.cpp - -----------------------------===// +//===- unittests/MC/TargetRegistry.cpp ------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,6 +7,10 @@ // //===----------------------------------------------------------------------===// +// The target registry code lives in Support, but it relies on linking in all +// LLVM targets. We keep this test with the MC tests, which already do that, to +// keep the SupportTests target small. + #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetSelect.h" #include "gtest/gtest.h" diff --git a/llvm/unittests/Support/CMakeLists.txt b/llvm/unittests/Support/CMakeLists.txt index 3ab98d58d5f0..0c4a5c51f07c 100644 --- a/llvm/unittests/Support/CMakeLists.txt +++ b/llvm/unittests/Support/CMakeLists.txt @@ -1,5 +1,4 @@ set(LLVM_LINK_COMPONENTS - ${LLVM_TARGETS_TO_BUILD} Support ) @@ -39,7 +38,6 @@ add_llvm_unittest(SupportTests StreamingMemoryObject.cpp StringPool.cpp SwapByteOrderTest.cpp - TargetRegistry.cpp ThreadLocalTest.cpp ThreadPool.cpp TimerTest.cpp