testsuite: Add testcase for #14754
authorBen Gamari <ben@smart-cactus.org>
Sun, 4 Feb 2018 00:19:08 +0000 (19:19 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sun, 4 Feb 2018 01:35:12 +0000 (20:35 -0500)
testsuite/tests/codeGen/should_run/T14754.hs [new file with mode: 0644]
testsuite/tests/codeGen/should_run/T14754.stderr [new file with mode: 0644]
testsuite/tests/codeGen/should_run/T14754.stdout [new file with mode: 0644]
testsuite/tests/codeGen/should_run/all.T

diff --git a/testsuite/tests/codeGen/should_run/T14754.hs b/testsuite/tests/codeGen/should_run/T14754.hs
new file mode 100644 (file)
index 0000000..181659d
--- /dev/null
@@ -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 (file)
index 0000000..42c78ed
--- /dev/null
@@ -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 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
index 145365e..9403c4b 100644 (file)
@@ -166,3 +166,4 @@ test('T13825-unit',
      compile_and_run,
      ['-package ghc'])
 test('T14619', normal, compile_and_run, [''])
+test('T14754', normal, compile_and_run, [''])