]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Update shift-shift-5.c testcase for big endian
authorMarcus Comstedt <marcus@mc.pp.se>
Fri, 19 Mar 2021 19:49:07 +0000 (20:49 +0100)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 23 Mar 2021 09:32:32 +0000 (17:32 +0800)
gcc/testsuite/

* gcc.target/riscv/shift-shift-5.c (sub): Change
order of struct fields depending on byteorder.

gcc/testsuite/gcc.target/riscv/shift-shift-5.c

index 5b2ae89a471d9b1aac74e06b1c8c3cc5662058c2..0ecab9723c9cf876ba020ce05be9b6cca3eddce4 100644 (file)
@@ -7,7 +7,11 @@ unsigned long
 sub (long l)
 {
   union u {
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
     struct s { int a : 19; unsigned int b : 13; int x; } s;
+#else
+    struct s { int x; unsigned int b : 13; int a : 19; } s;
+#endif
     long l;
   } u;
   u.l = l;