diff --git a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in --- a/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in +++ b/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in @@ -5,7 +5,7 @@ config.substitutions.append(('%{flags}', '--driver-mode=g++')) config.substitutions.append(('%{compile_flags}', - '-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS' + '-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' )) config.substitutions.append(('%{link_flags}', '-nostdlib -L %{lib} -lc++ -lmsvcrt -lmsvcprt -loldnames' diff --git a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in --- a/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in +++ b/libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in @@ -5,7 +5,7 @@ config.substitutions.append(('%{flags}', '--driver-mode=g++')) config.substitutions.append(('%{compile_flags}', - '-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS' + '-nostdinc++ -isystem %{include} -isystem %{target-include} -I %{libcxx}/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX' )) config.substitutions.append(('%{link_flags}', '-nostdlib -L %{lib} -llibc++ -lmsvcrt -lmsvcprt -loldnames' diff --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp @@ -19,9 +19,6 @@ // file_time_type last_write_time() const; // file_time_type last_write_time(error_code const&) const noexcept; -// Disable min() and max() macros in on Windows. -// ADDITIONAL_COMPILE_FLAGS: -DNOMINMAX - #include "filesystem_include.h" #include #include diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp @@ -22,9 +22,6 @@ // void last_write_time(const path& p, file_time_type new_type, // std::error_code& ec) noexcept; -// Disable min() and max() macros in on Windows. -// ADDITIONAL_COMPILE_FLAGS: -DNOMINMAX - #include "filesystem_include.h" #include #include diff --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h --- a/libcxx/test/support/filesystem_test_helper.h +++ b/libcxx/test/support/filesystem_test_helper.h @@ -31,9 +31,6 @@ # include #endif -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - namespace utils { #ifdef _WIN32 inline int mkdir(const char* path, int mode) { (void)mode; return ::_mkdir(path); } @@ -736,6 +733,4 @@ return fs::path(); } -_LIBCPP_POP_MACROS - #endif /* FILESYSTEM_TEST_HELPER_H */ diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -245,6 +245,10 @@ # Build the tests in the same configuration as libcxx itself, # to avoid mismatches if linked statically. self.cxx.compile_flags += ['-D_CRT_STDIO_ISO_WIDE_SPECIFIERS'] + # Required so that tests using min/max don't fail on Windows, + # and so that those tests don't have to be changed to tolerate + # this insanity. + self.cxx.compile_flags += ['-DNOMINMAX'] additional_flags = self.get_lit_conf('test_compiler_flags') if additional_flags: self.cxx.compile_flags += shlex.split(additional_flags)