summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2022-01-05 19:17:03 +0100
committerPeter Trommler <ptrommler@acm.org>2022-01-16 16:38:14 +0000
commit68a59beafd1c926a2efe37bf37b2a6ca24f657f0 (patch)
tree8611e43aed0ce333e6747067b2190681c56cdce0
parent0dc723957d0fdb5909f145405b775efea0fe2f6e (diff)
downloadhaskell-68a59beafd1c926a2efe37bf37b2a6ca24f657f0.tar.gz
Fix T20638 on big-endian architectureswip/T20906
The test reads a 16 bit value from an array of 8 bit values. Naturally, that leads to different values read on big-endian architectures than on little-endian. In this case the value read is 0x8081 on big-endian and 0x8180 on little endian. This patch changes the argument of the `and` machop to mask bit 7 which is the only bit different. The test still checks that bit 15 is zero, which was the original issue in #20638. Fixes #20906.
-rw-r--r--testsuite/tests/cmm/should_run/machops/T20638.cmm2
-rw-r--r--testsuite/tests/cmm/should_run/machops/T20638.stdout2
2 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/cmm/should_run/machops/T20638.cmm b/testsuite/tests/cmm/should_run/machops/T20638.cmm
index 51fe449a76..64835b7584 100644
--- a/testsuite/tests/cmm/should_run/machops/T20638.cmm
+++ b/testsuite/tests/cmm/should_run/machops/T20638.cmm
@@ -1,4 +1,4 @@
test(bits64 buffer) {
- return (%zx64(%shrl(bits16[buffer + (128 :: bits64)], (1 :: bits64))) & (64711 :: bits64));
+ return (%zx64(%shrl(bits16[buffer + (128 :: bits64)], (1 :: bits64))) & (65407 :: bits64));
}
diff --git a/testsuite/tests/cmm/should_run/machops/T20638.stdout b/testsuite/tests/cmm/should_run/machops/T20638.stdout
index 5a54842902..81669a3724 100644
--- a/testsuite/tests/cmm/should_run/machops/T20638.stdout
+++ b/testsuite/tests/cmm/should_run/machops/T20638.stdout
@@ -1 +1 @@
-16576
+16448