summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-09-30 19:26:02 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-01 18:38:35 -0400
commite5523324d2c55e0091857e21bf5613b5f6b442a7 (patch)
treeca024915a9380f820d4f30419666e156c1109742 /testsuite/tests
parenta8018c17747342444c67eeec21a506c89c1110e8 (diff)
downloadhaskell-e5523324d2c55e0091857e21bf5613b5f6b442a7.tar.gz
Bignum: add integerNegate RULE
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/lib/integer/all.T1
-rw-r--r--testsuite/tests/lib/integer/integerNegate.hs8
-rw-r--r--testsuite/tests/lib/integer/integerNegate.stderr10
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/lib/integer/all.T b/testsuite/tests/lib/integer/all.T
index 45270453a1..0c997f7ebf 100644
--- a/testsuite/tests/lib/integer/all.T
+++ b/testsuite/tests/lib/integer/all.T
@@ -1,3 +1,4 @@
+test('integerNegate', normal, compile, ['-ddump-simpl -dno-typeable-binds -dsuppress-all -dsuppress-uniques'])
test('integerBits', normal, compile_and_run, [''])
test('integerConversions', normal, compile_and_run, [''])
test('plusMinusInteger', [omit_ways(['ghci'])], compile_and_run, [''])
diff --git a/testsuite/tests/lib/integer/integerNegate.hs b/testsuite/tests/lib/integer/integerNegate.hs
new file mode 100644
index 0000000000..777c1b002a
--- /dev/null
+++ b/testsuite/tests/lib/integer/integerNegate.hs
@@ -0,0 +1,8 @@
+{-# OPTIONS_GHC -O2 #-}
+
+module Test where
+
+import GHC.Num.Integer
+
+neg_neg :: Integer -> Integer
+neg_neg x = integerNegate (integerNegate x)
diff --git a/testsuite/tests/lib/integer/integerNegate.stderr b/testsuite/tests/lib/integer/integerNegate.stderr
new file mode 100644
index 0000000000..bebc75c44f
--- /dev/null
+++ b/testsuite/tests/lib/integer/integerNegate.stderr
@@ -0,0 +1,10 @@
+
+==================== Tidy Core ====================
+Result size of Tidy Core
+ = {terms: 3, types: 3, coercions: 0, joins: 0/0}
+
+-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
+neg_neg = \ x -> x
+
+
+