[Git][ghc/ghc][wip/alpine-ci] 5 commits: testsuite: Fix T8602 on musl

Ben Gamari gitlab at gitlab.haskell.org
Tue Jun 11 17:11:29 UTC 2019



Ben Gamari pushed to branch wip/alpine-ci at Glasgow Haskell Compiler / GHC


Commits:
44db05be by Ben Gamari at 2019-06-11T16:45:24Z
testsuite: Fix T8602 on musl

Musl wants hash-bangs on all executables.

- - - - -
19fdfe44 by Ben Gamari at 2019-06-11T16:48:32Z
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.

- - - - -
0a9d247b by Ben Gamari at 2019-06-11T16:56:53Z
testsuite: Fix escaping in uses of grep

Relying on grep's default mode is dangerous since it seems different
systems differ in their defaults. Explicitly use `grep -e` to avoid
this.

- - - - -
381d696d by Ben Gamari at 2019-06-11T17:04:05Z
testsuite: Flush conc059's printf buffer

Otherwise it the order out the Haskell and C output will be
system-dependent.

- - - - -
81dd0eaa by Ben Gamari at 2019-06-11T17:09:55Z
testsuite: Ensure that ffi005 output order is predictable

The libc output buffer wasn't being flushed, making the order
system-depedent.

- - - - -


8 changed files:

- testsuite/tests/concurrent/should_run/conc059.stdout
- testsuite/tests/concurrent/should_run/conc059_c.c
- testsuite/tests/driver/T8602/T8602.script
- testsuite/tests/ffi/should_run/ffi005.hs
- testsuite/tests/numeric/should_run/Makefile
- testsuite/tests/numeric/should_run/T7014.primops
- testsuite/tests/rts/T5423_cmm.cmm
- testsuite/tests/simplCore/should_compile/Makefile


Changes:

=====================================
testsuite/tests/concurrent/should_run/conc059.stdout
=====================================
@@ -1,3 +1,3 @@
-500000
 exiting...
+500000
 exited.


=====================================
testsuite/tests/concurrent/should_run/conc059_c.c
=====================================
@@ -16,6 +16,7 @@ int main(int argc, char *argv[])
     usleep(100000);
 #endif
     printf("exiting...\n");
+    fflush(stdout);
     hs_exit();
     printf("exited.\n");
 #if mingw32_HOST_OS


=====================================
testsuite/tests/driver/T8602/T8602.script
=====================================
@@ -1,3 +1,4 @@
+:! echo '#!/bin/sh' >> t8602.sh
 :! echo 'echo $4 $5 $6; exit 1' > t8602.sh
 :! chmod +x t8602.sh
 :load A


=====================================
testsuite/tests/ffi/should_run/ffi005.hs
=====================================
@@ -21,6 +21,7 @@ main = do
 
   putStrLn "\nTesting puts (and withString)"
   withCString "Test successful" puts
+  c_fflush c_stdout
 
   putStrLn "\nTesting peekArray0"
   s <- withCString "Test successful" (peekArray0 (castCharToCChar '\0'))
@@ -71,6 +72,8 @@ withBuffer sz m = do
   return s
 
 foreign import ccall puts :: CString -> IO CInt
+foreign import ccall "fflush" c_fflush :: Ptr () -> IO CInt
+foreign import ccall "stdio.h stdout" c_stdout :: Ptr ()
 
 -- foreign import ccall "open" open'  :: CString -> CInt -> IO CInt
 -- foreign import ccall "open" open2' :: CString -> CInt -> CInt -> IO CInt


=====================================
testsuite/tests/numeric/should_run/Makefile
=====================================
@@ -6,5 +6,5 @@ include $(TOP)/mk/test.mk
 T7014:
 	rm -f T7014.simpl T7014.o T7014.hi
 	'$(TEST_HC)' -Wall -v0 -O --make T7014.hs -fforce-recomp -ddump-simpl > T7014.simpl
-	! grep -q -f T7014.primops T7014.simpl
+	! grep -e -q -f T7014.primops T7014.simpl
 	./T7014


=====================================
testsuite/tests/numeric/should_run/T7014.primops
=====================================
@@ -1,9 +1,9 @@
 and#
 or#
 uncheckedShift.*#
-\+#
-\-#
-\*#
++#
+-#
+*#
 quotInt#
 remInt#
 plusFloat#


=====================================
testsuite/tests/rts/T5423_cmm.cmm
=====================================
@@ -12,5 +12,6 @@ test (W_ r1,
  {
     foreign "C" printf("%d  %d  %d  %d  %d  %d  %d  %d  %d  %d\n",
                         r1, r2, r3, r4, r5, r6, r7, r8, r9, r10);
+    foreign "C" fflush(stdout);
     return (r10);
  }


=====================================
testsuite/tests/simplCore/should_compile/Makefile
=====================================
@@ -233,7 +233,7 @@ str-rules:
 # g should have been collapsed into one defininition by CSE.
 .PHONY: T13340
 T13340:
-	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '\+#'
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -e -c '+#'
 
 
 # We expect to see all dictionaries specialized away.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/b6b8202744b8aea160fae39d977b04ad32f4f3a5...81dd0eaa2b50baf859cc42f8f251e3f8ee30d8a6

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/b6b8202744b8aea160fae39d977b04ad32f4f3a5...81dd0eaa2b50baf859cc42f8f251e3f8ee30d8a6
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190611/13b7ea89/attachment-0001.html>


More information about the ghc-commits mailing list