[all-commits] [llvm/llvm-project] 1b4f16: [OpenMP][test] Make %p 0x prefix optional (#138514)
Rainer Orth via All-commits
all-commits at lists.llvm.org
Sat May 10 00:50:29 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1b4f161978f334197eb6902872699d3e92060d66
https://github.com/llvm/llvm-project/commit/1b4f161978f334197eb6902872699d3e92060d66
Author: Rainer Orth <ro at gcc.gnu.org>
Date: 2025-05-10 (Sat, 10 May 2025)
Changed paths:
M openmp/runtime/test/ompt/cancel/cancel_parallel.c
M openmp/runtime/test/ompt/cancel/cancel_taskgroup.c
M openmp/runtime/test/ompt/cancel/cancel_worksharing.c
M openmp/runtime/test/ompt/misc/api_calls_misc.c
M openmp/runtime/test/ompt/misc/control_tool.c
M openmp/runtime/test/ompt/misc/interoperability.cpp
M openmp/runtime/test/ompt/misc/runtime_error.c
M openmp/runtime/test/ompt/parallel/dynamic_enough_threads.c
M openmp/runtime/test/ompt/parallel/dynamic_not_enough_threads.c
M openmp/runtime/test/ompt/parallel/max_active_levels_serialized.c
M openmp/runtime/test/ompt/parallel/nested.c
M openmp/runtime/test/ompt/parallel/nested_lwt.c
M openmp/runtime/test/ompt/parallel/nested_serialized.c
M openmp/runtime/test/ompt/parallel/nested_serialized_task_frames.c
M openmp/runtime/test/ompt/parallel/nested_thread_num.c
M openmp/runtime/test/ompt/parallel/no_thread_num_clause.c
M openmp/runtime/test/ompt/parallel/normal.c
M openmp/runtime/test/ompt/parallel/not_enough_threads.c
M openmp/runtime/test/ompt/parallel/parallel_if0.c
M openmp/runtime/test/ompt/parallel/region_in_expl_task_task_frames.c
M openmp/runtime/test/ompt/parallel/repeated_calls.c
M openmp/runtime/test/ompt/parallel/serialized.c
M openmp/runtime/test/ompt/synchronization/barrier/explicit.c
M openmp/runtime/test/ompt/synchronization/barrier/for_loop.c
M openmp/runtime/test/ompt/synchronization/barrier/for_simd.c
M openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
M openmp/runtime/test/ompt/synchronization/barrier/parallel_region.c
M openmp/runtime/test/ompt/synchronization/barrier/sections.c
M openmp/runtime/test/ompt/synchronization/barrier/single.c
M openmp/runtime/test/ompt/synchronization/critical.c
M openmp/runtime/test/ompt/synchronization/flush.c
M openmp/runtime/test/ompt/synchronization/lock.c
M openmp/runtime/test/ompt/synchronization/masked.c
M openmp/runtime/test/ompt/synchronization/master.c
M openmp/runtime/test/ompt/synchronization/nest_lock.c
M openmp/runtime/test/ompt/synchronization/ordered.c
M openmp/runtime/test/ompt/synchronization/taskgroup.c
M openmp/runtime/test/ompt/synchronization/taskwait.c
M openmp/runtime/test/ompt/synchronization/test_lock.c
M openmp/runtime/test/ompt/synchronization/test_nest_lock.c
M openmp/runtime/test/ompt/synchronization/test_nest_lock_parallel.c
M openmp/runtime/test/ompt/tasks/dependences.c
M openmp/runtime/test/ompt/tasks/dependences_mutexinoutset.c
M openmp/runtime/test/ompt/tasks/explicit_task.c
M openmp/runtime/test/ompt/tasks/serialized.c
M openmp/runtime/test/ompt/tasks/task_early_fulfill.c
M openmp/runtime/test/ompt/tasks/task_if0-depend.c
M openmp/runtime/test/ompt/tasks/task_in_joinbarrier.c
M openmp/runtime/test/ompt/tasks/task_late_fulfill.c
M openmp/runtime/test/ompt/tasks/task_memory.c
M openmp/runtime/test/ompt/tasks/task_types.c
M openmp/runtime/test/ompt/tasks/task_types_serialized.c
M openmp/runtime/test/ompt/tasks/taskloop.c
M openmp/runtime/test/ompt/tasks/taskloop_dispatch.c
M openmp/runtime/test/ompt/tasks/taskwait-depend.c
M openmp/runtime/test/ompt/tasks/taskyield.c
M openmp/runtime/test/ompt/tasks/untied_task.c
M openmp/runtime/test/ompt/worksharing/for/base.h
M openmp/runtime/test/ompt/worksharing/for/base_serialized.h
M openmp/runtime/test/ompt/worksharing/for/base_split.h
M openmp/runtime/test/ompt/worksharing/sections.c
M openmp/runtime/test/ompt/worksharing/sections_dispatch.c
M openmp/runtime/test/ompt/worksharing/single.c
M openmp/runtime/test/ompt/worksharing/taskinfo/sections_serialized.c
M openmp/tools/multiplex/tests/custom_data_storage/custom_data_storage.c
M openmp/tools/multiplex/tests/print/print.c
Log Message:
-----------
[OpenMP][test] Make %p 0x prefix optional (#138514)
Testing `openmp` on Solaris/amd64 shows a large number of failures, all
due to the same issue:
```
# .---command stderr------------
# | openmp/runtime/test/ompt/misc/interoperability.cpp:67:16: error: CHECK-SAME: expected string not found in input
# | // CHECK-SAME: parent_task_frame.reenter={{0x[0-f]+}}
# | ^
# | <stdin>:5:101: note: scanning from here
# | 281474976710658: ompt_event_parallel_begin: parent_task_id=281474976710659, parent_task_frame.exit=0, parent_task_frame.reenter=7fffbedffe90, parallel_id=281474976710661, requested_team_size=2, codeptr_ra=408b8e, invoker=2
```
The testsuite expects pointers to be printed with a `0x` prefix when
using the `%p` format, while Solaris `libc` just prints them in hex
without a prefix.
However, this difference is completely benign. ISO C (up to C23,
7.23.6.1) states
```
p The argument shall be a pointer to void or a pointer to a character
type. The value of the pointer is converted to a sequence of printing
characters, in an implementation-defined manner.
```
I saw two ways around this:
- replace every instance of `%p` with a macro (`KMP_PTR_FMT`, defined as
`"%p"` or `"0x%p" as appropriate), or
- adjust the testsuite to make the `0x` prefix optional
The second route seemed less intrusive and more readable, so that's what
this patch does. While large, it's also completely mechanical.
Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list