Skip to content
Snippets Groups Projects
Commit a0f68379 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

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.
parent 81608e82
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,8 @@ T5423: ...@@ -37,7 +37,8 @@ T5423:
$(RM) T5423_cmm.o T5423.o T5423.hi T5423$(exeext) $(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_cmm.cmm
"$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c T5423.hs "$(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 ./T5423
.PHONY: T9405 .PHONY: T9405
......
...@@ -7,8 +7,13 @@ foreign import prim "test" test :: Int# -> Int# -> Int# -> Int# -> Int# ...@@ -7,8 +7,13 @@ foreign import prim "test" test :: Int# -> Int# -> Int# -> Int# -> Int#
-> Int# -> Int# -> Int# -> Int# -> Int# -> Int# -> Int# -> Int# -> Int# -> Int#
-> Int# -> Int#
foreign import ccall "flush_stdout" flush_stdout :: IO ()
v :: Int v :: Int
v = I# (test 111# 112# 113# 114# 115# 116# 117# 118# 119# 120#) v = I# (test 111# 112# 113# 114# 115# 116# 117# 118# 119# 120#)
main :: IO () main :: IO ()
main = print v main = do
n <- return $! v
flush_stdout -- Ensure that libc output buffer is flushed
print n
120
111 112 113 114 115 116 117 118 119 120 111 112 113 114 115 116 117 118 119 120
120
#include <stdio.h>
void flush_stdout(void)
{
fflush(stdout);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment