[commit: ghc] master: Add test case for #15108 (4e45ebe)

git at git.haskell.org git at git.haskell.org
Tue May 1 02:16:20 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4e45ebeea097b662076936f5a50c0873d8737923/ghc

>---------------------------------------------------------------

commit 4e45ebeea097b662076936f5a50c0873d8737923
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Mon Apr 30 22:13:38 2018 -0400

    Add test case for #15108
    
    thanks to cdisselkoen for the nicely minimized test case.


>---------------------------------------------------------------

4e45ebeea097b662076936f5a50c0873d8737923
 testsuite/tests/profiling/should_compile/T15108.hs | 22 ++++++++++++++++++++++
 testsuite/tests/profiling/should_compile/all.T     |  1 +
 2 files changed, 23 insertions(+)

diff --git a/testsuite/tests/profiling/should_compile/T15108.hs b/testsuite/tests/profiling/should_compile/T15108.hs
new file mode 100644
index 0000000..d0143bf
--- /dev/null
+++ b/testsuite/tests/profiling/should_compile/T15108.hs
@@ -0,0 +1,22 @@
+module Main where
+
+main :: IO ()
+main = do
+  _ <- return $ getInt Circle
+  return ()
+
+newtype MyInt = MyInt Int
+
+data Shape = Circle | Square
+
+getInt :: Shape -> MyInt
+getInt sh =
+  case sh of
+    Circle ->
+        let (MyInt i) = MyInt 3
+        in myInt i
+    Square ->
+        let (MyInt i) = MyInt 2
+        in myInt i
+    where
+      myInt = MyInt
diff --git a/testsuite/tests/profiling/should_compile/all.T b/testsuite/tests/profiling/should_compile/all.T
index 4664658..7d51a9c 100644
--- a/testsuite/tests/profiling/should_compile/all.T
+++ b/testsuite/tests/profiling/should_compile/all.T
@@ -7,3 +7,4 @@ test('T2410', [only_ways(['normal']), req_profiling], compile, ['-O2 -prof -fpro
 test('T5889', [only_ways(['normal']), req_profiling, extra_files(['T5889/A.hs', 'T5889/B.hs'])], multimod_compile, ['A B', '-O -prof -fno-prof-count-entries -v0'])
 test('T12790', [only_ways(['normal']), req_profiling], compile, ['-O -prof'])
 test('T14931', [only_ways(['normal']), req_profiling], run_command, ['$MAKE -s --no-print-directory T14931'])
+test('T15108', [only_ways(['normal']), req_profiling, expect_broken(15108)], compile, ['-O -prof -fprof-auto'])



More information about the ghc-commits mailing list