diff options
author | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2023-02-21 10:51:34 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-02-28 18:54:59 -0500 |
commit | 7192ef91c855e1fae6997f75cfde76aafd0b4bcf (patch) | |
tree | aef67a692c95e4e11b50d855ba651784eb89c109 /testsuite/tests | |
parent | 239202a2b14714740e016d7bbcd4f351356fcb00 (diff) | |
download | haskell-7192ef91c855e1fae6997f75cfde76aafd0b4bcf.tar.gz |
Take more care with unlifted bindings in the specialiser
As #22998 showed, we were floating an unlifted binding to top
level, which breaks a Core invariant.
The fix is easy, albeit a little bit conservative. See
Note [Care with unlifted bindings] in GHC.Core.Opt.Specialise
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/simplCore/should_run/T22998.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/T22998.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/all.T | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_run/T22998.hs b/testsuite/tests/simplCore/should_run/T22998.hs new file mode 100644 index 0000000000..459f576d82 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T22998.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE DataKinds #-} +module Main where + +import Data.Proxy (Proxy(Proxy)) +import GHC.TypeLits (natVal) + +main :: IO () +main = print x + where + x = natVal @18446744073709551616 Proxy + natVal @18446744073709551616 Proxy diff --git a/testsuite/tests/simplCore/should_run/T22998.stdout b/testsuite/tests/simplCore/should_run/T22998.stdout new file mode 100644 index 0000000000..1ce484120a --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T22998.stdout @@ -0,0 +1 @@ +36893488147419103232 diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index 527f44a1bc..928bf89df9 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -108,3 +108,5 @@ test('T21575', normal, compile_and_run, ['-O']) test('T21575b', [], multimod_compile_and_run, ['T21575b', '-O']) test('T20836', normal, compile_and_run, ['-O0']) # Should not time out; See #20836 test('T22448', normal, compile_and_run, ['-O1']) +test('T22998', normal, compile_and_run, ['-O0 -fspecialise -dcore-lint']) + |