Commit e948d22b authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #5658b

parent df587d57
......@@ -7,6 +7,11 @@ T3055:
'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T3055.hs -ddump-simpl > T3055.simpl
grep 'I# (-28)' T3055.simpl | sed 's/.*\(I# (-28)\).*/\1/'
T5658b:
$(RM) -f T5658b.o T5658b.hi
'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5658b.hs -ddump-simpl | grep --count indexIntArray
# Trac 5658 meant that there were three calls to indexIntArray instead of two
T3772:
$(RM) -f T3772*.hi T3772*.o
'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772_A.hs
......
{-# LANGUAGE MagicHash, BangPatterns #-}
module T5658b where
import GHC.Prim
foo :: ByteArray# -> ByteArray# -> Int# -> Int# -> Bool
foo xs ys m n = go 0# 0#
where
go i j = case i >=# m of
False -> let !x = indexIntArray# xs i in
case j >=# n of
False -> case x ==# indexIntArray# ys j of
False -> False
True -> go (i +# 1#) (j +# 1#)
True -> False
True -> case j >=# n of
False -> let !y = indexIntArray# ys i in False
True -> True
......@@ -134,3 +134,7 @@ test('simpl021',
run_command,
['$MAKE -s --no-print-directory simpl021'])
test('T5327', normal, run_command, ['$MAKE -s --no-print-directory T5327'])
test('T5658b',
normal,
run_command,
['$MAKE -s --no-print-directory T5658b'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment