[compiler-rt] [sanitizer_common][test] Move fork_threaded.c to Linux (PR #75480)

Rainer Orth via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 06:56:23 PST 2023


https://github.com/rorth created https://github.com/llvm/llvm-project/pull/75480

Since the new `Posix/fork_threaded.c` test was enabled for `ubsan`, the test `FAIL`s on Solaris (and most likely all other non-Linux targets):

```
FAIL: SanitizerCommon-ubsan-sparc-SunOS::fork_threaded.cpp
FAIL: SanitizerCommon-ubsan-sparcv9-SunOS::fork_threaded.cpp

/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp:79:33: error: use of undeclared identifier '__WALL'; did you mean 'P_ALL'?
   79 |     while (waitpid(-1, &status, __WALL) != pid) {
      |                                 ^~~~~~
      |                                 P_ALL
/usr/include/sys/procset.h:45:2: note: 'P_ALL' declared here
   45 |         P_ALL,          /* all processes                                */
      |         ^
```
The use of `__WALL` is unportable, AFAICS it's a glibc addition, certainly not POSIX.

This patch moves the test to `Linux` to match this.

Tested on `x86_64-pc-linux-gnu` and `amd64-pc-solaris2.11`.

>From 7863b78ea44588ea38cccce2d9cb12325f746ba4 Mon Sep 17 00:00:00 2001
From: Rainer Orth <ro at gcc.gnu.org>
Date: Thu, 14 Dec 2023 15:39:53 +0100
Subject: [PATCH] [sanitizer_common][test] Move fork_threaded.c to Linux

Since the new `Posix/fork_threaded.c` test was enabled for `ubsan`, the
test `FAIL`s on Solaris (and most likely all other non-Linux targets):

```
FAIL: SanitizerCommon-ubsan-sparc-SunOS::fork_threaded.cpp
FAIL: SanitizerCommon-ubsan-sparcv9-SunOS::fork_threaded.cpp

/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp:79:33: error: use of undeclared identifier '__WALL'; did you mean 'P_ALL'?
   79 |     while (waitpid(-1, &status, __WALL) != pid) {
      |                                 ^~~~~~
      |                                 P_ALL
/usr/include/sys/procset.h:45:2: note: 'P_ALL' declared here
   45 |         P_ALL,          /* all processes                                */
      |         ^
```
The use of `__WALL` is unportable, AFAICS it's a glibc addition, certainly
not POXIX.

This patch moves the test to `Linux` to match this.

Tested on `x86_64-pc-linux-gnu` and `amd64-pc-solaris2.11`.
---
 .../sanitizer_common/TestCases/{Posix => Linux}/fork_threaded.c   | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename compiler-rt/test/sanitizer_common/TestCases/{Posix => Linux}/fork_threaded.c (100%)

diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/fork_threaded.c
similarity index 100%
rename from compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.c
rename to compiler-rt/test/sanitizer_common/TestCases/Linux/fork_threaded.c



More information about the llvm-commits mailing list