summaryrefslogtreecommitdiff
path: root/testsuite/tests/profiling/should_compile
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/profiling/should_compile')
-rw-r--r--testsuite/tests/profiling/should_compile/2410.hs10
-rw-r--r--testsuite/tests/profiling/should_compile/Makefile3
-rw-r--r--testsuite/tests/profiling/should_compile/all.T8
-rw-r--r--testsuite/tests/profiling/should_compile/prof001.hs5
-rw-r--r--testsuite/tests/profiling/should_compile/prof002.hs17
-rw-r--r--testsuite/tests/profiling/should_compile/prof002.stdout1
6 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/tests/profiling/should_compile/2410.hs b/testsuite/tests/profiling/should_compile/2410.hs
new file mode 100644
index 0000000000..5c56e82992
--- /dev/null
+++ b/testsuite/tests/profiling/should_compile/2410.hs
@@ -0,0 +1,10 @@
+{-# OPTIONS_GHC -fno-warn-missing-methods -fno-warn-deprecations #-}
+module C where
+
+ data Complex a = !a :+ !a
+ deriving (Eq, Show)
+
+ instance (RealFloat a) => Num (Complex a) where
+ {-# SPECIALISE instance Num (Complex Float) #-}
+ {-# SPECIALISE instance Num (Complex Double) #-}
+ (x :+ y) + (x' :+ y') = (x + x') :+ (y + y')
diff --git a/testsuite/tests/profiling/should_compile/Makefile b/testsuite/tests/profiling/should_compile/Makefile
new file mode 100644
index 0000000000..9101fbd40a
--- /dev/null
+++ b/testsuite/tests/profiling/should_compile/Makefile
@@ -0,0 +1,3 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/profiling/should_compile/all.T b/testsuite/tests/profiling/should_compile/all.T
new file mode 100644
index 0000000000..b9539038b1
--- /dev/null
+++ b/testsuite/tests/profiling/should_compile/all.T
@@ -0,0 +1,8 @@
+
+# We need to run prof001 and prof002 the normal way, as the extra flags
+# added for the profiling ways makes it pass
+test('prof001', compose(only_ways(['normal']), req_profiling), compile_and_run, ['-prof -caf-all'])
+test('prof002', compose(only_ways(['normal']), req_profiling), compile_and_run, ['-prof -caf-all'])
+
+test('2410', compose(only_ways(['normal']), req_profiling), compile, ['-O2 -prof -caf-all'])
+
diff --git a/testsuite/tests/profiling/should_compile/prof001.hs b/testsuite/tests/profiling/should_compile/prof001.hs
new file mode 100644
index 0000000000..8873a8487e
--- /dev/null
+++ b/testsuite/tests/profiling/should_compile/prof001.hs
@@ -0,0 +1,5 @@
+
+-- This tests trac #249
+
+main = return ()
+
diff --git a/testsuite/tests/profiling/should_compile/prof002.hs b/testsuite/tests/profiling/should_compile/prof002.hs
new file mode 100644
index 0000000000..0b631bbcd2
--- /dev/null
+++ b/testsuite/tests/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)
+
diff --git a/testsuite/tests/profiling/should_compile/prof002.stdout b/testsuite/tests/profiling/should_compile/prof002.stdout
new file mode 100644
index 0000000000..e74b083d69
--- /dev/null
+++ b/testsuite/tests/profiling/should_compile/prof002.stdout
@@ -0,0 +1 @@
+"[1,2,3,4,5]"