diff options
author | Adam Gundry <adam@well-typed.com> | 2021-03-16 12:59:53 +0000 |
---|---|---|
committer | Adam Gundry <adam@well-typed.com> | 2021-04-15 15:03:41 +0100 |
commit | dea9332dea5cd14c5a63130422f4439b9a83633d (patch) | |
tree | d42ce9a5f5db18e054d82cf7badbe02b11556336 | |
parent | aae17c2b00c66f97c4bba80175e36a203908e67d (diff) | |
download | haskell-dea9332dea5cd14c5a63130422f4439b9a83633d.tar.gz |
Add test for #13386
-rw-r--r-- | testsuite/tests/perf/compiler/T13386.hs | 20 | ||||
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 4 |
2 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/T13386.hs b/testsuite/tests/perf/compiler/T13386.hs new file mode 100644 index 0000000000..68d681c19f --- /dev/null +++ b/testsuite/tests/perf/compiler/T13386.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE DataKinds, TypeApplications, TypeFamilies, TypeOperators, UndecidableInstances #-} +{-# OPTIONS_GHC -O0 -freduction-depth=500 #-} + +module T13386 where + +import GHC.TypeLits + +type DivisibleBy x y = Help x y 0 (CmpNat x 0) + +type family Help x y z b where + Help x y z EQ = True + Help x y z LT = False + Help x y z GT = Help x y (z+y) (CmpNat x z) + +foo :: DivisibleBy y 3 ~ True => proxy y -> () +foo _ = () + +type N = 1002 + +k = foo @N undefined diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 3c444406b3..ec21d6aeed 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -469,3 +469,7 @@ test ('T8095', [ collect_compiler_stats('bytes allocated',2) ], compile, ['-v0 -O']) +test ('T13386', + [ collect_compiler_stats('bytes allocated',2) ], + compile, + ['-v0 -O0']) |