[libunwind] libunwind: Enable more tests to run on FreeBSD (PR #167642)
Gleb Popov via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 18 08:45:53 PST 2025
https://github.com/arrowd updated https://github.com/llvm/llvm-project/pull/167642
>From 936acb229e7d6436409882aefea903044531367d Mon Sep 17 00:00:00 2001
From: Gleb Popov <6yearold at gmail.com>
Date: Tue, 30 Sep 2025 13:59:25 +0300
Subject: [PATCH] libunwind: Remove OS requirements from tests to make them run
on more OSes
While at it, replace "echo -ne" with "printf" for more compatibility.
---
libunwind/test/aarch64_vg_unwind.pass.cpp | 3 ++-
libunwind/test/aarch64_za_unwind.pass.cpp | 3 ++-
libunwind/test/bad_unwind_info.pass.cpp | 3 ++-
libunwind/test/eh_frame_fde_pc_range.pass.cpp | 4 ++--
libunwind/test/floatregister.pass.cpp | 3 ++-
libunwind/test/forceunwind.pass.cpp | 3 ++-
libunwind/test/remember_state_leak.pass.sh.s | 3 ++-
libunwind/test/signal_unwind.pass.cpp | 3 ++-
libunwind/test/unwind_leaffunction.pass.cpp | 3 ++-
libunwind/test/unwind_scalable_vectors.pass.cpp | 2 +-
10 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/libunwind/test/aarch64_vg_unwind.pass.cpp b/libunwind/test/aarch64_vg_unwind.pass.cpp
index 1c139a7ae9e41..60eb8b41ef3a3 100644
--- a/libunwind/test/aarch64_vg_unwind.pass.cpp
+++ b/libunwind/test/aarch64_vg_unwind.pass.cpp
@@ -6,7 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// REQUIRES: linux && target={{aarch64-.+}}
+// REQUIRES: target-aarch64
+// UNSUPPORTED: target={{.*-w64-windows-gnu}}
#include <libunwind.h>
#include <stdlib.h>
diff --git a/libunwind/test/aarch64_za_unwind.pass.cpp b/libunwind/test/aarch64_za_unwind.pass.cpp
index 2985bb8d298de..b6f975994758d 100644
--- a/libunwind/test/aarch64_za_unwind.pass.cpp
+++ b/libunwind/test/aarch64_za_unwind.pass.cpp
@@ -6,7 +6,8 @@
//
//===----------------------------------------------------------------------===//
-// REQUIRES: linux && target={{aarch64-.+}}
+// REQUIRES: target-aarch64
+// UNSUPPORTED: target={{.*-w64-windows-gnu}}
#include <libunwind.h>
#include <stdint.h>
diff --git a/libunwind/test/bad_unwind_info.pass.cpp b/libunwind/test/bad_unwind_info.pass.cpp
index 272a83f64a611..56813eef728b4 100644
--- a/libunwind/test/bad_unwind_info.pass.cpp
+++ b/libunwind/test/bad_unwind_info.pass.cpp
@@ -10,7 +10,8 @@
// Ensure that libunwind doesn't crash on invalid info; the Linux aarch64
// sigreturn frame check would previously attempt to access invalid memory in
// this scenario.
-// REQUIRES: target={{(aarch64|s390x|x86_64)-.+linux.*}}
+// REQUIRES: target={{(aarch64|s390x|x86_64)-.+}}
+// UNSUPPORTED: target={{.*-w64-windows-gnu}}
// GCC doesn't support __attribute__((naked)) on AArch64.
// UNSUPPORTED: gcc
diff --git a/libunwind/test/eh_frame_fde_pc_range.pass.cpp b/libunwind/test/eh_frame_fde_pc_range.pass.cpp
index 795ce66806f28..41bed928872c2 100644
--- a/libunwind/test/eh_frame_fde_pc_range.pass.cpp
+++ b/libunwind/test/eh_frame_fde_pc_range.pass.cpp
@@ -13,7 +13,7 @@
// clang-format off
-// REQUIRES: target={{x86_64-.+-linux-gnu}}
+// REQUIRES: target-x86_64
// REQUIRES: objcopy-available
// TODO: Figure out why this fails with Memory Sanitizer.
@@ -21,7 +21,7 @@
// RUN: %{build}
// RUN: %{objcopy} --dump-section .eh_frame_hdr=%t_ehf_hdr.bin %t.exe
-// RUN: echo -ne '\xFF' | dd of=%t_ehf_hdr.bin bs=1 seek=2 count=2 conv=notrunc status=none
+// RUN: printf '\377' | dd of=%t_ehf_hdr.bin bs=1 seek=2 count=2 conv=notrunc status=none
// RUN: %{objcopy} --update-section .eh_frame_hdr=%t_ehf_hdr.bin %t.exe
// RUN: %{exec} %t.exe
diff --git a/libunwind/test/floatregister.pass.cpp b/libunwind/test/floatregister.pass.cpp
index 018b792bd5f1e..79f49953e3fd4 100644
--- a/libunwind/test/floatregister.pass.cpp
+++ b/libunwind/test/floatregister.pass.cpp
@@ -7,7 +7,8 @@
//
//===----------------------------------------------------------------------===//
-// REQUIRES: linux && target={{aarch64-.+}}
+// REQUIRES: target-aarch64
+// UNSUPPORTED: target={{.*-w64-windows-gnu}}
// Basic test for float registers number are accepted.
diff --git a/libunwind/test/forceunwind.pass.cpp b/libunwind/test/forceunwind.pass.cpp
index 9e032fc680806..491b92a7f0942 100644
--- a/libunwind/test/forceunwind.pass.cpp
+++ b/libunwind/test/forceunwind.pass.cpp
@@ -7,7 +7,8 @@
//
//===----------------------------------------------------------------------===//
-// REQUIRES: linux
+// UNSUPPORTED: system-darwin
+// UNSUPPORTED: target={{.*-w64-windows-gnu}}
// TODO: Figure out why this fails with Memory Sanitizer.
// XFAIL: msan
diff --git a/libunwind/test/remember_state_leak.pass.sh.s b/libunwind/test/remember_state_leak.pass.sh.s
index d3335cf82290b..ed1b9735d1e68 100644
--- a/libunwind/test/remember_state_leak.pass.sh.s
+++ b/libunwind/test/remember_state_leak.pass.sh.s
@@ -6,7 +6,8 @@
#
#===------------------------------------------------------------------------===#
-# REQUIRES: target={{x86_64-.+-linux-gnu}}
+# REQUIRES: target-x86_64
+# UNSUPPORTED: target={{.*-w64-windows-gnu}}
# Inline assembly isn't supported by Memory Sanitizer
# UNSUPPORTED: msan
diff --git a/libunwind/test/signal_unwind.pass.cpp b/libunwind/test/signal_unwind.pass.cpp
index 4de271ecb886b..b39f6dad78a5d 100644
--- a/libunwind/test/signal_unwind.pass.cpp
+++ b/libunwind/test/signal_unwind.pass.cpp
@@ -8,7 +8,8 @@
//===----------------------------------------------------------------------===//
// Ensure that the unwinder can cope with the signal handler.
-// REQUIRES: target={{(aarch64|loongarch64|riscv64|s390x|x86_64)-.+linux.*}}
+// REQUIRES: target={{(aarch64|loongarch64|riscv64|s390x|x86_64)-.+}}
+// UNSUPPORTED: target={{.*-w64-windows-gnu}}
// TODO: Figure out why this fails with Memory Sanitizer.
// XFAIL: msan
diff --git a/libunwind/test/unwind_leaffunction.pass.cpp b/libunwind/test/unwind_leaffunction.pass.cpp
index d336c159c131b..d725d5fcaece4 100644
--- a/libunwind/test/unwind_leaffunction.pass.cpp
+++ b/libunwind/test/unwind_leaffunction.pass.cpp
@@ -8,7 +8,8 @@
//===----------------------------------------------------------------------===//
// Ensure that leaf function can be unwund.
-// REQUIRES: target={{(aarch64|loongarch64|riscv64|s390x|x86_64)-.+linux.*}}
+// REQUIRES: target={{(aarch64|loongarch64|riscv64|s390x|x86_64)-.+}}
+// UNSUPPORTED: target={{.*-w64-windows-gnu}}
// TODO: Figure out why this fails with Memory Sanitizer.
// XFAIL: msan
diff --git a/libunwind/test/unwind_scalable_vectors.pass.cpp b/libunwind/test/unwind_scalable_vectors.pass.cpp
index 57ef4d78244c5..458b50f12f698 100644
--- a/libunwind/test/unwind_scalable_vectors.pass.cpp
+++ b/libunwind/test/unwind_scalable_vectors.pass.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-// REQUIRES: linux && target={{riscv64-.+}}
+// REQUIRES: target-riscv64
#undef NDEBUG
#include <assert.h>
More information about the cfe-commits
mailing list