diff options
author | Ian Lynagh <igloo@earth.li> | 2006-10-13 15:12:33 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2006-10-13 15:12:33 +0000 |
commit | 0b4b8c0af0acf175ceac7281c86a6d0b61be7a4b (patch) | |
tree | 5e69d7ee7ed0f44ff0881852ce61a05d16694ed5 /testsuite/tests/ghc-regress/profiling/should_compile | |
parent | 04f38aeb176d7a57268fd9bcdb26f5ec228ef970 (diff) | |
download | haskell-0b4b8c0af0acf175ceac7281c86a6d0b61be7a4b.tar.gz |
Add tests for trac#249 and #931
Diffstat (limited to 'testsuite/tests/ghc-regress/profiling/should_compile')
4 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/profiling/should_compile/Makefile b/testsuite/tests/ghc-regress/profiling/should_compile/Makefile new file mode 100644 index 0000000000..1c39d1c1fe --- /dev/null +++ b/testsuite/tests/ghc-regress/profiling/should_compile/Makefile @@ -0,0 +1,3 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/ghc-regress/profiling/should_compile/all.T b/testsuite/tests/ghc-regress/profiling/should_compile/all.T new file mode 100644 index 0000000000..4d8f168cbc --- /dev/null +++ b/testsuite/tests/ghc-regress/profiling/should_compile/all.T @@ -0,0 +1,10 @@ + +def f( opts ): + opts.only_ways = filter(lambda x: 'prof' in x, config.run_ways) +setTestOpts(f) + +# We need to run prof001 and prof002 all ways, as the compile succeeds +# due to the extra flags added for the profiling ways. +test('prof001', only_ways([]), compile, ['-prof -caf-all']) +test('prof002', only_ways([]), compile, ['-prof -caf-all']) + diff --git a/testsuite/tests/ghc-regress/profiling/should_compile/prof001.hs b/testsuite/tests/ghc-regress/profiling/should_compile/prof001.hs new file mode 100644 index 0000000000..8873a8487e --- /dev/null +++ b/testsuite/tests/ghc-regress/profiling/should_compile/prof001.hs @@ -0,0 +1,5 @@ + +-- This tests trac #249 + +main = return () + diff --git a/testsuite/tests/ghc-regress/profiling/should_compile/prof002.hs b/testsuite/tests/ghc-regress/profiling/should_compile/prof002.hs new file mode 100644 index 0000000000..0b631bbcd2 --- /dev/null +++ b/testsuite/tests/ghc-regress/profiling/should_compile/prof002.hs @@ -0,0 +1,17 @@ + +-- This tests trac #931 + +module Main where + +x = f [1..5] (f [2..] [3..]) + +f xs ys = l + where + l = [ if s then x else y | (x, y) <- zip xs ys ] + s = g xs ys + g [] _ = True + g _ [] = False + g (x:xs) (y:ys) = g xs ys + +main = print (show x) + |