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