testsuite: Really fix #16741
[ghc.git] / testsuite / tests / simplCore / should_compile / Makefile
1 TOP=../../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/test.mk
4
5 T14978:
6 $(RM) -f T14978.o T14978.hi
7 -'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T14978.hs -dsuppress-coercions | grep 'foo'
8 # Expecting the defn of 'foo' to apply Goof to an unboxed coercion
9
10 T13468:
11 $(RM) -f T13468.o T13468.hi
12 -'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T13468.hs | grep 'Error'
13 # Expecting no output from the grep, hence "-"
14 # If the case branch is not eliminated, we get a patError
15
16 T3234:
17 $(RM) -f T3234.o T3234.hi
18 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl-stats T3234.hs | grep 'fold/build'
19
20 T3990:
21 $(RM) -f T3990.o T3990.hi
22 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T3990.hs | grep 'test_case'
23 # Grep output should show an unpacked constructor
24
25 T8848:
26 $(RM) -f T8848.o T8848.hi
27 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-rule-firings T8848.hs | grep 'SPEC map2'
28 # Should fire twice
29
30 T9509:
31 $(RM) -f T9509*.o T9509*.hi
32 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T9509a.hs
33 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T9509.hs \
34 -ddump-rule-rewrites | grep SPEC
35 # Grep output should show a SPEC rule firing, twice
36
37 T13317:
38 $(RM) -f T13317.o T13317.hi
39 '$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl-stats T13317.hs | grep 'KnownBranch'
40
41 T13367:
42 $(RM) -f T13317.o T13317.hi
43 '$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl -dsuppress-ticks T13367.hs | grep 'foo'
44 # There should be only one copy of the string "foo"#
45
46 T8832:
47 $(RM) -f T8832.o T8832.hi
48 '$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl -dsuppress-ticks T8832.hs | grep '^[a-zA-Z0-9]\+ ='
49
50 T12603:
51 $(RM) -f T12603.o T12603.hi
52 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques -dsuppress-ticks T12603.hs | grep 'GHC.Real'
53 # Horribly delicate; looking for a top-level shared call to 2^8
54
55 T11155:
56 $(RM) -f T11155.o T11155.hi
57 '$(TEST_HC)' $(TEST_HC_OPTS) -c T11155.hs
58 -nm T11155.o | grep 'stg_ap_0_upd'
59 # Expecting no output from the grep
60
61 T8274:
62 $(RM) -f T8274.o T8274.hi
63 # Set -dppr-cols to ensure things don't wrap
64 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques -dsuppress-ticks -dppr-cols=200 T8274.hs | grep '#'
65
66 T7865:
67 $(RM) -f T7865.o T7865.hi
68 '$(TEST_HC)' $(TEST_HC_OPTS) -dsuppress-uniques -dsuppress-ticks -O2 -c -ddump-simpl T7865.hs | grep expensive
69
70 T3055:
71 $(RM) -f T3055.o T3055.hi T3055.simpl
72 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T3055.hs -ddump-simpl > T3055.simpl
73 grep 'I# -28#' T3055.simpl | sed 's/.*\(I# -28#\).*/\1/'
74
75 T5658b:
76 $(RM) -f T5658b.o T5658b.hi
77 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5658b.hs -ddump-simpl | grep -c indexIntArray
78 # #5658 meant that there were three calls to indexIntArray instead of two
79 # (now four due to join-point discount causing W/W to stabilize unfolding)
80
81 T5776:
82 $(RM) -f T5776.o T5776.hi
83 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5776.hs -ddump-rules | grep -c dEq
84
85 T3772:
86 $(RM) -f T3772*.hi T3772*.o
87 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772_A.hs
88 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772.hs -dsuppress-uniques -dsuppress-ticks -ddump-simpl
89
90 T4306:
91 $(RM) -f T4306.hi T4306.o
92 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4306.hs
93 '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4306.hi | grep 'wupd ::'
94
95 T4201:
96 $(RM) -f T4201.hi T4201.o T4201.list
97 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4201.hs
98 '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4201.hi > T4201.list
99 # poor man idea about how to replace GNU grep -B2 "Sym" invocation with pure POSIX tools
100 for i in `grep -n "Sym" T4201.list |cut -d ':' -f -1`; do head -$$i T4201.list | tail -3 ; done
101 $(RM) -f T4201.list
102
103 # This one looped as a result of bogus specialisation
104 T4903:
105 $(RM) -f T4903.hi T4903a.hi T4903a.o T4903.o
106 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903a.hs -dcore-lint
107 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903.hs -dcore-lint
108
109 # N.B. Suppress ticks to ensure that the test result doesn't change if `base`
110 # is compiled with -g. See #16741.
111 T4918:
112 $(RM) -f T4918.hi T4918.o T4918a.hi T4918a.o
113 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918a.hs
114 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918.hs -ddump-simpl -dsuppress-all 2>&1 | grep 'C#'
115
116 EvalTest:
117 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O EvalTest.hs -ddump-simpl -dsuppress-uniques | grep 'rght.*Dmd' | sed 's/^ *//'
118
119 T5168:
120 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5168.hs -ddump-simpl -dsuppress-uniques | grep 'patError')
121
122 # When SpecConstr works there are no STUArrays at all
123 # The "-(...)" ignores the (expected) non-zero exit code from grep
124 # when there are (as expected) no matches
125 T4945:
126 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 -fno-liberate-case T4945.hs -ddump-simpl -dsuppress-uniques | grep 'STUArray')
127
128 # When this one works there are no 'lets' at all
129 T4957:
130 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4957.hs -ddump-simpl -dsuppress-uniques | grep 'let')
131
132 .PHONY: simpl021
133 simpl021:
134 $(RM) -f Simpl021A.hi Simpl021A.o Simpl021B.hi Simpl021B.o
135 '$(TEST_HC)' $(TEST_HC_OPTS) -c Simpl021A.hs -O
136 '$(TEST_HC)' $(TEST_HC_OPTS) -c Simpl021B.hs -O
137
138 .PHONY: T5327
139 T5327:
140 $(RM) -f T5327.hi T5327.o
141 '$(TEST_HC)' $(TEST_HC_OPTS) -c T5327.hs -O -ddump-simpl | grep -c '># 34# '
142
143 .PHONY: T16254
144 T16254:
145 $(RM) -f T16254.hi T16254.o
146 '$(TEST_HC)' $(TEST_HC_OPTS) -c T16254.hs -O -ddump-simpl | grep -c '># 34# '
147
148 .PHONY: T5623
149 T5623:
150 $(RM) -f T5623.hi T5623.o
151 '$(TEST_HC)' $(TEST_HC_OPTS) -c T5623.hs -O -ddump-prep | grep -c "plusAddr#"
152 T13155:
153 $(RM) -f T13155.hi T13155.o
154 '$(TEST_HC)' $(TEST_HC_OPTS) -c T13155.hs -O -ddump-prep | grep -c "plusAddr#"
155 # There should be only one plusAddr#!
156
157 T13156:
158 $(RM) -f T13156.hi T13156.o
159 '$(TEST_HC)' $(TEST_HC_OPTS) -c T13156.hs -O -ddump-prep -dsuppress-uniques | grep "case.*Any"
160 # There should be a single 'case r @ GHC.Types.Any'
161
162 .PHONY: T4138
163 T4138:
164 $(RM) -f T4138.hi T4138.o
165 $(RM) -f T4138_A.hi T4138_A.o
166 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4138_A.hs
167 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4138.hs -ddump-simpl > T4138.simpl
168 grep -c 'F#' T4138.simpl
169 # We expect to see this
170
171 T7165:
172 $(RM) -f T7165.hi T7165a.hi T7165a.o T7165.o
173 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165a.hs -dcore-lint
174 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165.hs -dcore-lint
175
176 T5366:
177 $(RM) -f T5366.hi T5366.o
178 '$(TEST_HC)' $(TEST_HC_OPTS) -ddump-simpl -dsuppress-uniques -c -O T5366.hs | grep 'Bar.*I#'
179
180 # We expect 0 occurrences of ' $sgo' in -ddump-prep. Mind the Makefile
181 # $-escaping. The -grep ignores grep's expected exit code of 1.
182 .PHONY: T7796
183 T7796:
184 '$(TEST_HC)' $(TEST_HC_OPTS) -O1 -c T7796.hs -ddump-prep > T7796.prep
185 (grep -q '$$w$$sgo' T7796.prep || echo 'could not find $$w$$sgo; compilation was not as expected')
186 -grep -c ' $$sgo' T7796.prep
187
188 T7995:
189 $(RM) -f T7995.hi T7995.o
190 '$(TEST_HC)' $(TEST_HC_OPTS) -package ghc -ddump-rule-firings -c -O T7995.hs | grep 'text/str'
191
192 T8221:
193 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -fforce-recomp T8221a.hs
194 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -fforce-recomp T8221.hs
195
196 T5996:
197 $(RM) -f T5996.o T5996.hi
198 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5996.hs -ddump-simpl -dsuppress-uniques -dsuppress-all | grep y2
199
200 T10083:
201 $(RM) -f T10083.o T10083.hi T10083.hi-boot T10083a.o T10083a.hi
202 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs-boot
203 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083a.hs
204 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs
205
206 .PHONY: T5615
207 T5615:
208 $(RM) -f T5615.o T5615.hi T5615.dump-simpl
209 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5615.hs -ddump-simpl -ddump-to-file
210 -grep 'divInt#' T5615.dump-simpl
211 -grep 'modInt#' T5615.dump-simpl
212 -grep 'quotInt#' T5615.dump-simpl
213 -grep 'remInt#' T5615.dump-simpl
214 grep -c '1999#' T5615.dump-simpl
215
216 # When this one works there are no 'plusWord' left at all
217 T12877:
218 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T12877.hs -ddump-simpl | grep 'plusWord')
219
220 T13025:
221 $(RM) -f T13025.o T13025.hi T13025a.o T13025a.hi
222 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13025a.hs
223 -'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13025.hs -ddump-simpl | grep -c heq_sel
224 # No lines should match 'heq_sel' so wc should output zeros
225
226 .PHONY: str-rules
227 str-rules:
228 $(RM) -f str-rules.hi str-rules.o
229 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O str-rules.hs -ddump-simpl -dsuppress-ticks | grep -o '"@@@[^"].*"#' | sort
230
231 # We expect there to be precisely one use of +# in the simplified Core as f and
232 # g should have been collapsed into one defininition by CSE.
233 .PHONY: T13340
234 T13340:
235 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '\+#'
236
237
238 # We expect to see all dictionaries specialized away.
239 .PHONY: T11272
240 T11272:
241 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T11272a.hs
242 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -ddump-prep T11272.hs | { ! grep Ord ;}
243
244 # We expect to see a $wfoo worker that doesn't take any dictionaries.
245 .PHONY: T12600
246 T12600:
247 '$(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
248
249 # We don't expect to case match on any literal numbers other than
250 # 0 or 1. See T14140.hs for an explanation.
251 T14140:
252 $(RM) -f T14140.o T14140.hi
253 -'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T14140.hs | grep '[2-9]# *->'
254 # Expecting no output from the grep, hence "-"
255
256 T15631:
257 $(RM) -f T15631.o T15631.hi
258 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques -dsuppress-ticks T15631.hs | grep 'case'
259 # Expecting one fewwer case expressions after fixing #15631