brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 90f05f7 Raw
40 lines · c
1// clang-format off2// RUN: %libomp-compile-and-run 2>&1 | sort | FileCheck %s3// REQUIRES: ompt4// clang-format on5 6#include <string.h>7#include <stdio.h>8#include "callback.h"9 10// TODO: use error directive when compiler suppors11typedef void ident_t;12extern void __kmpc_error(ident_t *, int, const char *);13 14int main() {15#pragma omp parallel num_threads(2)16  {17    if (omp_get_thread_num() == 0) {18      const char *msg = "User message goes here";19      printf("0: Message length=%" PRIu64 "\n", (uint64_t)strlen(msg));20      __kmpc_error(NULL, ompt_warning, msg);21    }22  }23  return 0;24}25 26// clang-format off27// CHECK: {{^}}0: Message length=[[LENGTH:[0-9]+]]28// CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]29 30// CHECK: {{^}}[[PRIMARY_ID:[0-9]+]]: ompt_event_implicit_task_begin31// CHECK: {{^}}[[PRIMARY_ID]]: ompt_event_runtime_error32// CHECK-SAME: severity=133// CHECK-SAME: message=User message goes here34// CHECK-SAME: length=[[LENGTH]]35// CHECK-SAME: codeptr_ra={{(0x)?[0-f]+}}36 37// Message from runtime38// CHECK: {{^}}OMP: Warning{{.*}}User message goes here39// clang-format on40