From 4109d5606e23a2d422e62aabff726f8e269c5b3e Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Mon, 20 May 2019 14:21:42 +0000 Subject: [OpenMP][OMPT] Fix locking testcases for 32 bit architectures https://reviews.llvm.org/D58454 did not fix the problem for a typical use case of building LLVM with gcc or icc and then testing with the newly built clang compiler. The compilers do not agree on how to extend a 32-bit pointer to uint64, so make the pointer unsigned first, before adjusting the size. Patch by Joachim Protze Differential Revision: https://reviews.llvm.org/D58506 llvm-svn: 361158 --- openmp/runtime/test/ompt/synchronization/lock.c | 2 +- openmp/runtime/test/ompt/synchronization/nest_lock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'openmp/runtime/test') diff --git a/openmp/runtime/test/ompt/synchronization/lock.c b/openmp/runtime/test/ompt/synchronization/lock.c index c62e65520ab..2a934ee855a 100644 --- a/openmp/runtime/test/ompt/synchronization/lock.c +++ b/openmp/runtime/test/ompt/synchronization/lock.c @@ -10,7 +10,7 @@ int main() print_ids(0); omp_lock_t lock; - printf("%" PRIu64 ": &lock: %" PRIu64 "\n", ompt_get_thread_data()->value, (ompt_wait_id_t) &lock); + printf("%" PRIu64 ": &lock: %" PRIu64 "\n", ompt_get_thread_data()->value, (ompt_wait_id_t)(uintptr_t) &lock); omp_init_lock(&lock); print_fuzzy_address(1); omp_set_lock(&lock); diff --git a/openmp/runtime/test/ompt/synchronization/nest_lock.c b/openmp/runtime/test/ompt/synchronization/nest_lock.c index 60c1a014918..159048e2e74 100644 --- a/openmp/runtime/test/ompt/synchronization/nest_lock.c +++ b/openmp/runtime/test/ompt/synchronization/nest_lock.c @@ -10,7 +10,7 @@ int main() print_ids(0); omp_nest_lock_t nest_lock; - printf("%" PRIu64 ": &nest_lock: %lli\n", ompt_get_thread_data()->value, (ompt_wait_id_t) &nest_lock); + printf("%" PRIu64 ": &nest_lock: %lli\n", ompt_get_thread_data()->value, (ompt_wait_id_t)(uintptr_t) &nest_lock); omp_init_nest_lock(&nest_lock); print_fuzzy_address(1); omp_set_nest_lock(&nest_lock); -- cgit v1.2.3