[Git][ghc/ghc][master] JS: install rts/Types.h header file (#27033)
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 5b1be555 by Sylvain Henry at 2026-03-20T12:30:48-04:00 JS: install rts/Types.h header file (#27033) It was an omission, making HsFFI.h not usable with GHC using the JS backend. - - - - - 6 changed files: - rts/rts.cabal - + testsuite/tests/javascript/js-c-sources/T27033.hs - + testsuite/tests/javascript/js-c-sources/T27033.stdout - + testsuite/tests/javascript/js-c-sources/T27033_c.c - + testsuite/tests/javascript/js-c-sources/T27033_js.js - testsuite/tests/javascript/js-c-sources/all.T Changes: ===================================== rts/rts.cabal ===================================== @@ -150,6 +150,7 @@ library install-includes: HsFFI.h MachDeps.h Rts.h RtsAPI.h Stg.h ghcautoconf.h ghcconfig.h ghcplatform.h ghcversion.h DerivedConstants.h + rts/Types.h stg/MachRegs.h stg/MachRegs/arm32.h stg/MachRegs/arm64.h ===================================== testsuite/tests/javascript/js-c-sources/T27033.hs ===================================== @@ -0,0 +1,4 @@ +main :: IO () +main = print =<< increment 41 + +foreign import javascript "increment_wrapper" increment :: Int -> IO Int ===================================== testsuite/tests/javascript/js-c-sources/T27033.stdout ===================================== @@ -0,0 +1 @@ +42 ===================================== testsuite/tests/javascript/js-c-sources/T27033_c.c ===================================== @@ -0,0 +1,5 @@ +#include "HsFFI.h" + +HsInt increment(HsInt x) { + return x + 1; +} ===================================== testsuite/tests/javascript/js-c-sources/T27033_js.js ===================================== @@ -0,0 +1,5 @@ +//#OPTIONS:EMCC:EXPORTED_FUNCTIONS=_increment + +function increment_wrapper(x) { + return _increment(x); +} ===================================== testsuite/tests/javascript/js-c-sources/all.T ===================================== @@ -3,3 +3,4 @@ setTestOpts(when(not(js_arch()),skip)) test('js-c-sources01', extra_files(['js-c-sources01_c.c','js-c-sources01_js.js']), compile_and_run, ['js-c-sources01_c.c js-c-sources01_js.js']) test('js-c-sources02', extra_files(['js-c-sources02_c.c','js-c-sources02_js.js']), compile_and_run, ['js-c-sources02_c.c js-c-sources02_js.js']) +test('T27033', extra_files(['T27033_c.c','T27033_js.js']), compile_and_run, ['T27033_c.c T27033_js.js']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b1be555be4f0989d78c274991c5046d... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b1be555be4f0989d78c274991c5046d... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)