[PATCH] D17139: [test-suite][mips] Fix MIPS related conditions in the CMakeLists.txt

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 06:33:20 PST 2016


atanasyan created this revision.
atanasyan added reviewers: rengolin, dsanders.
atanasyan added a subscriber: llvm-commits.
atanasyan set the repository for this revision to rL LLVM.
Herald added a reviewer: vkalintiris.
Herald added a subscriber: dsanders.

CMake `string(FIND ...)` function returns -1 (not an empty string) if it does not find specified substring. The patch replaces statements like `if("" STREQUAL "${TMP1}")` to `if("${TMP1}" EQUAL -1)`.

Repository:
  rL LLVM

http://reviews.llvm.org/D17139

Files:
  MultiSource/UnitTests/C++11/CMakeLists.txt
  MultiSource/UnitTests/Mips/CMakeLists.txt
  SingleSource/UnitTests/CMakeLists.txt
  SingleSource/UnitTests/Mips/CMakeLists.txt

Index: SingleSource/UnitTests/Mips/CMakeLists.txt
===================================================================
--- SingleSource/UnitTests/Mips/CMakeLists.txt
+++ SingleSource/UnitTests/Mips/CMakeLists.txt
@@ -1,4 +1,5 @@
+# Add special tests for mips16
 string(FIND "${MIPSARCH}" "mips16" TMP1)
-if(NOT "" STREQUAL "${TMP1}")
+if("${TMP1}" GREATER -1)
   llvm_add_subdirectories(Mips16)
 endif()
Index: SingleSource/UnitTests/CMakeLists.txt
===================================================================
--- SingleSource/UnitTests/CMakeLists.txt
+++ SingleSource/UnitTests/CMakeLists.txt
@@ -21,8 +21,9 @@
 endif()
 if("${ARCH}" STREQUAL "Mips")
   llvm_add_subdirectories(Mips)
+  # Only MIPS 64-bit supports 8 bytes atomic operations.
   string(FIND "${MIPSARCH}" "mips64" TMP2)
-  if("" STREQUAL "${TMP2}")
+  if("${TMP2}" EQUAL -1)
     list(APPEND PROGRAMS_TO_SKIP AtomicOps)
   endif()
 endif()
Index: MultiSource/UnitTests/Mips/CMakeLists.txt
===================================================================
--- MultiSource/UnitTests/Mips/CMakeLists.txt
+++ MultiSource/UnitTests/Mips/CMakeLists.txt
@@ -1,4 +1,5 @@
+# Add special tests for mips16
 string(FIND "${MIPSARCH}" "mips16" TMP1)
-if("" STREQUAL "${TMP1}")
+if("${TMP1}" GREATER -1)
   llvm_add_subdirectories(Mips16)
 endif()
Index: MultiSource/UnitTests/C++11/CMakeLists.txt
===================================================================
--- MultiSource/UnitTests/C++11/CMakeLists.txt
+++ MultiSource/UnitTests/C++11/CMakeLists.txt
@@ -1,5 +1,6 @@
 list(APPEND CPPFLAGS -std=c++11)
+# Disable frame_layout test on Mips16
 string(FIND "${MIPSARCH}" "mips16" TMP1)
-if("" STREQUAL "${TMP1}")
+if("${TMP1}" EQUAL -1)
   llvm_add_subdirectories(frame_layout)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17139.47638.patch
Type: text/x-patch
Size: 1753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160211/ea798731/attachment.bin>


More information about the llvm-commits mailing list