diff --git a/ghc/lib/tests/Array/arr001/Main.hs b/ghc/lib/tests/Array/arr001/Main.hs deleted file mode 100644 index 4785170771e6c60ee4c1d65a7bac6b7c3de2cd01..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr001/Main.hs +++ /dev/null @@ -1,9 +0,0 @@ --- Simple array creation - -import Array - -main = - let a1 = array (1,3) (zip [2,3,1] ['a'..'d']) in - print a1 - --- Result: diff --git a/ghc/lib/tests/Array/arr001/Makefile b/ghc/lib/tests/Array/arr001/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr001/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr002/Main.hs b/ghc/lib/tests/Array/arr002/Main.hs deleted file mode 100644 index fd3bf7e3dd66001aa25fa110699cd24f25bf0503..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr002/Main.hs +++ /dev/null @@ -1,23 +0,0 @@ --- Array creation, (index,value) list with duplicates. --- --- Haskell library report 1.3 (and earlier) specifies --- that `array' values created with lists containing dups, --- are undefined ( _|_ ). --- --- GHC-2.02 (and earlier) does not flag this as such, the --- last (index,value) is instead used. --- --- The report also specifies `array' is spine strict in --- the (index,value) list argument and to check the --- validity of the index values upon creation, it also --- strict for the indices. To test this, we do (a!1) --- twice, expecting to see the same value.. --- -import Array - -main = - let a1 = array (1,3) (zip (1:[1..3]) ['a'..'d']) in - print (a1!1) >> - print a1 >> - print (a1!1) - diff --git a/ghc/lib/tests/Array/arr002/Makefile b/ghc/lib/tests/Array/arr002/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr002/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr003/Main.hs b/ghc/lib/tests/Array/arr003/Main.hs deleted file mode 100644 index 0dbe42bc0e3f97f0529bd02baee6c4bd77ad2703..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr003/Main.hs +++ /dev/null @@ -1,19 +0,0 @@ --- Array creation, (index,value) list with out of bound index. --- --- Haskell library report 1.3 (and earlier) specifies --- that `array' values created with lists containing out-of-bounds indices, --- are undefined ( _|_ ). --- --- GHC implementation of `array' catches this (or, rather, --- `index' does) - the argument list to `array' is defined --- to have its spine be evaluated - so the indexing below --- should cause a failure. --- -import Array - -main = - let a1 = array (1,3) (zip ([1..4]) ['a'..'d']) in - print (a1!2) - - - diff --git a/ghc/lib/tests/Array/arr003/Makefile b/ghc/lib/tests/Array/arr003/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr003/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr004/Main.hs b/ghc/lib/tests/Array/arr004/Main.hs deleted file mode 100644 index 5a1283435f3e8ed7c64d981c296cf5f4d7a1177a..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr004/Main.hs +++ /dev/null @@ -1,15 +0,0 @@ --- Array - accessing undefined element --- --- Sample Haskell implementation in the 1.3 Lib report defines --- this as being undefined/error. - -import Array - -main = - let a1 = array (1,3) (zip ([1,2]) ['a'..'d']) in - print (a1!3) - --- output: Fail: (Array.!): undefined array element - - - diff --git a/ghc/lib/tests/Array/arr004/Makefile b/ghc/lib/tests/Array/arr004/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr004/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr005/Main.hs b/ghc/lib/tests/Array/arr005/Main.hs deleted file mode 100644 index 6d531cdac8f2ff12df20d9af6aa1dc668d3ae172..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr005/Main.hs +++ /dev/null @@ -1,16 +0,0 @@ --- Array - recurrences --- --- array does not evaluate the elements. --- -import Array - -main = - let - a1 = array (1,100) ((1,1::Integer):[(i,i*a1!(i-1))|i<-[2..100]]) - in - print a1 - --- - - - diff --git a/ghc/lib/tests/Array/arr005/Makefile b/ghc/lib/tests/Array/arr005/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr005/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr006/Main.hs b/ghc/lib/tests/Array/arr006/Main.hs deleted file mode 100644 index 95abb1cfb5303c9893869256875775782115e5ce..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr006/Main.hs +++ /dev/null @@ -1,11 +0,0 @@ --- Array - empty arrays --- --- print a couple of them to try to expose empty arrays --- to a GC or two. -import Array - -main = - let - a1 = array (1,0) [] - in - print (take 300 $ repeat (a1 :: Array Int Int)) diff --git a/ghc/lib/tests/Array/arr006/Makefile b/ghc/lib/tests/Array/arr006/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr006/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr007/Main.hs b/ghc/lib/tests/Array/arr007/Main.hs deleted file mode 100644 index e3e4ba0f7bb0d231968403068596146c0718a469..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr007/Main.hs +++ /dev/null @@ -1,11 +0,0 @@ --- Array - accessing empty arrays --- --- empty arrays are legal, but indexing them is undefined! --- -import Array - -main = - let - a1 = array (1,0) [(1,'a')] - in - print (a1!0) diff --git a/ghc/lib/tests/Array/arr007/Makefile b/ghc/lib/tests/Array/arr007/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr007/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr008/Main.hs b/ghc/lib/tests/Array/arr008/Main.hs deleted file mode 100644 index c066cddebb9091af07f04084d65a3cfc021cbbe4..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr008/Main.hs +++ /dev/null @@ -1,14 +0,0 @@ --- Array - out-of-range (index,value) pairs --- --- supplying a list containing one or more pairs --- with out-of-range index is undefined. --- --- -import Array - -main = - let - a1 = array (1,0) [] - a2 = array (0,1) (zip [0..] ['a'..'z']) - in - print (a1::Array Int Int) >> print a2 diff --git a/ghc/lib/tests/Array/arr008/Makefile b/ghc/lib/tests/Array/arr008/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr008/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr009/Main.hs b/ghc/lib/tests/Array/arr009/Main.hs deleted file mode 100644 index a6fe26e04d1d6422a437fe15af916e89d51b1791..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr009/Main.hs +++ /dev/null @@ -1,17 +0,0 @@ --- Array - derived ops --- --- testing the well-behavedness of --- derived ops for empty and non-empty arrays --- -import Array - -main = - let - a1 = array (1,0) ([]::[(Int,Int)]) - a2 = array (1,26) (zip [1..] ['a'..'z']) - - dump a = (bounds a, indices a, elems a, assocs a) - in - print (dump a1) >> - print (dump a2) - diff --git a/ghc/lib/tests/Array/arr009/Makefile b/ghc/lib/tests/Array/arr009/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr009/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr010/Main.hs b/ghc/lib/tests/Array/arr010/Main.hs deleted file mode 100644 index 2952bec5296cdef0f86edb80763566dc3d840c8b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr010/Main.hs +++ /dev/null @@ -1,19 +0,0 @@ --- --- Array - accumulated arrays --- --- -module Main(main) where - -import Array -import Ix - -hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b -hist bnds is = accumArray (+) 0 bnds [(i,1) | i <- is , inRange bnds i] - -main = - let - a1 = hist (0,10) (concat $ take 2 $ repeat [1..20]) - in - print a1 - - diff --git a/ghc/lib/tests/Array/arr010/Makefile b/ghc/lib/tests/Array/arr010/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr010/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr011/Main.hs b/ghc/lib/tests/Array/arr011/Main.hs deleted file mode 100644 index 76ad1780ee327a4a286d357f966bfabe1c03f896..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr011/Main.hs +++ /dev/null @@ -1,20 +0,0 @@ --- Array - array difference operator --- --- -module Main(main) where - -import Array -import Ix - -hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b -hist bnds is = accumArray (+) 0 bnds [(i,1) | i <- is , inRange bnds i] - -main = - let - a1 = hist (0,10) (concat $ take 2 $ repeat [1..20]) - in - print a1 >> - print (a1 // [ (i,0) | i<-[0..10], odd i]) - - - diff --git a/ghc/lib/tests/Array/arr011/Makefile b/ghc/lib/tests/Array/arr011/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr011/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/lib/tests/Array/arr012/Main.hs b/ghc/lib/tests/Array/arr012/Main.hs deleted file mode 100644 index 61dc0bf5f84eb494db6c4a9d6049a871e1633ca9..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr012/Main.hs +++ /dev/null @@ -1,19 +0,0 @@ --- Array map operations --- --- -module Main(main) where - -import Array -import Char - -main = - let - a1 = array (0,10) (zip [0..10] ['a'..'z']) - in - print a1 >> - print (map (toUpper) a1) >> - print (ixmap (3,8) (+1) a1) - - - - diff --git a/ghc/lib/tests/Array/arr012/Makefile b/ghc/lib/tests/Array/arr012/Makefile deleted file mode 100644 index f66958d07b50cd4fccaf04f2abb57cf74769b80b..0000000000000000000000000000000000000000 --- a/ghc/lib/tests/Array/arr012/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/target.mk diff --git a/ghc/tests/array/should_run/arr012.stdout b/ghc/tests/array/should_run/arr012.stdout new file mode 100644 index 0000000000000000000000000000000000000000..599902dd16679a85c9a22ad666942f663f2369cf --- /dev/null +++ b/ghc/tests/array/should_run/arr012.stdout @@ -0,0 +1,3 @@ +array (0, 10) [(0, 'a'), (1, 'b'), (2, 'c'), (3, 'd'), (4, 'e'), (5, 'f'), (6, 'g'), (7, 'h'), (8, 'i'), (9, 'j'), (10, 'k')] +array (0, 10) [(0, 'A'), (1, 'B'), (2, 'C'), (3, 'D'), (4, 'E'), (5, 'F'), (6, 'G'), (7, 'H'), (8, 'I'), (9, 'J'), (10, 'K')] +array (3, 8) [(3, 'e'), (4, 'f'), (5, 'g'), (6, 'h'), (7, 'i'), (8, 'j')]