1 // RUN: %libomp-compile-and-run 2>&1 | sort | FileCheck %s
8 // TODO: use error directive when compiler suppors
10 extern void __kmpc_error(ident_t
*, int, const char *);
13 #pragma omp parallel num_threads(2)
15 if (omp_get_thread_num() == 0) {
16 const char *msg
= "User message goes here";
17 printf("0: Message length=%" PRIu64
"\n", (uint64_t)strlen(msg
));
18 __kmpc_error(NULL
, ompt_warning
, msg
);
24 // CHECK: {{^}}0: Message length=[[LENGTH:[0-9]+]]
25 // CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]
27 // CHECK: {{^}}[[PRIMARY_ID:[0-9]+]]: ompt_event_implicit_task_begin
28 // CHECK: {{^}}[[PRIMARY_ID]]: ompt_event_runtime_error
29 // CHECK-SAME: severity=1
30 // CHECK-SAME: message=User message goes here
31 // CHECK-SAME: length=[[LENGTH]]
32 // CHECK-SAME: codeptr_ra={{0x[0-f]+}}
34 // Message from runtime
35 // CHECK: {{^}}OMP: Warning{{.*}}User message goes here