From b9eccbec08de158b14424b84c85260e0c562a45d Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 10 Feb 2017 06:24:34 +0000 Subject: [PATCH] test: allow -target usage on Windows When running the tests on Windows with a debug build, _DEBUG must be added to the flags prior to the -target as the forced inclusion of a header will prevent the compile test for the flag to fail. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294716 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/libcxx/test/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py index 72de7f49f..e67a19bb0 100644 --- a/utils/libcxx/test/config.py +++ b/utils/libcxx/test/config.py @@ -462,13 +462,17 @@ class Configuration(object): gcc_toolchain = self.get_lit_conf('gcc_toolchain') if gcc_toolchain: self.cxx.flags += ['-gcc-toolchain', gcc_toolchain] + # NOTE: the _DEBUG definition must preceed the triple check because for + # the Windows build of libc++, the forced inclusion of a header requires + # that _DEBUG is defined. Incorrect ordering will result in -target + # being elided. + if self.is_windows and self.debug_build: + self.cxx.compile_flags += ['-D_DEBUG'] if self.use_target: if not self.cxx.addFlagIfSupported( ['-target', self.config.target_triple]): self.lit_config.warning('use_target is true but -target is '\ 'not supported by the compiler') - if self.is_windows and self.debug_build: - self.cxx.compile_flags += ['-D_DEBUG'] def configure_compile_flags_header_includes(self): support_path = os.path.join(self.libcxx_src_root, 'test', 'support')