openmp/runtime/test/ompt/misc/control_tool_no_ompt_support.c
raw| 1 | // clang-format off |
| 2 | // RUN: %libomp-compile-and-run |
| 3 | // clang-format on |
| 4 | |
| 5 | #include <omp.h> |
| 6 | #include <stdio.h> |
| 7 | |
| 8 | int main() { |
| 9 | #pragma omp parallel num_threads(1) |
| 10 | { |
| 11 | int result = omp_control_tool(omp_control_tool_flush, 1, NULL); |
| 12 | printf("control_tool result = %d\n", result); |
| 13 | } |
| 14 | |
| 15 | // clang-format off |
| 16 | // Check if libomp correctly reports -2 (no tool) if no tool is attached. |
| 17 | |
| 18 | // CHECK: control_tool result = -2 |
| 19 | // clang-format on |
| 20 | |
| 21 | return 0; |
| 22 | } |