[v2,5/5] RISC-V: Update shift-shift-5.c testcase for big endian

Message ID 20210221000903.32039-6-marcus@mc.pp.se
State Superseded
Headers show
Series
  • RISC-V big endian support
Related show

Commit Message

Marcus Comstedt Feb. 21, 2021, 12:09 a.m.
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 | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.26.2

Patch

diff --git a/gcc/testsuite/gcc.target/riscv/shift-shift-5.c b/gcc/testsuite/gcc.target/riscv/shift-shift-5.c
index 5b2ae89a471..0ecab9723c9 100644
--- a/gcc/testsuite/gcc.target/riscv/shift-shift-5.c
+++ b/gcc/testsuite/gcc.target/riscv/shift-shift-5.c
@@ -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;