Skip to content

Commit 2574cab

Browse files
authored
[NFC] Remove BLOCKLIT workaround. (#91001)
Lit already has support for stopping LIT from parsing further test directives. It is // END. After that directive, LIT will stop parsing. This change removes the BLOCKLIT hack and replaces it with END.
1 parent c18bcd0 commit 2574cab

File tree

4 files changed

+49
-42
lines changed

4 files changed

+49
-42
lines changed

libcxx/test/libcxx/clang_modules_include.gen.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,36 @@
1212

1313
# RUN: %{python} %s %{libcxx-dir}/utils
1414

15+
# block Lit from interpreting a RUN/XFAIL/etc inside the generation script
16+
# END.
17+
1518
import sys
1619
sys.path.append(sys.argv[1])
1720
from libcxx.header_information import lit_header_restrictions, public_headers
1821

19-
BLOCKLIT = '' # block Lit from interpreting a RUN/XFAIL/etc inside the generation script
20-
2122
for header in public_headers:
2223
print(f"""\
2324
//--- {header}.compile.pass.cpp
24-
// RUN{BLOCKLIT}: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
25+
// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
2526
2627
// GCC doesn't support -fcxx-modules
27-
// UNSUPPORTED{BLOCKLIT}: gcc
28+
// UNSUPPORTED: gcc
2829
2930
// The Windows headers don't appear to be compatible with modules
30-
// UNSUPPORTED{BLOCKLIT}: windows
31-
// UNSUPPORTED{BLOCKLIT}: buildhost=windows
31+
// UNSUPPORTED: windows
32+
// UNSUPPORTED: buildhost=windows
3233
3334
// The AIX headers don't appear to be compatible with modules
34-
// UNSUPPORTED{BLOCKLIT}: LIBCXX-AIX-FIXME
35+
// UNSUPPORTED: LIBCXX-AIX-FIXME
3536
3637
// The Android headers don't appear to be compatible with modules yet
37-
// UNSUPPORTED{BLOCKLIT}: LIBCXX-ANDROID-FIXME
38+
// UNSUPPORTED: LIBCXX-ANDROID-FIXME
3839
3940
// TODO: Investigate this failure
40-
// UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME
41+
// UNSUPPORTED: LIBCXX-FREEBSD-FIXME
4142
4243
// TODO: Investigate this failure
43-
// UNSUPPORTED{BLOCKLIT}: LIBCXX-PICOLIBC-FIXME
44+
// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME
4445
4546
{lit_header_restrictions.get(header, '')}
4647
@@ -49,25 +50,25 @@
4950

5051
print(f"""\
5152
//--- __std_clang_module.compile.pass.mm
52-
// RUN{BLOCKLIT}: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
53+
// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
5354
54-
// REQUIRES{BLOCKLIT}: clang-modules-build
55+
// REQUIRES: clang-modules-build
5556
5657
// GCC doesn't support -fcxx-modules
57-
// UNSUPPORTED{BLOCKLIT}: gcc
58+
// UNSUPPORTED: gcc
5859
5960
// The Windows headers don't appear to be compatible with modules
60-
// UNSUPPORTED{BLOCKLIT}: windows
61-
// UNSUPPORTED{BLOCKLIT}: buildhost=windows
61+
// UNSUPPORTED: windows
62+
// UNSUPPORTED: buildhost=windows
6263
6364
// The AIX headers don't appear to be compatible with modules
64-
// UNSUPPORTED{BLOCKLIT}: LIBCXX-AIX-FIXME
65+
// UNSUPPORTED: LIBCXX-AIX-FIXME
6566
6667
// The Android headers don't appear to be compatible with modules yet
67-
// UNSUPPORTED{BLOCKLIT}: LIBCXX-ANDROID-FIXME
68+
// UNSUPPORTED: LIBCXX-ANDROID-FIXME
6869
6970
// TODO: Investigate this failure
70-
// UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME
71+
// UNSUPPORTED: LIBCXX-FREEBSD-FIXME
7172
7273
@import std;
7374

libcxx/test/libcxx/clang_tidy.gen.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,27 @@
1010

1111
# RUN: %{python} %s %{libcxx-dir}/utils
1212

13+
# block Lit from interpreting a RUN/XFAIL/etc inside the generation script
14+
# END.
15+
1316
import sys
1417
sys.path.append(sys.argv[1])
1518
from libcxx.header_information import lit_header_restrictions, public_headers
1619

1720
for header in public_headers:
18-
BLOCKLIT = '' # block Lit from interpreting a RUN/XFAIL/etc inside the generation script
1921
print(f"""\
2022
//--- {header}.sh.cpp
2123
22-
// REQUIRES{BLOCKLIT}: has-clang-tidy
24+
// REQUIRES: has-clang-tidy
2325
2426
// The GCC compiler flags are not always compatible with clang-tidy.
25-
// UNSUPPORTED{BLOCKLIT}: gcc
27+
// UNSUPPORTED: gcc
2628
2729
{lit_header_restrictions.get(header, '')}
2830
2931
// TODO: run clang-tidy with modules enabled once they are supported
30-
// RUN{BLOCKLIT}: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- %{{compile_flags}} -fno-modules
31-
// RUN{BLOCKLIT}: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy -- -Wweak-vtables %{{compile_flags}} -fno-modules
32+
// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- %{{compile_flags}} -fno-modules
33+
// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy -- -Wweak-vtables %{{compile_flags}} -fno-modules
3234
3335
#include <{header}>
3436
""")

libcxx/test/libcxx/double_include.gen.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@
1010

1111
# RUN: %{python} %s %{libcxx-dir}/utils
1212

13+
# Block Lit from interpreting a RUN/XFAIL/etc inside the generation script.
14+
# END.
15+
1316
import sys
1417
sys.path.append(sys.argv[1])
1518
from libcxx.header_information import lit_header_restrictions, public_headers
1619

1720
for header in public_headers:
18-
BLOCKLIT = '' # block Lit from interpreting a RUN/XFAIL/etc inside the generation script
1921
print(f"""\
2022
//--- {header}.sh.cpp
2123
{lit_header_restrictions.get(header, '')}
2224
23-
// RUN{BLOCKLIT}: %{{cxx}} -c %s -o %t.first.o %{{flags}} %{{compile_flags}}
24-
// RUN{BLOCKLIT}: %{{cxx}} -c %s -o %t.second.o -DWITH_MAIN %{{flags}} %{{compile_flags}}
25-
// RUN{BLOCKLIT}: %{{cxx}} -o %t.exe %t.first.o %t.second.o %{{flags}} %{{link_flags}}
26-
// RUN{BLOCKLIT}: %{{run}}
25+
// RUN: %{{cxx}} -c %s -o %t.first.o %{{flags}} %{{compile_flags}}
26+
// RUN: %{{cxx}} -c %s -o %t.second.o -DWITH_MAIN %{{flags}} %{{compile_flags}}
27+
// RUN: %{{cxx}} -o %t.exe %t.first.o %t.second.o %{{flags}} %{{link_flags}}
28+
// RUN: %{{run}}
2729
2830
#include <{header}>
2931

libcxx/test/libcxx/transitive_includes.gen.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
# RUN: %{python} %s %{libcxx-dir}/utils
2020

21+
# block Lit from interpreting a RUN/XFAIL/etc inside the generation script
22+
# END.
23+
2124
import sys
2225
sys.path.append(sys.argv[1])
2326
from libcxx.header_information import lit_header_restrictions, public_headers
@@ -29,11 +32,10 @@
2932
# for std in c++03 c++11 c++14 c++17 c++20 c++23 c++26; do <build>/bin/llvm-lit --param std=$std libcxx/test/libcxx/transitive_includes.gen.py; done
3033
regenerate_expected_results = False
3134

32-
BLOCKLIT = '' # block Lit from interpreting a RUN/XFAIL/etc inside the generation script
3335
if regenerate_expected_results:
3436
print(f"""\
3537
//--- generate-transitive-includes.sh.cpp
36-
// RUN{BLOCKLIT}: mkdir %t
38+
// RUN: mkdir %t
3739
""")
3840

3941
all_traces = []
@@ -43,12 +45,12 @@
4345

4446
normalized_header = re.sub('/', '_', header)
4547
print(f"""\
46-
// RUN{BLOCKLIT}: echo "#include <{header}>" | %{{cxx}} -xc++ - %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.{normalized_header}.txt
48+
// RUN: echo "#include <{header}>" | %{{cxx}} -xc++ - %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.{normalized_header}.txt
4749
""")
4850
all_traces.append(f'%t/trace-includes.{normalized_header}.txt')
4951

5052
print(f"""\
51-
// RUN{BLOCKLIT}: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes_to_csv.py {' '.join(all_traces)} > %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv
53+
// RUN: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes_to_csv.py {' '.join(all_traces)} > %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv
5254
""")
5355

5456
else:
@@ -64,27 +66,27 @@
6466
{lit_header_restrictions.get(header, '')}
6567
6668
// TODO: Fix this test to make it work with localization or wide characters disabled
67-
// UNSUPPORTED{BLOCKLIT}: no-localization, no-wide-characters, no-threads, no-filesystem, libcpp-has-no-experimental-tzdb, no-tzdb
69+
// UNSUPPORTED: no-localization, no-wide-characters, no-threads, no-filesystem, libcpp-has-no-experimental-tzdb, no-tzdb
6870
6971
// When built with modules, this test doesn't work because --trace-includes doesn't
7072
// report the stack of includes correctly.
71-
// UNSUPPORTED{BLOCKLIT}: clang-modules-build
73+
// UNSUPPORTED: clang-modules-build
7274
7375
// This test uses --trace-includes, which is not supported by GCC.
74-
// UNSUPPORTED{BLOCKLIT}: gcc
76+
// UNSUPPORTED: gcc
7577
7678
// This test is not supported when we remove the transitive includes provided for backwards
7779
// compatibility. When we bulk-remove them, we'll adjust the includes that are expected by
7880
// this test instead.
79-
// UNSUPPORTED{BLOCKLIT}: transitive-includes-disabled
81+
// UNSUPPORTED: transitive-includes-disabled
8082
8183
// TODO: Figure out why <stdatomic.h> doesn't work on FreeBSD
82-
// UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME
84+
// UNSUPPORTED: LIBCXX-FREEBSD-FIXME
8385
84-
// RUN{BLOCKLIT}: mkdir %t
85-
// RUN{BLOCKLIT}: %{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
86-
// RUN{BLOCKLIT}: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes_to_csv.py %t/trace-includes.txt > %t/actual_transitive_includes.csv
87-
// RUN{BLOCKLIT}: cat %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{escaped_header} / {{ print }}' > %t/expected_transitive_includes.csv
88-
// RUN{BLOCKLIT}: diff -w %t/expected_transitive_includes.csv %t/actual_transitive_includes.csv
86+
// RUN: mkdir %t
87+
// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
88+
// RUN: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes_to_csv.py %t/trace-includes.txt > %t/actual_transitive_includes.csv
89+
// RUN: cat %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{escaped_header} / {{ print }}' > %t/expected_transitive_includes.csv
90+
// RUN: diff -w %t/expected_transitive_includes.csv %t/actual_transitive_includes.csv
8991
#include <{header}>
9092
""")

0 commit comments

Comments
 (0)