Skip to content

Commit 38aebe5

Browse files
committed
[libc++] Move a bunch of tests from .sh.cpp to .pass.cpp
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.
1 parent 7b06cb4 commit 38aebe5

File tree

8 files changed

+10
-24
lines changed

8 files changed

+10
-24
lines changed

libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.sh.cpp renamed to libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// RUN: %{build} -fno-exceptions
10-
// RUN: %{run}
9+
// ADDITIONAL_COMPILE_FLAGS: -fno-exceptions
1110

1211
// UNSUPPORTED: c++98, c++03
1312

@@ -43,7 +42,7 @@ int main(int, char**) {
4342
// have to be moved when it is resized.
4443
v.reserve(10);
4544
size_t old_cap = v.capacity();
46-
for (int i = 0; i < v.capacity(); ++i) {
45+
for (size_t i = 0; i < v.capacity(); ++i) {
4746
v.emplace_back(42);
4847
}
4948
assert(v.capacity() == old_cap);

libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp renamed to libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
//===----------------------------------------------------------------------===//
99

1010
// REQUIRES: fcoroutines-ts
11-
12-
// RUN: %{build} -fcoroutines-ts
13-
// RUN: %{run}
11+
// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts
1412

1513
// A simple "breathing" test that checks that <experimental/coroutine>
1614
// can be parsed and used in all dialects, including C++03 in order to match

libcxx/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp renamed to libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
// UNSUPPORTED: c++98, c++03, c++11
1111
// REQUIRES: fcoroutines-ts
12-
13-
// RUN: %{build} -fcoroutines-ts
14-
// RUN: %{run}
12+
// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts
1513

1614
#include <experimental/coroutine>
1715

libcxx/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp renamed to libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
// typedef TrivialClock file_time_type;
1414

15-
// RUN: %{build} -I%{libcxx_src_root}/src/filesystem
16-
// RUN: %{run}
15+
// ADDITIONAL_COMPILE_FLAGS: -I%{libcxx_src_root}/src/filesystem
1716

1817
#include <filesystem>
1918
#include <chrono>

libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp renamed to libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// definitions, which does not yet provide aligned allocation
1414
// XFAIL: LIBCXX-WINDOWS-FIXME
1515

16-
// REQUIRES: -faligned-allocation
17-
1816
// The dylibs shipped before macosx10.13 do not contain the aligned allocation
1917
// functions, so trying to force using those with -faligned-allocation results
2018
// in a link error.
@@ -25,8 +23,8 @@
2523
// XFAIL: with_system_cxx_lib=macosx10.8
2624
// XFAIL: with_system_cxx_lib=macosx10.7
2725

28-
// RUN: %{build} -faligned-allocation
29-
// RUN: %{run}
26+
// REQUIRES: -faligned-allocation
27+
// ADDITIONAL_COMPILE_FLAGS: -faligned-allocation
3028

3129
#include <new>
3230
#include <typeinfo>

libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp renamed to libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
// test that cmath builds with -fdelayed-template-parsing
1010

1111
// REQUIRES: fdelayed-template-parsing
12-
13-
// RUN: %{build} -fdelayed-template-parsing
14-
// RUN: %{run}
12+
// ADDITIONAL_COMPILE_FLAGS: -fdelayed-template-parsing
1513

1614
#include <cmath>
1715
#include <cassert>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121

2222
// NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
2323
// REQUIRES: -fsized-deallocation
24-
25-
// RUN: %{build} -fsized-deallocation
26-
// RUN: %{run}
24+
// ADDITIONAL_COMPILE_FLAGS: -fsized-deallocation
2725

2826
#if !defined(__cpp_sized_deallocation)
2927
# error __cpp_sized_deallocation should be defined
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121
// NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
2222
// REQUIRES: -fsized-deallocation
23-
24-
// RUN: %{build} -fsized-deallocation -O3
25-
// RUN: %{run}
23+
// ADDITIONAL_COMPILE_FLAGS: -fsized-deallocation, -O3
2624

2725
#if !defined(__cpp_sized_deallocation)
2826
# error __cpp_sized_deallocation should be defined

0 commit comments

Comments
 (0)