diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-16 10:40:55 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-17 05:25:28 -0500 |
commit | 4e6c80197f1cc46dfdef0300de46847c7cfbdcb0 (patch) | |
tree | 72b3ddcfd121f161f5f611ac250941c1c58296d9 /testsuite/tests | |
parent | 4127e86dfdfcfce60e5029c716c98c244851779a (diff) | |
download | haskell-4e6c80197f1cc46dfdef0300de46847c7cfbdcb0.tar.gz |
Always define __GLASGOW_HASKELL_PATCHLEVEL1/2__ macros
As #21076 reports if you are using `-Wcpp-undef` then you get warnings
when using the `MIN_VERSION_GLASGOW_HASKELL` macro because
__GLASGOW_HASKELL_PATCHLEVEL2__ is very rarely explicitliy set (as
version numbers are not 4 components long).
This macro was introduced in 3549c952b535803270872adaf87262f2df0295a4
and it seems the bug has existed ever since.
Fixes #21076
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/driver/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/driver/patch-level2.hs | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 907002fcf7..af81d61eb8 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -303,3 +303,4 @@ test('T20200loop', extra_files(['T20200loop']), multimod_compile, ['Datatypes', '-iT20200loop -O -v0']) test('T20316', normal, makefile_test, []) test('MultiRootsErr', normal, multimod_compile_fail, ['MultiRootsErr', 'MultiRootsErr']) +test('patch-level2', normal, compile, ['-Wcpp-undef']) diff --git a/testsuite/tests/driver/patch-level2.hs b/testsuite/tests/driver/patch-level2.hs new file mode 100644 index 0000000000..ae89fbed8e --- /dev/null +++ b/testsuite/tests/driver/patch-level2.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE CPP #-} +module PatchLevel2 where + + +p2 = __GLASGOW_HASKELL_PATCHLEVEL2__ +p1 = __GLASGOW_HASKELL_PATCHLEVEL1__ |