LLVM OpenMP 22.0.0git
lock_double_destroy.cpp
Go to the documentation of this file.
1// clang-format off
2// RUN: %libomp-cxx-compile-and-run | FileCheck %s
3
4// disabled until fixed, see: https://github.com/llvm/llvm-project/pull/145625#issuecomment-3007625680
5// remove "needs-fix", after fixing the issue in the runtime
6// REQUIRES: ompt, needs-fix
7// clang-format on
8#include "callback.h"
9#include "omp_testsuite.h"
10
11// tests that the destructor doesn't segv even though
12// ompt_finalize_tool() destroys the lock
13struct myLock {
14 omp_lock_t lock;
15 myLock() { omp_init_lock(&lock); }
16 ~myLock() { omp_destroy_lock(&lock); }
17};
18
20
21int main() {
23
24 printf("Before ompt_finalize_tool\n");
26 printf("After ompt_finalize_tool\n");
27
28 return get_exit_value();
29}
30
31// clang-format off
32// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
33// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_thread_begin:
34// CHECK-SAME: thread_type=ompt_thread_initial=1
35
36// CHECK: {{^}}[[THREAD_ID]]: ompt_event_init_lock
37
38// CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_begin
39// CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_end
40
41// CHECK: {{^}}Before ompt_finalize_tool
42
43// CHECK: {{^}}[[THREAD_ID]]: ompt_event_thread_end: thread_id=[[THREAD_ID]]
44// CHECK: 0: ompt_event_runtime_shutdown
45
46// CHECK: {{^}}After ompt_finalize_tool
47// clang-format on
static ompt_finalize_tool_t ompt_finalize_tool
Definition callback.h:161
static kmp_bootstrap_lock_t lock
Definition kmp_i18n.cpp:57
int main()
static void go_parallel_nthreads(int nthreads)
static int get_exit_value()
omp_lock_t lock