Float unboxed expressions by boxing
[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 T8832:
19 $(RM) -f T8832.o T8832.hi
20 '$(TEST_HC)' $(TEST_HC_OPTS) $(T8832_WORDSIZE_OPTS) -O -c -ddump-simpl T8832.hs | grep '^[a-zA-Z0-9]\+ ='
21
22 T12603:
23 $(RM) -f T8832.o T8832.hi
24 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques T12603.hs | grep 'wf1'
25
26 T11155:
27 $(RM) -f T11155.o T11155.hi
28 '$(TEST_HC)' $(TEST_HC_OPTS) -c T11155.hs
29 -nm T11155.o | grep 'stg_ap_0_upd'
30 # Expecting no output from the grep
31
32 T8274:
33 $(RM) -f T8274.o T8274.hi
34 # Set -dppr-cols to ensure things don't wrap
35 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques -dppr-cols=200 T8274.hs | grep '#'
36
37 T7865:
38 $(RM) -f T7865.o T7865.hi
39 '$(TEST_HC)' $(TEST_HC_OPTS) -dsuppress-uniques -O2 -c -ddump-simpl T7865.hs | grep expensive
40
41 T3055:
42 $(RM) -f T3055.o T3055.hi T3055.simpl
43 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T3055.hs -ddump-simpl > T3055.simpl
44 grep 'I# -28#' T3055.simpl | sed 's/.*\(I# -28#\).*/\1/'
45
46 T5658b:
47 $(RM) -f T5658b.o T5658b.hi
48 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5658b.hs -ddump-simpl | grep -c indexIntArray
49 # Trac 5658 meant that there were three calls to indexIntArray instead of two
50
51 T5776:
52 $(RM) -f T5776.o T5776.hi
53 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5776.hs -ddump-rules | grep -c dEq
54
55 T3772:
56 $(RM) -f T3772*.hi T3772*.o
57 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772_A.hs
58 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772.hs -dsuppress-uniques -ddump-simpl
59
60 T4306:
61 $(RM) -f T4306.hi T4306.o
62 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4306.hs
63 '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4306.hi | grep 'wupd ::'
64
65 T4201:
66 $(RM) -f T4201.hi T4201.o T4201.list
67 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4201.hs
68 '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4201.hi > T4201.list
69 # poor man idea about how to replace GNU grep -B2 "Sym" invocation with pure POSIX tools
70 for i in `grep -n "Sym" T4201.list |cut -d ':' -f -1`; do head -$$i T4201.list | tail -3 ; done
71 $(RM) -f T4201.list
72
73 # This one looped as a result of bogus specialisation
74 T4903:
75 $(RM) -f T4903.hi T4903a.hi T4903a.o T4903.o
76 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903a.hs -dcore-lint
77 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903.hs -dcore-lint
78
79 T4918:
80 $(RM) -f T4918.hi T4918.o T4918a.hi T4918a.o
81 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918a.hs
82 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918.hs
83 '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4918.hi | grep 'C#'
84
85 EvalTest:
86 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O EvalTest.hs -ddump-simpl -dsuppress-uniques | grep 'rght.*Dmd' | sed 's/^ *//'
87
88 T5168:
89 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5168.hs -ddump-simpl -dsuppress-uniques | grep 'patError')
90
91 # When SpecConstr works there are no STUArrays at all
92 # The "-(...)" ignores the (expected) non-zero exit code from grep
93 # when there are (as expected) no matches
94 T4945:
95 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 -fno-liberate-case T4945.hs -ddump-simpl -dsuppress-uniques | grep 'STUArray')
96
97 # When this one works there are no 'lets' at all
98 T4957:
99 -('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4957.hs -ddump-simpl -dsuppress-uniques | grep 'let')
100
101 .PHONY: simpl021
102 simpl021:
103 $(RM) -f Simpl021A.hi Simpl021A.o Simpl021B.hi Simpl021B.o
104 '$(TEST_HC)' $(TEST_HC_OPTS) -c Simpl021A.hs -O
105 '$(TEST_HC)' $(TEST_HC_OPTS) -c Simpl021B.hs -O
106
107 .PHONY: T5327
108 T5327:
109 $(RM) -f T5327.hi T5327.o
110 '$(TEST_HC)' $(TEST_HC_OPTS) -c T5327.hs -O -ddump-simpl | grep -c '># 34# '
111
112 .PHONY: T5623
113 T5623:
114 $(RM) -f T5623.hi T5623.o
115 '$(TEST_HC)' $(TEST_HC_OPTS) -c T5623.hs -O -ddump-prep | grep -c "plusAddr#"
116
117 .PHONY: T4138
118 T4138:
119 $(RM) -f T4138.hi T4138.o
120 $(RM) -f T4138_A.hi T4138_A.o
121 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4138_A.hs
122 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4138.hs -ddump-simpl > T4138.simpl
123 grep -c 'F#' T4138.simpl
124
125 T7165:
126 $(RM) -f T7165.hi T7165a.hi T7165a.o T7165.o
127 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165a.hs -dcore-lint
128 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 T7165.hs -dcore-lint
129
130 T5366:
131 $(RM) -f T5366.hi T5366.o
132 '$(TEST_HC)' $(TEST_HC_OPTS) -ddump-simpl -dsuppress-uniques -c -O T5366.hs | grep 'Bar.*I#'
133
134 # We expect 0 occurrences of ' $sgo' in -ddump-prep. Mind the Makefile
135 # $-escaping. The -grep ignores grep's expected exit code of 1.
136 .PHONY: T7796
137 T7796:
138 '$(TEST_HC)' $(TEST_HC_OPTS) -O1 -c T7796.hs -ddump-prep > T7796.prep
139 (grep -q '$$w$$sgo' T7796.prep || echo 'could not find $$w$$sgo; compilation was not as expected')
140 -grep -c ' $$sgo' T7796.prep
141
142 T7995:
143 $(RM) -f T7995.hi T7995.o
144 '$(TEST_HC)' $(TEST_HC_OPTS) -package ghc -ddump-rule-firings -c -O T7995.hs | grep 'text/str'
145
146 T8221:
147 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -fforce-recomp T8221a.hs
148 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -fforce-recomp T8221.hs
149
150 T5996:
151 $(RM) -f T5996.o T5996.hi
152 '$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5996.hs -ddump-simpl -dsuppress-uniques -dsuppress-all | grep y2
153
154 T10083:
155 $(RM) -f T10083.o T10083.hi T10083.hi-boot T10083a.o T10083a.hi
156 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs-boot
157 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083a.hs
158 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs
159
160 .PHONY: T5615
161 T5615:
162 $(RM) -f T5615.o T5615.hi T5615.dump-simpl
163 '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T5615.hs -ddump-simpl -ddump-to-file
164 -grep 'divInt#' T5615.dump-simpl
165 -grep 'modInt#' T5615.dump-simpl
166 -grep 'quotInt#' T5615.dump-simpl
167 -grep 'remInt#' T5615.dump-simpl
168 grep -c '1999#' T5615.dump-simpl