2007-10-19 Marek Habersack <mhabersack@novell.com>
[mono.git] / mono / tests / Makefile.am
1 SUBDIRS = cas assemblyresolve
2
3 check-local: test
4
5 TEST_PROG = ../interpreter/mint
6 JITTEST_PROG = ../mini/mono
7
8 TEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(TEST_PROG)
9 JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(JITTEST_PROG)
10
11 RUNTIME_ARGS=--config tests-config --optimize=all
12
13 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/default
14 with_mono_path2 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
15 with_mono_path21 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_1
16
17 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
18 RUNTIME2 = $(with_mono_path2) $(top_builddir)/runtime/mono-wrapper
19 RUNTIME21 = $(with_mono_path21) $(top_builddir)/runtime/mono-wrapper
20
21 MKBUNDLE = \
22         PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
23         $(RUNTIME) $(mcs_topdir)/class/lib/default/mkbundle.exe
24
25 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
26 GMCS = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/gmcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
27 SMCS = $(RUNTIME21) $(mcs_topdir)/class/lib/net_2_1/smcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
28 ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/default/ilasm.exe
29 ILASM2 = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/ilasm.exe
30
31 BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
32
33 STRESS_TESTS_SRC=       \
34         abort-stress-1.cs       \
35         abort-stress-2.cs       \
36         abort-stress-3.cs       \
37         domain-stress.cs        \
38         gchandle-stress.cs      \
39         monitor-stress.cs       \
40         thread-stress.cs        \
41         gc-stress.cs
42
43 TEST_CS_SRC=                    \
44         array-init.cs           \
45         arraylist.cs            \
46         assemblyresolve_event.cs        \
47         assemblyresolve_event3.cs       \
48         checked.cs              \
49         char-isnumber.cs        \
50         create-instance.cs      \
51         field-layout.cs         \
52         pack-layout.cs          \
53         pack-bug.cs             \
54         hash-table.cs           \
55         test-ops.cs             \
56         obj.cs                  \
57         test-dup-mp.cs          \
58         string.cs               \
59         stringbuilder.cs        \
60         switch.cs               \
61         outparm.cs              \
62         delegate.cs             \
63         bitconverter.cs         \
64         exception.cs            \
65         exception2.cs           \
66         exception3.cs           \
67         exception4.cs           \
68         exception5.cs           \
69         exception6.cs           \
70         exception7.cs           \
71         exception8.cs           \
72         exception10.cs          \
73         exception11.cs          \
74         exception12.cs          \
75         exception13.cs          \
76         exception14.cs          \
77         exception15.cs          \
78         exception16.cs          \
79         typeload-unaligned.cs   \
80         struct.cs               \
81         valuetype-gettype.cs    \
82         typeof-ptr.cs           \
83         static-constructor.cs   \
84         pinvoke.cs              \
85         pinvoke2.cs             \
86         pinvoke3.cs             \
87         pinvoke11.cs            \
88         pinvoke13.cs            \
89         pinvoke17.cs            \
90         invoke.cs               \
91         invoke2.cs              \
92         runtime-invoke.cs               \
93         invoke-string-ctors.cs          \
94         reinit.cs               \
95         box.cs                  \
96         array.cs                \
97         enum.cs                 \
98         enum2.cs                \
99         property.cs             \
100         enumcast.cs             \
101         assignable-tests.cs     \
102         array-cast.cs           \
103         array-subtype-attr.cs   \
104         cattr-compile.cs        \
105         cattr-field.cs          \
106         cattr-object.cs         \
107         custom-attr.cs          \
108         double-cast.cs          \
109         newobj-valuetype.cs     \
110         arraylist-clone.cs      \
111         setenv.cs               \
112         vtype.cs                \
113         isvaluetype.cs          \
114         iface6.cs               \
115         iface7.cs               \
116         ipaddress.cs            \
117         array-vt.cs             \
118         interface1.cs           \
119         reflection-enum.cs      \
120         reflection-prop.cs      \
121         reflection4.cs          \
122         reflection5.cs          \
123         reflection-const-field.cs \
124         many-locals.cs          \
125         string-compare.cs       \
126         test-prime.cs           \
127         params.cs               \
128         reflection.cs           \
129         interface.cs            \
130         iface.cs                \
131         iface2.cs               \
132         iface3.cs               \
133         iface4.cs               \
134         iface-large.cs          \
135         virtual-method.cs       \
136         intptrcast.cs           \
137         indexer.cs              \
138         stream.cs               \
139         console.cs              \
140         shift.cs                \
141         jit-int.cs              \
142         jit-uint.cs             \
143         jit-long.cs             \
144         long.cs                 \
145         jit-ulong.cs            \
146         jit-float.cs            \
147         pop.cs                  \
148         time.cs                 \
149         appdomain.cs        \
150         appdomain1.cs           \
151         appdomain2.cs           \
152         appdomain-client.cs     \
153         appdomain-unload.cs \
154         loader.cs       \
155         pointer.cs              \
156         hashcode.cs             \
157         delegate1.cs            \
158         delegate2.cs            \
159         delegate3.cs            \
160         delegate5.cs            \
161         delegate6.cs            \
162         delegate7.cs            \
163         delegate8.cs            \
164         remoting1.cs            \
165         remoting2.cs            \
166         remoting3.cs            \
167         remoting4.cs            \
168         remoting5.cs            \
169         nonvirt.cs              \
170         largeexp.cs             \
171         largeexp2.cs            \
172         marshalbyref1.cs        \
173         static-ctor.cs          \
174         inctest.cs              \
175         bound.cs                \
176         array-invoke.cs         \
177         test-arr.cs             \
178         decimal.cs              \
179         decimal-array.cs        \
180         marshal.cs              \
181         marshal1.cs             \
182         marshal2.cs             \
183         marshal3.cs             \
184         marshal5.cs             \
185         marshal6.cs             \
186         marshal7.cs             \
187         marshal8.cs             \
188         marshal9.cs             \
189         test-byval-in-struct.cs \
190         thread.cs               \
191         thread5.cs              \
192         thread6.cs              \
193         thread-static.cs        \
194         thread-static-init.cs   \
195         context-static.cs       \
196         float-pop.cs            \
197         interfacecast.cs        \
198         array3.cs               \
199         classinit.cs            \
200         classinit2.cs           \
201         synchronized.cs         \
202         async_read.cs           \
203         threadpool.cs           \
204         threadpool1.cs          \
205         base-definition.cs      \
206         bug-27420.cs            \
207         bug-47295.cs            \
208         bug-46781.cs            \
209         bug-48015.cs            \
210         bug-42136.cs            \
211         bug-59286.cs            \
212         bug-70561.cs            \
213         bug-78311.cs            \
214         bug-78653.cs            \
215         bug-78656.cs            \
216         bug-77127.cs            \
217         bug-331958.cs           \
218         interlocked.cs          \
219         cross-domain.cs         \
220         appdomain-exit.cs       \
221         delegate-async-exit.cs  \
222         delegate-delegate-exit.cs       \
223         delegate-exit.cs        \
224         finalizer-abort.cs      \
225         finalizer-exception.cs  \
226         finalizer-exit.cs       \
227         main-exit.cs    \
228         main-returns-abort-resetabort.cs        \
229         main-returns-background-abort-resetabort.cs     \
230         main-returns-background-resetabort.cs   \
231         main-returns-background.cs      \
232         main-returns-background-change.cs       \
233         main-returns.cs         \
234         subthread-exit.cs       \
235         desweak.cs              \
236         cominterop.cs           \
237         exists.cs               \
238         handleref.cs    \
239         transparentproxy.cs
240
241 if X86
242 # bug #71274
243 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
244 endif
245
246 if POWERPC
247 # bug #71274
248 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
249 endif
250
251 DISABLED_TESTS=                 \
252         delegate-async-exception.exe    \
253         delegate-delegate-exception.exe \
254         appdomain-unload.exe            \
255         $(PLATFORM_DISABLED_TESTS)
256
257 # These only compile with MS CSC
258 TEST_CSC_SRC=                   \
259         vararg.cs
260
261 TEST_IL_SRC=                    \
262         field-access.il         \
263         method-access.il        \
264         ldftn-access.il         \
265         cpblkTest.il            \
266         vbinterface.il          \
267         jmpTest.il              \
268         calliTest.il            \
269         ckfiniteTest.il         \
270         fault-handler.il                \
271         locallocTest.il         \
272         long-shift-regalloc.il          \
273         initblkTest.il          \
274         qt-instance.il          \
275         vararg.il               \
276         bug-29859.il            \
277         bug-78549.il            \
278         static-fields-nonconst.il       \
279         reload-at-bb-end.il     \
280         test-enum-indstoreil.il \
281         filter-bug.il           \
282         even-odd.il             \
283         bug-82022.il    \
284         vt-sync-method.il       \
285         enum_types.il
286
287 TEST_CS2_SRC = \
288         assemblyresolve_event2.2.cs     \
289         interlocked-2.2.cs      \
290         pinvoke-2.2.cs          \
291         bug-78431.2.cs          \
292         bug-79684.2.cs          \
293         catch-generics.2.cs     \
294         event-get.2.cs          \
295         safehandle.2.cs         \
296         stackframes-async.2.cs          \
297         module-cctor-loader.2.cs        \
298         generics-invoke-byref.2.cs      \
299         generic-signature-compare.2.cs  \
300         generics-sharing.2.cs   \
301         bug-80392.2.cs          \
302         dynamic-method-access.2.cs      \
303         bug-82194.2.cs  \
304         anonarray.2.cs  \
305         ienumerator-interfaces.2.cs     \
306         generic_type_definition_encoding.2.cs \
307         generic_type_definition.2.cs    \
308         bug-333798.2.cs         \
309         bug-333798-tb.2.cs
310
311 TEST_IL2_SRC = find-method.2.il \
312         bug-79215.2.il  \
313         bug-79956.2.il  \
314         bug-327438.2.il \
315         ldtoken_with_byref_typespec.2.il
316
317 # pre-requisite test sources: files that are not test themselves
318 # but that need to be compiled
319 PREREQ_IL_SRC=event-il.il module-cctor.il
320 PREREQ_CS_SRC=
321 PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
322 PREREQ_CS_DLL_SRC=
323
324 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
325 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
326 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
327 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
328 TESTSI_CS2=$(TEST_CS2_SRC:.2.cs=.exe)
329 TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
330 TESTBS=$(BENCHSRC:.cs=.exe)
331 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
332
333 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) \
334         $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
335
336 %.exe: %.2.il
337         $(ILASM2) -out:$@ $<
338
339 %.exe: %.il
340         $(ILASM) -out:$@ $<
341
342 %.exe: %.2.cs TestDriver.dll
343         $(GMCS) -r:TestDriver.dll -out:$@ $<
344
345 %.exe: %.cs TestDriver.dll
346         $(MCS) -r:TestDriver.dll -out:$@ $<
347
348 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
349 if POWERPC
350 test:   assemblyresolve/test/asm.dll testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466
351 else
352 # Can't use mkbundle on win32 since there is no static build there
353 # Can't run test-unhandled-exception on Windows because of all the debug popups...
354 if PLATFORM_WIN32
355 test:   assemblyresolve/test/asm.dll testjit test-type-load test-inline-call-stack test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466
356 else
357 test:   assemblyresolve/test/asm.dll testjit testbundle test-type-load test-inline-call-stack test-iomap-regression test-bug-80307 test-bug-81673 test-bug-81691 test-bug-81466
358 endif
359 endif
360
361 if INSTALL_2_1
362 test : test-coreclr-security
363 endif
364
365 assemblyresolve/test/asm.dll:
366         $(MAKE) -C assemblyresolve prereq
367
368 TestDriver.dll:
369         $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
370
371 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
372         @failed=0; \
373         passed=0; \
374         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
375         for i in $(TESTSI_CS); do       \
376                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
377                 then \
378                         passed=`expr $${passed} + 1`; \
379                 else \
380                         if [ $$? = 2 ]; then break; fi; \
381                         failed=`expr $${failed} + 1`; \
382                 fi \
383         done; \
384         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
385
386 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
387         @failed=0; \
388         passed=0; \
389         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
390         for i in $(TESTSI_IL); do       \
391                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
392                 then \
393                         passed=`expr $${passed} + 1`; \
394                 else \
395                         if [ $$? = 2 ]; then break; fi; \
396                         failed=`expr $${failed} + 1`; \
397                 fi \
398         done; \
399         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
400
401 testb: $(TEST_PROG) $(TESTBS)
402         for i in $(TESTBS); do  \
403                 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS);     \
404         done
405
406 testjit: testjit-default testjit-net_2_0
407
408 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
409         @failed=0; \
410         passed=0; \
411         failed_tests="";\
412         for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
413                 rm -f $${i}.so; \
414                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
415                 then \
416                         passed=`expr $${passed} + 1`; \
417                 else \
418                         if [ $$? = 2 ]; then break; fi; \
419                         failed=`expr $${failed} + 1`; \
420                         failed_tests="$${failed_tests} $$i"; \
421                 fi \
422         done; \
423         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
424         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
425           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
426
427 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
428         @failed=0; \
429         passed=0; \
430         failed_tests="";\
431         for i in $(TESTSI_CS2) $(TESTSI_IL2); do        \
432                 rm -f $${i}.so; \
433                 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
434                 then \
435                         passed=`expr $${passed} + 1`; \
436                 else \
437                         if [ $$? = 2 ]; then break; fi; \
438                         failed=`expr $${failed} + 1`; \
439                         failed_tests="$${failed_tests} $$i"; \
440                 fi \
441         done; \
442         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
443         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
444           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
445
446 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
447         @failed=0; \
448         passed=0; \
449         failed_tests="";\
450         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
451         for i in $(TESTSI_CS) $(TESTBS); do     \
452                 rm -f $${i}.so; \
453                 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
454                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
455                 then \
456                         passed=`expr $${passed} + 1`; \
457                 else \
458                         if [ $$? = 2 ]; then break; fi; \
459                         failed=`expr $${failed} + 1`; \
460                         failed_tests="$${failed_tests} $$i"; \
461                 fi \
462         done; \
463         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
464         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
465           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
466
467 testtrace:
468         $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
469
470 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
471         @failed=0; \
472         passed=0; \
473         failed_tests="";\
474         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
475         for i in $(TESTSI_CS) $(TESTSI_IL); do \
476                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
477                 then \
478                         passed=`expr $${passed} + 1`; \
479                 else \
480                         if [ $$? = 2 ]; then break; fi; \
481                         failed=`expr $${failed} + 1`; \
482                         failed_tests="$${failed_tests} $$i"; \
483                 fi \
484         done; \
485         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
486         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
487           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
488
489 testjitspeed: $(JITTEST_PROG) $(TESTBS)
490         for i in $(TESTBS); do  \
491                 echo $$i;       \
492                 time $(JITTEST_PROG) $$i;       \
493         done
494
495 test-iomap-regression: exists.cs
496         $(MCS) $(srcdir)/exists.cs -out:exists.exe
497         MONO_IOMAP=all $(RUNTIME) exists.exe
498
499 stresstest: $(STRESS_TESTS)
500         @failed=0; \
501         passed=0; \
502         failed_tests="";\
503         for i in $(STRESS_TESTS); do    \
504                 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
505                 then \
506                         passed=`expr $${passed} + 1`; \
507                 else \
508                         if [ $$? = 2 ]; then break; fi; \
509                         failed=`expr $${failed} + 1`; \
510                         failed_tests="$${failed_tests} $$i"; \
511                 fi \
512         done; \
513         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
514         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
515           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
516
517 testbundle: console.exe
518         $(MKBUNDLE) --static console.exe
519         $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
520         - rm -rf a.out
521
522 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
523 test-type-load: TestDriver.dll
524         $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
525         $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
526         $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
527         $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
528         $(RUNTIME) load-exceptions.exe
529
530 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
531 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
532         $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
533 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
534         $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
535 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
536         $(RUNTIME) test-inline-call-stack.exe
537
538
539 EXTRA_DIST += unhandled-exception-base-configuration.config
540 EXTRA_DIST += unhandled-exception-legacy-configuration.config
541 EXTRA_DIST += unhandled-exception-test-case.2.cs
542 EXTRA_DIST += unhandled-exception-test-runner.2.cs
543 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
544         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
545 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
546         cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
547 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
548         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
549 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
550         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
551         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
552         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
553         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
554 unhandled-exception-test-case.1.exe: unhandled-exception-test-case.1.cs
555         $(MCS) /debug unhandled-exception-test-case.1.cs
556 unhandled-exception-test-case-legacy.1.exe: unhandled-exception-test-case-legacy.1.cs
557         $(MCS) /debug unhandled-exception-test-case-legacy.1.cs
558 unhandled-exception-test-case.2.exe: unhandled-exception-test-case.2.cs
559         $(GMCS) /debug unhandled-exception-test-case.2.cs
560 unhandled-exception-test-case-legacy.2.exe: unhandled-exception-test-case-legacy.2.cs
561         $(GMCS) /debug unhandled-exception-test-case-legacy.2.cs
562 unhandled-exception-test-runner.2.exe: unhandled-exception-test-runner.2.cs
563         $(GMCS) /debug unhandled-exception-test-runner.2.cs
564
565 test-unhandled-exception: unhandled-exception-test-runner.2.exe unhandled-exception-config_files unhandled-exception-test-case.1.exe unhandled-exception-test-case-legacy.1.exe  unhandled-exception-test-case.2.exe unhandled-exception-test-case-legacy.2.exe
566         $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
567
568 EXTRA_DIST += bug-80307.cs
569 bug-80307.exe: $(srcdir)/bug-80307.cs
570         $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
571
572 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
573 test-bug-80307: bug-80307.exe
574         cd $(top_builddir)/runtime && $(MAKE) test-support-files
575         $(RUNTIME) bug-80307.exe
576
577 EXTRA_DIST += bug-81673.cs bug-81673-interface.cs
578 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
579         $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
580         $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
581         $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
582
583 test-bug-81673 : bug-81673.exe bug-81673-interface.dll
584         $(RUNTIME) bug-81673.exe
585
586 EXTRA_DIST += bug-81691.cs bug-81691-a.cs bug-81691-b.cs
587 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
588         $(GMCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
589         $(GMCS) -target:library -out:bug-81691-b.dll -r:bug-81691-a.dll $(srcdir)/bug-81691-b.cs
590         $(GMCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
591         rm -f bug-81691-a.dll
592
593 test-bug-81691 : bug-81691.exe bug-81691-b.dll
594         $(RUNTIME) bug-81691.exe
595
596 EXTRA_DIST += bug-81466.il bug-81466-lib.il
597 bug-81466-lib.dll: bug-81466-lib.il
598         $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
599 bug-81466.exe: bug-81466.il bug-81466-lib.dll
600         $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
601 test-bug-81466: bug-81466.exe bug-81466-lib.dll
602         $(RUNTIME) bug-81466.exe
603
604 EXTRA_DIST += coreclr-security.cs
605
606 if INSTALL_2_1
607 coreclr-security.exe : coreclr-security.cs
608         $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
609
610 test-coreclr-security : coreclr-security.exe
611         $(RUNTIME21) --security=core-clr-test coreclr-security.exe
612 endif
613
614 EXTRA_DIST += async-exceptions.cs
615 async-exceptions.exe : async-exceptions.cs
616         $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
617 test-async-exceptions : async-exceptions.exe
618         for i in `echo 0 1 2 3 4 5 6 7 8 9 10`; do $(RUNTIME) --inject-async-exc Tests:foo $$i async-exceptions.exe || exit 1; done
619         for i in `echo 0 1 2 3 4 5 6 7 8 9 10`; do $(RUNTIME) --inject-async-exc Tests:bar $$i async-exceptions.exe || exit 1; done
620
621 # Useful if mono is compiled with --enable-shared=no
622 patch-libtool:
623         cp "../../libtool" .
624         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
625         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
626         touch libtest.c
627
628 noinst_LTLIBRARIES = libtest.la
629
630 INCLUDES = $(GLIB_CFLAGS)
631
632 if PLATFORM_WIN32
633 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
634 # This shows up when compiling mono_test_marshal_delegate ()
635 libtest_la_CFLAGS=-fno-optimize-sibling-calls
636 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
637 # can't find them. So we use --kill-at to remove the @ suffix as well.
638 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
639 else
640 libtest_la_LDFLAGS = -rpath `pwd`
641 endif
642 libtest_la_SOURCES = libtest.c
643 libtest_la_LIBADD = $(GLIB_LIBS)
644
645 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat