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