Skip to content

Commit df9a90c

Browse files
authored
[OpenMP][test] Define print_possible_return_addresses on SPARC (#138523)
Parts of the `openmp` testsuite currently don't build on SPARC due to the lack of a `print_possible_return_addresses` definition. This patch provides one. With it, the vast majority of tests `PASS` on Solaris/sparcv9 and, with an additional patch, on Linux/sparc64. The current definition was obtained empirically. Tested on `sparcv9-sun-solaris2.11`, `sparc64-unknown-linux-gnu`, `amd64-pc-solaris2.11`, and `x86_64-pc-linux-gnu`.
1 parent 2110faa commit df9a90c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

openmp/runtime/test/ompt/callback.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,14 @@ ompt_label_##id:
311311
printf("%" PRIu64 ": current_address=%p or %p or %p\n", \
312312
ompt_get_thread_data()->value, ((char *)addr) - 2, \
313313
((char *)addr) - 8, ((char *)addr) - 12)
314+
#elif KMP_ARCH_SPARC
315+
// FIXME: Need to distinguish between 32 and 64-bit SPARC?
316+
// On SPARC the NOP instruction is 4 bytes long.
317+
// FIXME: Explain. Can use __builtin_frob_return_addr?
318+
#define print_possible_return_addresses(addr) \
319+
printf("%" PRIu64 ": current_address=%p or %p\n", \
320+
ompt_get_thread_data()->value, ((char *)addr) - 12, \
321+
(char *)addr - 20)
314322
#else
315323
#error Unsupported target architecture, cannot determine address offset!
316324
#endif

0 commit comments

Comments
 (0)