• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %libomp-compile-and-run | FileCheck %s
2 // REQUIRES: ompt
3 #include "callback.h"
4 #include <omp.h>
5 
main()6 int main()
7 {
8   #pragma omp parallel num_threads(1)
9   {
10 
11   }
12   ompt_set_callback(ompt_callback_parallel_begin, NULL);
13   #pragma omp parallel num_threads(1)
14   {
15 
16   }
17 
18   // Check if libomp supports the callbacks for this test.
19   // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_idle'
20 
21   // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
22 
23   // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_parallel_begin:
24   // CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_end:
25   // CHECK-NOT: {{^}}[[THREAD_ID]]: ompt_event_parallel_begin:
26   // CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_end:
27 
28   return 0;
29 }
30