| 1 |
// clang-format off |
| 2 |
// RUN: %libomp-compile-and-run | FileCheck %s |
| 3 |
// REQUIRES: ompt |
| 4 |
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7 |
| 5 |
// clang-format on |
| 6 |
#define TEST_NEED_PRINT_FRAME_FROM_OUTLINED_FN |
| 7 |
#define _OMPT_DISABLE_CONTROL_TOOL |
| 8 |
#include "callback.h" |
| 9 |
#include <omp.h> |
| 10 |
#include <stdio.h> |
| 11 |
|
| 12 |
int main() { |
| 13 |
#pragma omp parallel num_threads(1) |
| 14 |
{ |
| 15 |
int result = omp_control_tool(omp_control_tool_flush, 1, NULL); |
| 16 |
printf("control_tool result = %d\n", result); |
| 17 |
} |
| 18 |
|
| 19 |
// clang-format off |
| 20 |
// Check if libomp returns -1 (no callback) when a tool is attached, |
| 21 |
// but ompt_callback_control_tool is not registered |
| 22 |
|
| 23 |
// CHECK: 0: NULL_POINTER=[[NULL:.*$]] |
| 24 |
// CHECK: control_tool result = -1 |
| 25 |
|
| 26 |
// clang-format on |
| 27 |
|
| 28 |
return 0; |
| 29 |
} |