LLVM OpenMP
20.0.0git
runtime
test
ompt
misc
runtime_error.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run 2>&1 | sort | FileCheck %s
2
// REQUIRES: ompt
3
4
#include <string.h>
5
#include <stdio.h>
6
#include "
callback.h
"
7
8
// TODO: use error directive when compiler suppors
9
typedef
void
ident_t
;
10
extern
void
__kmpc_error
(
ident_t
*,
int
,
const
char
*);
11
12
int
main
() {
13
#pragma omp parallel num_threads(2)
14
{
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);
19
}
20
}
21
return
0;
22
}
23
24
// CHECK: {{^}}0: Message length=[[LENGTH:[0-9]+]]
25
// CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]
26
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]+}}
33
34
// Message from runtime
35
// CHECK: {{^}}OMP: Warning{{.*}}User message goes here
callback.h
__kmpc_error
void __kmpc_error(ident_t *, int, const char *)
Definition:
kmp_csupport.cpp:4532
ident_t
void ident_t
Definition:
runtime_error.c:9
main
int main()
Definition:
runtime_error.c:12
ident_t
Definition:
teams-no-par.c:23
Generated on Tue Feb 4 2025 13:28:33 for LLVM OpenMP by
1.9.6