[PATCH] D66984: compiler-rt/builtins: Make check-builtins run tests on macOS.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 07:29:31 PDT 2019


thakis updated this revision to Diff 220098.
thakis added a comment.

smaller diff


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66984/new/

https://reviews.llvm.org/D66984

Files:
  compiler-rt/test/builtins/CMakeLists.txt
  compiler-rt/test/builtins/Unit/lit.cfg.py


Index: compiler-rt/test/builtins/Unit/lit.cfg.py
===================================================================
--- compiler-rt/test/builtins/Unit/lit.cfg.py
+++ compiler-rt/test/builtins/Unit/lit.cfg.py
@@ -29,6 +29,9 @@
   base_lib = os.path.join(config.compiler_rt_libdir, "clang_rt.builtins%s.lib "
                           % config.target_suffix)
   config.substitutions.append( ("%librt ", base_lib) )
+elif config.host_os  == 'Darwin':
+  base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.osx.a ")
+  config.substitutions.append( ("%librt ", base_lib + ' -lSystem ') )
 else:
   base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins%s.a"
                           % config.target_suffix)
Index: compiler-rt/test/builtins/CMakeLists.txt
===================================================================
--- compiler-rt/test/builtins/CMakeLists.txt
+++ compiler-rt/test/builtins/CMakeLists.txt
@@ -25,9 +25,12 @@
 endif()
 pythonize_bool(BUILTINS_IS_MSVC)
 
-#TODO: Add support for Apple.
-if (NOT APPLE)
-foreach(arch ${BUILTIN_SUPPORTED_ARCH})
+set(BUILTIN_TEST_ARCH ${BUILTIN_SUPPORTED_ARCH})
+if(APPLE)
+  darwin_filter_host_archs(BUILTIN_SUPPORTED_ARCH BUILTIN_TEST_ARCH)
+endif()
+
+foreach(arch ${BUILTIN_TEST_ARCH})
   set(BUILTINS_TEST_TARGET_ARCH ${arch})
   string(TOLOWER "-${arch}-${OS_NAME}" BUILTINS_TEST_CONFIG_SUFFIX)
   get_test_cc_for_arch(${arch} BUILTINS_TEST_TARGET_CC BUILTINS_TEST_TARGET_CFLAGS)
@@ -49,7 +52,8 @@
     )
   list(APPEND BUILTINS_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME})
 endforeach()
-endif()
+
+# TODO: Add support for running tests on iOS and iOS simulator.
 
 add_lit_testsuite(check-builtins "Running the Builtins tests"
   ${BUILTINS_TESTSUITES}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66984.220098.patch
Type: text/x-patch
Size: 1758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190913/7861409e/attachment.bin>


More information about the llvm-commits mailing list