[libcxx-commits] [libcxx] f24e648 - [libcxx] [test] Check for C++ headers before building a test that uses them

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 12 00:18:36 PDT 2023


Author: Martin Storsjö
Date: 2023-04-12T10:16:50+03:00
New Revision: f24e6489c78fdfb5da50548a4b787a6773656dbe

URL: https://github.com/llvm/llvm-project/commit/f24e6489c78fdfb5da50548a4b787a6773656dbe
DIFF: https://github.com/llvm/llvm-project/commit/f24e6489c78fdfb5da50548a4b787a6773656dbe.diff

LOG: [libcxx] [test] Check for C++ headers before building a test that uses them

When the libcxx test framework is executed within libunwind, there
are no standard C++ headers available (libunwind builds with
-nostdinc++, but doesn't add any libcxx headers to the include path).

Check that a test that includes <iostream> can be compiled before trying
to build and execute a test program that includes it.

Previously, the compile error here would block all libunwind tests from
executing altogether.

Differential Revision: https://reviews.llvm.org/D147630

Added: 
    

Modified: 
    libcxx/utils/libcxx/test/features.py

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 9d031ffb41f4a..dd5163f844453 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -240,7 +240,10 @@ def _getSuitableClangTidy(cfg):
 DEFAULT_FEATURES += [
   Feature(name='darwin', when=lambda cfg: '__APPLE__' in compilerMacros(cfg)),
   Feature(name='windows', when=lambda cfg: '_WIN32' in compilerMacros(cfg)),
-  Feature(name='windows-dll', when=lambda cfg: '_WIN32' in compilerMacros(cfg) and programSucceeds(cfg, """
+  Feature(name='windows-dll', when=lambda cfg: '_WIN32' in compilerMacros(cfg) and sourceBuilds(cfg, """
+            #include <iostream>
+            int main(int, char**) { return 0; }
+          """) and programSucceeds(cfg, """
             #include <iostream>
             #include <windows.h>
             #include <winnt.h>


        


More information about the libcxx-commits mailing list