summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/profiling/should_compile/T15108.hs22
-rw-r--r--testsuite/tests/profiling/should_compile/all.T1
2 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/profiling/should_compile/T15108.hs b/testsuite/tests/profiling/should_compile/T15108.hs
new file mode 100644
index 0000000000..d0143bf849
--- /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 4664658aab..7d51a9c51e 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'])