aboutsummaryrefslogtreecommitdiffstats
path: root/community/ghc/0001-testsuite-Ensure-T5423-flushes-C-output-buffer.patch
diff options
context:
space:
mode:
authorRémi Lefèvre <rlefevre@dmy.fr>2019-12-10 08:57:43 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-12-12 16:31:59 +0000
commit42336c1358c0bc8186f48c20c6ae30f9ba63f1f3 (patch)
tree54f21d71fca8bd5d9a05a2f03aec4642c93caa3f /community/ghc/0001-testsuite-Ensure-T5423-flushes-C-output-buffer.patch
parentdb28db84a99ef663f3d06025a645c6c0d72a873a (diff)
downloadaports-42336c1358c0bc8186f48c20c6ae30f9ba63f1f3.tar.bz2
aports-42336c1358c0bc8186f48c20c6ae30f9ba63f1f3.tar.xz
community/ghc: fix testsuite on Alpine Linux
- Add `MAKEFLAGS= ` hack to work around failing `+PYTHON` - Add "stat too good" results for Alpine x64 - Increase tolerancy for two "stat not good enough" tests - Add a few more patches from mainline - Require gnu grep to fix T13340 & T7014 - Skip T2615 and T10458 (unresolved linking issues) Some tests should be investigated, particularly - T9630 (+22% memory allocation) - T10458: linking issue - T2615: linker script issue - T12600: broken pipe with grep .. | head -n 1 (replaced by grep -m 1) Hopefully we can get rid of the MAKEFLAGS hack once Hadrian is used.
Diffstat (limited to 'community/ghc/0001-testsuite-Ensure-T5423-flushes-C-output-buffer.patch')
-rw-r--r--community/ghc/0001-testsuite-Ensure-T5423-flushes-C-output-buffer.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/community/ghc/0001-testsuite-Ensure-T5423-flushes-C-output-buffer.patch b/community/ghc/0001-testsuite-Ensure-T5423-flushes-C-output-buffer.patch
new file mode 100644
index 0000000000..f2568318ca
--- /dev/null
+++ b/community/ghc/0001-testsuite-Ensure-T5423-flushes-C-output-buffer.patch
@@ -0,0 +1,72 @@
+From a0f683795a72f7b82962d24098b1dc7c2b04ab29 Mon Sep 17 00:00:00 2001
+From: Ben Gamari <ben@smart-cactus.org>
+Date: Tue, 11 Jun 2019 12:48:32 -0400
+Subject: testsuite: Ensure T5423 flushes C output buffer
+
+Previously T5423 would fail to flush the printf output buffer.
+Consequently it was platform-dependent whether the C or Haskell print
+output would be emitted first.
+---
+ testsuite/tests/rts/Makefile | 3 ++-
+ testsuite/tests/rts/T5423.hs | 7 ++++++-
+ testsuite/tests/rts/T5423.stdout | 2 +-
+ testsuite/tests/rts/T5423_c.c | 6 ++++++
+ 4 files changed, 15 insertions(+), 3 deletions(-)
+ create mode 100644 testsuite/tests/rts/T5423_c.c
+
+diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile
+index 32c2b17e27..51f2746c1f 100644
+--- a/testsuite/tests/rts/Makefile
++++ b/testsuite/tests/rts/Makefile
+@@ -37,7 +37,8 @@ T5423:
+ $(RM) T5423_cmm.o T5423.o T5423.hi T5423$(exeext)
+ "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c T5423_cmm.cmm
+ "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c T5423.hs
+- "$(TEST_HC)" $(TEST_HC_OPTS) -v0 T5423.o T5423_cmm.o -o T5423$(exeext)
++ "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c T5423_c.c
++ "$(TEST_HC)" $(TEST_HC_OPTS) -v0 T5423.o T5423_cmm.o T5423_c.o -o T5423$(exeext)
+ ./T5423
+
+ .PHONY: T9405
+diff --git a/testsuite/tests/rts/T5423.hs b/testsuite/tests/rts/T5423.hs
+index 2565c3f002..cda87048d7 100644
+--- a/testsuite/tests/rts/T5423.hs
++++ b/testsuite/tests/rts/T5423.hs
+@@ -7,8 +7,13 @@ foreign import prim "test" test :: Int# -> Int# -> Int# -> Int# -> Int#
+ -> Int# -> Int# -> Int# -> Int# -> Int#
+ -> Int#
+
++foreign import ccall "flush_stdout" flush_stdout :: IO ()
++
+ v :: Int
+ v = I# (test 111# 112# 113# 114# 115# 116# 117# 118# 119# 120#)
+
+ main :: IO ()
+-main = print v
++main = do
++ n <- return $! v
++ flush_stdout -- Ensure that libc output buffer is flushed
++ print n
+diff --git a/testsuite/tests/rts/T5423.stdout b/testsuite/tests/rts/T5423.stdout
+index 478bb27b19..fc92992860 100644
+--- a/testsuite/tests/rts/T5423.stdout
++++ b/testsuite/tests/rts/T5423.stdout
+@@ -1,2 +1,2 @@
+-120
+ 111 112 113 114 115 116 117 118 119 120
++120
+diff --git a/testsuite/tests/rts/T5423_c.c b/testsuite/tests/rts/T5423_c.c
+new file mode 100644
+index 0000000000..efc9c845f5
+--- /dev/null
++++ b/testsuite/tests/rts/T5423_c.c
+@@ -0,0 +1,6 @@
++#include <stdio.h>
++
++void flush_stdout(void)
++{
++ fflush(stdout);
++}
+--
+2.17.1
+