Makefile 8.54 KB
Newer Older
1
TOP=../../..
2 3
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
Ian Lynagh's avatar
Ian Lynagh committed
4

5 6 7 8 9
T14978:
	$(RM) -f T14978.o T14978.hi
	-'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T14978.hs -dsuppress-coercions | grep 'foo'
        # Expecting the defn of 'foo' to apply Goof to an unboxed coercion

10 11 12 13 14 15
T13468:
	$(RM) -f T13468.o T13468.hi
	-'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T13468.hs | grep 'Error'
        # Expecting no output from the grep, hence "-"
        # If the case branch is not eliminated, we get a patError

Simon Peyton Jones's avatar
Simon Peyton Jones committed
16 17 18 19 20
T3990:
	$(RM) -f T3990.o T3990.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T3990.hs | grep 'test_case'
        # Grep output should show an unpacked constructor

Simon Peyton Jones's avatar
Simon Peyton Jones committed
21 22 23 24 25
T8848:
	$(RM) -f T8848.o T8848.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-rule-firings T8848.hs | grep 'SPEC map2'
        # Should fire twice

26 27 28
T9509:
	$(RM) -f T9509*.o T9509*.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T9509a.hs
Simon Peyton Jones's avatar
Simon Peyton Jones committed
29
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T9509.hs  \
30
              -ddump-rule-rewrites | grep SPEC
Simon Peyton Jones's avatar
Simon Peyton Jones committed
31
        # Grep output should show a SPEC rule firing, twice
32

33 34 35 36
T13317:
	$(RM) -f T13317.o T13317.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl-stats T13317.hs | grep 'KnownBranch'

37 38 39 40 41
T13367:
	$(RM) -f T13317.o T13317.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl T13367.hs | grep 'foo'
        # There should be only one copy of the string "foo"#

Simon Peyton Jones's avatar
Simon Peyton Jones committed
42 43
T8832:
	$(RM) -f T8832.o T8832.hi
44
	'$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl T8832.hs | grep '^[a-zA-Z0-9]\+ ='
Simon Peyton Jones's avatar
Simon Peyton Jones committed
45

46
T12603:
David Feuer's avatar
David Feuer committed
47 48 49
	$(RM) -f T12603.o T12603.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques T12603.hs | grep 'GHC.Real'
         # Horribly delicate; looking for a top-level shared call to 2^8
50

51 52 53 54 55 56
T11155:
	$(RM) -f T11155.o T11155.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) -c T11155.hs
	-nm T11155.o  | grep 'stg_ap_0_upd'
	# Expecting no output from the grep

57 58
T8274:
	$(RM) -f T8274.o T8274.hi
59 60
	# Set -dppr-cols to ensure things don't wrap
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques -dppr-cols=200 T8274.hs | grep '#'
61

Simon Peyton Jones's avatar
Simon Peyton Jones committed
62
T7865:
Jan Stolarek's avatar
Jan Stolarek committed
63
	$(RM) -f T7865.o T7865.hi
Simon Peyton Jones's avatar
Simon Peyton Jones committed
64 65
	'$(TEST_HC)' $(TEST_HC_OPTS) -dsuppress-uniques -O2 -c -ddump-simpl T7865.hs | grep expensive

Ian Lynagh's avatar
Ian Lynagh committed
66 67
T3055:
	$(RM) -f T3055.o T3055.hi T3055.simpl
68
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T3055.hs -ddump-simpl > T3055.simpl
69
	grep 'I# -28#' T3055.simpl | sed 's/.*\(I# -28#\).*/\1/'
Ian Lynagh's avatar
Ian Lynagh committed
70

Simon Peyton Jones's avatar
Simon Peyton Jones committed
71
T5658b:
Jan Stolarek's avatar
Jan Stolarek committed
72
	$(RM) -f T5658b.o T5658b.hi
73
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5658b.hs -ddump-simpl | grep -c indexIntArray
Simon Peyton Jones's avatar
Simon Peyton Jones committed
74
# Trac 5658 meant that there were three calls to indexIntArray instead of two
lukemaurer's avatar
lukemaurer committed
75
# (now four due to join-point discount causing W/W to stabilize unfolding)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
76

Simon Peyton Jones's avatar
Simon Peyton Jones committed
77
T5776:
Jan Stolarek's avatar
Jan Stolarek committed
78
	$(RM) -f T5776.o T5776.hi
79
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5776.hs -ddump-rules | grep -c dEq
Simon Peyton Jones's avatar
Simon Peyton Jones committed
80

Simon Peyton Jones's avatar
Simon Peyton Jones committed
81
T3772:
Ian Lynagh's avatar
Ian Lynagh committed
82
	$(RM) -f T3772*.hi T3772*.o
Jan Stolarek's avatar
Jan Stolarek committed
83
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772_A.hs
84
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772.hs -dsuppress-uniques -ddump-simpl
Simon Peyton Jones's avatar
Simon Peyton Jones committed
85 86

T4306:
Ian Lynagh's avatar
Ian Lynagh committed
87
	$(RM) -f T4306.hi T4306.o
Jan Stolarek's avatar
Jan Stolarek committed
88
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4306.hs
89
	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4306.hi | grep 'wupd ::'
Simon Peyton Jones's avatar
Simon Peyton Jones committed
90

91
T4201:
92
	$(RM) -f T4201.hi T4201.o T4201.list
Jan Stolarek's avatar
Jan Stolarek committed
93
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4201.hs
94 95 96 97
	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4201.hi > T4201.list
	# poor man idea about how to replace GNU grep -B2 "Sym" invocation with pure POSIX tools
	for i in `grep -n "Sym" T4201.list |cut -d ':' -f -1`; do head -$$i T4201.list | tail -3 ; done
	$(RM) -f T4201.list
98

Simon Peyton Jones's avatar
Simon Peyton Jones committed
99 100
# This one looped as a result of bogus specialisation
T4903:
Simon Marlow's avatar
Simon Marlow committed
101
	$(RM) -f T4903.hi T4903a.hi T4903a.o T4903.o
102 103
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903a.hs -dcore-lint
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903.hs -dcore-lint
Simon Peyton Jones's avatar
Simon Peyton Jones committed
104

Simon Peyton Jones's avatar
Simon Peyton Jones committed
105 106
T4918:
	$(RM) -f T4918.hi T4918.o T4918a.hi T4918a.o
Jan Stolarek's avatar
Jan Stolarek committed
107 108
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918a.hs
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918.hs
109
	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4918.hi | grep 'C#'
Simon Peyton Jones's avatar
Simon Peyton Jones committed
110

111
EvalTest:
112
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O EvalTest.hs -ddump-simpl -dsuppress-uniques | grep 'rght.*Dmd' | sed 's/^ *//'
Simon Peyton Jones's avatar
Simon Peyton Jones committed
113

114 115 116
T5168:
	-('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5168.hs -ddump-simpl -dsuppress-uniques | grep 'patError')

Simon Peyton Jones's avatar
Simon Peyton Jones committed
117 118 119 120
# When SpecConstr works there are no STUArrays at all
# The "-(...)" ignores the (expected) non-zero exit code from grep
# when there are (as expected) no matches
T4945:
121
	-('$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 -fno-liberate-case T4945.hs -ddump-simpl -dsuppress-uniques | grep 'STUArray')
Simon Peyton Jones's avatar
Simon Peyton Jones committed
122 123 124

# When this one works there are no 'lets' at all
T4957:
125
	-('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4957.hs -ddump-simpl -dsuppress-uniques | grep 'let')
126 127 128 129

.PHONY: simpl021
simpl021:
	$(RM) -f Simpl021A.hi Simpl021A.o Simpl021B.hi Simpl021B.o
130 131
	'$(TEST_HC)' $(TEST_HC_OPTS) -c Simpl021A.hs -O
	'$(TEST_HC)' $(TEST_HC_OPTS) -c Simpl021B.hs -O
132

Ian Lynagh's avatar
Ian Lynagh committed
133 134 135
.PHONY: T5327
T5327:
	$(RM) -f T5327.hi T5327.o
136
	'$(TEST_HC)' $(TEST_HC_OPTS) -c T5327.hs -O -ddump-simpl | grep -c '># 34# '
Ian Lynagh's avatar
Ian Lynagh committed
137

Simon Peyton Jones's avatar
Simon Peyton Jones committed
138 139 140 141
.PHONY: T5623
T5623:
	$(RM) -f T5623.hi T5623.o
	'$(TEST_HC)' $(TEST_HC_OPTS) -c T5623.hs -O -ddump-prep | grep -c "plusAddr#"
142 143 144 145
T13155:
	$(RM) -f T13155.hi T13155.o
	'$(TEST_HC)' $(TEST_HC_OPTS) -c T13155.hs -O -ddump-prep | grep -c "plusAddr#"
        # There should be only one plusAddr#!
Simon Peyton Jones's avatar
Simon Peyton Jones committed
146

Simon Peyton Jones's avatar
Simon Peyton Jones committed
147 148
T13156:
	$(RM) -f T13156.hi T13156.o
David Feuer's avatar
David Feuer committed
149
	'$(TEST_HC)' $(TEST_HC_OPTS) -c T13156.hs -O -ddump-prep -dsuppress-uniques | grep "case.*Any"
lukemaurer's avatar
lukemaurer committed
150
        # There should be a single 'case r @ GHC.Types.Any'
Simon Peyton Jones's avatar
Simon Peyton Jones committed
151

152 153 154 155 156 157 158
.PHONY: T4138
T4138:
	$(RM) -f T4138.hi   T4138.o
	$(RM) -f T4138_A.hi T4138_A.o
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4138_A.hs
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4138.hs -ddump-simpl > T4138.simpl
	grep -c 'F#' T4138.simpl
Simon Peyton Jones's avatar
Simon Peyton Jones committed
159
        # We expect to see this
160

Simon Peyton Jones's avatar
Simon Peyton Jones committed
161 162 163 164 165
T7165:
	$(RM) -f T7165.hi T7165a.hi T7165a.o T7165.o
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165a.hs -dcore-lint
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165.hs -dcore-lint

Simon Peyton Jones's avatar
Simon Peyton Jones committed
166 167 168
T5366:
	$(RM) -f T5366.hi T5366.o
	'$(TEST_HC)' $(TEST_HC_OPTS) -ddump-simpl -dsuppress-uniques -c -O T5366.hs | grep 'Bar.*I#'
169 170 171 172 173 174 175 176

# We expect 0 occurrences of ' $sgo' in -ddump-prep. Mind the Makefile
# $-escaping. The -grep ignores grep's expected exit code of 1.
.PHONY: T7796
T7796:
	'$(TEST_HC)' $(TEST_HC_OPTS) -O1 -c T7796.hs -ddump-prep > T7796.prep
	(grep -q '$$w$$sgo' T7796.prep || echo 'could not find $$w$$sgo; compilation was not as expected')
	-grep -c ' $$sgo' T7796.prep
Simon Peyton Jones's avatar
Simon Peyton Jones committed
177 178 179 180 181

T7995:
	$(RM) -f T7995.hi T7995.o
	'$(TEST_HC)' $(TEST_HC_OPTS) -package ghc -ddump-rule-firings -c -O T7995.hs | grep 'text/str'

Simon Peyton Jones's avatar
Simon Peyton Jones committed
182
T8221:
Jan Stolarek's avatar
Jan Stolarek committed
183
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O -fforce-recomp T8221a.hs
Simon Peyton Jones's avatar
Simon Peyton Jones committed
184
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O -fforce-recomp T8221.hs
Simon Peyton Jones's avatar
Simon Peyton Jones committed
185 186 187 188

T5996:
	$(RM) -f T5996.o T5996.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5996.hs -ddump-simpl -dsuppress-uniques -dsuppress-all | grep y2
189 190 191 192 193 194

T10083:
	$(RM) -f T10083.o T10083.hi T10083.hi-boot T10083a.o T10083a.hi 
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs-boot
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083a.hs
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs
195 196 197 198 199 200 201 202 203 204

.PHONY: T5615
T5615:
	$(RM) -f T5615.o T5615.hi T5615.dump-simpl
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5615.hs -ddump-simpl -ddump-to-file
	-grep 'divInt#' T5615.dump-simpl
	-grep 'modInt#' T5615.dump-simpl
	-grep 'quotInt#' T5615.dump-simpl
	-grep 'remInt#' T5615.dump-simpl
	grep -c '1999#' T5615.dump-simpl
205

Sylvain Henry's avatar
Sylvain Henry committed
206 207 208 209
# When this one works there are no 'plusWord' left at all
T12877:
	-('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T12877.hs -ddump-simpl | grep 'plusWord')

210 211 212
T13025:
	$(RM) -f T13025.o T13025.hi T13025a.o T13025a.hi
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13025a.hs
213 214
	-'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13025.hs -ddump-simpl | grep -c heq_sel
	# No lines should match 'heq_sel' so wc should output zeros
215 216 217 218 219

.PHONY: str-rules
str-rules:
	$(RM) -f str-rules.hi str-rules.o
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O str-rules.hs -ddump-simpl | grep -o '"@@@[^"].*"#' | sort
Ben Gamari's avatar
Ben Gamari committed
220 221 222 223 224

# We expect there to be precisely one use of +# in the simplified Core as f and
# g should have been collapsed into one defininition by CSE.
.PHONY: T13340
T13340:
225
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '\+#'
David Feuer's avatar
David Feuer committed
226 227 228 229 230 231 232


# We expect to see all dictionaries specialized away.
.PHONY: T11272
T11272:
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T11272a.hs
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O -ddump-prep T11272.hs | { ! grep Ord ;}
David Feuer's avatar
David Feuer committed
233 234 235 236 237

# We expect to see a $wfoo worker that doesn't take any dictionaries.
.PHONY: T12600
T12600:
	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O -ddump-prep -dsuppress-all -dsuppress-uniques -dno-suppress-type-signatures -dppr-cols=200 T12600.hs | grep "wfoo" | head -n 1
David Feuer's avatar
David Feuer committed
238 239 240 241 242 243 244

# We don't expect to case match on any literal numbers other than
# 0 or 1. See T14140.hs for an explanation.
T14140:
	$(RM) -f T14140.o T14140.hi
	-'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T14140.hs | grep '[2-9]# *->'
# Expecting no output from the grep, hence "-"