[test-suite] r261487 - [test-suite][mips] Deduce using MIPS architecture automatically
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 21 10:51:15 PST 2016
Author: atanasyan
Date: Sun Feb 21 12:51:15 2016
New Revision: 261487
URL: http://llvm.org/viewvc/llvm-project?rev=261487&view=rev
Log:
[test-suite][mips] Deduce using MIPS architecture automatically
Use `check_symbol_exists`() to check macros defined by compiler and deduce
enabled MIPS features like mips16. If for example mips16 is enabled,
define `MIPS_IS_MIPS16_ENABLED` flag. Then use this flags to include
feature specific test cases or disable tests unsupported for the
feature.
Differential Revision: http://reviews.llvm.org/D17139
Modified:
test-suite/trunk/CMakeLists.txt
test-suite/trunk/MultiSource/UnitTests/C++11/CMakeLists.txt
test-suite/trunk/MultiSource/UnitTests/Mips/CMakeLists.txt
test-suite/trunk/SingleSource/UnitTests/CMakeLists.txt
test-suite/trunk/SingleSource/UnitTests/Mips/CMakeLists.txt
Modified: test-suite/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/CMakeLists.txt?rev=261487&r1=261486&r2=261487&view=diff
==============================================================================
--- test-suite/trunk/CMakeLists.txt (original)
+++ test-suite/trunk/CMakeLists.txt Sun Feb 21 12:51:15 2016
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.2)
+include(CheckSymbolExists)
+
# The test-suite is designed to be built in release mode anyway and
# falls over unless -DNDEBUG is set.
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@@ -108,6 +110,11 @@ if(NOT DEFINED ENDIAN)
endif()
endif()
+if("${ARCH}" STREQUAL "Mips")
+ check_symbol_exists(__mips16 "" MIPS_IS_MIPS16_ENABLED)
+ check_symbol_exists(__mips64 "" MIPS_IS_MIPS64_ENABLED)
+endif()
+
add_subdirectory(tools)
# Shortcut for the path to the fpcmp executable
set(FPCMP ${CMAKE_BINARY_DIR}/tools/fpcmp)
Modified: test-suite/trunk/MultiSource/UnitTests/C++11/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/UnitTests/C%2B%2B11/CMakeLists.txt?rev=261487&r1=261486&r2=261487&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/UnitTests/C++11/CMakeLists.txt (original)
+++ test-suite/trunk/MultiSource/UnitTests/C++11/CMakeLists.txt Sun Feb 21 12:51:15 2016
@@ -1,5 +1,5 @@
list(APPEND CPPFLAGS -std=c++11)
-string(FIND "${MIPSARCH}" "mips16" TMP1)
-if("" STREQUAL "${TMP1}")
+
+if(NOT MIPS_IS_MIPS16_ENABLED)
llvm_add_subdirectories(frame_layout)
endif()
Modified: test-suite/trunk/MultiSource/UnitTests/Mips/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/UnitTests/Mips/CMakeLists.txt?rev=261487&r1=261486&r2=261487&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/UnitTests/Mips/CMakeLists.txt (original)
+++ test-suite/trunk/MultiSource/UnitTests/Mips/CMakeLists.txt Sun Feb 21 12:51:15 2016
@@ -1,4 +1,3 @@
-string(FIND "${MIPSARCH}" "mips16" TMP1)
-if("" STREQUAL "${TMP1}")
+if(MIPS_IS_MIPS16_ENABLED)
llvm_add_subdirectories(Mips16)
endif()
Modified: test-suite/trunk/SingleSource/UnitTests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/CMakeLists.txt?rev=261487&r1=261486&r2=261487&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/CMakeLists.txt (original)
+++ test-suite/trunk/SingleSource/UnitTests/CMakeLists.txt Sun Feb 21 12:51:15 2016
@@ -21,8 +21,8 @@ if("${ARCH}" STREQUAL "AArch64")
endif()
if("${ARCH}" STREQUAL "Mips")
llvm_add_subdirectories(Mips)
- string(FIND "${MIPSARCH}" "mips64" TMP2)
- if("" STREQUAL "${TMP2}")
+ # Only MIPS 64-bit supports 8 bytes atomic operations.
+ if(NOT MIPS_IS_MIPS64_ENABLED)
list(APPEND PROGRAMS_TO_SKIP AtomicOps)
endif()
endif()
Modified: test-suite/trunk/SingleSource/UnitTests/Mips/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/Mips/CMakeLists.txt?rev=261487&r1=261486&r2=261487&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/Mips/CMakeLists.txt (original)
+++ test-suite/trunk/SingleSource/UnitTests/Mips/CMakeLists.txt Sun Feb 21 12:51:15 2016
@@ -1,4 +1,3 @@
-string(FIND "${MIPSARCH}" "mips16" TMP1)
-if(NOT "" STREQUAL "${TMP1}")
+if(MIPS_IS_MIPS16_ENABLED)
llvm_add_subdirectories(Mips16)
endif()
More information about the llvm-commits
mailing list