diff options
author | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2013-08-14 16:15:43 +0100 |
---|---|---|
committer | Jan Stolarek <jan.stolarek@p.lodz.pl> | 2013-08-14 16:15:43 +0100 |
commit | 0c03faed43cd010bcbe20f01a95182a93e4f35df (patch) | |
tree | 81aac9276563a7f66145e0a9e58bb831802bcb48 /testsuite/tests/simplCore | |
parent | 5f18e9e092a65a71a35a78e07b02e4c8ed245f96 (diff) | |
download | haskell-0c03faed43cd010bcbe20f01a95182a93e4f35df.tar.gz |
Comparison primops return Int# (Fixes #6135)
This patch adds tests for new primops and fixes the existing ones.
For a deatiled discussion of this changes please visit the wiki page:
http://hackage.haskell.org/trac/ghc/wiki/PrimBool
Diffstat (limited to 'testsuite/tests/simplCore')
5 files changed, 23 insertions, 15 deletions
diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile index 6fb26b2865..417c948b45 100644 --- a/testsuite/tests/simplCore/should_compile/Makefile +++ b/testsuite/tests/simplCore/should_compile/Makefile @@ -72,7 +72,7 @@ simpl021: .PHONY: T5327 T5327: $(RM) -f T5327.hi T5327.o - '$(TEST_HC)' $(TEST_HC_OPTS) -c T5327.hs -O -ddump-simpl | grep -c "GHC.Prim.># 34 " + '$(TEST_HC)' $(TEST_HC_OPTS) -c T5327.hs -O -ddump-simpl | grep -c 'GHC.Prim.>$$# 34 ' .PHONY: T5623 T5623: diff --git a/testsuite/tests/simplCore/should_compile/T3772.stdout b/testsuite/tests/simplCore/should_compile/T3772.stdout index 5dadfecd93..e42c76e073 100644 --- a/testsuite/tests/simplCore/should_compile/T3772.stdout +++ b/testsuite/tests/simplCore/should_compile/T3772.stdout @@ -1,13 +1,14 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 27, types: 10, coercions: 0} +Result size of Tidy Core = {terms: 29, types: 12, coercions: 0} Rec { xs :: GHC.Prim.Int# -> () [GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <L,U>] xs = \ (m :: GHC.Prim.Int#) -> - case GHC.Prim.<=# m 1 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<=$# m 1) + of _ { GHC.Types.False -> xs (GHC.Prim.-# m 1); GHC.Types.True -> GHC.Tuple.() } @@ -18,7 +19,8 @@ T3772.foo [InlPrag=NOINLINE] :: GHC.Types.Int -> () T3772.foo = \ (n :: GHC.Types.Int) -> case n of _ { GHC.Types.I# n# -> - case GHC.Prim.<=# n# 0 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<=$# n# 0) + of _ { GHC.Types.False -> xs n#; GHC.Types.True -> GHC.Tuple.() } diff --git a/testsuite/tests/simplCore/should_compile/T4930.stderr b/testsuite/tests/simplCore/should_compile/T4930.stderr index 5cde5c08b9..fcc1d1c32f 100644 --- a/testsuite/tests/simplCore/should_compile/T4930.stderr +++ b/testsuite/tests/simplCore/should_compile/T4930.stderr @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 22, types: 10, coercions: 0} +Result size of Tidy Core = {terms: 23, types: 11, coercions: 0} lvl :: [GHC.Types.Char] [GblId, Str=DmdType] @@ -19,7 +19,7 @@ T4930.foo :: GHC.Types.Int -> GHC.Types.Int Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False) Tmpl= \ (n [Occ=Once!] :: GHC.Types.Int) -> case n of _ { GHC.Types.I# x -> - case GHC.Prim.<# x 5 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<$# x 5) of _ { GHC.Types.False -> GHC.Types.I# (GHC.Prim.+# x 5); GHC.Types.True -> T4930.foo1 } @@ -27,7 +27,7 @@ T4930.foo :: GHC.Types.Int -> GHC.Types.Int T4930.foo = \ (n :: GHC.Types.Int) -> case n of _ { GHC.Types.I# x -> - case GHC.Prim.<# x 5 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<$# x 5) of _ { GHC.Types.False -> GHC.Types.I# (GHC.Prim.+# x 5); GHC.Types.True -> T4930.foo1 } diff --git a/testsuite/tests/simplCore/should_compile/T5658b.hs b/testsuite/tests/simplCore/should_compile/T5658b.hs index 2c1c9ca340..61454a1339 100644 --- a/testsuite/tests/simplCore/should_compile/T5658b.hs +++ b/testsuite/tests/simplCore/should_compile/T5658b.hs @@ -1,6 +1,7 @@ {-# LANGUAGE MagicHash, BangPatterns #-} module T5658b where import GHC.Prim +import GHC.PrimWrappers foo :: ByteArray# -> ByteArray# -> Int# -> Int# -> Bool foo xs ys m n = go 0# 0# diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr index 28e54da3ba..8700b958d9 100644 --- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr +++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr @@ -1,6 +1,6 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 156, types: 55, coercions: 0} +Result size of Tidy Core = {terms: 162, types: 61, coercions: 0} Roman.foo3 :: GHC.Types.Int [GblId, Str=DmdType b] @@ -24,11 +24,13 @@ Roman.foo_$s$wgo = (GHC.Prim.+# (GHC.Prim.+# (GHC.Prim.+# sc1 sc1) sc1) sc1) sc1) sc1) sc1 } in - case GHC.Prim.<=# sc 0 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<=$# sc 0) + of _ { GHC.Types.False -> - case GHC.Prim.<# sc 100 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<$# sc 100) + of _ { GHC.Types.False -> - case GHC.Prim.<# sc 500 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<$# sc 500) of _ { GHC.Types.False -> Roman.foo_$s$wgo (GHC.Prim.-# sc 1) (GHC.Prim.+# a a); GHC.Types.True -> Roman.foo_$s$wgo (GHC.Prim.-# sc 3) a @@ -47,7 +49,7 @@ Roman.$wgo Str=DmdType <S,1*U><S,1*U>, Unf=Unf{Src=<vanilla>, TopLvl=True, Arity=2, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=IF_ARGS [60 30] 253 0}] + Guidance=IF_ARGS [60 30] 256 0}] Roman.$wgo = \ (w :: Data.Maybe.Maybe GHC.Types.Int) (w1 :: Data.Maybe.Maybe GHC.Types.Int) -> @@ -69,11 +71,14 @@ Roman.$wgo = Data.Maybe.Nothing -> Roman.foo_$s$wgo 10 a; Data.Maybe.Just n -> case n of _ { GHC.Types.I# x2 -> - case GHC.Prim.<=# x2 0 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<=$# x2 0) + of _ { GHC.Types.False -> - case GHC.Prim.<# x2 100 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<$# x2 100) + of _ { GHC.Types.False -> - case GHC.Prim.<# x2 500 of _ { + case GHC.Prim.tagToEnum# @ GHC.Types.Bool (GHC.Prim.<$# x2 500) + of _ { GHC.Types.False -> Roman.foo_$s$wgo (GHC.Prim.-# x2 1) (GHC.Prim.+# a a); GHC.Types.True -> Roman.foo_$s$wgo (GHC.Prim.-# x2 3) a |