summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-02-03 19:19:08 -0500
committerBen Gamari <ben@smart-cactus.org>2018-02-03 20:35:12 -0500
commit606edbfba14b025ce85a02e5ed7c03e8a097d692 (patch)
treefa00c49cdf86028bc991041dd5203c3893867cb7 /testsuite
parent50adbd7c5fe5894d3e6e2a58b353ed07e5f8949d (diff)
downloadhaskell-606edbfba14b025ce85a02e5ed7c03e8a097d692.tar.gz
testsuite: Add testcase for #14754
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/codeGen/should_run/T14754.hs15
-rw-r--r--testsuite/tests/codeGen/should_run/T14754.stderr2
-rw-r--r--testsuite/tests/codeGen/should_run/T14754.stdout1
-rw-r--r--testsuite/tests/codeGen/should_run/all.T1
4 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_run/T14754.hs b/testsuite/tests/codeGen/should_run/T14754.hs
new file mode 100644
index 0000000000..181659d4eb
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T14754.hs
@@ -0,0 +1,15 @@
+module Main where
+
+import Debug.Trace
+
+main :: IO ()
+main = print (alg 3 1)
+
+alg :: Word -> Word -> Word
+alg a b
+ | traceShow (a, b) False = undefined
+ | c < b = alg b c
+ | c > b = alg c b
+ | otherwise = c
+ where
+ c = a - b
diff --git a/testsuite/tests/codeGen/should_run/T14754.stderr b/testsuite/tests/codeGen/should_run/T14754.stderr
new file mode 100644
index 0000000000..42c78ed097
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T14754.stderr
@@ -0,0 +1,2 @@
+(3,1)
+(2,1)
diff --git a/testsuite/tests/codeGen/should_run/T14754.stdout b/testsuite/tests/codeGen/should_run/T14754.stdout
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/T14754.stdout
@@ -0,0 +1 @@
+1
diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T
index 145365e802..9403c4b1e1 100644
--- a/testsuite/tests/codeGen/should_run/all.T
+++ b/testsuite/tests/codeGen/should_run/all.T
@@ -166,3 +166,4 @@ test('T13825-unit',
compile_and_run,
['-package ghc'])
test('T14619', normal, compile_and_run, [''])
+test('T14754', normal, compile_and_run, [''])