From 56186b8f2c48b717a891a77a94bdd51815f5ef65 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Mon, 13 Dec 2021 18:57:54 +0100 Subject: Test case from #19313 --- testsuite/tests/simplCore/should_run/T19313.hs | 17 +++++++++++++++++ testsuite/tests/simplCore/should_run/T19313.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 testsuite/tests/simplCore/should_run/T19313.hs create mode 100644 testsuite/tests/simplCore/should_run/T19313.stdout diff --git a/testsuite/tests/simplCore/should_run/T19313.hs b/testsuite/tests/simplCore/should_run/T19313.hs new file mode 100644 index 0000000000..0297260f79 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T19313.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE MagicHash #-} +module Main where + +import GHC.Exts + +{-# NOINLINE up #-} +up :: Int# -> Int# +up x = x +# 1# + +{-# NOINLINE down #-} +down :: Int# -> Int# +down x = x -# 1# + +{-# RULES "up/down" forall x. up (down x) = 42# #-} + +main = do + print (I# (up (down 1#))) diff --git a/testsuite/tests/simplCore/should_run/T19313.stdout b/testsuite/tests/simplCore/should_run/T19313.stdout new file mode 100644 index 0000000000..d81cc0710e --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T19313.stdout @@ -0,0 +1 @@ +42 diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index fe6b5d3479..ac758668ab 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -98,4 +98,5 @@ test('NumConstantFolding16', normal, compile_and_run, ['']) test('NumConstantFolding32', normal, compile_and_run, ['']) test('NumConstantFolding', normal, compile_and_run, ['']) test('T19413', normal, compile_and_run, ['']) -test('T20203', normal, compile, ['-O -dsuppress-all -dsuppress-uniques -dno-typeable-binds -ddump-simpl']) \ No newline at end of file +test('T20203', normal, compile, ['-O -dsuppress-all -dsuppress-uniques -dno-typeable-binds -ddump-simpl']) +test('T19313', expect_broken(19131), compile_and_run, ['']) -- cgit v1.2.1