Index: compiler-rt/trunk/test/builtins/CMakeLists.txt =================================================================== --- compiler-rt/trunk/test/builtins/CMakeLists.txt +++ compiler-rt/trunk/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} Index: compiler-rt/trunk/test/builtins/Unit/lit.cfg.py =================================================================== --- compiler-rt/trunk/test/builtins/Unit/lit.cfg.py +++ compiler-rt/trunk/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)