[Git][ghc/ghc][wip/sjakobi/deprecated-flags-2016] Make T2464 actually test #ifdef'd pragmas
Simon Jakobi pushed to branch wip/sjakobi/deprecated-flags-2016 at Glasgow Haskell Compiler / GHC Commits: b3ba3621 by Simon Jakobi at 2026-10-12T16:07:54+02:00 Make T2464 actually test #ifdef'd pragmas The test guarded a LANGUAGE EmptyDataDecls pragma behind #if, but EmptyDataDecls is on by default since Haskell2010, so the module compiled even when the guarded pragma was ignored. Guard MagicHash instead, which is unlikely to be included in a future default language. Also restore the check that warnings from file-header pragmas are emitted only once, even though the pragmas are parsed both before and after CPP. The -fffi deprecation warning used to serve as that canary. Use an unrecognised warning flag instead, which will not go away. Assisted-by: Claude Fable 5.1 - - - - - 2 changed files: - testsuite/tests/driver/T2464.hs - + testsuite/tests/driver/T2464.stderr Changes: ===================================== testsuite/tests/driver/T2464.hs ===================================== @@ -1,8 +1,13 @@ {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -DTEST #-} +{-# OPTIONS_GHC -Wno-such-warning #-} -- warned about exactly once #if defined(TEST) -{-# LANGUAGE EmptyDataDecls #-} +{-# LANGUAGE MagicHash #-} #endif module Test2464 where -data T + +import GHC.Exts + +f :: Int# -> Int# +f x = x +# 1# ===================================== testsuite/tests/driver/T2464.stderr ===================================== @@ -0,0 +1,3 @@ + +T2464.hs:3:17: warning: [GHC-93741] [-Wunrecognised-warning-flags (in -Wdefault)] + unrecognised warning flag: -Wno-such-warning View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3ba3621bb41972b140eb7857e50f2e1... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3ba3621bb41972b140eb7857e50f2e1... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Simon Jakobi (@sjakobi)