Skip to content

Commit

Permalink
libcxxabi tests: disable large tests (#356)
Browse files Browse the repository at this point in the history
update patches to versions in upstream review
  • Loading branch information
domin144 authored Nov 15, 2023
1 parent 608f455 commit 7078506
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 36 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ set(
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0001-Fix-llvm-test-CodeGen-ARM-build-attributes.ll-test.patch
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0002-Add-check-for-building-with-picolibc.patch
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0003-Run-picolibc-tests-with-qemu.patch
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch)
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0004-xfail-two-remaining-libcxx-with-picolibc-tests.patch
${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm-project/0005-disable-large-tests.patch)
FetchContent_Declare(llvmproject
GIT_REPOSITORY https://github.com/llvm/llvm-project.git
GIT_TAG "${llvmproject_TAG}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ec470a25055bec9d33cffe3183a6f70c4cedf69c Mon Sep 17 00:00:00 2001
From 9efc154d6fa0a7b079cc2cdf488e58a2d3a3065b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
Date: Tue, 10 Oct 2023 15:43:59 +0200
Subject: [PATCH 1/4] Fix llvm/test/CodeGen/ARM/build-attributes.ll test.
Subject: [PATCH 1/5] Fix llvm/test/CodeGen/ARM/build-attributes.ll test.

The test llvm/test/CodeGen/ARM/build-attributes.ll
needs updating to incorporate the change
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 47f113bfa3cfa5c6b8c37636cedb4cf4d12d65aa Mon Sep 17 00:00:00 2001
From acb9eb72087a5ca9e408c8642c316f663f91cd9f Mon Sep 17 00:00:00 2001
From: Michael Platings <[email protected]>
Date: Fri, 29 Sep 2023 09:35:52 +0100
Subject: [PATCH 2/4] Add check for building with picolibc
Subject: [PATCH 2/5] Add check for building with picolibc

This is intended to identify changes that would fail to build on
embedded platforms e.g. D152382
Expand Down Expand Up @@ -31,7 +31,6 @@ Differential Revision: https://reviews.llvm.org/D154246
.../atomic_fetch_xor_explicit.pass.cpp | 2 +
.../ctor.pass.cpp | 2 +
.../depr.c.headers/fenv_h.compile.pass.cpp | 3 +
.../depr.c.headers/stdio_h.compile.pass.cpp | 3 +
.../depr.c.headers/uchar_h.compile.pass.cpp | 3 +
.../reference_assignment.pass.cpp | 3 +
.../narrow.stream.objects/cerr.sh.cpp | 2 +
Expand All @@ -50,14 +49,14 @@ Differential Revision: https://reviews.llvm.org/D154246
.../time.clock.system/to_time_t.pass.cpp | 3 +
.../op_-duration.pass.cpp | 3 +
libcxx/utils/ci/BOT_OWNERS.txt | 2 +-
libcxx/utils/ci/build-picolibc.sh | 109 ++++++++++++++++++
libcxx/utils/ci/build-picolibc.sh | 111 ++++++++++++++++++
libcxx/utils/ci/buildkite-pipeline.yml | 5 +
libcxx/utils/ci/run-buildbot | 35 ++++++
libcxx/utils/libcxx/test/features.py | 29 ++++-
.../test/configs/armv7m-libc++abi.cfg.in | 33 ++++++
libcxxabi/test/test_demangle.pass.cpp | 3 +
.../test/configs/armv7m-libunwind.cfg.in | 33 ++++++
47 files changed, 430 insertions(+), 14 deletions(-)
46 files changed, 429 insertions(+), 14 deletions(-)
create mode 100644 libcxx/cmake/caches/Armv7M-picolibc.cmake
create mode 100644 libcxx/test/configs/armv7m-libc++.cfg.in
create mode 100755 libcxx/utils/ci/build-picolibc.sh
Expand Down Expand Up @@ -445,20 +444,6 @@ index fda5e186c036..dcc97573d607 100644
// <fenv.h>

#include <fenv.h>
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
index 55731c857ecf..af97ef2fddfb 100644
--- 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
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//

+// stderr et al are not macros in picolibc's tinystdio.
+// XFAIL: LIBCXX-PICOLIBC-FIXME
+
// test <stdio.h>

#include <stdio.h>
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
index 2b6455466681..a1560c8ee585 100644
--- a/libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
Expand Down Expand Up @@ -707,10 +692,10 @@ index 721b19e52d8b..de575c591383 100644
E: [email protected]
diff --git a/libcxx/utils/ci/build-picolibc.sh b/libcxx/utils/ci/build-picolibc.sh
new file mode 100755
index 000000000000..acdcabe96e96
index 000000000000..078c2bdf5ebc
--- /dev/null
+++ b/libcxx/utils/ci/build-picolibc.sh
@@ -0,0 +1,109 @@
@@ -0,0 +1,111 @@
+#!/usr/bin/env bash
+#===----------------------------------------------------------------------===##
+#
Expand Down Expand Up @@ -783,9 +768,11 @@ index 000000000000..acdcabe96e96
+mkdir -p "${picolibc_source_dir}"
+mkdir -p "${picolibc_build_dir}"
+# Download the version of picolibc that was the latest at the time this script was written.
+# The picolibc linker script was changed after version 1.8.2 to work with ld.lld so a
+# more recent version is required, which at the time of writing is not yet released.
+picolibc_commit="8dd225aa1469c03805617106020d494912c6d265"
+# Following changes are required and were introduced after version 1.8.5:
+# - updated semihost arguments handling,
+# - added missing macros in stdio.h
+# Version following 1.8.5, was not released by the time of writing.
+picolibc_commit="4b9b8ef01d18cf0563348ad4af4ae89a7277e7ca"
+curl -L "https://github.com/picolibc/picolibc/archive/${picolibc_commit}.zip" --output "${picolibc_source_dir}/picolibc.zip"
+unzip -q "${picolibc_source_dir}/picolibc.zip" -d "${picolibc_source_dir}"
+mv "${picolibc_source_dir}/picolibc-${picolibc_commit}"/* "${picolibc_source_dir}"
Expand Down
12 changes: 6 additions & 6 deletions patches/llvm-project/0003-Run-picolibc-tests-with-qemu.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 07b092ce872453a787435f08bf3dd01bd54320d4 Mon Sep 17 00:00:00 2001
From e007ef8e327bc72e379d8d2d529e492e3d018747 Mon Sep 17 00:00:00 2001
From: Michael Platings <[email protected]>
Date: Fri, 29 Sep 2023 12:23:37 +0100
Subject: [PATCH 3/4] Run picolibc tests with qemu
Subject: [PATCH 3/5] Run picolibc tests with qemu

Differential Revision: https://reviews.llvm.org/D155521
---
Expand Down Expand Up @@ -270,7 +270,7 @@ index 0852483a8b39..4ba17a48988b 100644

// file_clock
diff --git a/libcxxabi/test/configs/armv7m-libc++abi.cfg.in b/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
index 876f43e44bbb..91821cfd95c7 100644
index 876f43e44bbb..c244e44bbe71 100644
--- a/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
+++ b/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
@@ -17,10 +17,16 @@ config.substitutions.append(('%{link_flags}',
Expand All @@ -279,7 +279,7 @@ index 876f43e44bbb..91821cfd95c7 100644
))
+
+config.executor = (
+ '@LIBCXX_SOURCE_DIR@/utils/qemu_baremetal.py'
+ '@LIBCXXABI_LIBCXX_PATH@/utils/qemu_baremetal.py'
+ ' --qemu @QEMU_SYSTEM_ARM@'
+ ' --machine mps2-an385'
+ ' --cpu cortex-m3')
Expand All @@ -293,7 +293,7 @@ index 876f43e44bbb..91821cfd95c7 100644
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
diff --git a/libunwind/test/configs/armv7m-libunwind.cfg.in b/libunwind/test/configs/armv7m-libunwind.cfg.in
index 6ddb6138c402..2c4467cdadc8 100644
index 6ddb6138c402..48c02add6e49 100644
--- a/libunwind/test/configs/armv7m-libunwind.cfg.in
+++ b/libunwind/test/configs/armv7m-libunwind.cfg.in
@@ -17,10 +17,16 @@ config.substitutions.append(('%{link_flags}',
Expand All @@ -302,7 +302,7 @@ index 6ddb6138c402..2c4467cdadc8 100644
))
+
+config.executor = (
+ '@LIBCXX_SOURCE_DIR@/utils/qemu_baremetal.py'
+ '@LIBUNWIND_LIBCXX_PATH@/utils/qemu_baremetal.py'
+ ' --qemu @QEMU_SYSTEM_ARM@'
+ ' --machine mps2-an385'
+ ' --cpu cortex-m3')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
From e7c019953cb3680b69872eaae5a0de930f091ff8 Mon Sep 17 00:00:00 2001
From cf8e60c8ef9adefe24587ddcfad499d758126c11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
Date: Mon, 16 Oct 2023 11:35:48 +0200
Subject: [PATCH 4/4] xfail two remaining libcxx with picolibc tests
Subject: [PATCH 4/5] xfail two remaining libcxx with picolibc tests

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

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
index fd16afeefb03..004ebc0a6bcd 100644
Expand Down
69 changes: 69 additions & 0 deletions patches/llvm-project/0005-disable-large-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
From 8789ad306129822ae49eb69bd05731fe366ee372 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <[email protected]>
Date: Wed, 15 Nov 2023 12:18:35 +0100
Subject: [PATCH 5/5] disable large tests

---
libcxx/test/configs/armv7m-libc++.cfg.in | 2 ++
libcxxabi/test/configs/armv7m-libc++abi.cfg.in | 3 +++
libcxxabi/test/test_demangle.pass.cpp | 2 +-
libunwind/test/configs/armv7m-libunwind.cfg.in | 3 +++
4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libcxx/test/configs/armv7m-libc++.cfg.in b/libcxx/test/configs/armv7m-libc++.cfg.in
index 9d8d567d7766..93c14c726bf7 100644
--- a/libcxx/test/configs/armv7m-libc++.cfg.in
+++ b/libcxx/test/configs/armv7m-libc++.cfg.in
@@ -39,6 +39,8 @@ config.substitutions.append(('%{exec}',

# Long tests are prohibitively slow when run via emulation.
config.long_tests = False
+# The emulated target has limited memory.
+config.large_tests = False

import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
diff --git a/libcxxabi/test/configs/armv7m-libc++abi.cfg.in b/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
index c244e44bbe71..dc6a48ce9b55 100644
--- a/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
+++ b/libcxxabi/test/configs/armv7m-libc++abi.cfg.in
@@ -28,6 +28,9 @@ config.substitutions.append(('%{exec}',
' --execdir %T'
))

+# The emulated target has limited memory.
+config.large_tests = False
+
import os, site
site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.config
diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp
index 0bc7d0db3db2..735f2b3d18bc 100644
--- a/libcxxabi/test/test_demangle.pass.cpp
+++ b/libcxxabi/test/test_demangle.pass.cpp
@@ -10,7 +10,7 @@
// XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}

// This test is too big for most embedded devices.
-// XFAIL: LIBCXX-PICOLIBC-FIXME
+// REQUIRES: large_tests

// https://llvm.org/PR51407 was not fixed in some previously-released
// demanglers, which causes them to run into the infinite loop.
diff --git a/libunwind/test/configs/armv7m-libunwind.cfg.in b/libunwind/test/configs/armv7m-libunwind.cfg.in
index 48c02add6e49..5d66de215f83 100644
--- a/libunwind/test/configs/armv7m-libunwind.cfg.in
+++ b/libunwind/test/configs/armv7m-libunwind.cfg.in
@@ -28,6 +28,9 @@ config.substitutions.append(('%{exec}',
' --execdir %T'
))

+# The emulated target has limited memory.
+config.large_tests = False
+
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.config
--
2.34.1

0 comments on commit 7078506

Please sign in to comment.