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