[Git][ghc/ghc][wip/sjakobi/T9074] Add regression test for #9074
Simon Jakobi pushed to branch wip/sjakobi/T9074 at Glasgow Haskell Compiler / GHC Commits: 81819c6a by Simon Jakobi at 2026-03-24T00:32:16+01:00 Add regression test for #9074 Closes #9074. - - - - - 7 changed files: - + testsuite/tests/ghci/T9074/Makefile - + testsuite/tests/ghci/T9074/T9074.hs - + testsuite/tests/ghci/T9074/T9074.script - + testsuite/tests/ghci/T9074/T9074.stdout - + testsuite/tests/ghci/T9074/T9074a.c - + testsuite/tests/ghci/T9074/T9074b.c - + testsuite/tests/ghci/T9074/all.T Changes: ===================================== testsuite/tests/ghci/T9074/Makefile ===================================== @@ -0,0 +1,12 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +.PHONY: T9074 +T9074 : + "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c -fPIC T9074b.c + "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c -fPIC T9074a.c + # Historically, loading T9074b.o before T9074a.o could fail with + # "Loading temp shared object failed ... undefined symbol: shared_value". + cat T9074.script | "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) \ + -v0 T9074b.o T9074a.o T9074.hs ===================================== testsuite/tests/ghci/T9074/T9074.hs ===================================== @@ -0,0 +1,6 @@ +{-# LANGUAGE ForeignFunctionInterface #-} + +foreign import ccall unsafe "read_from_b" readFromB :: IO Int + +main :: IO () +main = readFromB >>= print ===================================== testsuite/tests/ghci/T9074/T9074.script ===================================== @@ -0,0 +1 @@ +main ===================================== testsuite/tests/ghci/T9074/T9074.stdout ===================================== @@ -0,0 +1 @@ +65 ===================================== testsuite/tests/ghci/T9074/T9074a.c ===================================== @@ -0,0 +1 @@ +int shared_value = 65; ===================================== testsuite/tests/ghci/T9074/T9074b.c ===================================== @@ -0,0 +1,5 @@ +extern int shared_value; + +int read_from_b(void) { + return shared_value; +} ===================================== testsuite/tests/ghci/T9074/all.T ===================================== @@ -0,0 +1,4 @@ +test('T9074', + [req_c, + req_interp], + makefile_test, []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/81819c6a7064ed51d45d269e69586573... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/81819c6a7064ed51d45d269e69586573... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Jakobi (@sjakobi2)