diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -82,7 +82,7 @@ set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING "TargetInfo to use when setting up test environment.") -set(LIBCXX_EXECUTOR "${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/../utils/run.py" CACHE STRING +set(LIBCXX_EXECUTOR "${Python3_EXECUTABLE} '${CMAKE_CURRENT_LIST_DIR}/../utils/run.py'" CACHE STRING "Executor to use when running tests.") set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!") diff --git a/libcxx/test/libcxx/double_include.sh.cpp b/libcxx/test/libcxx/double_include.sh.cpp --- a/libcxx/test/libcxx/double_include.sh.cpp +++ b/libcxx/test/libcxx/double_include.sh.cpp @@ -9,9 +9,9 @@ // Test that we can include each header in two TU's and link them together. -// RUN: %{cxx} -c %s -o %t.first.o %{flags} %{compile_flags} -// RUN: %{cxx} -c %s -o %t.second.o -DWITH_MAIN %{flags} %{compile_flags} -// RUN: %{cxx} -o %t.exe %t.first.o %t.second.o %{flags} %{link_flags} +// RUN: %{cxx} -c "%s" -o "%t.first.o" %{flags} %{compile_flags} +// RUN: %{cxx} -c "%s" -o "%t.second.o" -DWITH_MAIN %{flags} %{compile_flags} +// RUN: %{cxx} -o "%t.exe" "%t.first.o" "%t.second.o" %{flags} %{link_flags} // RUN: %{run} // GCC 5 pretends it supports C++17 features, but some features like static_assert diff --git a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp --- a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp +++ b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp @@ -11,9 +11,9 @@ // UNSUPPORTED: libcpp-has-no-localization // UNSUPPORTED: c++03 -// RUN: %{cxx} %{flags} %s -o %t.exe %{compile_flags} -g %{link_flags} +// RUN: %{cxx} %{flags} "%s" -o "%t.exe" %{compile_flags} -g %{link_flags} // Ensure locale-independence for unicode tests. -// RUN: %{gdb} -nx -batch -iex "set autoload off" -ex "source %S/../../../utils/gdb/libcxx/printers.py" -ex "python register_libcxx_printer_loader()" -ex "source %S/gdb_pretty_printer_test.py" %t.exe +// RUN: %{gdb} -nx -batch -iex "set autoload off" -ex "source %S/../../../utils/gdb/libcxx/printers.py" -ex "python register_libcxx_printer_loader()" -ex "source %S/gdb_pretty_printer_test.py" "%t.exe" #include #include diff --git a/libcxx/test/libcxx/include_as_c.sh.cpp b/libcxx/test/libcxx/include_as_c.sh.cpp --- a/libcxx/test/libcxx/include_as_c.sh.cpp +++ b/libcxx/test/libcxx/include_as_c.sh.cpp @@ -19,7 +19,7 @@ // NOTE: It's not common or recommended to have libc++ in the header search // path when compiling C files, but it does happen often enough. -// RUN: %{cxx} -c -xc %s -fsyntax-only %{flags} %{compile_flags} -std=c99 +// RUN: %{cxx} -c -xc "%s" -fsyntax-only %{flags} %{compile_flags} -std=c99 #include <__config> diff --git a/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp --- a/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp +++ b/libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03 -// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../../../src/filesystem +// ADDITIONAL_COMPILE_FLAGS: -I "%S/../../../../../../src/filesystem" // diff --git a/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp --- a/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp +++ b/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp @@ -13,7 +13,7 @@ // typedef TrivialClock file_time_type; -// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../src/filesystem +// ADDITIONAL_COMPILE_FLAGS: -I "%S/../../../../src/filesystem" #include #include diff --git a/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.merged.sh.cpp b/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.merged.sh.cpp --- a/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.merged.sh.cpp +++ b/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.merged.sh.cpp @@ -8,11 +8,11 @@ // UNSUPPORTED: no-rtti -// RUN: %{cxx} %s %{flags} %{compile_flags} -c -o %t.tu1.o -DTU1 -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=1 -// RUN: %{cxx} %s %{flags} %{compile_flags} -c -o %t.tu2.o -DTU2 -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=1 -// RUN: %{cxx} %s %{flags} %{compile_flags} -c -o %t.main.o -DMAIN -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=1 -// RUN: %{cxx} %t.tu1.o %t.tu2.o %t.main.o %{flags} %{link_flags} -o %t.exe -// RUN: %{exec} %t.exe +// RUN: %{cxx} "%s" %{flags} %{compile_flags} -c -o "%t.tu1.o" -DTU1 -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=1 +// RUN: %{cxx} "%s" %{flags} %{compile_flags} -c -o "%t.tu2.o" -DTU2 -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=1 +// RUN: %{cxx} "%s" %{flags} %{compile_flags} -c -o "%t.main.o" -DMAIN -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=1 +// RUN: %{cxx} "%t.tu1.o" "%t.tu2.o" "%t.main.o" %{flags} %{link_flags} -o "%t.exe" +// RUN: %{exec} "%t.exe" #include #include diff --git a/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.unmerged.sh.cpp b/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.unmerged.sh.cpp --- a/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.unmerged.sh.cpp +++ b/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.unmerged.sh.cpp @@ -8,11 +8,11 @@ // UNSUPPORTED: no-rtti -// RUN: %{cxx} %s %{flags} %{compile_flags} -c -o %t.tu1.o -DTU1 -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2 -// RUN: %{cxx} %s %{flags} %{compile_flags} -c -o %t.tu2.o -DTU2 -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2 -// RUN: %{cxx} %s %{flags} %{compile_flags} -c -o %t.main.o -DMAIN -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2 -// RUN: %{cxx} %t.tu1.o %t.tu2.o %t.main.o %{flags} %{link_flags} -o %t.exe -// RUN: %{exec} %t.exe +// RUN: %{cxx} "%s" %{flags} %{compile_flags} -c -o "%t.tu1.o" -DTU1 -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2 +// RUN: %{cxx} "%s" %{flags} %{compile_flags} -c -o "%t.tu2.o" -DTU2 -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2 +// RUN: %{cxx} "%s" %{flags} %{compile_flags} -c -o "%t.main.o" -DMAIN -D_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION=2 +// RUN: %{cxx} "%t.tu1.o" "%t.tu2.o" "%t.main.o" %{flags} %{link_flags} -o "%t.exe" +// RUN: %{exec} "%t.exe" #include #include diff --git a/libcxx/test/libcxx/libcpp_freestanding.sh.cpp b/libcxx/test/libcxx/libcpp_freestanding.sh.cpp --- a/libcxx/test/libcxx/libcpp_freestanding.sh.cpp +++ b/libcxx/test/libcxx/libcpp_freestanding.sh.cpp @@ -10,8 +10,8 @@ // Test that _LIBCPP_FREESTANDING is not defined when -ffreestanding is not passed // to the compiler but defined when -ffreestanding is passed to the compiler. -// RUN: %{cxx} %{flags} %{compile_flags} -fsyntax-only %s -// RUN: %{cxx} %{flags} %{compile_flags} -fsyntax-only -ffreestanding -DFREESTANDING %s +// RUN: %{cxx} %{flags} %{compile_flags} -fsyntax-only "%s" +// RUN: %{cxx} %{flags} %{compile_flags} -fsyntax-only -ffreestanding -DFREESTANDING "%s" #include <__config> diff --git a/libcxx/test/libcxx/modules/stds_include.sh.cpp b/libcxx/test/libcxx/modules/stds_include.sh.cpp --- a/libcxx/test/libcxx/modules/stds_include.sh.cpp +++ b/libcxx/test/libcxx/modules/stds_include.sh.cpp @@ -25,11 +25,11 @@ // NOTE: The -std=XXX flag is present in %{flags}, so we overwrite it by passing it after %{flags}. // FIXME: Remove the `-DINVALIDATE_CACHE_FOO` macros. Their purpose is to workaround a bug in older Clang versions // the same modules caches were reused across standard dialects. -// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++03 -DINVALIDATE_CACHE_CXX03 %s -// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++11 -DINVALIDATE_CACHE_CXX11 %s -// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++14 -DINVALIDATE_CACHE_CKK14 %s -// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++17 -DINVALIDATE_CACHE_CXX17 %s -// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++2a -DINVALIDATE_CACHE_CXX2A %s +// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++03 -DINVALIDATE_CACHE_CXX03 "%s" +// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++11 -DINVALIDATE_CACHE_CXX11 "%s" +// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++14 -DINVALIDATE_CACHE_CKK14 "%s" +// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++17 -DINVALIDATE_CACHE_CXX17 "%s" +// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++2a -DINVALIDATE_CACHE_CXX2A "%s" #include diff --git a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py --- a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py +++ b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py @@ -8,8 +8,8 @@ # Note: We prepend arguments with 'x' to avoid thinking there are too few # arguments in case an argument is an empty string. -# RUN: %{python} %s x%S \ -# RUN: x%T \ +# RUN: %{python} "%s" "x%S" \ +# RUN: "x%T" \ # RUN: x%{escaped_exec} \ # RUN: x%{escaped_cxx} \ # RUN: x%{escaped_flags} \ diff --git a/libcxx/test/libcxx/selftest/file_dependencies/absolute-and-relative-paths.sh.cpp b/libcxx/test/libcxx/selftest/file_dependencies/absolute-and-relative-paths.sh.cpp --- a/libcxx/test/libcxx/selftest/file_dependencies/absolute-and-relative-paths.sh.cpp +++ b/libcxx/test/libcxx/selftest/file_dependencies/absolute-and-relative-paths.sh.cpp @@ -8,8 +8,8 @@ // Make sure that FILE_DEPENDENCIES work with relative AND absolute paths. -// FILE_DEPENDENCIES: %S/a.txt -// RUN: test -e %T/a.txt +// FILE_DEPENDENCIES: "%S/a.txt" +// RUN: test -e "%T/a.txt" // FILE_DEPENDENCIES: dir/b.txt -// RUN: test -e %T/b.txt +// RUN: test -e "%T/b.txt" diff --git a/libcxx/test/libcxx/selftest/file_dependencies/substitute-in-dependencies.sh.cpp b/libcxx/test/libcxx/selftest/file_dependencies/substitute-in-dependencies.sh.cpp --- a/libcxx/test/libcxx/selftest/file_dependencies/substitute-in-dependencies.sh.cpp +++ b/libcxx/test/libcxx/selftest/file_dependencies/substitute-in-dependencies.sh.cpp @@ -8,5 +8,5 @@ // Make sure that lit substitutions are expanded inside FILE_DEPENDENCIES lines. -// FILE_DEPENDENCIES: %s -// RUN: test -e %T/substitute-in-dependencies.sh.cpp +// FILE_DEPENDENCIES: "%s" +// RUN: test -e "%T/substitute-in-dependencies.sh.cpp" diff --git a/libcxx/test/libcxx/selftest/remote-substitutions.sh.cpp b/libcxx/test/libcxx/selftest/remote-substitutions.sh.cpp --- a/libcxx/test/libcxx/selftest/remote-substitutions.sh.cpp +++ b/libcxx/test/libcxx/selftest/remote-substitutions.sh.cpp @@ -15,9 +15,9 @@ // We also check that the path of test-executables is replaced whether they // appear first in the command-line or not. -// RUN: %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe -// RUN: %{exec} %t.exe 0 -// RUN: %{exec} bash -c '! %t.exe 1' +// RUN: %{cxx} "%s" %{flags} %{compile_flags} %{link_flags} -o "%t.exe" +// RUN: %{exec} "%t.exe" 0 +// RUN: %{exec} bash -c '! "%t.exe" 1' #include #include diff --git a/libcxx/test/libcxx/selftest/sh.cpp/substitutions.sh.cpp b/libcxx/test/libcxx/selftest/sh.cpp/substitutions.sh.cpp --- a/libcxx/test/libcxx/selftest/sh.cpp/substitutions.sh.cpp +++ b/libcxx/test/libcxx/selftest/sh.cpp/substitutions.sh.cpp @@ -13,8 +13,8 @@ // - %{link_flags} // - %{exec} -// RUN: %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe -// RUN: %{exec} %t.exe "HELLO" +// RUN: %{cxx} "%s" %{flags} %{compile_flags} %{link_flags} -o "%t.exe" +// RUN: %{exec} "%t.exe" "HELLO" #include #include diff --git a/libcxx/test/libcxx/selftest/tmpdir-exists.sh.cpp b/libcxx/test/libcxx/selftest/tmpdir-exists.sh.cpp --- a/libcxx/test/libcxx/selftest/tmpdir-exists.sh.cpp +++ b/libcxx/test/libcxx/selftest/tmpdir-exists.sh.cpp @@ -8,4 +8,4 @@ // Make sure that the directory represented by %T exists when we run the test. -// RUN: test -d %T +// RUN: test -d "%T" diff --git a/libcxx/test/libcxx/strings/basic.string/PR42676.sh.cpp b/libcxx/test/libcxx/strings/basic.string/PR42676.sh.cpp --- a/libcxx/test/libcxx/strings/basic.string/PR42676.sh.cpp +++ b/libcxx/test/libcxx/strings/basic.string/PR42676.sh.cpp @@ -8,7 +8,7 @@ // Regression test for PR42676. -// RUN: %{cxx} %{flags} %s -o %t.exe %{compile_flags} %{link_flags} -D_LIBCPP_HIDE_FROM_ABI_PER_TU +// RUN: %{cxx} %{flags} "%s" -o "%t.exe" %{compile_flags} %{link_flags} -D_LIBCPP_HIDE_FROM_ABI_PER_TU // RUN: %{run} #include diff --git a/libcxx/test/libcxx/utilities/function.objects/abi_bug_cxx03_cxx11_example.sh.cpp b/libcxx/test/libcxx/utilities/function.objects/abi_bug_cxx03_cxx11_example.sh.cpp --- a/libcxx/test/libcxx/utilities/function.objects/abi_bug_cxx03_cxx11_example.sh.cpp +++ b/libcxx/test/libcxx/utilities/function.objects/abi_bug_cxx03_cxx11_example.sh.cpp @@ -13,9 +13,9 @@ // This tests is meant to demonstrate an existing ABI bug between the // C++03 and C++11 implementations of std::function. It is not a real test. -// RUN: %{cxx} -c %s -o %t.first.o %{flags} %{compile_flags} -std=c++03 -g -// RUN: %{cxx} -c %s -o %t.second.o -DWITH_MAIN %{flags} %{compile_flags} -g -std=c++11 -// RUN: %{cxx} -o %t.exe %t.first.o %t.second.o %{flags} %{link_flags} -g +// RUN: %{cxx} -c "%s" -o "%t.first.o" %{flags} %{compile_flags} -std=c++03 -g +// RUN: %{cxx} -c "%s" -o "%t.second.o" -DWITH_MAIN %{flags} %{compile_flags} -g -std=c++11 +// RUN: %{cxx} -o "%t.exe" "%t.first.o" "%t.second.o" %{flags} %{link_flags} -g // RUN: %{run} #include diff --git a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp --- a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp +++ b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp @@ -17,8 +17,8 @@ // std::_IsSame: 689.634 ms 356 K // std::is_same: 8,129.180 ms 560 K // -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/orig.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/new.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_NEW +// RUN: %{cxx} %{flags} %{compile_flags} -c "%s" -o "%S/orig.o" -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 +// RUN: %{cxx} %{flags} %{compile_flags} -c "%s" -o "%S/new.o" -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_NEW #include #include diff --git a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_metafunctions.sh.cpp b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_metafunctions.sh.cpp --- a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_metafunctions.sh.cpp +++ b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_metafunctions.sh.cpp @@ -19,9 +19,9 @@ // __and_: 14,181.851 ms 648 M // -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/new.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/lazy.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_LAZY_AND -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/std.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_STD_AND +// RUN: %{cxx} %{flags} %{compile_flags} -c "%s" -o "%S/new.o" -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 +// RUN: %{cxx} %{flags} %{compile_flags} -c "%s" -o "%S/lazy.o" -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_LAZY_AND +// RUN: %{cxx} %{flags} %{compile_flags} -c "%s" -o "%S/std.o" -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_STD_AND #include #include diff --git a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp --- a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp +++ b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp @@ -24,15 +24,15 @@ // variant_new: 1,105 ms 828 KiB -// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c %s \ +// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c "%s" \ // RUN: -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -g \ -// RUN: -DTEST_NS=flat_impl -o %S/flat.o -// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c %s \ +// RUN: -DTEST_NS=flat_impl -o "%S/flat.o" +// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c "%s" \ // RUN: -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -g \ -// RUN: -DTEST_NS=rec_impl -o %S/rec.o -// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c %s \ +// RUN: -DTEST_NS=rec_impl -o "%S/rec.o" +// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c "%s" \ // RUN: -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -g \ -// RUN: -DTEST_NS=variant_impl -o %S/variant.o +// RUN: -DTEST_NS=variant_impl -o "%S/variant.o" #include #include diff --git a/libcxx/test/std/input.output/iostream.objects/check-stderr.sh b/libcxx/test/std/input.output/iostream.objects/check-stderr.sh --- a/libcxx/test/std/input.output/iostream.objects/check-stderr.sh +++ b/libcxx/test/std/input.output/iostream.objects/check-stderr.sh @@ -1,4 +1,4 @@ program=${1} expected_stderr=${2} -${program} 2>stderr.log >stdout.log +"${program}" 2>stderr.log >stdout.log [ "${expected_stderr}" == "$(cat stderr.log)" ] diff --git a/libcxx/test/std/input.output/iostream.objects/check-stdout.sh b/libcxx/test/std/input.output/iostream.objects/check-stdout.sh --- a/libcxx/test/std/input.output/iostream.objects/check-stdout.sh +++ b/libcxx/test/std/input.output/iostream.objects/check-stdout.sh @@ -1,4 +1,4 @@ program=${1} expected_stdout=${2} -${program} 2>stderr.log >stdout.log +"${program}" 2>stderr.log >stdout.log [ "${expected_stdout}" == "$(cat stdout.log)" ] diff --git a/libcxx/test/std/input.output/iostream.objects/send-stdin.sh b/libcxx/test/std/input.output/iostream.objects/send-stdin.sh --- a/libcxx/test/std/input.output/iostream.objects/send-stdin.sh +++ b/libcxx/test/std/input.output/iostream.objects/send-stdin.sh @@ -1,3 +1,3 @@ program=${1} input=${2} -echo -n ${input} | ${program} +echo -n ${input} | "${program}" diff --git a/libcxx/test/std/namespace/addressable_functions.sh.cpp b/libcxx/test/std/namespace/addressable_functions.sh.cpp --- a/libcxx/test/std/namespace/addressable_functions.sh.cpp +++ b/libcxx/test/std/namespace/addressable_functions.sh.cpp @@ -12,10 +12,10 @@ // in C++20, we test it in all standard modes because it's basic QOI to provide // a consistent behavior for that across standard modes. -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %t.tu1.o -DTU1 -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %t.tu2.o -DTU2 -// RUN: %{cxx} %t.tu1.o %t.tu2.o %{flags} %{link_flags} -o %t.exe -// RUN: %{exec} %t.exe +// RUN: %{cxx} %{flags} %{compile_flags} -c "%s" -o "%t.tu1.o" -DTU1 +// RUN: %{cxx} %{flags} %{compile_flags} -c "%s" -o "%t.tu2.o" -DTU2 +// RUN: %{cxx} "%t.tu1.o" "%t.tu2.o" %{flags} %{link_flags} -o "%t.exe" +// RUN: %{exec} "%t.exe" // The functions checked below come from & friends // UNSUPPORTED: libcpp-has-no-localization 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 @@ -589,7 +589,7 @@ codesign_ident = self.get_lit_conf('llvm_codesign_identity', '') env_vars = ' '.join('%s=%s' % (k, pipes.quote(v)) for (k, v) in self.exec_env.items()) exec_args = [ - '--execdir %T', + '--execdir "%T"', '--codesign_identity "{}"'.format(codesign_ident), '--env {}'.format(env_vars) ] diff --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py --- a/libcxx/utils/libcxx/test/dsl.py +++ b/libcxx/utils/libcxx/test/dsl.py @@ -95,7 +95,7 @@ with open(test.getSourcePath(), 'w') as sourceFile: sourceFile.write(source) out, err, exitCode, timeoutInfo = _executeScriptInternal(test, ['%{build}']) - _executeScriptInternal(test, ['rm %t.exe']) + _executeScriptInternal(test, ['rm "%t.exe"']) return exitCode == 0 @_memoizeExpensiveOperation(lambda c, p, args=None, testPrefix='': (c.substitutions, c.environment, p, args)) @@ -127,7 +127,7 @@ return actualOut finally: - _executeScriptInternal(test, ['rm %t.exe']) + _executeScriptInternal(test, ['rm "%t.exe"']) @_memoizeExpensiveOperation(lambda c, f: (c.substitutions, c.environment, f)) def hasCompileFlag(config, flag): @@ -190,7 +190,7 @@ # additional macros. sourceFile.write("#include ") unparsedOutput, err, exitCode, timeoutInfo = _executeScriptInternal(test, [ - "%{{cxx}} %s -dM -E %{{flags}} %{{compile_flags}} {}".format(flags) + "%{{cxx}} \"%s\" -dM -E %{{flags}} %{{compile_flags}} {}".format(flags) ]) parsedMacros = dict() defines = (l.strip() for l in unparsedOutput.split('\n') if l.startswith('#define ')) diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -48,7 +48,7 @@ # build against now-invalid cached headers from a previous build. Feature(name='modules-support', when=lambda cfg: hasCompileFlag(cfg, '-fmodules'), - actions=lambda cfg: [AddCompileFlag('-fmodules-cache-path=%t/ModuleCache')]), + actions=lambda cfg: [AddCompileFlag('-fmodules-cache-path="%t/ModuleCache"')]), Feature(name='non-lockfree-atomics', when=lambda cfg: sourceBuilds(cfg, """ diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py --- a/libcxx/utils/libcxx/test/format.py +++ b/libcxx/utils/libcxx/test/format.py @@ -70,8 +70,8 @@ # Check base substitutions and add the %{build} and %{run} convenience substitutions _checkBaseSubstitutions(substitutions) - substitutions.append(('%{build}', '%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe')) - substitutions.append(('%{run}', '%{exec} %t.exe')) + substitutions.append(('%{build}', '%{cxx} "%s" %{flags} %{compile_flags} %{link_flags} -o "%t.exe"')) + substitutions.append(('%{run}', '%{exec} "%t.exe"')) # Parse the test file, including custom directives additionalCompileFlags = [] @@ -96,7 +96,7 @@ # that file to the execution directory. Execute the copy from %S to allow # relative paths from the test directory. for dep in fileDependencies: - script += ['%dbg(SETUP) cd %S && cp {} %T'.format(dep)] + script += ['%dbg(SETUP) cd "%S" && cp {} "%T"'.format(dep)] script += preamble script += scriptInTest @@ -235,23 +235,23 @@ return self._executeShTest(test, litConfig, steps) elif filename.endswith('.compile.pass.cpp'): steps = [ - "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} -fsyntax-only" + "%dbg(COMPILED WITH) %{cxx} \"%s\" %{flags} %{compile_flags} -fsyntax-only" ] return self._executeShTest(test, litConfig, steps) elif filename.endswith('.compile.fail.cpp'): steps = [ - "%dbg(COMPILED WITH) ! %{cxx} %s %{flags} %{compile_flags} -fsyntax-only" + "%dbg(COMPILED WITH) ! %{cxx} \"%s\" %{flags} %{compile_flags} -fsyntax-only" ] return self._executeShTest(test, litConfig, steps) elif filename.endswith('.link.pass.cpp'): steps = [ - "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe" + "%dbg(COMPILED WITH) %{cxx} \"%s\" %{flags} %{compile_flags} %{link_flags} -o \"%t.exe\"" ] return self._executeShTest(test, litConfig, steps) elif filename.endswith('.link.fail.cpp'): steps = [ - "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} -c -o %t.o", - "%dbg(LINKED WITH) ! %{cxx} %t.o %{flags} %{link_flags} -o %t.exe" + "%dbg(COMPILED WITH) %{cxx} \"%s\" %{flags} %{compile_flags} -c -o \"%t.o\"", + "%dbg(LINKED WITH) ! %{cxx} \"%t.o\" %{flags} %{link_flags} -o \"%t.exe\"" ] return self._executeShTest(test, litConfig, steps) elif filename.endswith('.verify.cpp'): @@ -261,15 +261,15 @@ steps = [ # Note: Use -Wno-error to make sure all diagnostics are not treated as errors, # which doesn't make sense for clang-verify tests. - "%dbg(COMPILED WITH) %{{cxx}} %s %{{flags}} %{{compile_flags}} -fsyntax-only -Wno-error {}".format(VERIFY_FLAGS) + "%dbg(COMPILED WITH) %{{cxx}} \"%s\" %{{flags}} %{{compile_flags}} -fsyntax-only -Wno-error {}".format(VERIFY_FLAGS) ] return self._executeShTest(test, litConfig, steps) # Make sure to check these ones last, since they will match other # suffixes above too. elif filename.endswith('.pass.cpp') or filename.endswith('.pass.mm'): steps = [ - "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe", - "%dbg(EXECUTED AS) %{exec} %t.exe" + "%dbg(COMPILED WITH) %{cxx} \"%s\" %{flags} %{compile_flags} %{link_flags} -o \"%t.exe\"", + "%dbg(EXECUTED AS) %{exec} \"%t.exe\"" ] return self._executeShTest(test, litConfig, steps) # This is like a .verify.cpp test when clang-verify is supported, @@ -278,11 +278,11 @@ elif filename.endswith('.fail.cpp'): if supportsVerify: steps = [ - "%dbg(COMPILED WITH) %{{cxx}} %s %{{flags}} %{{compile_flags}} -fsyntax-only -Wno-error {}".format(VERIFY_FLAGS) + "%dbg(COMPILED WITH) %{{cxx}} \"%s\" %{{flags}} %{{compile_flags}} -fsyntax-only -Wno-error {}".format(VERIFY_FLAGS) ] else: steps = [ - "%dbg(COMPILED WITH) ! %{cxx} %s %{flags} %{compile_flags} -fsyntax-only" + "%dbg(COMPILED WITH) ! %{cxx} \"%s\" %{flags} %{compile_flags} -fsyntax-only" ] return self._executeShTest(test, litConfig, steps) else: diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -50,7 +50,7 @@ pythonize_bool(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI) set(LIBCXXABI_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING "TargetInfo to use when setting up test environment.") -set(LIBCXXABI_EXECUTOR "${Python3_EXECUTABLE} ${LIBCXXABI_LIBCXX_PATH}/utils/run.py" CACHE STRING +set(LIBCXXABI_EXECUTOR "${Python3_EXECUTABLE} '${LIBCXXABI_LIBCXX_PATH}/utils/run.py'" CACHE STRING "Executor to use when running tests.") if (LIBCXXABI_ENABLE_SHARED) diff --git a/libcxxabi/test/incomplete_type.sh.cpp b/libcxxabi/test/incomplete_type.sh.cpp --- a/libcxxabi/test/incomplete_type.sh.cpp +++ b/libcxxabi/test/incomplete_type.sh.cpp @@ -20,10 +20,10 @@ // in the system libc++abi installation on OS X. (DYLD_LIBRARY_PATH is ignored // for shell tests because of Apple security features). -// RUN: %{cxx} %{flags} %{compile_flags} -Wno-unreachable-code -c %s -o %t.one.o -// RUN: %{cxx} %{flags} %{compile_flags} -Wno-unreachable-code -c %s -o %t.two.o -DTU_ONE -// RUN: %{cxx} %{flags} %t.one.o %t.two.o %{link_libcxxabi} %{link_flags} -o %t.exe -// RUN: %{exec} %t.exe +// RUN: %{cxx} %{flags} %{compile_flags} -Wno-unreachable-code -c "%s" -o "%t.one.o" +// RUN: %{cxx} %{flags} %{compile_flags} -Wno-unreachable-code -c "%s" -o "%t.two.o" -DTU_ONE +// RUN: %{cxx} %{flags} "%t.one.o" "%t.two.o" %{link_libcxxabi} %{link_flags} -o "%t.exe" +// RUN: %{exec} "%t.exe" #include #include diff --git a/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-00.pass.sh.s b/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-00.pass.sh.s --- a/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-00.pass.sh.s +++ b/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-00.pass.sh.s @@ -1,5 +1,5 @@ -@ RUN: %{cxx} %{flags} %{link_flags} %s -o %t.exe -@ RUN: %t.exe +@ RUN: %{cxx} %{flags} %{link_flags} "%s" -o "%t.exe" +@ RUN: "%t.exe" @ UNSUPPORTED: no-exceptions @ PURPOSE: Check that 0x00 is a valid value for ttype encoding. LLVM and diff --git a/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-90.pass.sh.s b/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-90.pass.sh.s --- a/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-90.pass.sh.s +++ b/libcxxabi/test/native/arm-linux-eabi/ttype-encoding-90.pass.sh.s @@ -1,5 +1,5 @@ -@ RUN: %{cxx} %{flags} %{link_flags} %s -o %t.exe -@ RUN: %t.exe +@ RUN: %{cxx} %{flags} %{link_flags} "%s" -o "%t.exe" +@ RUN: "%t.exe" @ UNSUPPORTED: no-exceptions @ PURPOSE: Check that 0x90 is a valid value for ttype encoding.