15 Commits
Author SHA1 Message Date
Jonas Hahnfeld 3eae253b1a [OpenMP] Enable warning about "implicit fallthrough"
Fix last warned location in ittnotify_static.cpp using the defined
macro KMP_FALLTHROUGH().

Differential Revision: https://reviews.llvm.org/D65871

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@369003 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 13:26:55 +00:00
Jonas Hahnfeld 04b98c1875 [OpenMP] Turn on -Wall compiler warnings by default
Instead, maintain a list of disabled options to still build libomp and
libomptarget without warnings. This includes -Wno-error and -Wno-pedantic
to silence warnings that LLVM enables when building in-tree.

I tested the following compilers:
 * Clang 6.0, 7.0, 8.0
 * GCC 4.8.5 (CentOS 7), GCC 6, 7, 8, 9
 * Intel Compiler 16, 17, 18, 19

RFC thread on openmp-dev mailing list:
http://lists.llvm.org/pipermail/openmp-dev/2019-August/002668.html

Differential Revision: https://reviews.llvm.org/D65867

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@368999 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 13:11:50 +00:00
Dimitry Andric 4403c91b6b After rL357618, quote ${CMAKE_THREAD_LIBS_INIT} so CMake does not
complain when the variable is empty.  Fixes PR 41401.


git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@357828 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 22:19:40 +00:00
Dimitry Andric cf0276b9ab Ensure correct pthread flags and libraries are used
On most platforms, certain compiler and linker flags have to be passed
when using pthreads, otherwise linking against libomp.so might fail with
undefined references to several pthread functions.

Use CMake's `find_package(Threads)` to determine these for standalone
builds, or take them (and optionally modify them) from the top-level
LLVM cmake files.

Also, On FreeBSD, ensure that libomp.so is linked against libm.so,
similar to NetBSD.

Adjust test cases with hardcoded `-lpthread` flag to use the common
build flags, which should now have the required pthread flags.

Reviewers: emaste, jlpeyton, krytarowski, mgorny, protze.joachim, Hahnfeld

Reviewed By: Hahnfeld

Subscribers: AndreyChurbanov, tra, EricWF, Hahnfeld, jfb, jdoerfert, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D59451


git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@357618 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 18:11:36 +00:00
Shoaib Meenai 6b80cedde4 [build] Rename clang-headers to clang-resource-headers
Summary:
The current install-clang-headers target installs clang's resource
directory headers. This is different from the install-llvm-headers
target, which installs LLVM's API headers. We want to introduce the
corresponding target to clang, and the natural name for that new target
would be install-clang-headers. Rename the existing target to
install-clang-resource-headers to free up the install-clang-headers name
for the new target, following the discussion on cfe-dev [1].

I didn't find any bots on zorg referencing install-clang-headers. I'll
send out another PSA to cfe-dev to accompany this rename.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html

Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille

Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits

Tags: #clang, #sanitizers, #lldb, #openmp, #llvm

Differential Revision: https://reviews.llvm.org/D58791

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@355340 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 21:19:53 +00:00
Jonathan Peyton 4cb0b6cbbc [OpenMP][Cmake] Allowed OpenMP testing detect test compiler with same generator
Fix ninja build detect test compiler failed under windows.

Patch by Peiyuan Song

Differential Revision: https://reviews.llvm.org/D53479


git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@351223 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 19:08:26 +00:00
Michal Gorny 3ccd20f0f6 [cmake] Use -std=gnu++11 to fix alloca() on NetBSD
Prefer using '-std=gnu++11' over '-std=c++11' when available, as NetBSD
exposes the correct alloca() implementation only with gnu* C/C++
standards.

Differential Revision: https://reviews.llvm.org/D55477

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@348854 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 15:39:22 +00:00
Jonas Hahnfeld 08bc82d162 [libomptarget-nvptx] Add testing infrastructure
This patch also introduces testing for libomptarget-nvptx
which has been missing until now. I propose to add tests for
all bugs that are fixed in the future.
The target check-libomptarget-nvptx is not run by default because
 - we can't determine if there is a GPU plugged into the system.
 - it will require the latest Clang compiler. Keeping compatibility
   with older releases would prevent testing newer code generation
   developed in trunk.

Differential Revision: https://reviews.llvm.org/D51687

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@343324 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 15:05:43 +00:00
Jonathan Peyton d97a5dfc16 [OpenMP] Fix doacross testing for gcc
This patch adds a test using the doacross clauses in OpenMP and removes gcc from
testing kmp_doacross_check.c which is only testing the kmp rather than the
gomp interface.

Differential Revision: https://reviews.llvm.org/D50014


git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@338757 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 19:13:07 +00:00
Jonas Hahnfeld 4a1407dda6 [CMake] Add -fno-experimental-isel for testing
GlobalISel doesn't yet implement blockaddress and falls back to
SelectionDAG. This results in additional branch instruction to
the next basic block which breaks the OMPT tests.
Disable GlobalISel for now when compiling the tests because fixing
them is not easily possible. See http://llvm.org/PR36313 for full
discussion history.

Differential Revision: https://reviews.llvm.org/D43195

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@325218 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15 08:10:22 +00:00
Joachim Protze ad36fb50c7 [OMPT] Add annotations to testcases that are expected to fail when using certain compilers
Reasons for expected failures are mainly bugs when using lables in OpenMP regions
or missing support of some OpenMP features.
For some worksharing clauses, support to distinguish the kind of workshare was
added just recently.

If an issue was fixed in a minor release version of a compiler, we flag the
test as unsupported for this compiler version to avoid false positives.
Same for fixes that where backported to older compiler versions.

Differential Revision: https://reviews.llvm.org/D40384

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@321262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-21 13:55:16 +00:00
Jonas Hahnfeld a5acc90e8d [CMake] Remove legacy LIBOMP_LIT_ARGS
The bots have been updated, this option isn't needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@320153 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 15:07:08 +00:00
Jonas Hahnfeld d180ffbb82 [CMake] Detect information about test compiler
Perform a nested CMake invocation to avoid writing our own parser
for compiler versions when we are not testing the in-tree compiler.
Use the extracted information to mark a test as unsupported that
hangs with Clang prior to version 4.0.1 and restrict tests for
libomptarget to Clang version 6.0.0 and later.

Differential Revision: https://reviews.llvm.org/D40083

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@319448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 17:08:31 +00:00
Jonas Hahnfeld a1b4de8ad3 [CMake] Refactor testing infrastructure
The code for the two OpenMP runtime libraries was very similar.
Move to common CMake file that is included and provides a simple
interface for adding testsuites. Also add a common check-openmp
target that runs all testsuites that have been registered.

Note that this renames all test options to the common OPENMP
namespace, for example OPENMP_TEST_C_COMPILER instead of
LIBOMP_TEST_COMPILER and so on.

Differential Revision: https://reviews.llvm.org/D40082

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@319343 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 19:31:52 +00:00
Jonas Hahnfeld 41aebf5e26 [CMake] Refactor common settings and flags
These are needed by both libraries, so we can do that in a
common namespace and unify configuration parameters.
Also make sure that the user isn't requesting libomptarget
if the library cannot be built on the system. Issue an error
in that case.

Differential Revision: https://reviews.llvm.org/D40081

git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@319342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29 19:31:48 +00:00