LLVM OpenMP
22.0.0git
runtime
test
ompt
misc
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
13
struct
myLock
{
14
omp_lock_t
lock
;
15
myLock
() { omp_init_lock(&
lock
); }
16
~myLock
() { omp_destroy_lock(&
lock
); }
17
};
18
19
myLock
lock
;
20
21
int
main
() {
22
go_parallel_nthreads
(2);
23
24
printf(
"Before ompt_finalize_tool\n"
);
25
ompt_finalize_tool
();
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
callback.h
ompt_finalize_tool
static ompt_finalize_tool_t ompt_finalize_tool
Definition
callback.h:161
lock
static kmp_bootstrap_lock_t lock
Definition
kmp_i18n.cpp:57
main
int main()
Definition
lock_double_destroy.cpp:21
omp_testsuite.h
go_parallel_nthreads
static void go_parallel_nthreads(int nthreads)
Definition
omp_testsuite.h:37
get_exit_value
static int get_exit_value()
Definition
omp_testsuite.h:73
myLock
Definition
lock_double_destroy.cpp:13
myLock::~myLock
~myLock()
Definition
lock_double_destroy.cpp:16
myLock::myLock
myLock()
Definition
lock_double_destroy.cpp:15
myLock::lock
omp_lock_t lock
Definition
lock_double_destroy.cpp:14
Generated on
for LLVM OpenMP by
1.14.0