[Openmp-commits] [openmp] [OpenMP][test]Flip bit-fields in 'struct flags' for big-endian in test cases (PR #79895)

Xing Xue via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 6 13:35:05 PST 2024


================
@@ -50,12 +50,21 @@ typedef struct kmp_depend_info {
      union {
         kmp_uint8 flag; // flag as an unsigned char
         struct { // flag as a set of 8 bits
-            unsigned in : 1;
-            unsigned out : 1;
-            unsigned mtx : 1;
-            unsigned set : 1;
-            unsigned unused : 3;
-            unsigned all : 1;
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
----------------
xingxue-ibm wrote:

> I was wondering whether this test something that is compiler(clang) specific, or is this portable? 

Checked compilers in [Compiler Explorer](https://godbolt.org/), the test works with gcc, clang, icc, icx, and zig cc. Does not seem to work with msvc.



https://github.com/llvm/llvm-project/pull/79895


More information about the Openmp-commits mailing list