mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-30 00:38:54 -04:00

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
24 lines
554 B
C
24 lines
554 B
C
// RUN: %libomp-compile && env OMP_MAX_TASK_PRIORITY=42 %libomp-run
|
|
// REQUIRES: openmp-4.5
|
|
// Test OMP 4.5 task priorities
|
|
// Currently only API function and envirable parsing implemented.
|
|
// Test environment sets envirable: OMP_MAX_TASK_PRIORITY=42 as tested below.
|
|
#include <stdio.h>
|
|
#include <omp.h>
|
|
|
|
int main (void) {
|
|
int passed;
|
|
|
|
passed = (omp_get_max_task_priority() == 42);
|
|
printf("Got %d\n", omp_get_max_task_priority());
|
|
|
|
if (passed) {
|
|
printf("passed\n");
|
|
return 0;
|
|
}
|
|
|
|
printf("failed\n");
|
|
return 1;
|
|
}
|
|
|