[Openmp-commits] [openmp] [OpenMP][Tests] Sync struct DEP with the runtime (PR #69982)

Ilya Leoshkevich via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 23 16:32:56 PDT 2023


https://github.com/iii-i created https://github.com/llvm/llvm-project/pull/69982

struct DEP defined in multiple testcases must correspond to runtime's struct kmp_depend_info. The former defines flags as int, and the latter as kmp_uint8_t. This discrepancy goes unnoticed on little-endian systems, but breaks big-endian ones.

Make flags in struct DEP unsigned char.

>From c245e985aa486fa9822d34b8cb64e78ae7ffbc8a Mon Sep 17 00:00:00 2001
From: Ilya Leoshkevich <iii at linux.ibm.com>
Date: Thu, 19 Oct 2023 14:00:32 +0200
Subject: [PATCH] [OpenMP][Tests] Sync struct DEP with the runtime

struct DEP defined in multiple testcases must correspond to runtime's
struct kmp_depend_info. The former defines flags as int, and the
latter as kmp_uint8_t. This discrepancy goes unnoticed on little-endian
systems, but breaks big-endian ones.

Make flags in struct DEP unsigned char.
---
 openmp/runtime/test/tasking/kmp_detach_tasks_t3.c    | 2 +-
 openmp/runtime/test/tasking/kmp_taskwait_nowait.c    | 2 +-
 openmp/runtime/test/tasking/omp50_task_depend_mtx.c  | 2 +-
 openmp/runtime/test/tasking/omp50_task_depend_mtx2.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/openmp/runtime/test/tasking/kmp_detach_tasks_t3.c b/openmp/runtime/test/tasking/kmp_detach_tasks_t3.c
index e14bab60b1cfb86..bf41d94fcbbd824 100644
--- a/openmp/runtime/test/tasking/kmp_detach_tasks_t3.c
+++ b/openmp/runtime/test/tasking/kmp_detach_tasks_t3.c
@@ -56,7 +56,7 @@ typedef struct task {
 typedef struct DEP {
   size_t addr;
   size_t len;
-  int flags;
+  unsigned char flags;
 } dep;
 
 typedef int(* task_entry_t)( int, ptask );
diff --git a/openmp/runtime/test/tasking/kmp_taskwait_nowait.c b/openmp/runtime/test/tasking/kmp_taskwait_nowait.c
index 809642aea2c4838..0353d62e322418c 100644
--- a/openmp/runtime/test/tasking/kmp_taskwait_nowait.c
+++ b/openmp/runtime/test/tasking/kmp_taskwait_nowait.c
@@ -11,7 +11,7 @@
 typedef struct DEP {
   size_t addr;
   size_t len;
-  int flags;
+  unsigned char flags;
 } _dep;
 typedef struct ID {
   int reserved_1;
diff --git a/openmp/runtime/test/tasking/omp50_task_depend_mtx.c b/openmp/runtime/test/tasking/omp50_task_depend_mtx.c
index 79c270e94a7d814..e6cd7ff1d9d207c 100644
--- a/openmp/runtime/test/tasking/omp50_task_depend_mtx.c
+++ b/openmp/runtime/test/tasking/omp50_task_depend_mtx.c
@@ -37,7 +37,7 @@ typedef int(*entry_t)(int, int**);
 typedef struct DEP {
   size_t addr;
   size_t len;
-  int flags;
+  unsigned char flags;
 } dep;
 typedef struct ID {
   int reserved_1;
diff --git a/openmp/runtime/test/tasking/omp50_task_depend_mtx2.c b/openmp/runtime/test/tasking/omp50_task_depend_mtx2.c
index ec8a7d1cab690de..cc0a3a190382426 100644
--- a/openmp/runtime/test/tasking/omp50_task_depend_mtx2.c
+++ b/openmp/runtime/test/tasking/omp50_task_depend_mtx2.c
@@ -37,7 +37,7 @@ typedef int(*entry_t)(int, int**);
 typedef struct DEP {
   size_t addr;
   size_t len;
-  int flags;
+  unsigned char flags;
 } dep;
 typedef struct ID {
   int reserved_1;



More information about the Openmp-commits mailing list