Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 530e8e58 by Simon Peyton Jones at 2026-02-12T20:17:23-05:00 Add regression tests for four StaticPtr bugs Tickets #26545, #24464, #24773, #16981 are all solved by the recently-landed MR commit 318ee13bcffa6aa8df42ba442ccd92aa0f7e210c Author: Simon Peyton Jones <simon.peytonjones@gmail.com> Date: Mon Oct 20 23:07:20 2025 +0100 Simplify the treatment of static forms This MR just adds regression tests for them. - - - - - e594aa0f by Cheng Shao at 2026-02-12T20:50:17-05:00 ci: remove unused hlint-ghc-and-base job definition This patch removes the unused `hlint-ghc-and-base` job definition, it's never run since !9806. Note that hadrian lint rules still work locally, so anyone that wishes to run hlint on the codebase can continue to do so in their local worktree. - - - - - d93ce703 by Cheng Shao at 2026-02-12T20:50:18-05:00 wasm: use import.meta.main for proper distinction of nodejs main modules This patch uses `import.meta.main` for proper distinction of nodejs main modules, especially when the main module might be installed as a symlink. Fixes #26916. - - - - - 13 changed files: - .gitlab-ci.yml - + testsuite/tests/rename/should_fail/T26545.hs - + testsuite/tests/rename/should_fail/T26545.stderr - testsuite/tests/rename/should_fail/all.T - + testsuite/tests/typecheck/should_compile/T24464.hs - testsuite/tests/typecheck/should_compile/all.T - + testsuite/tests/typecheck/should_run/T16981.hs - + testsuite/tests/typecheck/should_run/T16981.stdout - + testsuite/tests/typecheck/should_run/T24773.hs - + testsuite/tests/typecheck/should_run/T24773.stdout - testsuite/tests/typecheck/should_run/all.T - utils/jsffi/dyld.mjs - utils/jsffi/post-link.mjs Changes: ===================================== .gitlab-ci.yml ===================================== @@ -387,20 +387,6 @@ lint-submods-branch: paths: - cabal-cache -# Disabled due to #22830 -.hlint-ghc-and-base: - extends: .lint-params - image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV" - variables: - BUILD_FLAVOUR: default - script: - - .gitlab/ci.sh setup - - .gitlab/ci.sh configure - - .gitlab/ci.sh run_hadrian lint:ghc-internal - - .gitlab/ci.sh run_hadrian lint:ghc-experimental - - .gitlab/ci.sh run_hadrian lint:base - - .gitlab/ci.sh run_hadrian lint:compiler - ############################################################ # GHC-in-GHCi (Hadrian) ############################################################ ===================================== testsuite/tests/rename/should_fail/T26545.hs ===================================== @@ -0,0 +1,12 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE StaticPointers #-} + +module Foo where + +import GHC.Exts + +f :: Int# -> Int# +f 0# = 0# +f n# = f (n# -# 1#) + +h x = let v = f 3# in static (I# (v +# 1#)) ===================================== testsuite/tests/rename/should_fail/T26545.stderr ===================================== @@ -0,0 +1,3 @@ +T26545.hs:12:23: error: [GHC-88431] + ‘v’ is used in a static form but it is not defined at top level + ===================================== testsuite/tests/rename/should_fail/all.T ===================================== @@ -263,3 +263,4 @@ test('T25901_sub_b', normal, compile_fail, ['']) test('T25901_sub_c', [extra_files(['T25901_sub_c_helper.hs'])], multimod_compile_fail, ['T25901_sub_c', '-v0']) test('T25901_sub_d', [extra_files(['T25901_sub_d_helper.hs'])], multimod_compile_fail, ['T25901_sub_d', '-v0']) test('T25901_sub_w', normal, compile_fail, ['']) +test('T26545', normal, compile_fail, ['']) ===================================== testsuite/tests/typecheck/should_compile/T24464.hs ===================================== @@ -0,0 +1,8 @@ +{-# LANGUAGE StaticPointers #-} +module T24464 where + +import GHC.StaticPtr + +class C a where + f :: a -> StaticPtr () + f _ = static () ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -960,4 +960,5 @@ test('T26582', normal, compile, ['']) test('T26746', normal, compile, ['']) test('T26737', normal, compile, ['']) test('T26805a', normal, compile, ['']) +test('T24464', normal, compile, ['']) ===================================== testsuite/tests/typecheck/should_run/T16981.hs ===================================== @@ -0,0 +1,31 @@ +{-# LANGUAGE StaticPointers #-} +-- Main.hs +module Main where + +import GHC.StaticPtr + +class UniqueHash a where + hash :: a -> String + +{-# NOINLINE unCacheable #-} +unCacheable :: Cacheable a -> a +unCacheable (CExplicit _ a) = a + +data Cacheable a = CExplicit String a + +instance UniqueHash (StaticPtr a) where + hash ptr = show $ staticKey ptr + +instance IsStatic Cacheable where + fromStaticPtr ptr = CExplicit h a where + h = hash ptr + a = deRefStaticPtr ptr + +{-# NOINLINE splitInjectedAsWindowed #-} +splitInjectedAsWindowed :: Int +-- WindowedDataset +splitInjectedAsWindowed = unCacheable $ static 1 + + +main :: IO () +main = print splitInjectedAsWindowed ===================================== testsuite/tests/typecheck/should_run/T16981.stdout ===================================== @@ -0,0 +1 @@ +1 ===================================== testsuite/tests/typecheck/should_run/T24773.hs ===================================== @@ -0,0 +1,16 @@ +{-# LANGUAGE StaticPointers #-} +{-# OPTIONS_GHC -O1 #-} + +module Main where + +import GHC.StaticPtr ( StaticPtr ) + +{-# NOINLINE uhoh #-} +uhoh :: () -> StaticPtr () +uhoh = + let ptr :: StaticPtr () + ptr = static () + in \_ -> ptr + +main :: IO () +main = putStrLn "Hello, Haskell!" ===================================== testsuite/tests/typecheck/should_run/T24773.stdout ===================================== @@ -0,0 +1 @@ +Hello, Haskell! ===================================== testsuite/tests/typecheck/should_run/all.T ===================================== @@ -181,3 +181,5 @@ test('T15598', normal, compile_and_run, ['']) test('T22086', normal, compile_and_run, ['']) test('T24411', normal, compile_and_run, ['']) test('DefaultExceptionContext', normal, compile_and_run, ['']) +test('T24773', normal, compile_and_run, ['']) +test('T16981', normal, compile_and_run, ['']) ===================================== utils/jsffi/dyld.mjs ===================================== @@ -1470,7 +1470,7 @@ async function nodeMain({ searchDirs, mainSoPath, outFd, inFd, args }) { ); } -const isNodeMain = isNode && import.meta.filename === process.argv[1]; +const isNodeMain = isNode && import.meta.main; // node iserv as invoked by // GHC.Runtime.Interpreter.Wasm.spawnWasmInterp ===================================== utils/jsffi/post-link.mjs ===================================== @@ -119,7 +119,7 @@ function isMain() { return false; } - return import.meta.filename === process.argv[1]; + return import.meta.main; } async function main() { View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c1085eb00c38d964e9ae6e3066c9920... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c1085eb00c38d964e9ae6e3066c9920... You're receiving this email because of your account on gitlab.haskell.org.