336d14f881154da8f7c4fc25565bf4bff7288e9c
[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         interlocked.cs          \
218         cross-domain.cs         \
219         appdomain-exit.cs       \
220         delegate-async-exit.cs  \
221         delegate-delegate-exit.cs       \
222         delegate-exit.cs        \
223         finalizer-abort.cs      \
224         finalizer-exception.cs  \
225         finalizer-exit.cs       \
226         main-exit.cs    \
227         main-returns-abort-resetabort.cs        \
228         main-returns-background-abort-resetabort.cs     \
229         main-returns-background-resetabort.cs   \
230         main-returns-background.cs      \
231         main-returns-background-change.cs       \
232         main-returns.cs         \
233         subthread-exit.cs       \
234         desweak.cs              \
235         cominterop.cs           \
236         exists.cs               \
237         handleref.cs    \
238         transparentproxy.cs
239
240 if X86
241 # bug #71274
242 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
243 endif
244
245 if POWERPC
246 # bug #71274
247 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
248 endif
249
250 DISABLED_TESTS=                 \
251         delegate-async-exception.exe    \
252         delegate-delegate-exception.exe \
253         appdomain-unload.exe            \
254         $(PLATFORM_DISABLED_TESTS)
255
256 # These only compile with MS CSC
257 TEST_CSC_SRC=                   \
258         vararg.cs
259
260 TEST_IL_SRC=                    \
261         field-access.il         \
262         method-access.il        \
263         ldftn-access.il         \
264         cpblkTest.il            \
265         vbinterface.il          \
266         jmpTest.il              \
267         calliTest.il            \
268         ckfiniteTest.il         \
269         fault-handler.il                \
270         locallocTest.il         \
271         long-shift-regalloc.il          \
272         initblkTest.il          \
273         qt-instance.il          \
274         vararg.il               \
275         bug-29859.il            \
276         bug-78549.il            \
277         static-fields-nonconst.il       \
278         reload-at-bb-end.il     \
279         test-enum-indstoreil.il \
280         filter-bug.il           \
281         even-odd.il             \
282         bug-82022.il    \
283         enum_types.il
284
285 TEST_CS2_SRC = \
286         assemblyresolve_event2.2.cs     \
287         interlocked-2.2.cs      \
288         pinvoke-2.2.cs          \
289         bug-78431.2.cs          \
290         bug-79684.2.cs          \
291         catch-generics.2.cs     \
292         event-get.2.cs          \
293         safehandle.2.cs         \
294         stackframes-async.2.cs          \
295         module-cctor-loader.2.cs        \
296         generics-invoke-byref.2.cs      \
297         generic-signature-compare.2.cs  \
298         generics-sharing.2.cs   \
299         bug-80392.2.cs          \
300         dynamic-method-access.2.cs      \
301         bug-82194.2.cs  \
302         anonarray.2.cs  \
303         generic_type_definition.2.cs
304
305 TEST_IL2_SRC = find-method.2.il \
306         bug-79215.2.il  \
307         bug-79956.2.il  \
308         bug-327438.2.il \
309         ldtoken_with_byref_typespec.2.il
310
311 # pre-requisite test sources: files that are not test themselves
312 # but that need to be compiled
313 PREREQ_IL_SRC=event-il.il module-cctor.il
314 PREREQ_CS_SRC=
315 PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
316 PREREQ_CS_DLL_SRC=
317
318 PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
319 PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
320 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
321 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
322 TESTSI_CS2=$(TEST_CS2_SRC:.2.cs=.exe)
323 TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
324 TESTBS=$(BENCHSRC:.cs=.exe)
325 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
326
327 EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) \
328         $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
329
330 %.exe: %.2.il
331         $(ILASM2) -out:$@ $<
332
333 %.exe: %.il
334         $(ILASM) -out:$@ $<
335
336 %.exe: %.2.cs TestDriver.dll
337         $(GMCS) -r:TestDriver.dll -out:$@ $<
338
339 %.exe: %.cs TestDriver.dll
340         $(MCS) -r:TestDriver.dll -out:$@ $<
341
342 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
343 if POWERPC
344 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
345 else
346 # Can't use mkbundle on win32 since there is no static build there
347 # Can't run test-unhandled-exception on Windows because of all the debug popups...
348 if PLATFORM_WIN32
349 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
350 else
351 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
352 endif
353 endif
354
355 if INSTALL_2_1
356 test : test-coreclr-security
357 endif
358
359 assemblyresolve/test/asm.dll:
360         $(MAKE) -C assemblyresolve prereq
361
362 TestDriver.dll:
363         $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
364
365 test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
366         @failed=0; \
367         passed=0; \
368         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
369         for i in $(TESTSI_CS); do       \
370                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
371                 then \
372                         passed=`expr $${passed} + 1`; \
373                 else \
374                         if [ $$? = 2 ]; then break; fi; \
375                         failed=`expr $${failed} + 1`; \
376                 fi \
377         done; \
378         echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
379
380 test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
381         @failed=0; \
382         passed=0; \
383         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
384         for i in $(TESTSI_IL); do       \
385                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
386                 then \
387                         passed=`expr $${passed} + 1`; \
388                 else \
389                         if [ $$? = 2 ]; then break; fi; \
390                         failed=`expr $${failed} + 1`; \
391                 fi \
392         done; \
393         echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
394
395 testb: $(TEST_PROG) $(TESTBS)
396         for i in $(TESTBS); do  \
397                 $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS);     \
398         done
399
400 testjit: testjit-default testjit-net_2_0
401
402 testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
403         @failed=0; \
404         passed=0; \
405         failed_tests="";\
406         for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do        \
407                 rm -f $${i}.so; \
408                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
409                 then \
410                         passed=`expr $${passed} + 1`; \
411                 else \
412                         if [ $$? = 2 ]; then break; fi; \
413                         failed=`expr $${failed} + 1`; \
414                         failed_tests="$${failed_tests} $$i"; \
415                 fi \
416         done; \
417         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
418         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
419           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
420
421 testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
422         @failed=0; \
423         passed=0; \
424         failed_tests="";\
425         for i in $(TESTSI_CS2) $(TESTSI_IL2); do        \
426                 rm -f $${i}.so; \
427                 if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
428                 then \
429                         passed=`expr $${passed} + 1`; \
430                 else \
431                         if [ $$? = 2 ]; then break; fi; \
432                         failed=`expr $${failed} + 1`; \
433                         failed_tests="$${failed_tests} $$i"; \
434                 fi \
435         done; \
436         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
437         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
438           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
439
440 testaot: $(TESTSI_CS) $(TESTBS) libtest.la
441         @failed=0; \
442         passed=0; \
443         failed_tests="";\
444         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
445         for i in $(TESTSI_CS) $(TESTBS); do     \
446                 rm -f $${i}.so; \
447                 $(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
448                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
449                 then \
450                         passed=`expr $${passed} + 1`; \
451                 else \
452                         if [ $$? = 2 ]; then break; fi; \
453                         failed=`expr $${failed} + 1`; \
454                         failed_tests="$${failed_tests} $$i"; \
455                 fi \
456         done; \
457         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
458         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
459           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
460
461 testtrace:
462         $(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" testjit
463
464 testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
465         @failed=0; \
466         passed=0; \
467         failed_tests="";\
468         export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
469         for i in $(TESTSI_CS) $(TESTSI_IL); do \
470                 if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
471                 then \
472                         passed=`expr $${passed} + 1`; \
473                 else \
474                         if [ $$? = 2 ]; then break; fi; \
475                         failed=`expr $${failed} + 1`; \
476                         failed_tests="$${failed_tests} $$i"; \
477                 fi \
478         done; \
479         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
480         if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; \
481           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
482
483 testjitspeed: $(JITTEST_PROG) $(TESTBS)
484         for i in $(TESTBS); do  \
485                 echo $$i;       \
486                 time $(JITTEST_PROG) $$i;       \
487         done
488
489 test-iomap-regression: exists.cs
490         $(MCS) $(srcdir)/exists.cs -out:exists.exe
491         MONO_IOMAP=all $(RUNTIME) exists.exe
492
493 stresstest: $(STRESS_TESTS)
494         @failed=0; \
495         passed=0; \
496         failed_tests="";\
497         for i in $(STRESS_TESTS); do    \
498                 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
499                 then \
500                         passed=`expr $${passed} + 1`; \
501                 else \
502                         if [ $$? = 2 ]; then break; fi; \
503                         failed=`expr $${failed} + 1`; \
504                         failed_tests="$${failed_tests} $$i"; \
505                 fi \
506         done; \
507         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
508         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
509           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
510
511 testbundle: console.exe
512         $(MKBUNDLE) --static console.exe
513         $(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) MONO_SHARED_DIR=$(mono_build_root)/runtime ./a.out
514         - rm -rf a.out
515
516 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
517 test-type-load: TestDriver.dll
518         $(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
519         $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
520         $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
521         $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
522         $(RUNTIME) load-exceptions.exe
523
524 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
525 test-inline-call-stack-library.dll: TestDriver.dll $(srcdir)/test-inline-call-stack-library.cs
526         $(MCS) -t:library -out:test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack-library.cs
527 test-inline-call-stack.exe: TestDriver.dll test-inline-call-stack-library.dll $(srcdir)/test-inline-call-stack.cs
528         $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:test-inline-call-stack.exe $(srcdir)/test-inline-call-stack.cs
529 test-inline-call-stack: TestDriver.dll test-inline-call-stack-library.dll test-inline-call-stack.exe
530         $(RUNTIME) test-inline-call-stack.exe
531
532
533 EXTRA_DIST += unhandled-exception-base-configuration.config
534 EXTRA_DIST += unhandled-exception-legacy-configuration.config
535 EXTRA_DIST += unhandled-exception-test-case.2.cs
536 EXTRA_DIST += unhandled-exception-test-runner.2.cs
537 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
538         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
539 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
540         cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
541 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
542         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
543 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
544         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
545         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
546         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
547         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
548 unhandled-exception-test-case.1.exe: unhandled-exception-test-case.1.cs
549         $(MCS) /debug unhandled-exception-test-case.1.cs
550 unhandled-exception-test-case-legacy.1.exe: unhandled-exception-test-case-legacy.1.cs
551         $(MCS) /debug unhandled-exception-test-case-legacy.1.cs
552 unhandled-exception-test-case.2.exe: unhandled-exception-test-case.2.cs
553         $(GMCS) /debug unhandled-exception-test-case.2.cs
554 unhandled-exception-test-case-legacy.2.exe: unhandled-exception-test-case-legacy.2.cs
555         $(GMCS) /debug unhandled-exception-test-case-legacy.2.cs
556 unhandled-exception-test-runner.2.exe: unhandled-exception-test-runner.2.cs
557         $(GMCS) /debug unhandled-exception-test-runner.2.cs
558
559 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
560         $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
561
562 EXTRA_DIST += bug-80307.cs
563 bug-80307.exe: $(srcdir)/bug-80307.cs
564         $(MCS) -r:System.Web -out:$@ $(srcdir)/bug-80307.cs
565
566 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
567 test-bug-80307: bug-80307.exe
568         cd $(top_builddir)/runtime && $(MAKE) test-support-files
569         $(RUNTIME) bug-80307.exe
570
571 EXTRA_DIST += bug-81673.cs bug-81673-interface.cs
572 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
573         $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
574         $(MCS) -out:bug-81673.exe -r:bug-81673-interface.dll $(srcdir)/bug-81673.cs
575         $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
576
577 test-bug-81673 : bug-81673.exe bug-81673-interface.dll
578         $(RUNTIME) bug-81673.exe
579
580 EXTRA_DIST += bug-81691.cs bug-81691-a.cs bug-81691-b.cs
581 bug-81691.exe bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
582         $(GMCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
583         $(GMCS) -target:library -out:bug-81691-b.dll -r:bug-81691-a.dll $(srcdir)/bug-81691-b.cs
584         $(GMCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
585         rm -f bug-81691-a.dll
586
587 test-bug-81691 : bug-81691.exe bug-81691-b.dll
588         $(RUNTIME) bug-81691.exe
589
590 EXTRA_DIST += bug-81466.il bug-81466-lib.il
591 bug-81466-lib.dll: bug-81466-lib.il
592         $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
593 bug-81466.exe: bug-81466.il bug-81466-lib.dll
594         $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
595 test-bug-81466: bug-81466.exe bug-81466-lib.dll
596         $(RUNTIME) bug-81466.exe
597
598 EXTRA_DIST += coreclr-security.cs
599
600 if INSTALL_2_1
601 coreclr-security.exe : coreclr-security.cs
602         $(SMCS) -out:coreclr-security.exe $(srcdir)/coreclr-security.cs
603
604 test-coreclr-security : coreclr-security.exe
605         $(RUNTIME21) --security=core-clr-test coreclr-security.exe
606 endif
607
608 EXTRA_DIST += async-exceptions.cs
609 async-exceptions.exe : async-exceptions.cs
610         $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
611 test-async-exceptions : async-exceptions.exe
612         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
613         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
614
615 # Useful if mono is compiled with --enable-shared=no
616 patch-libtool:
617         cp "../../libtool" .
618         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
619         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
620         touch libtest.c
621
622 noinst_LTLIBRARIES = libtest.la
623
624 INCLUDES = $(GLIB_CFLAGS)
625
626 if PLATFORM_WIN32
627 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
628 # This shows up when compiling mono_test_marshal_delegate ()
629 libtest_la_CFLAGS=-fno-optimize-sibling-calls
630 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
631 # can't find them. So we use --kill-at to remove the @ suffix as well.
632 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
633 else
634 libtest_la_LDFLAGS = -rpath `pwd`
635 endif
636 libtest_la_SOURCES = libtest.c
637 libtest_la_LIBADD = $(GLIB_LIBS)
638
639 CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) $(STRESS_TESTS) *.dll *.stdout *.exe stest.dat