brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 1a26f98 Raw
48 lines · cpp
1// clang-format off2// RUN: %libomp-cxx-compile-and-run | FileCheck %s3 4// disabled until fixed, see: https://github.com/llvm/llvm-project/pull/145625#issuecomment-30076256805// remove "needs-fix", after fixing the issue in the runtime6// REQUIRES: ompt, needs-fix7// clang-format on8#include "callback.h"9#include "omp_testsuite.h"10 11// tests that the destructor doesn't segv even though12// ompt_finalize_tool() destroys the lock13struct myLock {14  omp_lock_t lock;15  myLock() { omp_init_lock(&lock); }16  ~myLock() { omp_destroy_lock(&lock); }17};18 19myLock lock;20 21int 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 off32// CHECK: 0: NULL_POINTER=[[NULL:.*$]]33// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_thread_begin:34// CHECK-SAME: thread_type=ompt_thread_initial=135 36// CHECK: {{^}}[[THREAD_ID]]: ompt_event_init_lock37 38// CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_begin39// CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_end40 41// CHECK: {{^}}Before ompt_finalize_tool42 43// CHECK: {{^}}[[THREAD_ID]]: ompt_event_thread_end: thread_id=[[THREAD_ID]]44// CHECK: 0: ompt_event_runtime_shutdown45 46// CHECK: {{^}}After ompt_finalize_tool47// clang-format on48