Commit Graph

14 Commits

Author SHA1 Message Date
Joel E. Denny ba942610f6 [OpenMP] Add scaffolding for negative runtime tests
Without this patch, the openmp project's test suites do not appear to
have support for negative tests.  However, D78170 needs to add a test
that an expected runtime failure occurs.

This patch makes `not` visible in all of the openmp project's test
suites.  In all but `libomptarget/test`, it should be possible for a
test author to insert `not` before a use of the lit substitution for
running a test program.  In `libomptarget/test`, that substitution is
target-specific, and its value is `echo` when the target is not
available.  In that case, inserting `not` before a lit substitution
would expect an `echo` fail, so this patch instead defines a separate
lit substitution for expected runtime fails.

Reviewed By: jdoerfert, Hahnfeld

Differential Revision: https://reviews.llvm.org/D78566
2020-04-21 17:10:50 -04:00
Kazuaki Ishizaki 4201679110 [OpenMP] NFC: Fix trivial typo
Differential Revision: https://reviews.llvm.org/D77430
2020-04-04 12:06:54 +09:00
Jonas Hahnfeld f0689d2e62 archer: Remove superfluous dot from warning message 2020-03-06 15:19:30 +01:00
Johannes Doerfert 3ff4e2eee8 [OpenMP] Switch default C++ standard to C++ 14
Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D74258
2020-02-11 17:11:54 -06:00
Michał Górny 3c545e4b73 [openmp] Disable archer if LIBOMP_OMPT_SUPPORT is off
This fixed build failures due to missing ompt headers.

See https://bugs.gentoo.org/700762.

Differential Revision: https://reviews.llvm.org/D73249
2020-01-23 19:26:18 +01:00
Joachim Protze 39f746d8de [OpenMP][Tool] Fix memory leak and double-allocation
Fix the memory leak pointed out in https://reviews.llvm.org/D70412.
And a second one due to double-allocation.

Reviewed by: Hahnfeld

Differential revision: https://reviews.llvm.org/D72779
2020-01-16 10:05:06 -10:00
Joachim Protze 2d4571bf30 [OpenMP][Tool] Runtime warning for missing TSan-option
TSan spuriously reports for any OpenMP application a race on the initialization
of a runtime internal mutex:

```
Atomic read of size 1 at 0x7b6800005940 by thread T4:
  #0 pthread_mutex_lock <null> (a.out+0x43f39e)
  #1 __kmp_resume_64 <null> (libomp.so.5+0x84db4)

Previous write of size 1 at 0x7b6800005940 by thread T7:
  #0 pthread_mutex_init <null> (a.out+0x424793)
  #1 __kmp_suspend_initialize_thread <null> (libomp.so.5+0x8422e)
```

According to @AndreyChurbanov this is a false positive report, as the control
flow of the runtime guarantees the ordering of the mutex initialization and
the lock:
https://software.intel.com/en-us/forums/intel-open-source-openmp-runtime-library/topic/530363

To suppress this report, I suggest the use of
TSAN_OPTIONS='ignore_uninstrumented_modules=1'.
With this patch, a runtime warning is provided in case an OpenMP application
is built with Tsan and executed without this Tsan-option.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D70412
2020-01-14 09:58:05 -10:00
Joachim Protze ed810da732 [OpenMP][Tool] Improving stack trace for Archer
The OpenMP runtime is not instrumented, so entering the runtime leaves no hint
on the source line of the pragma on ThreadSanitizer's function stack.

This patch adds function entry/exit annotations for OpenMP parallel regions,
and synchronization regions (barrier, taskwait, taskgroup).

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D70408
2020-01-13 22:14:06 -10:00
Joachim Protze 84637408f2 [OpenMP][Tool] Make tests for archer dependent on TSan
If the openmp project is built standalone, the test compiler is feature tested for an available -fsanitize=thread flag.
If the openmp project is built as part of llvm, the target tsan is needed to test archer.

An additional line (requires tsan) was introduced to the tests, this patch updates the line numbers for the race.

Follow-up for 77ad98c

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D71914
2020-01-13 21:47:58 -10:00
Kazuaki Ishizaki 4c6a098ad5 [OpenMP] NFC: Fix trivial typos in comments
Reviewers: jdoerfert, Jim

Reviewed By: Jim

Subscribers: Jim, mgorny, guansong, jfb, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D72285
2020-01-07 14:05:03 +08:00
protze@itc.rwth-aachen.de 77ad98c808 [OpenMP][Tool] archer tests require tsan
Testing for tsan capability in the test-compiler in follow-up review
2019-11-22 17:11:16 +01:00
protze@itc.rwth-aachen.de 6b2431e0c2 [OpenMP][Tool] disable archer tests in standalone build
Will be enabled after Build-Bots are fixed
2019-11-22 15:25:43 +01:00
protze@itc.rwth-aachen.de ac21de0d7e [OpenMP][Tool] Fix cmake variable in lit.site.cfg.in
As noted in D45890
2019-11-22 14:31:54 +01:00
protze@itc.rwth-aachen.de 2b8115b10b [OpenMP] Add implementation and tests of Archer tool
The tool provides TSAN annotations for OpenMP synchronization. The tool
is activated if no other OMPT tool is loaded.

The tool detects whether the application was built with TSan and rejects
activation according to the OMPT protocol if there is no TSan-rt.

Differential Revision: https://reviews.llvm.org/D45890
2019-11-18 14:45:34 +01:00