Add test case for #15108
authorJoachim Breitner <mail@joachim-breitner.de>
Tue, 1 May 2018 02:13:38 +0000 (22:13 -0400)
committerJoachim Breitner <mail@joachim-breitner.de>
Tue, 1 May 2018 02:15:56 +0000 (22:15 -0400)
thanks to cdisselkoen for the nicely minimized test case.

testsuite/tests/profiling/should_compile/T15108.hs [new file with mode: 0644]
testsuite/tests/profiling/should_compile/all.T

diff --git a/testsuite/tests/profiling/should_compile/T15108.hs b/testsuite/tests/profiling/should_compile/T15108.hs
new file mode 100644 (file)
index 0000000..d0143bf
--- /dev/null
@@ -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
index 4664658..7d51a9c 100644 (file)
@@ -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'])