summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Liew <dan@su-root.co.uk>2019-10-17 18:12:49 +0000
committerDan Liew <dan@su-root.co.uk>2019-10-17 18:12:49 +0000
commit650d5e6d1a5b8f36cdeea4d94a7d4dbab3dcad6c (patch)
tree5b611bd76c74c9cfd60c2c3a616923c66b1ce127
parent3bd385c6f182169886bec74afd1115df10b95b80 (diff)
downloadcompiler-rt-650d5e6d1a5b8f36cdeea4d94a7d4dbab3dcad6c.tar.gz
[Builtins] Provide a mechanism to selectively disable tests based on whether an implementation is provided by a builtin library.
Summary: If a platform removes some builtin implementations (e.g. via the Darwin-excludes mechanism) then this can lead to test failures because the test expects an implementation to be available. To solve this lit features are added for each configuration based on which sources are included in the builtin library. The features are of the form `librt_has_<name>` where `<name>` is the name of the source file with the file extension removed. This handles C and assembly sources. With the lit features in place it is possible to make certain tests require them. Example: ``` REQUIRES: librt_has_comparedf2 ``` All top-level tests in `test/builtins/Unit` (i.e. not under `arm`, `ppc`, and `riscv`) have been annotated with the appropriate `REQUIRES: librt_has_*` statement. rdar://problem/55520987 Reviewers: beanz, steven_wu, arphaman, dexonsmith, phosek, thakis Subscribers: mgorny, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D68064 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@375150 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/builtins/CMakeLists.txt27
-rw-r--r--test/builtins/Unit/absvdi2_test.c1
-rw-r--r--test/builtins/Unit/absvsi2_test.c1
-rw-r--r--test/builtins/Unit/absvti2_test.c1
-rw-r--r--test/builtins/Unit/adddf3vfp_test.c1
-rw-r--r--test/builtins/Unit/addsf3vfp_test.c1
-rw-r--r--test/builtins/Unit/addtf3_test.c1
-rw-r--r--test/builtins/Unit/addvdi3_test.c1
-rw-r--r--test/builtins/Unit/addvsi3_test.c1
-rw-r--r--test/builtins/Unit/addvti3_test.c1
-rw-r--r--test/builtins/Unit/ashldi3_test.c1
-rw-r--r--test/builtins/Unit/ashlti3_test.c1
-rw-r--r--test/builtins/Unit/ashrdi3_test.c1
-rw-r--r--test/builtins/Unit/ashrti3_test.c1
-rw-r--r--test/builtins/Unit/bswapdi2_test.c1
-rw-r--r--test/builtins/Unit/bswapsi2_test.c1
-rw-r--r--test/builtins/Unit/clear_cache_test.c1
-rw-r--r--test/builtins/Unit/clzdi2_test.c1
-rw-r--r--test/builtins/Unit/clzsi2_test.c1
-rw-r--r--test/builtins/Unit/clzti2_test.c1
-rw-r--r--test/builtins/Unit/cmpdi2_test.c1
-rw-r--r--test/builtins/Unit/cmpti2_test.c1
-rw-r--r--test/builtins/Unit/comparedf2_test.c1
-rw-r--r--test/builtins/Unit/comparesf2_test.c1
-rw-r--r--test/builtins/Unit/cpu_model_test.c1
-rw-r--r--test/builtins/Unit/ctzdi2_test.c1
-rw-r--r--test/builtins/Unit/ctzsi2_test.c1
-rw-r--r--test/builtins/Unit/ctzti2_test.c1
-rw-r--r--test/builtins/Unit/divdc3_test.c1
-rw-r--r--test/builtins/Unit/divdf3_test.c1
-rw-r--r--test/builtins/Unit/divdf3vfp_test.c1
-rw-r--r--test/builtins/Unit/divdi3_test.c1
-rw-r--r--test/builtins/Unit/divmodsi4_test.c1
-rw-r--r--test/builtins/Unit/divsc3_test.c1
-rw-r--r--test/builtins/Unit/divsf3_test.c1
-rw-r--r--test/builtins/Unit/divsf3vfp_test.c1
-rw-r--r--test/builtins/Unit/divsi3_test.c1
-rw-r--r--test/builtins/Unit/divtc3_test.c1
-rw-r--r--test/builtins/Unit/divtf3_test.c1
-rw-r--r--test/builtins/Unit/divti3_test.c1
-rw-r--r--test/builtins/Unit/divxc3_test.c1
-rw-r--r--test/builtins/Unit/enable_execute_stack_test.c1
-rw-r--r--test/builtins/Unit/eqdf2vfp_test.c1
-rw-r--r--test/builtins/Unit/eqsf2vfp_test.c1
-rw-r--r--test/builtins/Unit/eqtf2_test.c1
-rw-r--r--test/builtins/Unit/extenddftf2_test.c1
-rw-r--r--test/builtins/Unit/extendhfsf2_test.c1
-rw-r--r--test/builtins/Unit/extendsfdf2vfp_test.c (renamed from test/builtins/Unit/extebdsfdf2vfp_test.c)1
-rw-r--r--test/builtins/Unit/extendsftf2_test.c1
-rw-r--r--test/builtins/Unit/ffsdi2_test.c1
-rw-r--r--test/builtins/Unit/ffssi2_test.c1
-rw-r--r--test/builtins/Unit/ffsti2_test.c1
-rw-r--r--test/builtins/Unit/fixdfdi_test.c1
-rw-r--r--test/builtins/Unit/fixdfsivfp_test.c1
-rw-r--r--test/builtins/Unit/fixdfti_test.c1
-rw-r--r--test/builtins/Unit/fixsfdi_test.c1
-rw-r--r--test/builtins/Unit/fixsfsivfp_test.c1
-rw-r--r--test/builtins/Unit/fixsfti_test.c1
-rw-r--r--test/builtins/Unit/fixtfdi_test.c1
-rw-r--r--test/builtins/Unit/fixtfsi_test.c1
-rw-r--r--test/builtins/Unit/fixtfti_test.c1
-rw-r--r--test/builtins/Unit/fixunsdfdi_test.c1
-rw-r--r--test/builtins/Unit/fixunsdfsi_test.c1
-rw-r--r--test/builtins/Unit/fixunsdfsivfp_test.c1
-rw-r--r--test/builtins/Unit/fixunsdfti_test.c1
-rw-r--r--test/builtins/Unit/fixunssfdi_test.c1
-rw-r--r--test/builtins/Unit/fixunssfsi_test.c1
-rw-r--r--test/builtins/Unit/fixunssfsivfp_test.c1
-rw-r--r--test/builtins/Unit/fixunssfti_test.c1
-rw-r--r--test/builtins/Unit/fixunstfdi_test.c1
-rw-r--r--test/builtins/Unit/fixunstfsi_test.c1
-rw-r--r--test/builtins/Unit/fixunstfti_test.c1
-rw-r--r--test/builtins/Unit/fixunsxfdi_test.c1
-rw-r--r--test/builtins/Unit/fixunsxfsi_test.c1
-rw-r--r--test/builtins/Unit/fixunsxfti_test.c1
-rw-r--r--test/builtins/Unit/fixxfdi_test.c1
-rw-r--r--test/builtins/Unit/fixxfti_test.c1
-rw-r--r--test/builtins/Unit/floatdidf_test.c1
-rw-r--r--test/builtins/Unit/floatdisf_test.c1
-rw-r--r--test/builtins/Unit/floatditf_test.c1
-rw-r--r--test/builtins/Unit/floatdixf_test.c1
-rw-r--r--test/builtins/Unit/floatsidfvfp_test.c1
-rw-r--r--test/builtins/Unit/floatsisfvfp_test.c1
-rw-r--r--test/builtins/Unit/floatsitf_test.c1
-rw-r--r--test/builtins/Unit/floattidf_test.c1
-rw-r--r--test/builtins/Unit/floattisf_test.c1
-rw-r--r--test/builtins/Unit/floattitf_test.c1
-rw-r--r--test/builtins/Unit/floattixf_test.c1
-rw-r--r--test/builtins/Unit/floatundidf_test.c1
-rw-r--r--test/builtins/Unit/floatundisf_test.c1
-rw-r--r--test/builtins/Unit/floatunditf_test.c1
-rw-r--r--test/builtins/Unit/floatundixf_test.c1
-rw-r--r--test/builtins/Unit/floatunsitf_test.c1
-rw-r--r--test/builtins/Unit/floatunssidfvfp_test.c1
-rw-r--r--test/builtins/Unit/floatunssisfvfp_test.c1
-rw-r--r--test/builtins/Unit/floatuntidf_test.c1
-rw-r--r--test/builtins/Unit/floatuntisf_test.c1
-rw-r--r--test/builtins/Unit/floatuntitf_test.c1
-rw-r--r--test/builtins/Unit/floatuntixf_test.c1
-rw-r--r--test/builtins/Unit/gedf2vfp_test.c1
-rw-r--r--test/builtins/Unit/gesf2vfp_test.c1
-rw-r--r--test/builtins/Unit/getf2_test.c1
-rw-r--r--test/builtins/Unit/gtdf2vfp_test.c1
-rw-r--r--test/builtins/Unit/gtsf2vfp_test.c1
-rw-r--r--test/builtins/Unit/gttf2_test.c1
-rw-r--r--test/builtins/Unit/ledf2vfp_test.c1
-rw-r--r--test/builtins/Unit/lesf2vfp_test.c1
-rw-r--r--test/builtins/Unit/letf2_test.c1
-rw-r--r--test/builtins/Unit/lit.cfg.py22
-rw-r--r--test/builtins/Unit/lit.site.cfg.py.in2
-rw-r--r--test/builtins/Unit/lshrdi3_test.c1
-rw-r--r--test/builtins/Unit/lshrti3_test.c1
-rw-r--r--test/builtins/Unit/ltdf2vfp_test.c1
-rw-r--r--test/builtins/Unit/ltsf2vfp_test.c1
-rw-r--r--test/builtins/Unit/lttf2_test.c1
-rw-r--r--test/builtins/Unit/moddi3_test.c1
-rw-r--r--test/builtins/Unit/modsi3_test.c1
-rw-r--r--test/builtins/Unit/modti3_test.c1
-rw-r--r--test/builtins/Unit/muldc3_test.c1
-rw-r--r--test/builtins/Unit/muldf3vfp_test.c1
-rw-r--r--test/builtins/Unit/muldi3_test.c1
-rw-r--r--test/builtins/Unit/mulodi4_test.c1
-rw-r--r--test/builtins/Unit/mulosi4_test.c1
-rw-r--r--test/builtins/Unit/muloti4_test.c1
-rw-r--r--test/builtins/Unit/mulsc3_test.c1
-rw-r--r--test/builtins/Unit/mulsf3vfp_test.c1
-rw-r--r--test/builtins/Unit/multc3_test.c1
-rw-r--r--test/builtins/Unit/multf3_test.c1
-rw-r--r--test/builtins/Unit/multi3_test.c1
-rw-r--r--test/builtins/Unit/mulvdi3_test.c1
-rw-r--r--test/builtins/Unit/mulvsi3_test.c1
-rw-r--r--test/builtins/Unit/mulvti3_test.c1
-rw-r--r--test/builtins/Unit/mulxc3_test.c1
-rw-r--r--test/builtins/Unit/nedf2vfp_test.c1
-rw-r--r--test/builtins/Unit/negdf2vfp_test.c1
-rw-r--r--test/builtins/Unit/negdi2_test.c1
-rw-r--r--test/builtins/Unit/negsf2vfp_test.c1
-rw-r--r--test/builtins/Unit/negti2_test.c1
-rw-r--r--test/builtins/Unit/negvdi2_test.c1
-rw-r--r--test/builtins/Unit/negvsi2_test.c1
-rw-r--r--test/builtins/Unit/negvti2_test.c1
-rw-r--r--test/builtins/Unit/nesf2vfp_test.c1
-rw-r--r--test/builtins/Unit/netf2_test.c1
-rw-r--r--test/builtins/Unit/paritydi2_test.c1
-rw-r--r--test/builtins/Unit/paritysi2_test.c1
-rw-r--r--test/builtins/Unit/parityti2_test.c1
-rw-r--r--test/builtins/Unit/popcountdi2_test.c1
-rw-r--r--test/builtins/Unit/popcountsi2_test.c1
-rw-r--r--test/builtins/Unit/popcountti2_test.c1
-rw-r--r--test/builtins/Unit/powidf2_test.c1
-rw-r--r--test/builtins/Unit/powisf2_test.c1
-rw-r--r--test/builtins/Unit/powitf2_test.c1
-rw-r--r--test/builtins/Unit/powixf2_test.c1
-rw-r--r--test/builtins/Unit/subdf3vfp_test.c1
-rw-r--r--test/builtins/Unit/subsf3vfp_test.c1
-rw-r--r--test/builtins/Unit/subtf3_test.c1
-rw-r--r--test/builtins/Unit/subvdi3_test.c1
-rw-r--r--test/builtins/Unit/subvsi3_test.c1
-rw-r--r--test/builtins/Unit/subvti3_test.c1
-rw-r--r--test/builtins/Unit/trampoline_setup_test.c1
-rw-r--r--test/builtins/Unit/truncdfhf2_test.c1
-rw-r--r--test/builtins/Unit/truncdfsf2_test.c1
-rw-r--r--test/builtins/Unit/truncdfsf2vfp_test.c1
-rw-r--r--test/builtins/Unit/truncsfhf2_test.c1
-rw-r--r--test/builtins/Unit/trunctfdf2_test.c1
-rw-r--r--test/builtins/Unit/trunctfsf2_test.c1
-rw-r--r--test/builtins/Unit/ucmpdi2_test.c1
-rw-r--r--test/builtins/Unit/ucmpti2_test.c1
-rw-r--r--test/builtins/Unit/udivdi3_test.c1
-rw-r--r--test/builtins/Unit/udivmoddi4_test.c1
-rw-r--r--test/builtins/Unit/udivmodsi4_test.c1
-rw-r--r--test/builtins/Unit/udivmodti4_test.c1
-rw-r--r--test/builtins/Unit/udivsi3_test.c1
-rw-r--r--test/builtins/Unit/udivti3_test.c1
-rw-r--r--test/builtins/Unit/umoddi3_test.c1
-rw-r--r--test/builtins/Unit/umodsi3_test.c1
-rw-r--r--test/builtins/Unit/umodti3_test.c1
-rw-r--r--test/builtins/Unit/unorddf2vfp_test.c1
-rw-r--r--test/builtins/Unit/unordsf2vfp_test.c1
-rw-r--r--test/builtins/Unit/unordtf2_test.c1
180 files changed, 228 insertions, 0 deletions
diff --git a/test/builtins/CMakeLists.txt b/test/builtins/CMakeLists.txt
index b80b8a112..e3796f840 100644
--- a/test/builtins/CMakeLists.txt
+++ b/test/builtins/CMakeLists.txt
@@ -44,6 +44,33 @@ foreach(arch ${BUILTIN_TEST_ARCH})
string(REPLACE ";" " " BUILTINS_TEST_TARGET_CFLAGS "${BUILTINS_TEST_TARGET_CFLAGS}")
endif()
+ # Compute builtins available in library and add them as lit features.
+ if(APPLE)
+ # TODO: Support other Apple platforms.
+ set(BUILTIN_LIB_TARGET_NAME "clang_rt.builtins_${arch}_osx")
+ else()
+ set(BUILTIN_LIB_TARGET_NAME "clang_rt.builtins-${arch}")
+ endif()
+ if (NOT TARGET "${BUILTIN_LIB_TARGET_NAME}")
+ message(FATAL_ERROR "Target ${BUILTIN_LIB_TARGET_NAME} does not exist")
+ endif()
+ get_target_property(BUILTIN_LIB_SOURCES "${BUILTIN_LIB_TARGET_NAME}" SOURCES)
+ list(LENGTH BUILTIN_LIB_SOURCES BUILTIN_LIB_SOURCES_LENGTH)
+ if (BUILTIN_LIB_SOURCES_LENGTH EQUAL 0)
+ message(FATAL_ERROR "Failed to find source files for ${arch} builtin library")
+ endif()
+ set(BUILTINS_LIT_SOURCE_FEATURES "")
+ foreach (file_name ${BUILTIN_LIB_SOURCES})
+ # Strip off any directories and file extensions. This approach means we add
+ # add a single feature if there is a C source file or assembly override
+ # present in the builtin library.
+ # E.g.
+ # "hexagon/udivsi3.S" => "udivsi3"
+ # "udivsi3.c" => "udivsi3"
+ get_filename_component(FILE_NAME_FILTERED "${file_name}" NAME_WE)
+ list(APPEND BUILTINS_LIT_SOURCE_FEATURES "librt_has_${FILE_NAME_FILTERED}")
+ endforeach()
+
string(TOUPPER ${arch} ARCH_UPPER_CASE)
set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
configure_lit_site_cfg(
diff --git a/test/builtins/Unit/absvdi2_test.c b/test/builtins/Unit/absvdi2_test.c
index 00db5cc2f..a1bdbc5ef 100644
--- a/test/builtins/Unit/absvdi2_test.c
+++ b/test/builtins/Unit/absvdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_absvdi2
//===-- absvdi2_test.c - Test __absvdi2 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/absvsi2_test.c b/test/builtins/Unit/absvsi2_test.c
index 332395b24..b9d3105d3 100644
--- a/test/builtins/Unit/absvsi2_test.c
+++ b/test/builtins/Unit/absvsi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_absvsi2
//===-- absvsi2_test.c - Test __absvsi2 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/absvti2_test.c b/test/builtins/Unit/absvti2_test.c
index 60d6c34ff..635c0f92b 100644
--- a/test/builtins/Unit/absvti2_test.c
+++ b/test/builtins/Unit/absvti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_absvti2
// REQUIRES: int128
//===-- absvti2_test.c - Test __absvti2 -----------------------------------===//
//
diff --git a/test/builtins/Unit/adddf3vfp_test.c b/test/builtins/Unit/adddf3vfp_test.c
index f2642323d..5eb85b358 100644
--- a/test/builtins/Unit/adddf3vfp_test.c
+++ b/test/builtins/Unit/adddf3vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_adddf3vfp
//===-- adddf3vfp_test.c - Test __adddf3vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/addsf3vfp_test.c b/test/builtins/Unit/addsf3vfp_test.c
index 8a742e6a4..50522f0d4 100644
--- a/test/builtins/Unit/addsf3vfp_test.c
+++ b/test/builtins/Unit/addsf3vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_addsf3vfp
//===-- addsf3vfp_test.c - Test __addsf3vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/addtf3_test.c b/test/builtins/Unit/addtf3_test.c
index 492d93bb9..7ca0355e4 100644
--- a/test/builtins/Unit/addtf3_test.c
+++ b/test/builtins/Unit/addtf3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_addtf3
//===--------------- addtf3_test.c - Test __addtf3 ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/addvdi3_test.c b/test/builtins/Unit/addvdi3_test.c
index e30993ec0..0d87259e1 100644
--- a/test/builtins/Unit/addvdi3_test.c
+++ b/test/builtins/Unit/addvdi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_addvdi3
//===-- addvdi3_test.c - Test __addvdi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/addvsi3_test.c b/test/builtins/Unit/addvsi3_test.c
index 03ced89c2..73d9dbfb0 100644
--- a/test/builtins/Unit/addvsi3_test.c
+++ b/test/builtins/Unit/addvsi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_addvsi3
//===-- addvsi3_test.c - Test __addvsi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/addvti3_test.c b/test/builtins/Unit/addvti3_test.c
index 289ddc360..3c39613d7 100644
--- a/test/builtins/Unit/addvti3_test.c
+++ b/test/builtins/Unit/addvti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_addvti3
// REQUIRES: int128
//===-- addvti3_test.c - Test __addvti3 -----------------------------------===//
//
diff --git a/test/builtins/Unit/ashldi3_test.c b/test/builtins/Unit/ashldi3_test.c
index 671dcadc3..6061421d4 100644
--- a/test/builtins/Unit/ashldi3_test.c
+++ b/test/builtins/Unit/ashldi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ashldi3
//===-- ashldi3_test.c - Test __ashldi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ashlti3_test.c b/test/builtins/Unit/ashlti3_test.c
index 125863189..422e3cfa8 100644
--- a/test/builtins/Unit/ashlti3_test.c
+++ b/test/builtins/Unit/ashlti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ashlti3
// REQUIRES: int128
//===-- ashlti3_test.c - Test __ashlti3 -----------------------------------===//
//
diff --git a/test/builtins/Unit/ashrdi3_test.c b/test/builtins/Unit/ashrdi3_test.c
index 456660037..d3749f1b2 100644
--- a/test/builtins/Unit/ashrdi3_test.c
+++ b/test/builtins/Unit/ashrdi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ashrdi3
//===-- ashrdi3_test.c - Test __ashrdi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ashrti3_test.c b/test/builtins/Unit/ashrti3_test.c
index 530cff53c..a491e9006 100644
--- a/test/builtins/Unit/ashrti3_test.c
+++ b/test/builtins/Unit/ashrti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ashrti3
// REQUIRES: int128
//===-- ashrti3_test.c - Test __ashrti3 -----------------------------------===//
//
diff --git a/test/builtins/Unit/bswapdi2_test.c b/test/builtins/Unit/bswapdi2_test.c
index a6b07775f..f61abc1e7 100644
--- a/test/builtins/Unit/bswapdi2_test.c
+++ b/test/builtins/Unit/bswapdi2_test.c
@@ -1,5 +1,6 @@
// UNSUPPORTED: armv6m-target-arch
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_bswapdi2
//===-- bswapdi2_test.c - Test __bswapdi2 ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/bswapsi2_test.c b/test/builtins/Unit/bswapsi2_test.c
index d2f03cb74..07f1e3a81 100644
--- a/test/builtins/Unit/bswapsi2_test.c
+++ b/test/builtins/Unit/bswapsi2_test.c
@@ -1,5 +1,6 @@
// UNSUPPORTED: armv6m-target-arch
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_bswapsi2
//===-- bswapsi2_test.c - Test __bswapsi2 ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/clear_cache_test.c b/test/builtins/Unit/clear_cache_test.c
index 4220ba651..1713bec93 100644
--- a/test/builtins/Unit/clear_cache_test.c
+++ b/test/builtins/Unit/clear_cache_test.c
@@ -1,6 +1,7 @@
// REQUIRES: native-run
// UNSUPPORTED: arm, aarch64
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_clear_cache
//===-- clear_cache_test.c - Test clear_cache -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/clzdi2_test.c b/test/builtins/Unit/clzdi2_test.c
index 1ef1ff323..0d4c06e61 100644
--- a/test/builtins/Unit/clzdi2_test.c
+++ b/test/builtins/Unit/clzdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_clzdi2
//===-- clzdi2_test.c - Test __clzdi2 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/clzsi2_test.c b/test/builtins/Unit/clzsi2_test.c
index e2e1e1b65..fc517cf14 100644
--- a/test/builtins/Unit/clzsi2_test.c
+++ b/test/builtins/Unit/clzsi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_clzsi2
//===-- clzsi2_test.c - Test __clzsi2 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/clzti2_test.c b/test/builtins/Unit/clzti2_test.c
index 15b871327..ef73ca41c 100644
--- a/test/builtins/Unit/clzti2_test.c
+++ b/test/builtins/Unit/clzti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_clzti2
// REQUIRES: int128
//===-- clzti2_test.c - Test __clzti2 -------------------------------------===//
//
diff --git a/test/builtins/Unit/cmpdi2_test.c b/test/builtins/Unit/cmpdi2_test.c
index 4bfcac025..1f64d2fc0 100644
--- a/test/builtins/Unit/cmpdi2_test.c
+++ b/test/builtins/Unit/cmpdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_cmpdi2
//===-- cmpdi2_test.c - Test __cmpdi2 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/cmpti2_test.c b/test/builtins/Unit/cmpti2_test.c
index 03183c870..7dd22880b 100644
--- a/test/builtins/Unit/cmpti2_test.c
+++ b/test/builtins/Unit/cmpti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_cmpti2
// REQUIRES: int128
//===-- cmpti2_test.c - Test __cmpti2 -------------------------------------===//
//
diff --git a/test/builtins/Unit/comparedf2_test.c b/test/builtins/Unit/comparedf2_test.c
index 9b1cac20b..04a183afc 100644
--- a/test/builtins/Unit/comparedf2_test.c
+++ b/test/builtins/Unit/comparedf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparedf2
//===-- cmpdf2_test.c - Test __cmpdf2 -------------------------------------===//
//
diff --git a/test/builtins/Unit/comparesf2_test.c b/test/builtins/Unit/comparesf2_test.c
index cabd20241..354cf0083 100644
--- a/test/builtins/Unit/comparesf2_test.c
+++ b/test/builtins/Unit/comparesf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparesf2
//===-- cmpsf2_test.c - Test __cmpsf2 -------------------------------------===//
//
diff --git a/test/builtins/Unit/cpu_model_test.c b/test/builtins/Unit/cpu_model_test.c
index dee031ea0..21847f679 100644
--- a/test/builtins/Unit/cpu_model_test.c
+++ b/test/builtins/Unit/cpu_model_test.c
@@ -2,6 +2,7 @@
// XFAIL: *
// REQUIRES: x86-target-arch
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_cpu_model
//===-- cpu_model_test.c - Test __builtin_cpu_supports --------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ctzdi2_test.c b/test/builtins/Unit/ctzdi2_test.c
index 269c43540..ebec5fab1 100644
--- a/test/builtins/Unit/ctzdi2_test.c
+++ b/test/builtins/Unit/ctzdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ctzdi2
//===-- ctzdi2_test.c - Test __ctzdi2 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ctzsi2_test.c b/test/builtins/Unit/ctzsi2_test.c
index 15ca4fdf1..26c0adf8d 100644
--- a/test/builtins/Unit/ctzsi2_test.c
+++ b/test/builtins/Unit/ctzsi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ctzsi2
//===-- ctzsi2_test.c - Test __ctzsi2 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ctzti2_test.c b/test/builtins/Unit/ctzti2_test.c
index a321a0aac..4e27f16d5 100644
--- a/test/builtins/Unit/ctzti2_test.c
+++ b/test/builtins/Unit/ctzti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ctzti2
// REQUIRES: int128
//===-- ctzti2_test.c - Test __ctzti2 -------------------------------------===//
//
diff --git a/test/builtins/Unit/divdc3_test.c b/test/builtins/Unit/divdc3_test.c
index 6a59691c4..1f3cb225f 100644
--- a/test/builtins/Unit/divdc3_test.c
+++ b/test/builtins/Unit/divdc3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divdc3
//===-- divdc3_test.c - Test __divdc3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divdf3_test.c b/test/builtins/Unit/divdf3_test.c
index 00b021f4e..28eb4eb89 100644
--- a/test/builtins/Unit/divdf3_test.c
+++ b/test/builtins/Unit/divdf3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divdf3
//===--------------- divdf3_test.c - Test __divdf3 ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divdf3vfp_test.c b/test/builtins/Unit/divdf3vfp_test.c
index 76d7cfafa..3ff9d117e 100644
--- a/test/builtins/Unit/divdf3vfp_test.c
+++ b/test/builtins/Unit/divdf3vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divdf3vfp
//===-- divdf3vfp_test.c - Test __divdf3vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divdi3_test.c b/test/builtins/Unit/divdi3_test.c
index 41ee1cf07..44cbb178a 100644
--- a/test/builtins/Unit/divdi3_test.c
+++ b/test/builtins/Unit/divdi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divdi3
//===-- divdi3_test.c - Test __divdi3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divmodsi4_test.c b/test/builtins/Unit/divmodsi4_test.c
index 4630ad8e7..326457f66 100644
--- a/test/builtins/Unit/divmodsi4_test.c
+++ b/test/builtins/Unit/divmodsi4_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divmodsi4
//===-- divmodsi4_test.c - Test __divmodsi4 -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divsc3_test.c b/test/builtins/Unit/divsc3_test.c
index 5781cff47..f09a2c8f7 100644
--- a/test/builtins/Unit/divsc3_test.c
+++ b/test/builtins/Unit/divsc3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -lm -o %t && %run %t
+// REQUIRES: librt_has_divsc3
//===-- divsc3_test.c - Test __divsc3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divsf3_test.c b/test/builtins/Unit/divsf3_test.c
index 4b14c81b3..1b4c241cc 100644
--- a/test/builtins/Unit/divsf3_test.c
+++ b/test/builtins/Unit/divsf3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divsf3
//===--------------- divsf3_test.c - Test __divsf3 ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divsf3vfp_test.c b/test/builtins/Unit/divsf3vfp_test.c
index fc3860e2c..fb0d89235 100644
--- a/test/builtins/Unit/divsf3vfp_test.c
+++ b/test/builtins/Unit/divsf3vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divsf3vfp
//===-- divsf3vfp_test.c - Test __divsf3vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divsi3_test.c b/test/builtins/Unit/divsi3_test.c
index fb453403c..0b8344045 100644
--- a/test/builtins/Unit/divsi3_test.c
+++ b/test/builtins/Unit/divsi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divsi3
//===-- divsi3_test.c - Test __divsi3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divtc3_test.c b/test/builtins/Unit/divtc3_test.c
index dbd2ee7da..f8181dafe 100644
--- a/test/builtins/Unit/divtc3_test.c
+++ b/test/builtins/Unit/divtc3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -lm -o %t && %run %t
+// REQUIRES: librt_has_divtc3
//
// 32-bit: Bug 42493, 64-bit: Bug 42496
// XFAIL: sparc
diff --git a/test/builtins/Unit/divtf3_test.c b/test/builtins/Unit/divtf3_test.c
index 23e1b5580..542d7d66c 100644
--- a/test/builtins/Unit/divtf3_test.c
+++ b/test/builtins/Unit/divtf3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divtf3
//===--------------- divtf3_test.c - Test __divtf3 ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/divti3_test.c b/test/builtins/Unit/divti3_test.c
index e29658d1a..8cb22eb4f 100644
--- a/test/builtins/Unit/divti3_test.c
+++ b/test/builtins/Unit/divti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_divti3
// REQUIRES: int128
//===-- divti3_test.c - Test __divti3 -------------------------------------===//
//
diff --git a/test/builtins/Unit/divxc3_test.c b/test/builtins/Unit/divxc3_test.c
index 4dbe5afa7..d5bb38514 100644
--- a/test/builtins/Unit/divxc3_test.c
+++ b/test/builtins/Unit/divxc3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -lm -o %t && %run %t
+// REQUIRES: librt_has_divxc3
// REQUIRES: x86-target-arch
// UNSUPPORTED: powerpc64
//===-- divxc3_test.c - Test __divxc3 -------------------------------------===//
diff --git a/test/builtins/Unit/enable_execute_stack_test.c b/test/builtins/Unit/enable_execute_stack_test.c
index ef29a1679..ad39915d3 100644
--- a/test/builtins/Unit/enable_execute_stack_test.c
+++ b/test/builtins/Unit/enable_execute_stack_test.c
@@ -1,5 +1,6 @@
// REQUIRES: native-run
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_enable_execute_stack
//===-- enable_execute_stack_test.c - Test __enable_execute_stack ----------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/eqdf2vfp_test.c b/test/builtins/Unit/eqdf2vfp_test.c
index 789a509f1..fc11af734 100644
--- a/test/builtins/Unit/eqdf2vfp_test.c
+++ b/test/builtins/Unit/eqdf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_eqdf2vfp
//===-- eqdf2vfp_test.c - Test __eqdf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/eqsf2vfp_test.c b/test/builtins/Unit/eqsf2vfp_test.c
index 9ab748183..0b0ac4420 100644
--- a/test/builtins/Unit/eqsf2vfp_test.c
+++ b/test/builtins/Unit/eqsf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_eqsf2vfp
//===-- eqsf2vfp_test.c - Test __eqsf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/eqtf2_test.c b/test/builtins/Unit/eqtf2_test.c
index e460b0871..69125ef14 100644
--- a/test/builtins/Unit/eqtf2_test.c
+++ b/test/builtins/Unit/eqtf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparetf2
//===------------ eqtf2_test.c - Test __eqtf2------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/extenddftf2_test.c b/test/builtins/Unit/extenddftf2_test.c
index 0ca825dd1..914aaba85 100644
--- a/test/builtins/Unit/extenddftf2_test.c
+++ b/test/builtins/Unit/extenddftf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_extenddftf2
//===--------------- extenddftf2_test.c - Test __extenddftf2 --------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/extendhfsf2_test.c b/test/builtins/Unit/extendhfsf2_test.c
index 73676806a..d47a5892f 100644
--- a/test/builtins/Unit/extendhfsf2_test.c
+++ b/test/builtins/Unit/extendhfsf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_extendhfsf2
//===--------------- extendhfsf2_test.c - Test __extendhfsf2 --------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/extebdsfdf2vfp_test.c b/test/builtins/Unit/extendsfdf2vfp_test.c
index 2255e6735..c49255e09 100644
--- a/test/builtins/Unit/extebdsfdf2vfp_test.c
+++ b/test/builtins/Unit/extendsfdf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_extendsfdf2vfp
//===-- extendsfdf2vfp_test.c - Test __extendsfdf2vfp ---------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/extendsftf2_test.c b/test/builtins/Unit/extendsftf2_test.c
index 2357fd341..7c97492b6 100644
--- a/test/builtins/Unit/extendsftf2_test.c
+++ b/test/builtins/Unit/extendsftf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_extendsftf2
//===--------------- extendsftf2_test.c - Test __extendsftf2 --------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ffsdi2_test.c b/test/builtins/Unit/ffsdi2_test.c
index 86ab9b979..50cb0bf68 100644
--- a/test/builtins/Unit/ffsdi2_test.c
+++ b/test/builtins/Unit/ffsdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ffsdi2
//===-- ffsdi2_test.c - Test __ffsdi2 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ffssi2_test.c b/test/builtins/Unit/ffssi2_test.c
index f97b398a7..a4876ea3e 100644
--- a/test/builtins/Unit/ffssi2_test.c
+++ b/test/builtins/Unit/ffssi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ffssi2
//===-- ffssi2_test.c - Test __ffssi2 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ffsti2_test.c b/test/builtins/Unit/ffsti2_test.c
index abc32e14f..2f35c884a 100644
--- a/test/builtins/Unit/ffsti2_test.c
+++ b/test/builtins/Unit/ffsti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ffsti2
// REQUIRES: int128
//===-- ffsti2_test.c - Test __ffsti2 -------------------------------------===//
//
diff --git a/test/builtins/Unit/fixdfdi_test.c b/test/builtins/Unit/fixdfdi_test.c
index 30f0a3b25..9fe19ddc4 100644
--- a/test/builtins/Unit/fixdfdi_test.c
+++ b/test/builtins/Unit/fixdfdi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixdfdi
//===-- fixdfdi_test.c - Test __fixdfdi -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixdfsivfp_test.c b/test/builtins/Unit/fixdfsivfp_test.c
index 4a76ea960..606875c71 100644
--- a/test/builtins/Unit/fixdfsivfp_test.c
+++ b/test/builtins/Unit/fixdfsivfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixdfsivfp
//===-- fixdfsivfp_test.c - Test __fixdfsivfp -----------------------------===//
//
diff --git a/test/builtins/Unit/fixdfti_test.c b/test/builtins/Unit/fixdfti_test.c
index 9a2de08dc..d9f2107a0 100644
--- a/test/builtins/Unit/fixdfti_test.c
+++ b/test/builtins/Unit/fixdfti_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixdfti
// REQUIRES: int128
//===-- fixdfti_test.c - Test __fixdfti -----------------------------------===//
//
diff --git a/test/builtins/Unit/fixsfdi_test.c b/test/builtins/Unit/fixsfdi_test.c
index e4b23f5b2..45c5b2011 100644
--- a/test/builtins/Unit/fixsfdi_test.c
+++ b/test/builtins/Unit/fixsfdi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixsfdi
//===-- fixsfdi_test.c - Test __fixsfdi -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixsfsivfp_test.c b/test/builtins/Unit/fixsfsivfp_test.c
index 7e6039319..4ca280cd3 100644
--- a/test/builtins/Unit/fixsfsivfp_test.c
+++ b/test/builtins/Unit/fixsfsivfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixsfsivfp
//===-- fixsfsivfp_test.c - Test __fixsfsivfp -----------------------------===//
//
diff --git a/test/builtins/Unit/fixsfti_test.c b/test/builtins/Unit/fixsfti_test.c
index bf985d2b2..cd4adcb47 100644
--- a/test/builtins/Unit/fixsfti_test.c
+++ b/test/builtins/Unit/fixsfti_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixsfti
// REQUIRES: int128
//===-- fixsfti_test.c - Test __fixsfti -----------------------------------===//
//
diff --git a/test/builtins/Unit/fixtfdi_test.c b/test/builtins/Unit/fixtfdi_test.c
index 1d1e1102c..32f63236e 100644
--- a/test/builtins/Unit/fixtfdi_test.c
+++ b/test/builtins/Unit/fixtfdi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixtfdi
//===--------------- fixtfdi_test.c - Test __fixtfdi ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixtfsi_test.c b/test/builtins/Unit/fixtfsi_test.c
index 752ede215..e679992e8 100644
--- a/test/builtins/Unit/fixtfsi_test.c
+++ b/test/builtins/Unit/fixtfsi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixtfsi
//===--------------- fixtfsi_test.c - Test __fixtfsi ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixtfti_test.c b/test/builtins/Unit/fixtfti_test.c
index ea648148d..5bafb68c7 100644
--- a/test/builtins/Unit/fixtfti_test.c
+++ b/test/builtins/Unit/fixtfti_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixtfti
//===--------------- fixtfti_test.c - Test __fixtfti ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunsdfdi_test.c b/test/builtins/Unit/fixunsdfdi_test.c
index 0497a9175..770cb2ffe 100644
--- a/test/builtins/Unit/fixunsdfdi_test.c
+++ b/test/builtins/Unit/fixunsdfdi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunsdfdi
//===-- fixunsdfdi_test.c - Test __fixunsdfdi -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunsdfsi_test.c b/test/builtins/Unit/fixunsdfsi_test.c
index 967e47334..b85b6513f 100644
--- a/test/builtins/Unit/fixunsdfsi_test.c
+++ b/test/builtins/Unit/fixunsdfsi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunsdfsi
//===-- fixunsdfsi_test.c - Test __fixunsdfsi -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunsdfsivfp_test.c b/test/builtins/Unit/fixunsdfsivfp_test.c
index 6d9b2307b..e7effc819 100644
--- a/test/builtins/Unit/fixunsdfsivfp_test.c
+++ b/test/builtins/Unit/fixunsdfsivfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunsdfsivfp
//===-- fixunsdfsivfp_test.c - Test __fixunsdfsivfp -----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunsdfti_test.c b/test/builtins/Unit/fixunsdfti_test.c
index 0c68a6690..e867d4f9d 100644
--- a/test/builtins/Unit/fixunsdfti_test.c
+++ b/test/builtins/Unit/fixunsdfti_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunsdfti
// REQUIRES: int128
//===-- fixunsdfti_test.c - Test __fixunsdfti -----------------------------===//
//
diff --git a/test/builtins/Unit/fixunssfdi_test.c b/test/builtins/Unit/fixunssfdi_test.c
index e68be55d2..7f301fb48 100644
--- a/test/builtins/Unit/fixunssfdi_test.c
+++ b/test/builtins/Unit/fixunssfdi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunssfdi
//===-- fixunssfdi_test.c - Test __fixunssfdi -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunssfsi_test.c b/test/builtins/Unit/fixunssfsi_test.c
index 89b16d871..e6952b228 100644
--- a/test/builtins/Unit/fixunssfsi_test.c
+++ b/test/builtins/Unit/fixunssfsi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunssfsi
//===-- fixunssfsi_test.c - Test __fixunssfsi -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunssfsivfp_test.c b/test/builtins/Unit/fixunssfsivfp_test.c
index 1f3df0bd3..67e0cbd37 100644
--- a/test/builtins/Unit/fixunssfsivfp_test.c
+++ b/test/builtins/Unit/fixunssfsivfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunssfsivfp
//===-- fixunssfsivfp_test.c - Test __fixunssfsivfp -----------------------===//
//
diff --git a/test/builtins/Unit/fixunssfti_test.c b/test/builtins/Unit/fixunssfti_test.c
index 7d75d2291..de82e5263 100644
--- a/test/builtins/Unit/fixunssfti_test.c
+++ b/test/builtins/Unit/fixunssfti_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunssfti
// REQUIRES: int128
//===-- fixunssfti_test.c - Test __fixunssfti -----------------------------===//
//
diff --git a/test/builtins/Unit/fixunstfdi_test.c b/test/builtins/Unit/fixunstfdi_test.c
index ddaea4e1b..7fdc44ebf 100644
--- a/test/builtins/Unit/fixunstfdi_test.c
+++ b/test/builtins/Unit/fixunstfdi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunstfdi
//===-- fixunstfdi_test.c - Test __fixunstfdi -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunstfsi_test.c b/test/builtins/Unit/fixunstfsi_test.c
index b6958ecb7..a895aa90e 100644
--- a/test/builtins/Unit/fixunstfsi_test.c
+++ b/test/builtins/Unit/fixunstfsi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunstfsi
//===--------------- fixunstfsi_test.c - Test __fixunstfsi ----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunstfti_test.c b/test/builtins/Unit/fixunstfti_test.c
index b4013d5c1..77c6a45d3 100644
--- a/test/builtins/Unit/fixunstfti_test.c
+++ b/test/builtins/Unit/fixunstfti_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunstfti
//===-- fixunstfti_test.c - Test __fixunstfti -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunsxfdi_test.c b/test/builtins/Unit/fixunsxfdi_test.c
index 7bbeccf66..50c046546 100644
--- a/test/builtins/Unit/fixunsxfdi_test.c
+++ b/test/builtins/Unit/fixunsxfdi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunsxfdi
//===-- fixunsxfdi_test.c - Test __fixunsxfdi -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunsxfsi_test.c b/test/builtins/Unit/fixunsxfsi_test.c
index ae7e5b649..365915c90 100644
--- a/test/builtins/Unit/fixunsxfsi_test.c
+++ b/test/builtins/Unit/fixunsxfsi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunsxfsi
//===-- fixunsxfsi_test.c - Test __fixunsxfsi -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixunsxfti_test.c b/test/builtins/Unit/fixunsxfti_test.c
index 8527d574a..2b1714d5e 100644
--- a/test/builtins/Unit/fixunsxfti_test.c
+++ b/test/builtins/Unit/fixunsxfti_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixunsxfti
// REQUIRES: x86-target-arch
//===-- fixunsxfti_test.c - Test __fixunsxfti -----------------------------===//
diff --git a/test/builtins/Unit/fixxfdi_test.c b/test/builtins/Unit/fixxfdi_test.c
index 6cb31b32a..aed3579eb 100644
--- a/test/builtins/Unit/fixxfdi_test.c
+++ b/test/builtins/Unit/fixxfdi_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixxfdi
//===-- fixxfdi_test.c - Test __fixxfdi -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/fixxfti_test.c b/test/builtins/Unit/fixxfti_test.c
index b92338848..ff7186aa3 100644
--- a/test/builtins/Unit/fixxfti_test.c
+++ b/test/builtins/Unit/fixxfti_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_fixxfti
// REQUIRES: x86-target-arch
//===-- fixxfti_test.c - Test __fixxfti -----------------------------------===//
diff --git a/test/builtins/Unit/floatdidf_test.c b/test/builtins/Unit/floatdidf_test.c
index e3e091ee5..a9e439fc8 100644
--- a/test/builtins/Unit/floatdidf_test.c
+++ b/test/builtins/Unit/floatdidf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatdidf
//===-- floatdidf.c - Test __floatdidf ------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatdisf_test.c b/test/builtins/Unit/floatdisf_test.c
index ce7a04d52..4b6b5d18a 100644
--- a/test/builtins/Unit/floatdisf_test.c
+++ b/test/builtins/Unit/floatdisf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatdisf
//===-- floatdisf_test.c - Test __floatdisf -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatditf_test.c b/test/builtins/Unit/floatditf_test.c
index 27ef9482e..b9a5dcd3f 100644
--- a/test/builtins/Unit/floatditf_test.c
+++ b/test/builtins/Unit/floatditf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatditf
//===-- floatditf_test.c - Test __floatditf -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatdixf_test.c b/test/builtins/Unit/floatdixf_test.c
index 0ee92e8bc..9965b5541 100644
--- a/test/builtins/Unit/floatdixf_test.c
+++ b/test/builtins/Unit/floatdixf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatdixf
//===-- floatdixf_test.c - Test __floatdixf -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatsidfvfp_test.c b/test/builtins/Unit/floatsidfvfp_test.c
index eb1d06b23..018a52724 100644
--- a/test/builtins/Unit/floatsidfvfp_test.c
+++ b/test/builtins/Unit/floatsidfvfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatsidfvfp
//===-- floatsidfvfp_test.c - Test __floatsidfvfp -------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatsisfvfp_test.c b/test/builtins/Unit/floatsisfvfp_test.c
index b977e339d..893e9130e 100644
--- a/test/builtins/Unit/floatsisfvfp_test.c
+++ b/test/builtins/Unit/floatsisfvfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatsisfvfp
//===-- floatsisfvfp_test.c - Test __floatsisfvfp -------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatsitf_test.c b/test/builtins/Unit/floatsitf_test.c
index 424a10fbc..10f1d4a04 100644
--- a/test/builtins/Unit/floatsitf_test.c
+++ b/test/builtins/Unit/floatsitf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatsitf
//===--------------- floatsitf_test.c - Test __floatsitf ------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floattidf_test.c b/test/builtins/Unit/floattidf_test.c
index 76288f002..60420331b 100644
--- a/test/builtins/Unit/floattidf_test.c
+++ b/test/builtins/Unit/floattidf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floattidf
// REQUIRES: int128
//===-- floattidf.c - Test __floattidf ------------------------------------===//
//
diff --git a/test/builtins/Unit/floattisf_test.c b/test/builtins/Unit/floattisf_test.c
index 4d48d94bb..bf667d757 100644
--- a/test/builtins/Unit/floattisf_test.c
+++ b/test/builtins/Unit/floattisf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floattisf
// REQUIRES: int128
//===-- floattisf_test.c - Test __floattisf -------------------------------===//
//
diff --git a/test/builtins/Unit/floattitf_test.c b/test/builtins/Unit/floattitf_test.c
index f0c7dfbc2..3775f595e 100644
--- a/test/builtins/Unit/floattitf_test.c
+++ b/test/builtins/Unit/floattitf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floattitf
//===-- floattitf.c - Test __floattitf ------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floattixf_test.c b/test/builtins/Unit/floattixf_test.c
index 5ab471263..00c3eb236 100644
--- a/test/builtins/Unit/floattixf_test.c
+++ b/test/builtins/Unit/floattixf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floattixf
// REQUIRES: x86-target-arch
//===-- floattixf.c - Test __floattixf ------------------------------------===//
diff --git a/test/builtins/Unit/floatundidf_test.c b/test/builtins/Unit/floatundidf_test.c
index e165228a8..540cb1f03 100644
--- a/test/builtins/Unit/floatundidf_test.c
+++ b/test/builtins/Unit/floatundidf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatundidf
//===-- floatundidf_test.c - Test __floatundidf ---------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatundisf_test.c b/test/builtins/Unit/floatundisf_test.c
index 1a2feebf1..d377009b3 100644
--- a/test/builtins/Unit/floatundisf_test.c
+++ b/test/builtins/Unit/floatundisf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatundisf
//===-- floatundisf_test.c - Test __floatundisf ---------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatunditf_test.c b/test/builtins/Unit/floatunditf_test.c
index 163f0099a..60914e5b4 100644
--- a/test/builtins/Unit/floatunditf_test.c
+++ b/test/builtins/Unit/floatunditf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatunditf
//===-- floatunditf_test.c - Test __floatunditf ---------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatundixf_test.c b/test/builtins/Unit/floatundixf_test.c
index 356653578..7104a2d6a 100644
--- a/test/builtins/Unit/floatundixf_test.c
+++ b/test/builtins/Unit/floatundixf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatundixf
//===-- floatundixf_test.c - Test __floatundixf ---------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatunsitf_test.c b/test/builtins/Unit/floatunsitf_test.c
index 99ca0b685..135c303af 100644
--- a/test/builtins/Unit/floatunsitf_test.c
+++ b/test/builtins/Unit/floatunsitf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatunsitf
//===--------------- floatunsitf_test.c - Test __floatunsitf --------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatunssidfvfp_test.c b/test/builtins/Unit/floatunssidfvfp_test.c
index e1ce2d288..d308326fb 100644
--- a/test/builtins/Unit/floatunssidfvfp_test.c
+++ b/test/builtins/Unit/floatunssidfvfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatunssidfvfp
//===-- floatunssidfvfp_test.c - Test __floatunssidfvfp -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatunssisfvfp_test.c b/test/builtins/Unit/floatunssisfvfp_test.c
index 878a42dd8..724f36e30 100644
--- a/test/builtins/Unit/floatunssisfvfp_test.c
+++ b/test/builtins/Unit/floatunssisfvfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatunssisfvfp
//===-- floatunssisfvfp_test.c - Test __floatunssisfvfp -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatuntidf_test.c b/test/builtins/Unit/floatuntidf_test.c
index 47c281560..d6cdef2a4 100644
--- a/test/builtins/Unit/floatuntidf_test.c
+++ b/test/builtins/Unit/floatuntidf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatuntidf
// REQUIRES: int128
//===-- floatuntidf.c - Test __floatuntidf --------------------------------===//
//
diff --git a/test/builtins/Unit/floatuntisf_test.c b/test/builtins/Unit/floatuntisf_test.c
index b3a50ed73..cc74dc4bb 100644
--- a/test/builtins/Unit/floatuntisf_test.c
+++ b/test/builtins/Unit/floatuntisf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatuntisf
//===-- floatuntisf.c - Test __floatuntisf --------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatuntitf_test.c b/test/builtins/Unit/floatuntitf_test.c
index eb4287ded..512b00e98 100644
--- a/test/builtins/Unit/floatuntitf_test.c
+++ b/test/builtins/Unit/floatuntitf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatuntitf
//===-- floatuntitf.c - Test __floatuntitf --------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/floatuntixf_test.c b/test/builtins/Unit/floatuntixf_test.c
index 9ff0b5fa8..e78ba028e 100644
--- a/test/builtins/Unit/floatuntixf_test.c
+++ b/test/builtins/Unit/floatuntixf_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_floatuntixf
// REQUIRES: x86-target-arch
//===-- floatuntixf.c - Test __floatuntixf --------------------------------===//
diff --git a/test/builtins/Unit/gedf2vfp_test.c b/test/builtins/Unit/gedf2vfp_test.c
index 0edf4b848..ca171157f 100644
--- a/test/builtins/Unit/gedf2vfp_test.c
+++ b/test/builtins/Unit/gedf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_gedf2vfp
//===-- gedf2vfp_test.c - Test __gedf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/gesf2vfp_test.c b/test/builtins/Unit/gesf2vfp_test.c
index e84fa4672..892d6895d 100644
--- a/test/builtins/Unit/gesf2vfp_test.c
+++ b/test/builtins/Unit/gesf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_gesf2vfp
//===-- gesf2vfp_test.c - Test __gesf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/getf2_test.c b/test/builtins/Unit/getf2_test.c
index be8e122d2..d29c92f99 100644
--- a/test/builtins/Unit/getf2_test.c
+++ b/test/builtins/Unit/getf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparetf2
//===------------ getf2_test.c - Test __getf2------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/gtdf2vfp_test.c b/test/builtins/Unit/gtdf2vfp_test.c
index d69d05347..6f5ccd089 100644
--- a/test/builtins/Unit/gtdf2vfp_test.c
+++ b/test/builtins/Unit/gtdf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_gtdf2vfp
//===-- gtdf2vfp_test.c - Test __gtdf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/gtsf2vfp_test.c b/test/builtins/Unit/gtsf2vfp_test.c
index b1eccfe90..a42588b68 100644
--- a/test/builtins/Unit/gtsf2vfp_test.c
+++ b/test/builtins/Unit/gtsf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_gtsf2vfp
//===-- gtsf2vfp_test.c - Test __gtsf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/gttf2_test.c b/test/builtins/Unit/gttf2_test.c
index 712d6818e..1890f1684 100644
--- a/test/builtins/Unit/gttf2_test.c
+++ b/test/builtins/Unit/gttf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparetf2
//===------------ gttf2_test.c - Test __gttf2------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ledf2vfp_test.c b/test/builtins/Unit/ledf2vfp_test.c
index 651a6cceb..be01e96de 100644
--- a/test/builtins/Unit/ledf2vfp_test.c
+++ b/test/builtins/Unit/ledf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ledf2vfp
//===-- ledf2vfp_test.c - Test __ledf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/lesf2vfp_test.c b/test/builtins/Unit/lesf2vfp_test.c
index 274be1b12..7bb0cb71d 100644
--- a/test/builtins/Unit/lesf2vfp_test.c
+++ b/test/builtins/Unit/lesf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_lesf2vfp
//===-- lesf2vfp_test.c - Test __lesf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/letf2_test.c b/test/builtins/Unit/letf2_test.c
index 39b3e9bfd..62481ef2b 100644
--- a/test/builtins/Unit/letf2_test.c
+++ b/test/builtins/Unit/letf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparetf2
//===------------ letf2_test.c - Test __letf2------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/lit.cfg.py b/test/builtins/Unit/lit.cfg.py
index 44b86f0d6..8fdb1a216 100644
--- a/test/builtins/Unit/lit.cfg.py
+++ b/test/builtins/Unit/lit.cfg.py
@@ -94,3 +94,25 @@ config.suffixes = ['.c', '.cpp']
if not config.emulator:
config.available_features.add('native-run')
+
+# Add features for available sources
+builtins_source_features = config.builtins_lit_source_features.split(';')
+# Sanity checks
+if not builtins_source_features:
+ lit_config.fatal('builtins_source_features cannot be empty')
+builtins_source_features_set = set()
+builtins_source_feature_duplicates = []
+for builtin_source_feature in builtins_source_features:
+ if len(builtin_source_feature) == 0:
+ lit_config.fatal('builtins_source_feature cannot contain empty features')
+ if builtin_source_feature not in builtins_source_features_set:
+ builtins_source_features_set.add(builtin_source_feature)
+ else:
+ builtins_source_feature_duplicates.append(builtin_source_feature)
+
+if len(builtins_source_feature_duplicates) > 0:
+ lit_config.fatal(
+ 'builtins_source_features contains duplicates: {}'.format(
+ builtins_source_feature_duplicates)
+ )
+config.available_features.update(builtins_source_features)
diff --git a/test/builtins/Unit/lit.site.cfg.py.in b/test/builtins/Unit/lit.site.cfg.py.in
index 10af44313..da7840b32 100644
--- a/test/builtins/Unit/lit.site.cfg.py.in
+++ b/test/builtins/Unit/lit.site.cfg.py.in
@@ -6,6 +6,8 @@ config.target_cflags = "@BUILTINS_TEST_TARGET_CFLAGS@"
config.target_arch = "@BUILTINS_TEST_TARGET_ARCH@"
config.is_msvc = @MSVC_PYBOOL@
config.builtins_is_msvc = @BUILTINS_IS_MSVC_PYBOOL@
+config.builtins_lit_source_features = "@BUILTINS_LIT_SOURCE_FEATURES@"
+
# Load common config for all compiler-rt lit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
diff --git a/test/builtins/Unit/lshrdi3_test.c b/test/builtins/Unit/lshrdi3_test.c
index 791980b0f..3e3c4b634 100644
--- a/test/builtins/Unit/lshrdi3_test.c
+++ b/test/builtins/Unit/lshrdi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_lshrdi3
//===-- lshrdi3_test.c - Test __lshrdi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/lshrti3_test.c b/test/builtins/Unit/lshrti3_test.c
index c16437708..d24e09092 100644
--- a/test/builtins/Unit/lshrti3_test.c
+++ b/test/builtins/Unit/lshrti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_lshrti3
// REQUIRES: int128
//===-- lshrti3_test.c - Test __lshrti3 -----------------------------------===//
//
diff --git a/test/builtins/Unit/ltdf2vfp_test.c b/test/builtins/Unit/ltdf2vfp_test.c
index 89a719d90..4bfe4cfdc 100644
--- a/test/builtins/Unit/ltdf2vfp_test.c
+++ b/test/builtins/Unit/ltdf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ltdf2vfp
//===-- ltdf2vfp_test.c - Test __ltdf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/ltsf2vfp_test.c b/test/builtins/Unit/ltsf2vfp_test.c
index d286ac09b..d7a8d2dd0 100644
--- a/test/builtins/Unit/ltsf2vfp_test.c
+++ b/test/builtins/Unit/ltsf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ltsf2vfp
//===-- ltsf2vfp_test.c - Test __ltsf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/lttf2_test.c b/test/builtins/Unit/lttf2_test.c
index c57c5d76d..0f3ea9e67 100644
--- a/test/builtins/Unit/lttf2_test.c
+++ b/test/builtins/Unit/lttf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparetf2
//===------------ lttf2_test.c - Test __lttf2------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/moddi3_test.c b/test/builtins/Unit/moddi3_test.c
index 02face1b9..e729c18cf 100644
--- a/test/builtins/Unit/moddi3_test.c
+++ b/test/builtins/Unit/moddi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_moddi3
//===-- moddi3_test.c - Test __moddi3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/modsi3_test.c b/test/builtins/Unit/modsi3_test.c
index bab944476..538a31b5a 100644
--- a/test/builtins/Unit/modsi3_test.c
+++ b/test/builtins/Unit/modsi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_modsi3
/* ===-- modsi3_test.c - Test __modsi3 -------------------------------------===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/modti3_test.c b/test/builtins/Unit/modti3_test.c
index 22b4483ad..edbc85764 100644
--- a/test/builtins/Unit/modti3_test.c
+++ b/test/builtins/Unit/modti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_modti3
// REQUIRES: int128
//===-- modti3_test.c - Test __modti3 -------------------------------------===//
//
diff --git a/test/builtins/Unit/muldc3_test.c b/test/builtins/Unit/muldc3_test.c
index 855a05f0c..7eb5ed664 100644
--- a/test/builtins/Unit/muldc3_test.c
+++ b/test/builtins/Unit/muldc3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -lm -o %t && %run %t
+// REQUIRES: librt_has_muldc3
//===-- muldc3_test.c - Test __muldc3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/muldf3vfp_test.c b/test/builtins/Unit/muldf3vfp_test.c
index 7022906b2..b8c785973 100644
--- a/test/builtins/Unit/muldf3vfp_test.c
+++ b/test/builtins/Unit/muldf3vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_muldf3vfp
//===-- muldf3vfp_test.c - Test __muldf3vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/muldi3_test.c b/test/builtins/Unit/muldi3_test.c
index c4eaf0437..bb79149c0 100644
--- a/test/builtins/Unit/muldi3_test.c
+++ b/test/builtins/Unit/muldi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_muldi3
//===-- muldi3_test.c - Test __muldi3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/mulodi4_test.c b/test/builtins/Unit/mulodi4_test.c
index d3d46ad38..e8654e1c3 100644
--- a/test/builtins/Unit/mulodi4_test.c
+++ b/test/builtins/Unit/mulodi4_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_mulodi4
//===-- mulodi4_test.c - Test __mulodi4 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/mulosi4_test.c b/test/builtins/Unit/mulosi4_test.c
index 4e90fb7a3..f653fe4a9 100644
--- a/test/builtins/Unit/mulosi4_test.c
+++ b/test/builtins/Unit/mulosi4_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_mulosi4
//===-- mulosi4_test.c - Test __mulosi4 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/muloti4_test.c b/test/builtins/Unit/muloti4_test.c
index d13a97758..987e0af39 100644
--- a/test/builtins/Unit/muloti4_test.c
+++ b/test/builtins/Unit/muloti4_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_muloti4
// REQUIRES: int128
//===-- muloti4_test.c - Test __muloti4 -----------------------------------===//
//
diff --git a/test/builtins/Unit/mulsc3_test.c b/test/builtins/Unit/mulsc3_test.c
index 0a4b92945..01ce25529 100644
--- a/test/builtins/Unit/mulsc3_test.c
+++ b/test/builtins/Unit/mulsc3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -lm -o %t && %run %t
+// REQUIRES: librt_has_mulsc3
//===-- mulsc3_test.c - Test __mulsc3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/mulsf3vfp_test.c b/test/builtins/Unit/mulsf3vfp_test.c
index 464e9f126..b771befaa 100644
--- a/test/builtins/Unit/mulsf3vfp_test.c
+++ b/test/builtins/Unit/mulsf3vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_mulsf3vfp
//===-- mulsf3vfp_test.c - Test __mulsf3vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/multc3_test.c b/test/builtins/Unit/multc3_test.c
index 811260507..125fa20ff 100644
--- a/test/builtins/Unit/multc3_test.c
+++ b/test/builtins/Unit/multc3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_multc3
//===-- multc3_test.c - Test __multc3 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/multf3_test.c b/test/builtins/Unit/multf3_test.c
index c821799bc..4dccfd9d6 100644
--- a/test/builtins/Unit/multf3_test.c
+++ b/test/builtins/Unit/multf3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_multf3
//===--------------- multf3_test.c - Test __multf3 ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/multi3_test.c b/test/builtins/Unit/multi3_test.c
index 52516cde6..6e3fb1b36 100644
--- a/test/builtins/Unit/multi3_test.c
+++ b/test/builtins/Unit/multi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_multi3
// REQUIRES: int128
//===-- multi3_test.c - Test __multi3 -------------------------------------===//
//
diff --git a/test/builtins/Unit/mulvdi3_test.c b/test/builtins/Unit/mulvdi3_test.c
index 5b0c3cbe4..81bd4b2a9 100644
--- a/test/builtins/Unit/mulvdi3_test.c
+++ b/test/builtins/Unit/mulvdi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_mulvdi3
//===-- mulvdi3_test.c - Test __mulvdi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/mulvsi3_test.c b/test/builtins/Unit/mulvsi3_test.c
index 3e38a8826..f1ef8b12b 100644
--- a/test/builtins/Unit/mulvsi3_test.c
+++ b/test/builtins/Unit/mulvsi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_mulvsi3
//===-- mulvsi3_test.c - Test __mulvsi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/mulvti3_test.c b/test/builtins/Unit/mulvti3_test.c
index 9afe3c81f..9cb86d756 100644
--- a/test/builtins/Unit/mulvti3_test.c
+++ b/test/builtins/Unit/mulvti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_mulvti3
// REQUIRES: int128
//===-- mulvti3_test.c - Test __mulvti3 -----------------------------------===//
//
diff --git a/test/builtins/Unit/mulxc3_test.c b/test/builtins/Unit/mulxc3_test.c
index 8458daf52..5937b6c85 100644
--- a/test/builtins/Unit/mulxc3_test.c
+++ b/test/builtins/Unit/mulxc3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -lm -o %t && %run %t
+// REQUIRES: librt_has_mulxc3
// UNSUPPORTED: powerpc64
// REQUIRES: x86-target-arch
//===-- mulxc3_test.c - Test __mulxc3 -------------------------------------===//
diff --git a/test/builtins/Unit/nedf2vfp_test.c b/test/builtins/Unit/nedf2vfp_test.c
index b6f0f4ade..28ed2206c 100644
--- a/test/builtins/Unit/nedf2vfp_test.c
+++ b/test/builtins/Unit/nedf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_nedf2vfp
//===-- nedf2vfp_test.c - Test __nedf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/negdf2vfp_test.c b/test/builtins/Unit/negdf2vfp_test.c
index 221452ebf..c90c26e4f 100644
--- a/test/builtins/Unit/negdf2vfp_test.c
+++ b/test/builtins/Unit/negdf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_negdf2vfp
//===-- negdf2vfp_test.c - Test __negdf2vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/negdi2_test.c b/test/builtins/Unit/negdi2_test.c
index 77386882d..7f47d845c 100644
--- a/test/builtins/Unit/negdi2_test.c
+++ b/test/builtins/Unit/negdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_negdi2
//===-- negdi2_test.c - Test __negdi2 -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/negsf2vfp_test.c b/test/builtins/Unit/negsf2vfp_test.c
index 72b990f1c..3f5955bf7 100644
--- a/test/builtins/Unit/negsf2vfp_test.c
+++ b/test/builtins/Unit/negsf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_negsf2vfp
//===-- negsf2vfp_test.c - Test __negsf2vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/negti2_test.c b/test/builtins/Unit/negti2_test.c
index 45533d070..43bacc4fb 100644
--- a/test/builtins/Unit/negti2_test.c
+++ b/test/builtins/Unit/negti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_negti2
// REQUIRES: int128
//===-- negti2_test.c - Test __negti2 -------------------------------------===//
//
diff --git a/test/builtins/Unit/negvdi2_test.c b/test/builtins/Unit/negvdi2_test.c
index f6e70c800..9e79dcbe6 100644
--- a/test/builtins/Unit/negvdi2_test.c
+++ b/test/builtins/Unit/negvdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_negvdi2
//===-- negvdi2_test.c - Test __negvdi2 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/negvsi2_test.c b/test/builtins/Unit/negvsi2_test.c
index 437ba8808..96863211a 100644
--- a/test/builtins/Unit/negvsi2_test.c
+++ b/test/builtins/Unit/negvsi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_negvsi2
//===-- negvsi2_test.c - Test __negvsi2 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/negvti2_test.c b/test/builtins/Unit/negvti2_test.c
index fd2ee25a0..a65728442 100644
--- a/test/builtins/Unit/negvti2_test.c
+++ b/test/builtins/Unit/negvti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_negvti2
// REQUIRES: int128
//===-- negvti2_test.c - Test __negvti2 -----------------------------------===//
//
diff --git a/test/builtins/Unit/nesf2vfp_test.c b/test/builtins/Unit/nesf2vfp_test.c
index dca50c781..f66813e96 100644
--- a/test/builtins/Unit/nesf2vfp_test.c
+++ b/test/builtins/Unit/nesf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_nesf2vfp
//===-- nesf2vfp_test.c - Test __nesf2vfp ---------------------------------===//
//
diff --git a/test/builtins/Unit/netf2_test.c b/test/builtins/Unit/netf2_test.c
index 75114979e..eeeff01ef 100644
--- a/test/builtins/Unit/netf2_test.c
+++ b/test/builtins/Unit/netf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparetf2
//===------------ netf2_test.c - Test __netf2------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/paritydi2_test.c b/test/builtins/Unit/paritydi2_test.c
index ac5e47271..e4b663e7c 100644
--- a/test/builtins/Unit/paritydi2_test.c
+++ b/test/builtins/Unit/paritydi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_paritydi2
//===-- paritydi2_test.c - Test __paritydi2 -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/paritysi2_test.c b/test/builtins/Unit/paritysi2_test.c
index f650b5661..b59335ddc 100644
--- a/test/builtins/Unit/paritysi2_test.c
+++ b/test/builtins/Unit/paritysi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_paritysi2
//===-- paritysi2_test.c - Test __paritysi2 -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/parityti2_test.c b/test/builtins/Unit/parityti2_test.c
index 2a1b654f9..4c9317d0b 100644
--- a/test/builtins/Unit/parityti2_test.c
+++ b/test/builtins/Unit/parityti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_parityti2
// REQUIRES: int128
//===-- parityti2_test.c - Test __parityti2 -------------------------------===//
//
diff --git a/test/builtins/Unit/popcountdi2_test.c b/test/builtins/Unit/popcountdi2_test.c
index 1d0eaee3c..5bec9ce9d 100644
--- a/test/builtins/Unit/popcountdi2_test.c
+++ b/test/builtins/Unit/popcountdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_popcountdi2
//===-- popcountdi2_test.c - Test __popcountdi2 ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/popcountsi2_test.c b/test/builtins/Unit/popcountsi2_test.c
index 4ab3499e9..ba80fa882 100644
--- a/test/builtins/Unit/popcountsi2_test.c
+++ b/test/builtins/Unit/popcountsi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_popcountsi2
//===-- popcountsi2_test.c - Test __popcountsi2 ---------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/popcountti2_test.c b/test/builtins/Unit/popcountti2_test.c
index 4e32ba747..58e0169fb 100644
--- a/test/builtins/Unit/popcountti2_test.c
+++ b/test/builtins/Unit/popcountti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_popcountti2
// REQUIRES: int128
//===-- popcountti2_test.c - Test __popcountti2 ----------------------------===//
//
diff --git a/test/builtins/Unit/powidf2_test.c b/test/builtins/Unit/powidf2_test.c
index 6bdca0899..f4c248f13 100644
--- a/test/builtins/Unit/powidf2_test.c
+++ b/test/builtins/Unit/powidf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_powidf2
//===-- powidf2_test.cpp - Test __powidf2 ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/powisf2_test.c b/test/builtins/Unit/powisf2_test.c
index f344f0833..62449d933 100644
--- a/test/builtins/Unit/powisf2_test.c
+++ b/test/builtins/Unit/powisf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_powisf2
//===-- powisf2_test.cpp - Test __powisf2 ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/powitf2_test.c b/test/builtins/Unit/powitf2_test.c
index 0850d77d7..70bc6dae0 100644
--- a/test/builtins/Unit/powitf2_test.c
+++ b/test/builtins/Unit/powitf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_powitf2
//===-- powitf2_test.cpp - Test __powitf2 ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/powixf2_test.c b/test/builtins/Unit/powixf2_test.c
index 03a157fc6..0e8798aaa 100644
--- a/test/builtins/Unit/powixf2_test.c
+++ b/test/builtins/Unit/powixf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_powixf2
// UNSUPPORTED: powerpc64
// REQUIRES: x86-target-arch
//===-- powixf2_test.cpp - Test __powixf2 ---------------------------------===//
diff --git a/test/builtins/Unit/subdf3vfp_test.c b/test/builtins/Unit/subdf3vfp_test.c
index afaaca804..7560370cf 100644
--- a/test/builtins/Unit/subdf3vfp_test.c
+++ b/test/builtins/Unit/subdf3vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_subdf3vfp
//===-- subdf3vfp_test.c - Test __subdf3vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/subsf3vfp_test.c b/test/builtins/Unit/subsf3vfp_test.c
index d93df6bdc..b0a2ced61 100644
--- a/test/builtins/Unit/subsf3vfp_test.c
+++ b/test/builtins/Unit/subsf3vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_subsf3vfp
//===-- subsf3vfp_test.c - Test __subsf3vfp -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/subtf3_test.c b/test/builtins/Unit/subtf3_test.c
index 4953d1ceb..b95f2ef99 100644
--- a/test/builtins/Unit/subtf3_test.c
+++ b/test/builtins/Unit/subtf3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_subtf3
//===--------------- subtf3_test.c - Test __subtf3 ------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/subvdi3_test.c b/test/builtins/Unit/subvdi3_test.c
index 04febf95c..768428f67 100644
--- a/test/builtins/Unit/subvdi3_test.c
+++ b/test/builtins/Unit/subvdi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_subvdi3
//===-- subvdi3_test.c - Test __subvdi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/subvsi3_test.c b/test/builtins/Unit/subvsi3_test.c
index fc8898ecd..6541473b5 100644
--- a/test/builtins/Unit/subvsi3_test.c
+++ b/test/builtins/Unit/subvsi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_subvsi3
//===-- subvsi3_test.c - Test __subvsi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/subvti3_test.c b/test/builtins/Unit/subvti3_test.c
index 9db967469..aef66b93f 100644
--- a/test/builtins/Unit/subvti3_test.c
+++ b/test/builtins/Unit/subvti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_subvti3
// REQUIRES: int128
//===-- subvti3_test.c - Test __subvti3 -----------------------------------===//
//
diff --git a/test/builtins/Unit/trampoline_setup_test.c b/test/builtins/Unit/trampoline_setup_test.c
index 316d7cce8..9cde76526 100644
--- a/test/builtins/Unit/trampoline_setup_test.c
+++ b/test/builtins/Unit/trampoline_setup_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -fnested-functions -o %t && %run %t
+// REQUIRES: librt_has_trampoline_setup
/* ===-- trampoline_setup_test.c - Test __trampoline_setup -----------------===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/truncdfhf2_test.c b/test/builtins/Unit/truncdfhf2_test.c
index 1b09fef78..5d49a7427 100644
--- a/test/builtins/Unit/truncdfhf2_test.c
+++ b/test/builtins/Unit/truncdfhf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_truncdfhf2
//===--------------- truncdfhf2_test.c - Test __truncdfhf2 ----------------===//
//
diff --git a/test/builtins/Unit/truncdfsf2_test.c b/test/builtins/Unit/truncdfsf2_test.c
index 6c8f11948..32972dabd 100644
--- a/test/builtins/Unit/truncdfsf2_test.c
+++ b/test/builtins/Unit/truncdfsf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_truncdfsf2
//===--------------- truncdfsf2_test.c - Test __truncdfsf2 ----------------===//
//
diff --git a/test/builtins/Unit/truncdfsf2vfp_test.c b/test/builtins/Unit/truncdfsf2vfp_test.c
index 0e52d3419..44291453f 100644
--- a/test/builtins/Unit/truncdfsf2vfp_test.c
+++ b/test/builtins/Unit/truncdfsf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_truncdfsf2vfp
//===-- truncdfsf2vfp_test.c - Test __truncdfsf2vfp -----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/truncsfhf2_test.c b/test/builtins/Unit/truncsfhf2_test.c
index f6f3fc2ec..4312b8946 100644
--- a/test/builtins/Unit/truncsfhf2_test.c
+++ b/test/builtins/Unit/truncsfhf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_truncsfhf2
//===--------------- truncsfhf2_test.c - Test __truncsfhf2 ----------------===//
//
diff --git a/test/builtins/Unit/trunctfdf2_test.c b/test/builtins/Unit/trunctfdf2_test.c
index ae372be84..8289622a3 100644
--- a/test/builtins/Unit/trunctfdf2_test.c
+++ b/test/builtins/Unit/trunctfdf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_trunctfdf2
//===-------------- trunctfdf2_test.c - Test __trunctfdf2 -----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/trunctfsf2_test.c b/test/builtins/Unit/trunctfsf2_test.c
index 3f350e621..9d0d8b115 100644
--- a/test/builtins/Unit/trunctfsf2_test.c
+++ b/test/builtins/Unit/trunctfsf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_trunctfsf2
//===--------------- trunctfsf2_test.c - Test __trunctfsf2 ----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ucmpdi2_test.c b/test/builtins/Unit/ucmpdi2_test.c
index 6faaac1d2..9cf64d8c4 100644
--- a/test/builtins/Unit/ucmpdi2_test.c
+++ b/test/builtins/Unit/ucmpdi2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ucmpdi2
//===-- ucmpdi2_test.c - Test __ucmpdi2 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/ucmpti2_test.c b/test/builtins/Unit/ucmpti2_test.c
index 71db5df23..db61b949b 100644
--- a/test/builtins/Unit/ucmpti2_test.c
+++ b/test/builtins/Unit/ucmpti2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_ucmpti2
// REQUIRES: int128
//===-- ucmpti2_test.c - Test __ucmpti2 -----------------------------------===//
//
diff --git a/test/builtins/Unit/udivdi3_test.c b/test/builtins/Unit/udivdi3_test.c
index bfdd1db13..3bd6a887e 100644
--- a/test/builtins/Unit/udivdi3_test.c
+++ b/test/builtins/Unit/udivdi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_udivdi3
//===-- udivdi3_test.c - Test __udivdi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/udivmoddi4_test.c b/test/builtins/Unit/udivmoddi4_test.c
index 278b29abc..2cc05add3 100644
--- a/test/builtins/Unit/udivmoddi4_test.c
+++ b/test/builtins/Unit/udivmoddi4_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_udivmoddi4
//===-- udivmoddi4_test.c - Test __udivmoddi4 -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/udivmodsi4_test.c b/test/builtins/Unit/udivmodsi4_test.c
index b390796a4..0e582549c 100644
--- a/test/builtins/Unit/udivmodsi4_test.c
+++ b/test/builtins/Unit/udivmodsi4_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_udivmodsi4
//===-- udivmodsi4_test.c - Test __udivmodsi4 -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/udivmodti4_test.c b/test/builtins/Unit/udivmodti4_test.c
index d022759db..602fd9e11 100644
--- a/test/builtins/Unit/udivmodti4_test.c
+++ b/test/builtins/Unit/udivmodti4_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_udivmodti4
// REQUIRES: int128
//===-- udivmodti4_test.c - Test __udivmodti4 -----------------------------===//
//
diff --git a/test/builtins/Unit/udivsi3_test.c b/test/builtins/Unit/udivsi3_test.c
index f4249f5d1..4ac727941 100644
--- a/test/builtins/Unit/udivsi3_test.c
+++ b/test/builtins/Unit/udivsi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_udivsi3
//===-- udivsi3_test.c - Test __udivsi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/udivti3_test.c b/test/builtins/Unit/udivti3_test.c
index ae6412338..8cb4ac19e 100644
--- a/test/builtins/Unit/udivti3_test.c
+++ b/test/builtins/Unit/udivti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_udivti3
// REQUIRES: int128
//===-- udivti3_test.c - Test __udivti3 -----------------------------------===//
//
diff --git a/test/builtins/Unit/umoddi3_test.c b/test/builtins/Unit/umoddi3_test.c
index 5c79e56a7..567c8e544 100644
--- a/test/builtins/Unit/umoddi3_test.c
+++ b/test/builtins/Unit/umoddi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_umoddi3
//===-- umoddi3_test.c - Test __umoddi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/umodsi3_test.c b/test/builtins/Unit/umodsi3_test.c
index 2ff1f9e79..e49fa8d72 100644
--- a/test/builtins/Unit/umodsi3_test.c
+++ b/test/builtins/Unit/umodsi3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_umodsi3
//===-- umodsi3_test.c - Test __umodsi3 -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/test/builtins/Unit/umodti3_test.c b/test/builtins/Unit/umodti3_test.c
index 0f9317599..5bbe1c3c1 100644
--- a/test/builtins/Unit/umodti3_test.c
+++ b/test/builtins/Unit/umodti3_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_umodti3
// REQUIRES: int128
//===-- umodti3_test.c - Test __umodti3 -----------------------------------===//
//
diff --git a/test/builtins/Unit/unorddf2vfp_test.c b/test/builtins/Unit/unorddf2vfp_test.c
index 128c1d81f..a04703e59 100644
--- a/test/builtins/Unit/unorddf2vfp_test.c
+++ b/test/builtins/Unit/unorddf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_unorddf2vfp
//===-- unorddf2vfp_test.c - Test __unorddf2vfp ---------------------------===//
//
diff --git a/test/builtins/Unit/unordsf2vfp_test.c b/test/builtins/Unit/unordsf2vfp_test.c
index 94f06d841..c3050a402 100644
--- a/test/builtins/Unit/unordsf2vfp_test.c
+++ b/test/builtins/Unit/unordsf2vfp_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_unordsf2vfp
//===-- unordsf2vfp_test.c - Test __unordsf2vfp ---------------------------===//
//
diff --git a/test/builtins/Unit/unordtf2_test.c b/test/builtins/Unit/unordtf2_test.c
index 8f5b11004..fa4bf7ebf 100644
--- a/test/builtins/Unit/unordtf2_test.c
+++ b/test/builtins/Unit/unordtf2_test.c
@@ -1,4 +1,5 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_comparetf2
//===------------ unordtf2_test.c - Test __unordtf2------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.