summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test
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
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')
-rw-r--r--openmp/runtime/test/api/omp_alloc.c3
-rw-r--r--openmp/runtime/test/lit.cfg9
-rw-r--r--openmp/runtime/test/lit.site.cfg.in1
-rw-r--r--openmp/runtime/test/ompt/misc/control_tool_no_ompt_support.c3
-rw-r--r--openmp/runtime/test/tasking/bug_nested_proxy_task.c1
-rw-r--r--openmp/runtime/test/tasking/bug_proxy_task_dep_waiting.c1
-rw-r--r--openmp/runtime/test/tasking/kmp_task_reduction_nest.cpp1
-rw-r--r--openmp/runtime/test/tasking/kmp_taskloop.c1
-rw-r--r--openmp/runtime/test/tasking/omp_task_priority.c1
-rw-r--r--openmp/runtime/test/tasking/omp_taskloop_grainsize.c1
-rw-r--r--openmp/runtime/test/tasking/omp_taskloop_num_tasks.c1
-rw-r--r--openmp/runtime/test/worksharing/for/kmp_doacross_check.c1
-rw-r--r--openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c1
-rw-r--r--openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c1
-rw-r--r--openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c1
-rw-r--r--openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c1
-rw-r--r--openmp/runtime/test/worksharing/for/omp_doacross.c1
17 files changed, 29 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>
diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index 82c3fd46c1d..48d2f2a2190 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -91,6 +91,15 @@ if config.has_ompt:
# for callback.h
config.test_flags += " -I " + config.test_source_root + "/ompt"
+if config.libomp_omp_version >= 50:
+ config.available_features.add("openmp-5.0")
+
+if config.libomp_omp_version >= 45:
+ config.available_features.add("openmp-4.5")
+
+if config.libomp_omp_version >= 40:
+ config.available_features.add("openmp-4.0")
+
if 'Linux' in config.operating_system:
config.available_features.add("linux")
diff --git a/openmp/runtime/test/lit.site.cfg.in b/openmp/runtime/test/lit.site.cfg.in
index c2825ee4eab..0964cfceabc 100644
--- a/openmp/runtime/test/lit.site.cfg.in
+++ b/openmp/runtime/test/lit.site.cfg.in
@@ -6,6 +6,7 @@ config.test_compiler_features = @OPENMP_TEST_COMPILER_FEATURES@
config.test_filecheck = "@OPENMP_FILECHECK_EXECUTABLE@"
config.test_openmp_flags = "@OPENMP_TEST_OPENMP_FLAGS@"
config.test_extra_flags = "@OPENMP_TEST_FLAGS@"
+config.libomp_omp_version = @LIBOMP_OMP_VERSION@
config.libomp_obj_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.library_dir = "@LIBOMP_LIBRARY_DIR@"
config.omp_header_directory = "@LIBOMP_BINARY_DIR@/src"
diff --git a/openmp/runtime/test/ompt/misc/control_tool_no_ompt_support.c b/openmp/runtime/test/ompt/misc/control_tool_no_ompt_support.c
index ee64da04f0d..23daf8b313d 100644
--- a/openmp/runtime/test/ompt/misc/control_tool_no_ompt_support.c
+++ b/openmp/runtime/test/ompt/misc/control_tool_no_ompt_support.c
@@ -1,4 +1,7 @@
// RUN: %libomp-compile-and-run
+
+// REQUIRES: openmp-5.0
+
#include <omp.h>
int main()
diff --git a/openmp/runtime/test/tasking/bug_nested_proxy_task.c b/openmp/runtime/test/tasking/bug_nested_proxy_task.c
index 6c0082236e0..84e4dfda9cc 100644
--- a/openmp/runtime/test/tasking/bug_nested_proxy_task.c
+++ b/openmp/runtime/test/tasking/bug_nested_proxy_task.c
@@ -1,4 +1,5 @@
// RUN: %libomp-compile -lpthread && %libomp-run
+// REQUIRES: openmp-4.5
// The runtime currently does not get dependency information from GCC.
// UNSUPPORTED: gcc
diff --git a/openmp/runtime/test/tasking/bug_proxy_task_dep_waiting.c b/openmp/runtime/test/tasking/bug_proxy_task_dep_waiting.c
index e6dd895fe1b..fe8f18db913 100644
--- a/openmp/runtime/test/tasking/bug_proxy_task_dep_waiting.c
+++ b/openmp/runtime/test/tasking/bug_proxy_task_dep_waiting.c
@@ -1,4 +1,5 @@
// RUN: %libomp-compile -lpthread && %libomp-run
+// REQUIRES: openmp-4.5
// The runtime currently does not get dependency information from GCC.
// UNSUPPORTED: gcc
diff --git a/openmp/runtime/test/tasking/kmp_task_reduction_nest.cpp b/openmp/runtime/test/tasking/kmp_task_reduction_nest.cpp
index 63dffe44dad..019a9feadfd 100644
--- a/openmp/runtime/test/tasking/kmp_task_reduction_nest.cpp
+++ b/openmp/runtime/test/tasking/kmp_task_reduction_nest.cpp
@@ -1,5 +1,6 @@
// RUN: %libomp-cxx-compile-and-run
// RUN: %libomp-cxx-compile -DFLG=1 && %libomp-run
+// REQUIRES: openmp-5.0
// GCC-5 is needed for OpenMP 4.0 support (taskgroup)
// XFAIL: gcc-4
#include <cstdio>
diff --git a/openmp/runtime/test/tasking/kmp_taskloop.c b/openmp/runtime/test/tasking/kmp_taskloop.c
index 4b137933bb0..359f7a4ae91 100644
--- a/openmp/runtime/test/tasking/kmp_taskloop.c
+++ b/openmp/runtime/test/tasking/kmp_taskloop.c
@@ -1,5 +1,6 @@
// RUN: %libomp-compile-and-run
// RUN: %libomp-compile && env KMP_TASKLOOP_MIN_TASKS=1 %libomp-run
+// REQUIRES: openmp-4.5
#include <stdio.h>
#include <omp.h>
#include "omp_my_sleep.h"
diff --git a/openmp/runtime/test/tasking/omp_task_priority.c b/openmp/runtime/test/tasking/omp_task_priority.c
index 7b623601733..6acb4a804e8 100644
--- a/openmp/runtime/test/tasking/omp_task_priority.c
+++ b/openmp/runtime/test/tasking/omp_task_priority.c
@@ -1,4 +1,5 @@
// 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.
diff --git a/openmp/runtime/test/tasking/omp_taskloop_grainsize.c b/openmp/runtime/test/tasking/omp_taskloop_grainsize.c
index 0833073efb2..c5756a481a1 100644
--- a/openmp/runtime/test/tasking/omp_taskloop_grainsize.c
+++ b/openmp/runtime/test/tasking/omp_taskloop_grainsize.c
@@ -1,5 +1,6 @@
// RUN: %libomp-compile-and-run
// RUN: %libomp-compile && env KMP_TASKLOOP_MIN_TASKS=1 %libomp-run
+// REQUIRES: openmp-4.5
// These compilers don't support the taskloop construct
// UNSUPPORTED: gcc-4, gcc-5, icc-16
diff --git a/openmp/runtime/test/tasking/omp_taskloop_num_tasks.c b/openmp/runtime/test/tasking/omp_taskloop_num_tasks.c
index 7c3c7042af3..75efea6e1c6 100644
--- a/openmp/runtime/test/tasking/omp_taskloop_num_tasks.c
+++ b/openmp/runtime/test/tasking/omp_taskloop_num_tasks.c
@@ -1,5 +1,6 @@
// RUN: %libomp-compile-and-run
// RUN: %libomp-compile && env KMP_TASKLOOP_MIN_TASKS=1 %libomp-run
+// REQUIRES: openmp-4.5
// These compilers don't support the taskloop construct
// UNSUPPORTED: gcc-4, gcc-5, icc-16
diff --git a/openmp/runtime/test/worksharing/for/kmp_doacross_check.c b/openmp/runtime/test/worksharing/for/kmp_doacross_check.c
index 59b61e32eb1..4eea328833a 100644
--- a/openmp/runtime/test/worksharing/for/kmp_doacross_check.c
+++ b/openmp/runtime/test/worksharing/for/kmp_doacross_check.c
@@ -1,4 +1,5 @@
// RUN: %libomp-compile-and-run
+// REQUIRES: openmp-4.5
// UNSUPPORTED: gcc
// This test is incompatible with gcc because of the explicit call to
// __kmpc_doacross_fini(). gcc relies on an implicit call to this function
diff --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
index 5c6f94bc729..6cf5d2ff822 100644
--- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
+++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
@@ -1,4 +1,5 @@
// RUN: %libomp-compile-and-run
+// REQUIRES: openmp-4.5
/*
Test for the 'schedule(simd:guided)' clause.
Compiler needs to generate a dynamic dispatching and pass the schedule
diff --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c
index 987a5c0d459..8b5f34a8c3f 100644
--- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c
+++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c
@@ -1,4 +1,5 @@
// RUN: %libomp-compile-and-run
+// REQUIRES: openmp-4.5
// The test checks schedule(simd:runtime)
// in combination with omp_set_schedule()
diff --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c
index 5dfaf24185e..142e9b36334 100644
--- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c
+++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c
@@ -6,6 +6,7 @@
// RUN: env OMP_SCHEDULE=dynamic,1 %libomp-run 1
// RUN: env OMP_SCHEDULE=dynamic,2 %libomp-run 2
// RUN: env OMP_SCHEDULE=auto %libomp-run
+// REQUIRES: openmp-4.5
// The test checks schedule(simd:runtime)
// in combination with OMP_SCHEDULE=guided[,chunk]
diff --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c
index d76046bac1f..e2c878fe79f 100644
--- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c
+++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c
@@ -1,5 +1,6 @@
// RUN: %libomp-compile && %libomp-run
// RUN: %libomp-run 1 && %libomp-run 2
+// REQUIRES: openmp-4.5
// The test checks schedule(simd:runtime)
// in combination with OMP_SCHEDULE=static[,chunk]
diff --git a/openmp/runtime/test/worksharing/for/omp_doacross.c b/openmp/runtime/test/worksharing/for/omp_doacross.c
index 364430675d6..32e8e82d331 100644
--- a/openmp/runtime/test/worksharing/for/omp_doacross.c
+++ b/openmp/runtime/test/worksharing/for/omp_doacross.c
@@ -1,4 +1,5 @@
// RUN: %libomp-compile-and-run
+// REQUIRES: openmp-4.5
// XFAIL: gcc-4, gcc-5, clang-3.7, clang-3.8, icc-15, icc-16
#include <stdio.h>
#include <stdlib.h>
OpenPOWER on IntegriCloud