From af6511d730f18beb9053c0120c45abef031344e9 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Mon, 17 May 2021 12:14:34 -0400 Subject: [PATCH] [OpenMP] Fixed Bug 49356 Bug 49356 (https://bugs.llvm.org/show_bug.cgi?id=49356) reports crash in the test case `tasking/bug_taskwait_detach.cpp`, which is caused by the wrong function declaration. `gtid` in `__kmpc_omp_task` should be `kmp_int32`. Reviewed By: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D102584 --- openmp/runtime/test/tasking/bug_taskwait_detach.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openmp/runtime/test/tasking/bug_taskwait_detach.cpp b/openmp/runtime/test/tasking/bug_taskwait_detach.cpp index cadfe9b..7a0ced7 100644 --- a/openmp/runtime/test/tasking/bug_taskwait_detach.cpp +++ b/openmp/runtime/test/tasking/bug_taskwait_detach.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -10,7 +11,7 @@ #define PTASK_FLAG_DETACHABLE 0x40 // OpenMP RTL interfaces -typedef long long kmp_int64; +using kmp_int32 = int32_t; typedef struct ID { int reserved_1; @@ -59,7 +60,8 @@ extern "C" { extern int __kmpc_global_thread_num(void *id_ref); extern int **__kmpc_omp_task_alloc(id *loc, int gtid, int flags, size_t sz, size_t shar, task_entry_t rtn); -extern int __kmpc_omp_task(id *loc, kmp_int64 gtid, kmp_task_t *task); +extern kmp_int32 __kmpc_omp_task(ident_t *loc_ref, kmp_int32 gtid, + kmp_task_t *new_task); extern omp_event_handle_t __kmpc_task_allow_completion_event(ident_t *loc_ref, int gtid, kmp_task_t *task); -- 2.7.4