Allow users to ignore optimization changes
[ghc.git] / testsuite / tests / driver / Makefile
1 TOP=../..
2 include $(TOP)/mk/boilerplate.mk
3 include $(TOP)/mk/test.mk
4
5 # A set of driver tests
6
7 # Things to test:
8 #
9 # - one-shot vs. --make
10 # - hierarchical vs. flat
11 # - -odir vs. no -odir
12 # - -hidir vs. no -hidir
13 # - root module vs. found modules
14
15 OBJSUFFIX = .o
16
17 TEST_HC_OPTS_NO_RTSOPTS = $(filter-out -rtsopts,$(TEST_HC_OPTS))
18
19 # -----------------------------------------------------------------------------
20 # One-shot compilations, non-hierarchical modules
21
22 test011:
23 $(RM) A011.hi
24 $(RM) A011$(OBJSUFFIX)
25 "$(TEST_HC)" $(TEST_HC_OPTS) -c A011.hs
26 test -f A011.hi
27 test -f A011$(OBJSUFFIX)
28
29 # test -o
30 test012:
31 $(RM) A012.hi
32 $(RM) A012$(OBJSUFFIX)oo
33 "$(TEST_HC)" $(TEST_HC_OPTS) -c A012.hs -o A012$(OBJSUFFIX)oo
34 test -f A012$(OBJSUFFIX)oo
35
36 # test -ohi
37 test013:
38 $(RM) A013.xhi
39 $(RM) A013$(OBJSUFFIX)
40 "$(TEST_HC)" $(TEST_HC_OPTS) -c A013.hs -ohi A013.xhi
41 test -f A013.xhi
42
43 # test -odir
44 test014:
45 $(RM) -f A014.hi
46 $(RM) -rf obj014
47 mkdir obj014
48 "$(TEST_HC)" $(TEST_HC_OPTS) -c A014.hs -odir obj014
49 test -f obj014/A014$(OBJSUFFIX)
50 test -f A014.hi
51
52 # test -hidir
53 test015:
54 $(RM) -f A015$(OBJSUFFIX)
55 $(RM) -rf hi015
56 mkdir hi015
57 "$(TEST_HC)" $(TEST_HC_OPTS) -c A015.hs -hidir hi015
58 test -f A015$(OBJSUFFIX)
59 test -f hi015/A015.hi
60
61 # test stub generation
62 test016:
63 $(RM) F016.hi F016$(OBJSUFFIX) F016_stub.h
64 "$(TEST_HC)" $(TEST_HC_OPTS) -c F016.hs
65 test -f F016_stub.h
66
67 # test -stubdir (filename differs from module name)
68 test017:
69 $(RM) F017.hi F017$(OBJSUFFIX)
70 "$(TEST_HC)" $(TEST_HC_OPTS) -c F017.hs -stubdir stub017
71 test -f stub017/TestStub017_stub.h
72
73 # test -odir with stubs (filename differs from module name)
74 test018:
75 $(RM) -f F018.hi F018$(OBJSUFFIX) F018_stub.h
76 $(RM) -rf obj018
77 mkdir obj018
78 "$(TEST_HC)" $(TEST_HC_OPTS) -c F018.hs -odir obj018
79
80 # test for bug #3093
81 test018a:
82 $(RM) -f F018a.hi F018a_stub.h *.obj.018
83 "$(TEST_HC)" $(TEST_HC_OPTS) -c F018a.hs -osuf obj.018
84 test -f F018a.obj.018
85
86 # test -outputdir
87 test019:
88 $(RM) -rf out019
89 "$(TEST_HC)" $(TEST_HC_OPTS) -c F019.hs -outputdir out019
90 test -f out019/TestStub019.hi
91 test -f out019/TestStub019_stub.h
92
93 # -----------------------------------------------------------------------------
94 # One-shot compilation, hierarchical modules
95
96 test021:
97 $(RM) B021/C.hi
98 $(RM) B021/C$(OBJSUFFIX)
99 "$(TEST_HC)" $(TEST_HC_OPTS) -c B021/C.hs
100 test -f B021/C.hi
101 test -f B021/C$(OBJSUFFIX)
102
103 # test -o
104 test022:
105 $(RM) B022/C.hi
106 $(RM) B022/C$(OBJSUFFIX)oo
107 "$(TEST_HC)" $(TEST_HC_OPTS) -c B022/C.hs -o B022/C$(OBJSUFFIX)oo
108 test -f B022/C$(OBJSUFFIX)oo
109
110 # test -ohi
111 test023:
112 $(RM) B023/C.xhi
113 $(RM) B023/C$(OBJSUFFIX)
114 "$(TEST_HC)" $(TEST_HC_OPTS) -c B023/C.hs -ohi B023/C.xhi
115 test -f B023/C.xhi
116
117 # test -odir
118 test024:
119 $(RM) -f B024/C.hi
120 $(RM) -rf obj024
121 mkdir obj024
122 "$(TEST_HC)" $(TEST_HC_OPTS) -c B024/C.hs -odir obj024
123 test -f obj024/B024/C$(OBJSUFFIX)
124
125 # test -odir with non-Haskell compilation
126 test024a:
127 $(RM) -rf B024a
128 $(RM) -rf obj024a
129 mkdir B024a
130 mkdir obj024a
131 echo >B024a/stub.c
132 "$(TEST_HC)" $(TEST_HC_OPTS) -c B024a/stub.c -odir obj024a
133 test -f obj024a/B024a/stub$(OBJSUFFIX)
134
135 # test -hidir
136 test025:
137 $(RM) -rf hi025
138 mkdir hi025
139 $(RM) B025/C$(OBJSUFFIX)
140 "$(TEST_HC)" $(TEST_HC_OPTS) -c B025/C.hs -hidir hi025
141 test -f hi025/B025/C.hi
142
143 # This is a hierarchical module that lives in a subdirectory.
144 test026:
145 $(RM) d026/P/Q.hi
146 $(RM) d026/P/Q$(OBJSUFFIX)
147 "$(TEST_HC)" $(TEST_HC_OPTS) -c d026/P/Q.hs
148 test -f d026/P/Q.hi
149 test -f d026/P/Q$(OBJSUFFIX)
150
151 # test stub generation
152 # -fvia-C, because we want to check that the .hc file can #include the stub.h
153 test027:
154 $(RM) B027/F.hi B027/F$(OBJSUFFIX) B027/F_stub.h
155 "$(TEST_HC)" $(TEST_HC_OPTS) -c B027/F.hs -fno-warn-deprecated-flags -fvia-C
156 test -f B027/F_stub.h
157
158 # test -stubdir
159 # -fvia-C, because we want to check that the .hc file can #include the stub.h
160 test028:
161 $(RM) B028/F.hi B028/F$(OBJSUFFIX)
162 $(RM) stub028/B028/F_stub.h
163 "$(TEST_HC)" $(TEST_HC_OPTS) -c B028/F.hs -stubdir stub028 -fno-warn-deprecated-flags -fvia-C
164 test -f stub028/B028/F_stub.h
165
166 # -----------------------------------------------------------------------------
167 # Compilation-manager compilations, flat modules
168
169 test031:
170 $(RM) A031.hi
171 $(RM) A031$(OBJSUFFIX)
172 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make A031.hs
173 test -f A031.hi
174 test -f A031$(OBJSUFFIX)
175
176 # test -odir
177 test032:
178 $(RM) A032.hi
179 $(RM) -rf obj032
180 mkdir obj032
181 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make A032.hs -odir obj032
182 test -f obj032/A032$(OBJSUFFIX)
183
184 # test -hidir
185 test033:
186 $(RM) -rf hi033
187 $(RM) A033$(OBJSUFFIX)
188 mkdir hi033
189 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make A033.hs -hidir hi033
190 test -f hi033/A033.hi
191
192 # test stub generation
193 test034:
194 $(RM) F034.hi F034$(OBJSUFFIX) F034_stub.h
195 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make F034.hs
196 test -f F034_stub.h
197
198 # test -stubdir (filename differs from module name)
199 test035:
200 $(RM) F035.hi F$(OBJSUFFIX) stub035/Stubs_stub.h
201 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make F035.hs -stubdir stub035
202 test -f stub035/TestStub035_stub.h
203
204 # -----------------------------------------------------------------------------
205 # Compilation-manager compilations, hierarchical modules
206
207 test041:
208 $(RM) B041/C.hi
209 $(RM) B041/C$(OBJSUFFIX)
210 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B041/C.hs
211 test -f B041/C.hi
212 test -f B041/C$(OBJSUFFIX)
213
214 # test -odir
215 test042:
216 $(RM) -rf obj042
217 mkdir obj042
218 $(RM) B042/C.hi
219 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B042/C.hs -odir obj042
220 test -f obj042/B042/C$(OBJSUFFIX)
221
222 # test -odir with stubs
223 test042stub:
224 $(RM) -rf obj042stub
225 mkdir obj042stub
226 $(RM) B042stub/C.hi
227 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B042stub/C.hs -odir obj042stub
228 test -f obj042stub/B042stub/C$(OBJSUFFIX)
229
230 # test -hidir
231 test043:
232 $(RM) -f B043/C$(OBJSUFFIX)
233 $(RM) -rf hi043
234 mkdir hi043
235 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B043/C.hs -hidir hi043
236 test -f hi043/B043/C.hi
237
238 # test stub generation
239 test044:
240 $(RM) B044/F.hi B044/F$(OBJSUFFIX) B044/F_stub.h
241 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B044/F.hs
242 test -f B044/F_stub.h
243
244 # test -stubdir
245 test045:
246 $(RM) B045/F.hi B045/F$(OBJSUFFIX)
247 $(RM) stub045/B045/F_stub.h
248 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B045/F.hs -stubdir stub045
249 test -f stub045/B045/F_stub.h
250
251 # -----------------------------------------------------------------------------
252 # Compilation-manager compilations, hierarchical modules, non-root modules
253
254 test051:
255 $(RM) d051_2/R/S.hi
256 $(RM) d051_2/R/S$(OBJSUFFIX)
257 $(RM) d051_1/P/Q.hi
258 $(RM) d051_1/P/Q$(OBJSUFFIX)
259 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -id051_1 -id051_2 R.S
260 test -f d051_2/R/S.hi
261 test -f d051_2/R/S$(OBJSUFFIX)
262 test -f d051_1/P/Q.hi
263 test -f d051_1/P/Q$(OBJSUFFIX)
264
265 # test -odir
266 test052:
267 $(RM) d052_2/R/S.hi
268 $(RM) d052_1/P/Q.hi
269 $(RM) -rf obj052
270 mkdir obj052
271 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -id052_1 -id052_2 -odir obj052 R.S
272 test -f d052_2/R/S.hi
273 test -f obj052/R/S$(OBJSUFFIX)
274 test -f d052_1/P/Q.hi
275 test -f obj052/P/Q$(OBJSUFFIX)
276
277 # test -hidir
278 test053:
279 $(RM) hi053/R/S.hi
280 $(RM) d053_2/R/S$(OBJSUFFIX)
281 $(RM) hi053/P/Q.hi
282 $(RM) d053_1/P/Q$(OBJSUFFIX)
283 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -id053_1 -id053_2 -hidir hi053 R.S
284 test -f hi053/R/S.hi
285 test -f d053_2/R/S$(OBJSUFFIX)
286 test -f hi053/P/Q.hi
287 test -f d053_1/P/Q$(OBJSUFFIX)
288
289 # -----------------------------------------------------------------------------
290 # Other tests
291
292 # Test that -keep-s-files works with --make and -fvia-C
293 test061a:
294 $(RM) A061a.hi A061a$(OBJSUFFIX) A061a.s
295 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -keep-s-files -fno-warn-deprecated-flags -fvia-C A061a.hs
296 test -f A061a.s
297
298 # Test that -keep-s-files works without --make
299 test061b:
300 $(RM) A061b.hi A061b$(OBJSUFFIX) A061b.s
301 "$(TEST_HC)" $(TEST_HC_OPTS) -c -keep-s-files -fno-warn-deprecated-flags -fvia-C A061b.hs
302 test -f A061b.s
303
304 # Test that -main-is works with --make
305 test062a:
306 $(RM) Hello062a.hs Hello062a.hi Hello062a$(OBJSUFFIX) Hello062a.hc hello062a
307 echo "module Hello062a where { hello062a = putStrLn \"ok\" }" >Hello062a.hs
308 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is Hello062a.hello062a Hello062a -o hello062a
309 ./hello062a
310 test062b:
311 $(RM) Hello062b.hs Hello062b.hi Hello062b$(OBJSUFFIX) Hello062b.hc hello062b
312 echo "module Hello062b where { main = putStrLn \"ok\" }" >Hello062b.hs
313 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is Hello062b Hello062b -o hello062b
314 ./hello062b
315 test062c:
316 $(RM) Hello062c.hs Hello062c.hi Hello062c$(OBJSUFFIX) Hello062c.hc hello062c
317 echo "module Main (hello062c) where { hello062c = putStrLn \"ok\" }" >Hello062c.hs
318 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is hello062c Hello062c.hs -o hello062c
319 ./hello062c
320 test062d:
321 $(RM) -rf B062d
322 $(RM) hello062d
323 mkdir B062d
324 echo "module B062d.Hello062d (hello062d) where { hello062d = putStrLn \"ok\" }" >B062d/Hello062d.hs
325 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is B062d.Hello062d.hello062d B062d/Hello062d.hs -o hello062d
326 ./hello062d
327 test062e:
328 $(RM) -rf B062e
329 $(RM) Hello062e.hc hello062e
330 mkdir B062e
331 echo "module B062e.Hello062e (main) where { main = putStrLn \"ok\" }" >B062e/Hello062e.hs
332 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is B062e.Hello062e B062e/Hello062e.hs -o hello062e
333 ./hello062e
334
335 # Test that -i deletes the list of search paths.
336 # The compilation will fail, but we ignore the failure and just
337 # compare the output, because make might give us a different exit code.
338 test063:
339 $(RM) A063.hi A063$(OBJSUFFIX) A063.hc D063.hi D063$(OBJSUFFIX) D063.hc
340 -"$(TEST_HC)" $(TEST_HC_OPTS) --make -i -v0 D063.hs
341
342 # Test -E
343 test064:
344 $(RM) A064.hi A064.hspp
345 "$(TEST_HC)" $(TEST_HC_OPTS) -E A064.hs
346 test -f A064.hspp
347
348 # Test -E/-cpp
349 test065:
350 $(RM) A065.hi A065.hspp
351 "$(TEST_HC)" $(TEST_HC_OPTS) -E -cpp A065.hs
352 test -f A065.hspp
353
354 # Test -E/-o
355 test066:
356 $(RM) A066.hi A066.tmp
357 "$(TEST_HC)" $(TEST_HC_OPTS) -E A066.hs -o A066.tmp
358 test -f A066.tmp
359
360 # Test -E/-cpp/-o
361 test067:
362 $(RM) A067.hi A067.tmp
363 "$(TEST_HC)" $(TEST_HC_OPTS) -cpp -E A067.hs -o A067.tmp
364 test -f A067.tmp
365
366 # Test -S
367 test070:
368 $(RM) A070.hi A070.s
369 "$(TEST_HC)" $(TEST_HC_OPTS) -S A070.hs
370 test -f A070.s
371
372 # Test -S/-o
373 test071:
374 $(RM) A071.hi A071.tmp
375 "$(TEST_HC)" $(TEST_HC_OPTS) -S A071.hs -o A071.tmp
376 test -f A071.tmp
377
378
379 # Tests for #2248, -o and .exe
380
381 define test081
382 $(RM) $(1).hs $(1).hi $(1)$(OBJSUFFIX) $(1).hc $(1)$(exeext)
383 echo "module Main where { main = putStrLn \"ok\" }" >$(1).hs
384 "$(TEST_HC)" $(TEST_HC_OPTS) --make -v0 $(1).hs
385 test -f $(1)$(exeext)
386 endef
387
388 test081a:
389 $(call test081, Test_081a)
390 test081b:
391 $(call test081, Test.081b)
392
393 # -----------------------------------------------------------------------------
394 # --make tests
395
396 # Test for overlap between home module and package module
397 test100:
398 $(RM) overlap/List.hi overlap/List.o
399 $(RM) overlap/Overlap.hi overlap/Overlap.o
400 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -ioverlap Overlap
401
402 # -----------------------------------------------------------------------------
403 # dependency-generation tests
404
405 DEPFILE200 = depend200
406
407 # Test that we can create a dependency file, and that we can
408 # modify an existing dependency file.
409 test200:
410 $(RM) $(DEPFILE200)
411 "$(TEST_HC)" $(TEST_HC_OPTS) -M -dep-suffix "" -dep-makefile $(DEPFILE200) D200
412 test -f $(DEPFILE200)
413 "$(TEST_HC)" $(TEST_HC_OPTS) -M -dep-suffix "" -dep-makefile $(DEPFILE200) D200 B200.C A200
414 test -f $(DEPFILE200)
415 "$(TEST_HC)" $(TEST_HC_OPTS) -M -dep-suffix "" -dep-makefile $(DEPFILE200) D200.hs B200/C.hs A200.hs
416 test -f $(DEPFILE200)
417
418 # -----------------------------------------------------------------------------
419
420 T2566::
421 if "$(TEST_HC)" $(TEST_HC_OPTS) -c foo2566.bar; then false else true; fi
422
423 .PHONY: mode001
424 # We use
425 # sed '2,$$d'
426 # rather than
427 # head -1
428 # as the latter gives
429 # ghc: <stdout>: hFlush: resource vanished (Broken pipe)
430 # on OS X
431 mode001:
432 "$(TEST_HC)" $(TEST_HC_OPTS) --make --help | sed '2,$$d'
433 "$(TEST_HC)" $(TEST_HC_OPTS) --help --make | sed '2,$$d'
434
435 "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) --help | sed '2,$$d'
436 "$(TEST_HC)" --help $(TEST_HC_OPTS_INTERACTIVE) | sed '2,$$d'
437
438 "$(TEST_HC)" $(TEST_HC_OPTS) --version --help | sed "s/, version.*//"
439 "$(TEST_HC)" $(TEST_HC_OPTS) --help --version | sed '2,$$d'
440
441 "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) --version | sed "s/, version.*//"
442 "$(TEST_HC)" --version $(TEST_HC_OPTS_INTERACTIVE) | sed "s/, version.*//"
443
444 "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) --show-options | grep -- --show-options | sed '2,$$d'
445 "$(TEST_HC)" --show-options $(TEST_HC_OPTS_INTERACTIVE) | grep -- --show-options | sed '2,$$d'
446
447 # Test for building DLLs with ghc -shared, see #2745
448 shared001:
449 $(RM) Shared001.hi Shared001.o HSdll.dll.a HSdll.dll Shared001_stub.*
450 "$(TEST_HC)" $(TEST_HC_OPTS_NO_RTSOPTS) -v0 -shared Shared001.hs
451
452 static001:
453 $(RM) Static001.hi Static001.o liba.a Static001_stub.*
454 "$(TEST_HC)" $(TEST_HC_OPTS_NO_RTSOPTS) -v0 -staticlib Static001.hs
455
456 # -----------------------------------------------------------------------------
457
458 T3674:
459 $(RM) T3674*.o T3674*.hi T3674_pre
460 "$(TEST_HC)" $(TEST_HC_OPTS) --make -v0 T3674_pre.hs
461 "$(TEST_HC)" $(TEST_HC_OPTS) --make -v0 T3674.hs
462
463 .PHONY: rtsopts001
464 rtsopts001:
465 $(RM) rtsOpts$(exeext) rtsOpts.hi rtsOpts.o
466 "$(TEST_HC)" $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 --make rtsOpts -rtsopts
467 echo "Normal"
468 -./rtsOpts +RTS -C0 2>&1
469 $(RM) rtsOpts$(exeext) rtsOpts.hi rtsOpts.o
470 "$(TEST_HC)" $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 --make rtsOpts
471 echo "No RTS opts"
472 -./rtsOpts +RTS -C0 2>&1
473
474 .PHONY: rtsopts002
475 rtsopts002:
476 $(RM) rtsopts002$(exeext) rtsopts002.hi rtsopts002.o
477 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make rtsopts002 -rtsopts=some
478 ./rtsopts002
479 ./rtsopts002 +RTS --info >/dev/null
480 if ./rtsopts002 +RTS -C0; then exit 1; else exit 0; fi
481 GHCRTS= ./rtsopts002
482 GHCRTS=--info ./rtsopts002 >/dev/null
483 if GHCRTS=-C0 ./rtsopts002; then exit 1; else exit 0; fi
484
485 .PHONY: withRtsOpts
486 withRtsOpts:
487 $(RM) withRtsOpts$(exeext) withRtsOpts.hi withRtsOpts.o withRtsOpts.out
488 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make withRtsOpts -with-rtsopts=--info
489 ./withRtsOpts | head -1
490 # Also test for non-safe RTS opts, these should be allowed too,
491 # since the author has explicitly requested them. (#5114)
492 $(RM) withRtsOpts$(exeext) withRtsOpts.hi withRtsOpts.o withRtsOpts.out
493 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make withRtsOpts -with-rtsopts=-twithRtsOpts.out
494 ./withRtsOpts | head -1
495 test -f withRtsOpts.out
496
497 .PHONY: T3364
498 T3364:
499 -"$(TEST_HC)" $(TEST_HC_OPTS) -H
500
501 .PHONY: T706
502 T706:
503 cp T706a.hs T706.hs
504 "$(TEST_HC)" $(TEST_HC_OPTS) $(ghciWayFlags) -c T706.hs
505 cp T706b.hs T706.hs
506 "$(TEST_HC)" $(TEST_HC_OPTS) $(ghciWayFlags) -c T706.hs
507 echo "test" | "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) T706
508
509 .PHONY: T5584
510 T5584:
511 $(RM) -rf T5584_out
512 mkdir T5584_out
513 "$(TEST_HC)" -odir T5584_out -c T5584_in/A.hs-boot
514
515 .PHONY: T5198
516 T5198:
517 $(RM) -rf T5198dump
518 [ ! -d T5198dump ]
519 "$(TEST_HC)" $(TEST_HC_OPTS) -c T5198.hs -dumpdir T5198dump -ddump-to-file -ddump-simpl
520 [ -f T5198dump/T5198.dump-simpl ]
521
522 .PHONY: T7060a
523 T7060a:
524 $(RM) -rf T7060dump
525 [ ! -d T7060dump ]
526 "$(TEST_HC)" $(TEST_HC_OPTS) -O -c T7060.hs -dumpdir T7060dump -ddump-to-file -ddump-rules
527 [ -f T7060dump/T7060.dump-rules ]
528
529 .PHONY: T7060b
530 T7060b:
531 $(RM) -rf T7060dump
532 [ ! -d T7060dump ]
533 "$(TEST_HC)" $(TEST_HC_OPTS) -O -c T7060.hs -dumpdir T7060dump -ddump-to-file -ddump-rule-firings
534 [ -f T7060dump/T7060.dump-rule-firings ]
535
536 .PHONY: T7060c
537 T7060c:
538 $(RM) -rf T7060dump
539 [ ! -d T7060dump ]
540 "$(TEST_HC)" $(TEST_HC_OPTS) -O -c T7060.hs -dumpdir T7060dump -ddump-to-file -ddump-rule-rewrites
541 [ -f T7060dump/T7060.dump-rule-rewrites ]
542
543 .PHONY: T7060
544 T7060: T7060a T7060b T7060c
545
546 .PHONY: T7130
547 T7130:
548 "$(TEST_HC)" $(TEST_HC_OPTS) -fflul-laziness
549
550 .PHONY: T7563
551 T7563:
552 -"$(TEST_HC)" $(TEST_HC_OPTS) -C T7563.hs
553
554 # Below we set LC_ALL=C to request standard ASCII output in the resulting error
555 # messages. Unfortunately, Mac OS X and Windows still use a Unicode encoding
556 # even with LC_ALL=C, so we expect these tests to fail there.
557
558 .PHONY: T6037
559 T6037:
560 -LC_ALL=C "$(TEST_HC)" $(TEST_HC_OPTS) -c T6037.hs
561
562 .PHONY: T2507
563 T2507:
564 -LC_ALL=C "$(TEST_HC)" $(TEST_HC_OPTS) -c T2507.hs
565
566 .PHONY: T8959a
567 T8959a:
568 -LC_ALL=C "$(TEST_HC)" $(TEST_HC_OPTS) -c T8959a.hs -XUnicodeSyntax
569
570 .PHONY: T703
571 T703:
572 $(RM) -rf T703
573 [ ! -d T703 ]
574 "$(TEST_HC)" $(TEST_HC_OPTS) --make T703.hs -v0
575 ! readelf -W -l T703 2>/dev/null | grep 'GNU_STACK' | grep -q 'RWE'
576
577 .PHONY: T2182
578 T2182:
579 $(RM) T2182_A.hi T2182.hi
580 ! "$(TEST_HC)" $(TEST_HC_OPTS) --make T2182_A.hs T2182.hs -v0
581 ! "$(TEST_HC)" $(TEST_HC_OPTS) --make T2182.hs T2182_A.hs -v0
582
583 .PHONY: write_interface_oneshot
584 write_interface_oneshot:
585 $(RM) -rf write_interface_oneshot/A011.hi
586 "$(TEST_HC)" $(TEST_HC_OPTS) -hidir write_interface_oneshot_hidir -fno-code -fwrite-interface -c A011.hs
587 test -f write_interface_oneshot_hidir/A011.hi
588
589 .PHONY: write_interface_make
590 write_interface_make:
591 $(RM) -rf write_interface_make/A011.hi
592 "$(TEST_HC)" $(TEST_HC_OPTS) -hidir write_interface_make_hidir -fno-code -fwrite-interface --make A011.hs
593 test -f write_interface_make_hidir/A011.hi
594
595 .PHONY: T9938
596 T9938:
597 $(RM) -rf T9938.o T9938.hi T9938
598 "$(TEST_HC)" $(TEST_HC_OPTS) -O2 -c T9938.hs
599 "$(TEST_HC)" $(TEST_HC_OPTS) -O2 T9938.o -o T9938
600
601 .PHONY: T9938B
602 T9938B:
603 $(RM) -rf T9938B.o T9938B.hi T9938B
604 "$(TEST_HC)" $(TEST_HC_OPTS) -O2 -c T9938B.hs
605 "$(TEST_HC)" $(TEST_HC_OPTS) -O2 T9938B.o -o T9938B
606
607 .PHONY: T10182
608 T10182:
609 $(RM) -rf T10182.o T10182a.o T10182.o-boot T10182.hi T10182a.hi T10182.hi-boot
610 "$(TEST_HC)" $(TEST_HC_OPTS) -c T10182.hs-boot
611 "$(TEST_HC)" $(TEST_HC_OPTS) -c T10182a.hs
612 "$(TEST_HC)" $(TEST_HC_OPTS) -c T10182.hs
613
614 .PHONY: T10320
615 T10320:
616 $(RM) -rf T10320 T10320.dump-rule-rewrites T10320.hi T10320.o
617 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -ddump-to-file -ddump-rule-rewrites -fenable-rewrite-rules T10320.hs
618 [ -s T10320.dump-rule-rewrites ]
619 "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -fforce-recomp -ddump-to-file -ddump-rule-rewrites T10320.hs
620 [ -f T10320.dump-rule-rewrites ] && [ ! -s T10320.dump-rule-rewrites ]
621
622 .PHONY: T12135
623 T12135:
624 $(RM) -rf T12135.o T12135.hi T12135 T12135a T12135b
625 mkdir T12135a T12135b
626 cp T12135a.h T12135a/T12135.h
627 "$(TEST_HC)" $(TEST_HC_OPTS) -IT12135b -IT12135a --make T12135.hs
628 ./T12135
629 cp T12135b.h T12135b/T12135.h
630 "$(TEST_HC)" $(TEST_HC_OPTS) -IT12135b -IT12135a --make T12135.hs
631 ./T12135
632
633 .PHONY: T10923
634 T10923:
635 $(RM) -rf T10923.o T10923.hi
636 "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c T10923.hs
637 # should NOT output "compilation is NOT required"
638 "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O -c T10923.hs
639
640 .PHONY: T13604
641 T13604:
642 $(RM) -rf T13604.o T13604.hi
643 "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c T13604.hs
644 # SHOULD output "compilation is NOT required"
645 "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O -c -fignore-optim-changes T13604.hs
646
647 .PHONY: T13604a
648 T13604a:
649 $(RM) -rf T13604a.o T13604a.hi
650 "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c -fhpc T13604a.hs
651 # SHOULD output "compilation is NOT required"
652 "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c -fignore-hpc-changes T13604a.hs
653
654 .PHONY: T12955
655 T12955:
656 ! "$(TEST_HC)" $(TEST_HC_OPTS) --make T12955
657 ! "$(TEST_HC)" $(TEST_HC_OPTS) --make T12955 -fbuilding-cabal-package
658
659 .PHONY: T12971
660 T12971:
661 mkdir -p ä
662 TMP=ä "$(TEST_HC)" $(TEST_HC_OPTS) --make T12971