Skip to content

Commit 08776de

Browse files
committed
[libc++/libc++abi] Properly delimit lit substitutions
lit is not very clever when it performs substitution on RUN lines. It simply looks for a match anywhere in the line (without tokenization) and replaces it by the expansion. This means that a RUN line containing e.g. `-verify-ignore-unexpected=note` wouod be expanded to `-verify-ignore-unexpected=<substitution for not>e`, which is surprising and nonsensical. It also means that something like `%compile_module` could be expanded to `<substitution-for-%compile>_module` or to the correct substitution, depending on the order in which substitutions are evaluated by lit. To avoid such problems, it is a good habit to delimit custom substitutions with some token. This commit does that for all substitutions used in the libc++ and libc++abi test suites.
1 parent 848112c commit 08776de

File tree

44 files changed

+106
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+106
-106
lines changed

libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
//
99
// UNSUPPORTED: libcpp-has-no-threads, c++98, c++03
1010
// REQUIRES: libatomic
11-
// RUN: %build -latomic
12-
// RUN: %run
11+
// RUN: %{build} -latomic
12+
// RUN: %{run}
1313
//
1414
// GCC currently fails because it needs -fabi-version=6 to fix mangling of
1515
// std::atomic when used with __attribute__((vector(X))).

libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.sh.cpp

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

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

1212
// UNSUPPORTED: c++98, c++03
1313

libcxx/test/libcxx/depr/depr.c.headers/math_h.sh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// RUN: %compile -fsyntax-only
9+
// RUN: %{compile} -fsyntax-only
1010

1111
#ifdef _MSC_VER
1212

libcxx/test/libcxx/double_include.sh.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
// Test that we can include each header in two TU's and link them together.
1111

12-
// RUN: %cxx -c %s -o %t.first.o %flags %compile_flags
13-
// RUN: %cxx -c %s -o %t.second.o -DWITH_MAIN %flags %compile_flags
14-
// RUN: %cxx -o %t.exe %t.first.o %t.second.o %flags %link_flags
15-
// RUN: %run
12+
// RUN: %{cxx} -c %s -o %t.first.o %{flags} %{compile_flags}
13+
// RUN: %{cxx} -c %s -o %t.second.o -DWITH_MAIN %{flags} %{compile_flags}
14+
// RUN: %{cxx} -o %t.exe %t.first.o %t.second.o %{flags} %{link_flags}
15+
// RUN: %{run}
1616

1717
// Prevent <ext/hash_map> from generating deprecated warnings for this test.
1818
#if defined(__DEPRECATED)

libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
// REQUIRES: fcoroutines-ts
1111

12-
// RUN: %build -fcoroutines-ts
13-
// RUN: %run
12+
// RUN: %{build} -fcoroutines-ts
13+
// RUN: %{run}
1414

1515
// A simple "breathing" test that checks that <experimental/coroutine>
1616
// 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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// UNSUPPORTED: c++98, c++03, c++11
1111
// REQUIRES: fcoroutines-ts
1212

13-
// RUN: %build -fcoroutines-ts
14-
// RUN: %run
13+
// RUN: %{build} -fcoroutines-ts
14+
// RUN: %{run}
1515

1616
#include <experimental/coroutine>
1717

libcxx/test/libcxx/include_as_c.sh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// NOTE: It's not common or recommended to have libc++ in the header search
1313
// path when compiling C files, but it does happen often enough.
1414

15-
// RUN: %cxx -c -xc %s -fsyntax-only %flags %compile_flags -std=c99
15+
// RUN: %{cxx} -c -xc %s -fsyntax-only %{flags} %{compile_flags} -std=c99
1616

1717
#include <complex.h>
1818
#include <ctype.h>

libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.sh.cpp

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

1313
// class directory_entry
1414

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

1818
#include "filesystem_include.h"
1919
#include <type_traits>

libcxx/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp

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

1313
// typedef TrivialClock file_time_type;
1414

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

1818
#include <filesystem>
1919
#include <chrono>

libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
// GCC doesn't support the aligned-allocation flags.
4040
// XFAIL: gcc
4141

42-
// RUN: %build -faligned-allocation -fsized-deallocation
43-
// RUN: %run
44-
// RUN: %build -faligned-allocation -fno-sized-deallocation -DNO_SIZE
45-
// RUN: %run
46-
// RUN: %build -fno-aligned-allocation -fsized-deallocation -DNO_ALIGN
47-
// RUN: %run
48-
// RUN: %build -fno-aligned-allocation -fno-sized-deallocation -DNO_ALIGN -DNO_SIZE
49-
// RUN: %run
42+
// RUN: %{build} -faligned-allocation -fsized-deallocation
43+
// RUN: %{run}
44+
// RUN: %{build} -faligned-allocation -fno-sized-deallocation -DNO_SIZE
45+
// RUN: %{run}
46+
// RUN: %{build} -fno-aligned-allocation -fsized-deallocation -DNO_ALIGN
47+
// RUN: %{run}
48+
// RUN: %{build} -fno-aligned-allocation -fno-sized-deallocation -DNO_ALIGN -DNO_SIZE
49+
// RUN: %{run}
5050

5151
#include <new>
5252
#include <typeinfo>

0 commit comments

Comments
 (0)