1 // RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
3 // UNSUPPORTED: intel-15.0, intel-16.0, intel-17.0, intel-18.0
4 // GCC generates code that does not distinguish between sections and loops
12 #pragma omp parallel sections num_threads(2)
16 printf("%lu: section 1\n", ompt_get_thread_data()->value
);
20 printf("%lu: section 2\n", ompt_get_thread_data()->value
);
24 // Check if libomp supports the callbacks for this test.
25 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_work'
26 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_dispatch'
28 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
30 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_sections_begin:
31 // CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-9]+]],
32 // CHECK-SAME: task_id=[[TASK_ID:[0-9]+]],
33 // CHECK-SAME: codeptr_ra=[[SECT_BEGIN:0x[0-f]+]], count=2
34 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_section_begin:
35 // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]]
36 // CHECK-SAME: codeptr_ra=[[SECT_BEGIN]]
37 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_sections_end:
38 // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
39 // CHECK-SAME: codeptr_ra=[[SECT_END:0x[0-f]+]]
41 // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_sections_begin:
42 // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID:[0-9]+]],
43 // CHECK-SAME: codeptr_ra=[[SECT_BEGIN]], count=2
44 // CHECK: {{^}}[[THREAD_ID]]: ompt_event_section_begin:
45 // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]]
46 // CHECK-SAME: codeptr_ra=[[SECT_BEGIN]]
47 // CHECK: {{^}}[[THREAD_ID]]: ompt_event_sections_end:
48 // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
49 // CHECK-SAME: codeptr_ra=[[SECT_END]]