summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/stranal')
-rw-r--r--testsuite/tests/stranal/should_run/T10218.hs18
-rw-r--r--testsuite/tests/stranal/should_run/T10218.stdout1
-rw-r--r--testsuite/tests/stranal/should_run/all.T1
3 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_run/T10218.hs b/testsuite/tests/stranal/should_run/T10218.hs
new file mode 100644
index 0000000000..572c6fdebf
--- /dev/null
+++ b/testsuite/tests/stranal/should_run/T10218.hs
@@ -0,0 +1,18 @@
+{-# OPTIONS_GHC -feager-blackholing #-}
+
+module Main where
+
+{-# NOINLINE foo #-}
+foo :: Bool -> Int -> Int -> Int
+foo True _ x = 1
+foo False _ x = x+1
+
+{-# NOINLINE bar #-}
+bar :: Int -> (Int,Int)
+bar x = let y1 = x * 2
+ y2 = x * 2
+ in (foo False y1 y2,foo False y2 y1)
+
+main = print (fst p + snd p)
+ where
+ p = bar 3
diff --git a/testsuite/tests/stranal/should_run/T10218.stdout b/testsuite/tests/stranal/should_run/T10218.stdout
new file mode 100644
index 0000000000..8351c19397
--- /dev/null
+++ b/testsuite/tests/stranal/should_run/T10218.stdout
@@ -0,0 +1 @@
+14
diff --git a/testsuite/tests/stranal/should_run/all.T b/testsuite/tests/stranal/should_run/all.T
index 7f64f85a11..8a82ce86a5 100644
--- a/testsuite/tests/stranal/should_run/all.T
+++ b/testsuite/tests/stranal/should_run/all.T
@@ -9,3 +9,4 @@ test('T2756b', normal, compile_and_run, [''])
test('T7649', normal, compile_and_run, [''])
test('T9254', normal, compile_and_run, [''])
test('T10148', normal, compile_and_run, [''])
+test('T10218', normal, compile_and_run, [''])