summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2022-01-05 19:17:03 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-01-18 20:46:08 -0500
commit95e7964b41c371d619f504a3d46b4976f86f5b55 (patch)
tree404282fd63eea93469ee05d42ab77559861f9b11
parent21510698817fbe7254112b5967854cad28a612bf (diff)
downloadhaskell-95e7964b41c371d619f504a3d46b4976f86f5b55.tar.gz
Fix T20638 on big-endian architectures
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