summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test/api/omp_alloc.c
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2018-12-15 09:23:39 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2018-12-15 09:23:39 +0000
commit781a0896b0efcb788067a5fa6245d0562aefd1dd (patch)
tree79c6427c4ef5cab72cb43a89dd8f2b322d1ad4aa /openmp/runtime/test/api/omp_alloc.c
parent7643f42bdd169870df33bfa790d276add0039dcf (diff)
downloadbcm5719-llvm-781a0896b0efcb788067a5fa6245d0562aefd1dd.tar.gz
bcm5719-llvm-781a0896b0efcb788067a5fa6245d0562aefd1dd.zip
[OpenMP] Fixes for LIBOMP_OMP_VERSION=45/40
Summary: I have discovered this because i wanted to experiment with building static libomp (with openmp-4.0 support only) for debugging purposes. There are three kinds of problems here: 1. `__kmp_compare_and_store_acq()` simply does not exist. It was added in D47903 by @jlpeyton. I'm guessing `__kmp_atomic_compare_store_acq()` was meant. 2. In `__kmp_is_ticket_lock_initialized()`, `lck->lk.initialized` is `std::atomic<bool>`, while `lck` is `kmp_ticket_lock_t *`. Naturally, they can't be equality-compared. Either, it should return the value read from `lck->lk.initialized`, or do what `__kmp_is_queuing_lock_initialized()` does, compare the passed pointer with the field in the struct pointed by the pointer. I think the latter is correct-er choice here. 3. Tests were not versioned. They assume that `LIBOMP_OMP_VERSION` is at the latest version. This does not touch LIBOMP_OMP_VERSION=30. That is still broken. Reviewers: jlpeyton, Hahnfeld, AndreyChurbanov Reviewed By: AndreyChurbanov Subscribers: guansong, jfb, openmp-commits, jlpeyton Tags: #openmp Differential Revision: https://reviews.llvm.org/D55496 llvm-svn: 349260
Diffstat (limited to 'openmp/runtime/test/api/omp_alloc.c')
-rw-r--r--openmp/runtime/test/api/omp_alloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/openmp/runtime/test/api/omp_alloc.c b/openmp/runtime/test/api/omp_alloc.c
index afad4a504e3..2002adbec57 100644
--- a/openmp/runtime/test/api/omp_alloc.c
+++ b/openmp/runtime/test/api/omp_alloc.c
@@ -1,4 +1,7 @@
// RUN: %libomp-compile-and-run
+
+// REQUIRES: openmp-5.0
+
#include <stdio.h>
#include <stdint.h>
#include <omp.h>
OpenPOWER on IntegriCloud