summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/cgrun011.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/codeGen/should_run/cgrun011.hs')
-rw-r--r--testsuite/tests/codeGen/should_run/cgrun011.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_run/cgrun011.hs b/testsuite/tests/codeGen/should_run/cgrun011.hs
new file mode 100644
index 0000000000..c687e50272
--- /dev/null
+++ b/testsuite/tests/codeGen/should_run/cgrun011.hs
@@ -0,0 +1,29 @@
+-- !!! simple overloading example
+
+class Foo a where
+ foo :: a -> a -> Bool
+
+class (Foo a) => Bar a where
+ bar :: a -> a -> Bool
+
+instance Foo Int where
+ foo a b = a /= b
+
+instance Foo Bool where
+ foo a b = a /= b
+
+instance Bar Int where
+ bar a b = a < b
+
+instance Bar Bool where
+ bar a b = a < b
+
+foO = if bar (2::Int) (3::Int) then
+ if bar False True then
+ (42::Int)
+ else
+ (888::Int)
+ else
+ (999::Int)
+
+main = print foO