[libc++] Move a bunch of tests from .sh.cpp to .pass.cpp
authorLouis Dionne <ldionne@apple.com>
Tue, 31 Mar 2020 18:09:09 +0000 (14:09 -0400)
committerLouis Dionne <ldionne@apple.com>
Tue, 31 Mar 2020 18:19:58 +0000 (14:19 -0400)
Using the ADDITIONAL_COMPILE_FLAGS annotation, it is possible to move
these tests from .sh.cpp to .pass.cpp, making them suitable for running
on remote hosts more easily.

libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp [moved from libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.sh.cpp with 93% similarity]
libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp [moved from libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp with 96% similarity]
libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp [moved from libcxx/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp with 92% similarity]
libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp [moved from libcxx/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp with 99% similarity]
libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp [moved from libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp with 98% similarity]
libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.pass.cpp [moved from libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp with 91% similarity]
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp [moved from libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp with 97% similarity]
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp [moved from libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp with 97% similarity]

@@ -6,8 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-// RUN: %{build} -fno-exceptions
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fno-exceptions
 
 // UNSUPPORTED: c++98, c++03
 
@@ -43,7 +42,7 @@ int main(int, char**) {
   // have to be moved when it is resized.
   v.reserve(10);
   size_t old_cap = v.capacity();
-  for (int i = 0; i < v.capacity(); ++i) {
+  for (size_t i = 0; i < v.capacity(); ++i) {
     v.emplace_back(42);
   }
   assert(v.capacity() == old_cap);
@@ -8,9 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 // REQUIRES: fcoroutines-ts
-
-// RUN: %{build} -fcoroutines-ts
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts
 
 // A simple "breathing" test that checks that <experimental/coroutine>
 // can be parsed and used in all dialects, including C++03 in order to match
@@ -12,8 +12,7 @@
 
 // typedef TrivialClock file_time_type;
 
-// RUN: %{build} -I%{libcxx_src_root}/src/filesystem
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -I%{libcxx_src_root}/src/filesystem
 
 #include <filesystem>
 #include <chrono>
@@ -13,8 +13,6 @@
 // definitions, which does not yet provide aligned allocation
 // XFAIL: LIBCXX-WINDOWS-FIXME
 
-// REQUIRES: -faligned-allocation
-
 // The dylibs shipped before macosx10.13 do not contain the aligned allocation
 // functions, so trying to force using those with -faligned-allocation results
 // in a link error.
@@ -25,8 +23,8 @@
 // XFAIL: with_system_cxx_lib=macosx10.8
 // XFAIL: with_system_cxx_lib=macosx10.7
 
-// RUN: %{build} -faligned-allocation
-// RUN: %{run}
+// REQUIRES: -faligned-allocation
+// ADDITIONAL_COMPILE_FLAGS: -faligned-allocation
 
 #include <new>
 #include <typeinfo>
@@ -9,9 +9,7 @@
 // test that cmath builds with -fdelayed-template-parsing
 
 // REQUIRES: fdelayed-template-parsing
-
-// RUN: %{build} -fdelayed-template-parsing
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fdelayed-template-parsing
 
 #include <cmath>
 #include <cassert>