Skip to content

Commit 7078506

Browse files
authored
libcxxabi tests: disable large tests (#356)
update patches to versions in upstream review
1 parent 608f455 commit 7078506

6 files changed

+95
-36
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ set(
259259
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-Fix-llvm-test-CodeGen-ARM-build-attributes.ll-test.patch
260260
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0002-Add-check-for-building-with-picolibc.patch
261261
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0003-Run-picolibc-tests-with-qemu.patch
262-
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch)
262+
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch
263+
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-disable-large-tests.patch)
263264
FetchContent_Declare(llvmproject
264265
GIT_REPOSITORY https://github.com/llvm/llvm-project.git
265266
GIT_TAG "${llvmproject_TAG}"

patches/llvm-project/0001-Fix-llvm-test-CodeGen-ARM-build-attributes.ll-test.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From ec470a25055bec9d33cffe3183a6f70c4cedf69c Mon Sep 17 00:00:00 2001
1+
From 9efc154d6fa0a7b079cc2cdf488e58a2d3a3065b Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
33
Date: Tue, 10 Oct 2023 15:43:59 +0200
4-
Subject: [PATCH 1/4] Fix llvm/test/CodeGen/ARM/build-attributes.ll test.
4+
Subject: [PATCH 1/5] Fix llvm/test/CodeGen/ARM/build-attributes.ll test.
55

66
The test llvm/test/CodeGen/ARM/build-attributes.ll
77
needs updating to incorporate the change

patches/llvm-project/0002-Add-check-for-building-with-picolibc.patch

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 47f113bfa3cfa5c6b8c37636cedb4cf4d12d65aa Mon Sep 17 00:00:00 2001
1+
From acb9eb72087a5ca9e408c8642c316f663f91cd9f Mon Sep 17 00:00:00 2001
22
From: Michael Platings <[email protected]>
33
Date: Fri, 29 Sep 2023 09:35:52 +0100
4-
Subject: [PATCH 2/4] Add check for building with picolibc
4+
Subject: [PATCH 2/5] Add check for building with picolibc
55

66
This is intended to identify changes that would fail to build on
77
embedded platforms e.g. D152382
@@ -31,7 +31,6 @@ Differential Revision: https://reviews.llvm.org/D154246
3131
.../atomic_fetch_xor_explicit.pass.cpp | 2 +
3232
.../ctor.pass.cpp | 2 +
3333
.../depr.c.headers/fenv_h.compile.pass.cpp | 3 +
34-
.../depr.c.headers/stdio_h.compile.pass.cpp | 3 +
3534
.../depr.c.headers/uchar_h.compile.pass.cpp | 3 +
3635
.../reference_assignment.pass.cpp | 3 +
3736
.../narrow.stream.objects/cerr.sh.cpp | 2 +
@@ -50,14 +49,14 @@ Differential Revision: https://reviews.llvm.org/D154246
5049
.../time.clock.system/to_time_t.pass.cpp | 3 +
5150
.../op_-duration.pass.cpp | 3 +
5251
libcxx/utils/ci/BOT_OWNERS.txt | 2 +-
53-
libcxx/utils/ci/build-picolibc.sh | 109 ++++++++++++++++++
52+
libcxx/utils/ci/build-picolibc.sh | 111 ++++++++++++++++++
5453
libcxx/utils/ci/buildkite-pipeline.yml | 5 +
5554
libcxx/utils/ci/run-buildbot | 35 ++++++
5655
libcxx/utils/libcxx/test/features.py | 29 ++++-
5756
.../test/configs/armv7m-libc++abi.cfg.in | 33 ++++++
5857
libcxxabi/test/test_demangle.pass.cpp | 3 +
5958
.../test/configs/armv7m-libunwind.cfg.in | 33 ++++++
60-
47 files changed, 430 insertions(+), 14 deletions(-)
59+
46 files changed, 429 insertions(+), 14 deletions(-)
6160
create mode 100644 libcxx/cmake/caches/Armv7M-picolibc.cmake
6261
create mode 100644 libcxx/test/configs/armv7m-libc++.cfg.in
6362
create mode 100755 libcxx/utils/ci/build-picolibc.sh
@@ -445,20 +444,6 @@ index fda5e186c036..dcc97573d607 100644
445444
// <fenv.h>
446445

447446
#include <fenv.h>
448-
diff --git a/libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp
449-
index 55731c857ecf..af97ef2fddfb 100644
450-
--- a/libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp
451-
+++ b/libcxx/test/std/depr/depr.c.headers/stdio_h.compile.pass.cpp
452-
@@ -6,6 +6,9 @@
453-
//
454-
//===----------------------------------------------------------------------===//
455-
456-
+// stderr et al are not macros in picolibc's tinystdio.
457-
+// XFAIL: LIBCXX-PICOLIBC-FIXME
458-
+
459-
// test <stdio.h>
460-
461-
#include <stdio.h>
462447
diff --git a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
463448
index 2b6455466681..a1560c8ee585 100644
464449
--- a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
@@ -707,10 +692,10 @@ index 721b19e52d8b..de575c591383 100644
707692
708693
diff --git a/libcxx/utils/ci/build-picolibc.sh b/libcxx/utils/ci/build-picolibc.sh
709694
new file mode 100755
710-
index 000000000000..acdcabe96e96
695+
index 000000000000..078c2bdf5ebc
711696
--- /dev/null
712697
+++ b/libcxx/utils/ci/build-picolibc.sh
713-
@@ -0,0 +1,109 @@
698+
@@ -0,0 +1,111 @@
714699
+#!/usr/bin/env bash
715700
+#===----------------------------------------------------------------------===##
716701
+#
@@ -783,9 +768,11 @@ index 000000000000..acdcabe96e96
783768
+mkdir -p "${picolibc_source_dir}"
784769
+mkdir -p "${picolibc_build_dir}"
785770
+# Download the version of picolibc that was the latest at the time this script was written.
786-
+# The picolibc linker script was changed after version 1.8.2 to work with ld.lld so a
787-
+# more recent version is required, which at the time of writing is not yet released.
788-
+picolibc_commit="8dd225aa1469c03805617106020d494912c6d265"
771+
+# Following changes are required and were introduced after version 1.8.5:
772+
+# - updated semihost arguments handling,
773+
+# - added missing macros in stdio.h
774+
+# Version following 1.8.5, was not released by the time of writing.
775+
+picolibc_commit="4b9b8ef01d18cf0563348ad4af4ae89a7277e7ca"
789776
+curl -L "https://github.com/picolibc/picolibc/archive/${picolibc_commit}.zip" --output "${picolibc_source_dir}/picolibc.zip"
790777
+unzip -q "${picolibc_source_dir}/picolibc.zip" -d "${picolibc_source_dir}"
791778
+mv "${picolibc_source_dir}/picolibc-${picolibc_commit}"/* "${picolibc_source_dir}"

patches/llvm-project/0003-Run-picolibc-tests-with-qemu.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 07b092ce872453a787435f08bf3dd01bd54320d4 Mon Sep 17 00:00:00 2001
1+
From e007ef8e327bc72e379d8d2d529e492e3d018747 Mon Sep 17 00:00:00 2001
22
From: Michael Platings <[email protected]>
33
Date: Fri, 29 Sep 2023 12:23:37 +0100
4-
Subject: [PATCH 3/4] Run picolibc tests with qemu
4+
Subject: [PATCH 3/5] Run picolibc tests with qemu
55

66
Differential Revision: https://reviews.llvm.org/D155521
77
---
@@ -270,7 +270,7 @@ index 0852483a8b39..4ba17a48988b 100644
270270

271271
// file_clock
272272
diff --git a/libcxxabi/test/configs/armv7m-libc++abi.cfg.in b/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
273-
index 876f43e44bbb..91821cfd95c7 100644
273+
index 876f43e44bbb..c244e44bbe71 100644
274274
--- a/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
275275
+++ b/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
276276
@@ -17,10 +17,16 @@ config.substitutions.append(('%{link_flags}',
@@ -279,7 +279,7 @@ index 876f43e44bbb..91821cfd95c7 100644
279279
))
280280
+
281281
+config.executor = (
282-
+ '@LIBCXX_SOURCE_DIR@/utils/qemu_baremetal.py'
282+
+ '@LIBCXXABI_LIBCXX_PATH@/utils/qemu_baremetal.py'
283283
+ ' --qemu @QEMU_SYSTEM_ARM@'
284284
+ ' --machine mps2-an385'
285285
+ ' --cpu cortex-m3')
@@ -293,7 +293,7 @@ index 876f43e44bbb..91821cfd95c7 100644
293293
import os, site
294294
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
295295
diff --git a/libunwind/test/configs/armv7m-libunwind.cfg.in b/libunwind/test/configs/armv7m-libunwind.cfg.in
296-
index 6ddb6138c402..2c4467cdadc8 100644
296+
index 6ddb6138c402..48c02add6e49 100644
297297
--- a/libunwind/test/configs/armv7m-libunwind.cfg.in
298298
+++ b/libunwind/test/configs/armv7m-libunwind.cfg.in
299299
@@ -17,10 +17,16 @@ config.substitutions.append(('%{link_flags}',
@@ -302,7 +302,7 @@ index 6ddb6138c402..2c4467cdadc8 100644
302302
))
303303
+
304304
+config.executor = (
305-
+ '@LIBCXX_SOURCE_DIR@/utils/qemu_baremetal.py'
305+
+ '@LIBUNWIND_LIBCXX_PATH@/utils/qemu_baremetal.py'
306306
+ ' --qemu @QEMU_SYSTEM_ARM@'
307307
+ ' --machine mps2-an385'
308308
+ ' --cpu cortex-m3')

patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
From e7c019953cb3680b69872eaae5a0de930f091ff8 Mon Sep 17 00:00:00 2001
1+
From cf8e60c8ef9adefe24587ddcfad499d758126c11 Mon Sep 17 00:00:00 2001
22
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
33
Date: Mon, 16 Oct 2023 11:35:48 +0200
4-
Subject: [PATCH 4/4] xfail two remaining libcxx with picolibc tests
4+
Subject: [PATCH 4/5] xfail two remaining libcxx with picolibc tests
55

66
---
77
.../cmp/cmp.alg/strong_order_long_double.verify.cpp | 5 +++++
88
.../language.support/support.start.term/quick_exit.pass.cpp | 3 +++
9-
2 files changed, 8 insertions(+)
9+
libcxx/test/std/re/re.alg/re.alg.match/exponential.pass.cpp | 3 +++
10+
libcxx/test/std/re/re.alg/re.alg.search/exponential.pass.cpp | 3 +++
11+
4 files changed, 14 insertions(+)
1012

1113
diff --git a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp
1214
index fd16afeefb03..004ebc0a6bcd 100644
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 8789ad306129822ae49eb69bd05731fe366ee372 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
3+
Date: Wed, 15 Nov 2023 12:18:35 +0100
4+
Subject: [PATCH 5/5] disable large tests
5+
6+
---
7+
libcxx/test/configs/armv7m-libc++.cfg.in | 2 ++
8+
libcxxabi/test/configs/armv7m-libc++abi.cfg.in | 3 +++
9+
libcxxabi/test/test_demangle.pass.cpp | 2 +-
10+
libunwind/test/configs/armv7m-libunwind.cfg.in | 3 +++
11+
4 files changed, 9 insertions(+), 1 deletion(-)
12+
13+
diff --git a/libcxx/test/configs/armv7m-libc++.cfg.in b/libcxx/test/configs/armv7m-libc++.cfg.in
14+
index 9d8d567d7766..93c14c726bf7 100644
15+
--- a/libcxx/test/configs/armv7m-libc++.cfg.in
16+
+++ b/libcxx/test/configs/armv7m-libc++.cfg.in
17+
@@ -39,6 +39,8 @@ config.substitutions.append(('%{exec}',
18+
19+
# Long tests are prohibitively slow when run via emulation.
20+
config.long_tests = False
21+
+# The emulated target has limited memory.
22+
+config.large_tests = False
23+
24+
import os, site
25+
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
26+
diff --git a/libcxxabi/test/configs/armv7m-libc++abi.cfg.in b/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
27+
index c244e44bbe71..dc6a48ce9b55 100644
28+
--- a/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
29+
+++ b/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
30+
@@ -28,6 +28,9 @@ config.substitutions.append(('%{exec}',
31+
' --execdir %T'
32+
))
33+
34+
+# The emulated target has limited memory.
35+
+config.large_tests = False
36+
+
37+
import os, site
38+
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
39+
import libcxx.test.params, libcxx.test.config
40+
diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp
41+
index 0bc7d0db3db2..735f2b3d18bc 100644
42+
--- a/libcxxabi/test/test_demangle.pass.cpp
43+
+++ b/libcxxabi/test/test_demangle.pass.cpp
44+
@@ -10,7 +10,7 @@
45+
// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
46+
47+
// This test is too big for most embedded devices.
48+
-// XFAIL: LIBCXX-PICOLIBC-FIXME
49+
+// REQUIRES: large_tests
50+
51+
// https://llvm.org/PR51407 was not fixed in some previously-released
52+
// demanglers, which causes them to run into the infinite loop.
53+
diff --git a/libunwind/test/configs/armv7m-libunwind.cfg.in b/libunwind/test/configs/armv7m-libunwind.cfg.in
54+
index 48c02add6e49..5d66de215f83 100644
55+
--- a/libunwind/test/configs/armv7m-libunwind.cfg.in
56+
+++ b/libunwind/test/configs/armv7m-libunwind.cfg.in
57+
@@ -28,6 +28,9 @@ config.substitutions.append(('%{exec}',
58+
' --execdir %T'
59+
))
60+
61+
+# The emulated target has limited memory.
62+
+config.large_tests = False
63+
+
64+
import os, site
65+
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
66+
import libcxx.test.params, libcxx.test.config
67+
--
68+
2.34.1
69+

0 commit comments

Comments
 (0)