From 0033a7311d61099e9679375565e7acd4ae85c218 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Thu, 15 Mar 2012 06:49:31 +0000 Subject: [PATCH] Follow-up to r152620: restore JIT event listener tests to unittest/ExecutionEngine/JIT llvm-svn: 152780 --- unittests/CMakeLists.txt | 16 +++++------ .../{ => JIT}/IntelJITEventListenerTest.cpp | 0 .../{ => JIT}/JITEventListenerTest.cpp | 0 .../{ => JIT}/JITEventListenerTestCommon.h | 0 unittests/ExecutionEngine/JIT/Makefile | 23 ++++++++++++++++ .../OProfileJITEventListenerTest.cpp | 0 unittests/ExecutionEngine/Makefile | 27 +------------------ 7 files changed, 32 insertions(+), 34 deletions(-) rename unittests/ExecutionEngine/{ => JIT}/IntelJITEventListenerTest.cpp (100%) rename unittests/ExecutionEngine/{ => JIT}/JITEventListenerTest.cpp (100%) rename unittests/ExecutionEngine/{ => JIT}/JITEventListenerTestCommon.h (100%) rename unittests/ExecutionEngine/{ => JIT}/OProfileJITEventListenerTest.cpp (100%) diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 648a1d86254..60423f25c25 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -83,11 +83,15 @@ add_llvm_unittest(Analysis Analysis/ScalarEvolutionTest.cpp ) +add_llvm_unittest(ExecutionEngine + ExecutionEngine/ExecutionEngineTest.cpp + ) + if( LLVM_USE_INTEL_JITEVENTS ) include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} ) link_directories( ${LLVM_INTEL_JITEVENTS_LIBDIR} ) set(ProfileTestSources - ExecutionEngine/IntelJITEventListenerTest.cpp + ExecutionEngine/JIT/IntelJITEventListenerTest.cpp ) set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} @@ -98,7 +102,7 @@ endif( LLVM_USE_INTEL_JITEVENTS ) if( LLVM_USE_OPROFILE ) set(ProfileTestSources ${ProfileTestSources} - ExecutionEngine/OProfileJITEventListenerTest.cpp + ExecutionEngine/JIT/OProfileJITEventListenerTest.cpp ) set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} @@ -106,16 +110,12 @@ if( LLVM_USE_OPROFILE ) ) endif( LLVM_USE_OPROFILE ) -add_llvm_unittest(ExecutionEngine - ExecutionEngine/ExecutionEngineTest.cpp - ExecutionEngine/JITEventListenerTest.cpp - ${ProfileTestSources} - ) - set(JITTestsSources + ExecutionEngine/JIT/JITEventListenerTest.cpp ExecutionEngine/JIT/JITMemoryManagerTest.cpp ExecutionEngine/JIT/JITTest.cpp ExecutionEngine/JIT/MultiJITTest.cpp + ${ProfileTestSources} ) if(MSVC) diff --git a/unittests/ExecutionEngine/IntelJITEventListenerTest.cpp b/unittests/ExecutionEngine/JIT/IntelJITEventListenerTest.cpp similarity index 100% rename from unittests/ExecutionEngine/IntelJITEventListenerTest.cpp rename to unittests/ExecutionEngine/JIT/IntelJITEventListenerTest.cpp diff --git a/unittests/ExecutionEngine/JITEventListenerTest.cpp b/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp similarity index 100% rename from unittests/ExecutionEngine/JITEventListenerTest.cpp rename to unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp diff --git a/unittests/ExecutionEngine/JITEventListenerTestCommon.h b/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h similarity index 100% rename from unittests/ExecutionEngine/JITEventListenerTestCommon.h rename to unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h diff --git a/unittests/ExecutionEngine/JIT/Makefile b/unittests/ExecutionEngine/JIT/Makefile index f5abe75a8f6..b429033b19b 100644 --- a/unittests/ExecutionEngine/JIT/Makefile +++ b/unittests/ExecutionEngine/JIT/Makefile @@ -12,6 +12,29 @@ TESTNAME = JIT LINK_COMPONENTS := asmparser bitreader bitwriter core jit native support include $(LEVEL)/Makefile.config + +SOURCES := JITEventListenerTest.cpp + +ifeq ($(USE_INTEL_JITEVENTS), 1) + # Build the Intel JIT Events interface tests + SOURCES += IntelJITEventListenerTest.cpp + + # Add the Intel JIT Events include directory + CPPFLAGS += -I$(INTEL_JITEVENTS_INCDIR) + + # Link against the LLVM Intel JIT Evens interface library + LINK_COMPONENTS += inteljitevents +endif + +ifeq ($(USE_OPROFILE), 1) + # Build the OProfile JIT interface tests + SOURCES += OProfileJITEventListenerTest.cpp + + # Link against the LLVM oprofile interface library + LINK_COMPONENTS += oprofilejit +endif + + include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest # Permit these tests to use the JIT's symbolic lookup. diff --git a/unittests/ExecutionEngine/OProfileJITEventListenerTest.cpp b/unittests/ExecutionEngine/JIT/OProfileJITEventListenerTest.cpp similarity index 100% rename from unittests/ExecutionEngine/OProfileJITEventListenerTest.cpp rename to unittests/ExecutionEngine/JIT/OProfileJITEventListenerTest.cpp diff --git a/unittests/ExecutionEngine/Makefile b/unittests/ExecutionEngine/Makefile index ffa05be87d2..a0395cdad3b 100644 --- a/unittests/ExecutionEngine/Makefile +++ b/unittests/ExecutionEngine/Makefile @@ -10,32 +10,7 @@ LEVEL = ../.. TESTNAME = ExecutionEngine LINK_COMPONENTS := engine interpreter - -include $(LEVEL)/Makefile.config - -SOURCES := ExecutionEngineTest.cpp \ - JITEventListenerTest.cpp - -ifeq ($(USE_INTEL_JITEVENTS), 1) - # Build the Intel JIT Events interface tests - SOURCES += IntelJITEventListenerTest.cpp - - # Add the Intel JIT Events include directory - CPPFLAGS += -I$(INTEL_JITEVENTS_INCDIR) - - # Link against the LLVM Intel JIT Evens interface library - LINK_COMPONENTS += inteljitevents -endif - -ifeq ($(USE_OPROFILE), 1) - # Build the OProfile JIT interface tests - SOURCES += OProfileJITEventListenerTest.cpp - - # Link against the LLVM oprofile interface library - LINK_COMPONENTS += oprofilejit -endif - - PARALLEL_DIRS = JIT +include $(LEVEL)/Makefile.config include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest