1206ad6f6a7b820dbe9854dfad41b8832b283d93
[ghc.git] / testsuite / tests / simplCore / should_compile / Makefile
1 TOP=../../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/test.mk
4
5 T3990:
6 $(RM) -f T3990.o T3990.hi
7 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T3990.hs | grep 'test_case'
8 # Grep output should show an unpacked constructor
9
10 T9509:
11 $(RM) -f T9509*.o T9509*.hi
12 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T9509a.hs
13 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T9509.hs -funfolding-use-threshold=20 \
14 -ddump-rule-rewrites | grep SPEC
15 # Grep output should show a SPEC rule firing
16 # The unfolding use threshold is to prevent foo inlining before it is specialised
17
18 T13317:
19 $(RM) -f T13317.o T13317.hi
20 '$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl-stats T13317.hs | grep 'KnownBranch'
21
22 T8832:
23 $(RM) -f T8832.o T8832.hi
24 '$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl T8832.hs | grep '^[a-zA-Z0-9]\+ ='
25
26 T12603:
27 $(RM) -f T8832.o T8832.hi
28 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques T12603.hs | grep 'wf1'
29
30 T11155:
31 $(RM) -f T11155.o T11155.hi
32 '$(TEST_HC)' $(TEST_HC_OPTS) -c T11155.hs
33 -nm T11155.o | grep 'stg_ap_0_upd'
34 # Expecting no output from the grep
35
36 T8274:
37 $(RM) -f T8274.o T8274.hi
38 # Set -dppr-cols to ensure things don't wrap
39 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques -dppr-cols=200 T8274.hs | grep '#'
40
41 T7865:
42 $(RM) -f T7865.o T7865.hi
43 '$(TEST_HC)' $(TEST_HC_OPTS) -dsuppress-uniques -O2 -c -ddump-simpl T7865.hs | grep expensive
44
45 T3055:
46 $(RM) -f T3055.o T3055.hi T3055.simpl
47 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T3055.hs -ddump-simpl > T3055.simpl
48 grep 'I# -28#' T3055.simpl | sed 's/.*\(I# -28#\).*/\1/'
49
50 T5658b:
51 $(RM) -f T5658b.o T5658b.hi
52 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5658b.hs -ddump-simpl | grep -c indexIntArray
53 # Trac 5658 meant that there were three calls to indexIntArray instead of two
54 # (now four due to join-point discount causing W/W to stabilize unfolding)
55
56 T5776:
57 $(RM) -f T5776.o T5776.hi
58 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5776.hs -ddump-rules | grep -c dEq
59
60 T3772:
61 $(RM) -f T3772*.hi T3772*.o
62 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772_A.hs
63 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772.hs -dsuppress-uniques -ddump-simpl
64
65 T4306:
66 $(RM) -f T4306.hi T4306.o
67 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4306.hs
68 '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4306.hi | grep 'wupd ::'
69
70 T4201:
71 $(RM) -f T4201.hi T4201.o T4201.list
72 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4201.hs
73 '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4201.hi > T4201.list
74 # poor man idea about how to replace GNU grep -B2 "Sym" invocation with pure POSIX tools
75 for i in `grep -n "Sym" T4201.list |cut -d ':' -f -1`; do head -$$i T4201.list | tail -3 ; done
76 $(RM) -f T4201.list
77
78 # This one looped as a result of bogus specialisation
79 T4903:
80 $(RM) -f T4903.hi T4903a.hi T4903a.o T4903.o
81 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903a.hs -dcore-lint
82 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903.hs -dcore-lint
83
84 T4918:
85 $(RM) -f T4918.hi T4918.o T4918a.hi T4918a.o
86 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918a.hs
87 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918.hs
88 '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4918.hi | grep 'C#'
89
90 EvalTest:
91 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O EvalTest.hs -ddump-simpl -dsuppress-uniques | grep 'rght.*Dmd' | sed 's/^ *//'
92
93 T5168:
94 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5168.hs -ddump-simpl -dsuppress-uniques | grep 'patError')
95
96 # When SpecConstr works there are no STUArrays at all
97 # The "-(...)" ignores the (expected) non-zero exit code from grep
98 # when there are (as expected) no matches
99 T4945:
100 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 -fno-liberate-case T4945.hs -ddump-simpl -dsuppress-uniques | grep 'STUArray')
101
102 # When this one works there are no 'lets' at all
103 T4957:
104 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4957.hs -ddump-simpl -dsuppress-uniques | grep 'let')
105
106 .PHONY: simpl021
107 simpl021:
108 $(RM) -f Simpl021A.hi Simpl021A.o Simpl021B.hi Simpl021B.o
109 '$(TEST_HC)' $(TEST_HC_OPTS) -c Simpl021A.hs -O
110 '$(TEST_HC)' $(TEST_HC_OPTS) -c Simpl021B.hs -O
111
112 .PHONY: T5327
113 T5327:
114 $(RM) -f T5327.hi T5327.o
115 '$(TEST_HC)' $(TEST_HC_OPTS) -c T5327.hs -O -ddump-simpl | grep -c '># 34# '
116
117 .PHONY: T5623
118 T5623:
119 $(RM) -f T5623.hi T5623.o
120 '$(TEST_HC)' $(TEST_HC_OPTS) -c T5623.hs -O -ddump-prep | grep -c "plusAddr#"
121 T13155:
122 $(RM) -f T13155.hi T13155.o
123 '$(TEST_HC)' $(TEST_HC_OPTS) -c T13155.hs -O -ddump-prep | grep -c "plusAddr#"
124 # There should be only one plusAddr#!
125
126 T13156:
127 $(RM) -f T13156.hi T13156.o
128 '$(TEST_HC)' $(TEST_HC_OPTS) -c T13156.hs -O -ddump-prep -dsuppress-uniques | grep "case"
129 # There should be a single 'case r @ GHC.Types.Any'
130
131 .PHONY: T4138
132 T4138:
133 $(RM) -f T4138.hi T4138.o
134 $(RM) -f T4138_A.hi T4138_A.o
135 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4138_A.hs
136 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4138.hs -ddump-simpl > T4138.simpl
137 grep -c 'F#' T4138.simpl
138
139 T7165:
140 $(RM) -f T7165.hi T7165a.hi T7165a.o T7165.o
141 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165a.hs -dcore-lint
142 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165.hs -dcore-lint
143
144 T5366:
145 $(RM) -f T5366.hi T5366.o
146 '$(TEST_HC)' $(TEST_HC_OPTS) -ddump-simpl -dsuppress-uniques -c -O T5366.hs | grep 'Bar.*I#'
147
148 # We expect 0 occurrences of ' $sgo' in -ddump-prep. Mind the Makefile
149 # $-escaping. The -grep ignores grep's expected exit code of 1.
150 .PHONY: T7796
151 T7796:
152 '$(TEST_HC)' $(TEST_HC_OPTS) -O1 -c T7796.hs -ddump-prep > T7796.prep
153 (grep -q '$$w$$sgo' T7796.prep || echo 'could not find $$w$$sgo; compilation was not as expected')
154 -grep -c ' $$sgo' T7796.prep
155
156 T7995:
157 $(RM) -f T7995.hi T7995.o
158 '$(TEST_HC)' $(TEST_HC_OPTS) -package ghc -ddump-rule-firings -c -O T7995.hs | grep 'text/str'
159
160 T8221:
161 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -fforce-recomp T8221a.hs
162 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -fforce-recomp T8221.hs
163
164 T5996:
165 $(RM) -f T5996.o T5996.hi
166 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5996.hs -ddump-simpl -dsuppress-uniques -dsuppress-all | grep y2
167
168 T10083:
169 $(RM) -f T10083.o T10083.hi T10083.hi-boot T10083a.o T10083a.hi
170 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs-boot
171 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083a.hs
172 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs
173
174 .PHONY: T5615
175 T5615:
176 $(RM) -f T5615.o T5615.hi T5615.dump-simpl
177 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5615.hs -ddump-simpl -ddump-to-file
178 -grep 'divInt#' T5615.dump-simpl
179 -grep 'modInt#' T5615.dump-simpl
180 -grep 'quotInt#' T5615.dump-simpl
181 -grep 'remInt#' T5615.dump-simpl
182 grep -c '1999#' T5615.dump-simpl
183
184 # When this one works there are no 'plusWord' left at all
185 T12877:
186 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T12877.hs -ddump-simpl | grep 'plusWord')
187
188 T13025:
189 $(RM) -f T13025.o T13025.hi T13025a.o T13025a.hi
190 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13025a.hs
191 -'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13025.hs -ddump-simpl | grep -c HEq_sc
192 # No lines should match 'HEq_sc' so wc should output zeros
193
194 .PHONY: str-rules
195 str-rules:
196 $(RM) -f str-rules.hi str-rules.o
197 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O str-rules.hs -ddump-simpl | grep -o '"@@@[^"].*"#' | sort
198
199 # We expect there to be precisely one use of +# in the simplified Core as f and
200 # g should have been collapsed into one defininition by CSE.
201 .PHONY: T13340
202 T13340:
203 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep '\+#' | wc -l