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