[runtime] Use HOST_ defines instead of PLATFORM_ defines. (#5362)
[mono.git] / mono / tests / Makefile.am
1 SUBDIRS = gc-descriptors . testing_gac
2
3 check-local:
4         ok=:; \
5         $(MAKE) test-jit || ok=false; \
6         $(MAKE) test-generic-sharing || ok=false; \
7         $(MAKE) test-type-load || ok=false; \
8         $(MAKE) test-multi-netmodule || ok=false; \
9         $(MAKE) test-cattr-type-load || ok=false; \
10         $(MAKE) test-reflection-load-with-context || ok=false; \
11         $(MAKE) test-platform || ok=false; \
12         $(MAKE) test-console-output || ok=false; \
13         $(MAKE) test-env-options || ok=false; \
14         $(MAKE) test-unhandled-exception-2 || ok=false; \
15         $(MAKE) test-appdomain-unload || ok=false; \
16         $(MAKE) test-process-stress || ok=false; \
17         $(MAKE) test-pedump || ok=false; \
18         $(MAKE) test-internalsvisibleto || ok=false; \
19         $(MAKE) rm-empty-logs || ok=false; \
20         $(MAKE) runtest-gac-loading || ok=false; \
21         $$ok
22
23 check-full:
24         ok=; \
25         $(MAKE) test-sgen || ok=false; \
26         $(MAKE) check-local || ok=false; \
27         $$ok
28
29 check-parallel:
30         ok=; \
31         $(MAKE) compile-tests; \
32         $(MAKE) check-full || ok=false; \
33         $$ok
34
35 check-coreclr:
36         $(MAKE) -C $(mono_build_root)/acceptance-tests check-coreclr
37
38 check-stress:
39         $(MAKE) test-stress-sgen
40
41 # for backwards compatibility on Wrench
42 test-wrench: check-parallel
43
44 aotcheck: testaot gshared-aot
45
46 JITTEST_PROG = $(if $(VALGRIND), valgrind $(VALGRIND_ARGS),) $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/mono/mini/mono)
47
48 JITTEST_PROG_RUN = MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(JITTEST_PROG)
49
50
51 RUNTIME_ARGS=--config tests-config --optimize=all --debug
52
53 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
54
55 with_mono_path = MONO_PATH=$(CLASS)
56
57 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
58 TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper --aot-path=$(mcs_topdir)/class/lib/build
59
60 MKBUNDLE = \
61         PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
62         $(RUNTIME) $(CLASS)/mkbundle.exe
63
64 if FULL_AOT_TESTS
65 PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY,FULL_AOT_DESKTOP 
66 endif
67
68 if HYBRID_AOT_TESTS
69 PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY 
70 endif
71
72 MCS_NO_UNSAFE = $(TOOLS_RUNTIME) $(CSC) -debug:portable \
73         -noconfig -nologo \
74         -nowarn:0162 -nowarn:0168 -nowarn:0219 -nowarn:0414 -nowarn:0618 \
75         -nowarn:0169 -nowarn:1690 -nowarn:0649 -nowarn:0612 -nowarn:3021 \
76         -nowarn:0197 $(PROFILE_MCS_FLAGS)
77 MCS_NO_LIB = $(MCS_NO_UNSAFE) -unsafe
78
79 MCS = $(MCS_NO_LIB)
80
81 ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
82
83 TEST_RUNNER = ./test-runner.exe --runtime $(top_builddir)/runtime/mono-wrapper --mono-path "$(CLASS)"
84
85 if FULL_AOT_TESTS
86 TEST_RUNNER += --runtime-args "$(AOT_RUN_FLAGS)"
87 endif
88
89 if HYBRID_AOT_TESTS
90 TEST_RUNNER += --runtime-args "$(AOT_RUN_FLAGS)"
91 endif
92
93 if HOST_WIN32
94 TEST_RUNNER += --config tests-config --runtime $(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),mono)
95 else
96 TEST_RUNNER += --config tests-config --runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
97 endif
98
99 TEST_RUNNER += $(if $(V), --verbose,)
100
101 TESTS_BENCH_SRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
102
103 TESTS_STRESS_SRC=       \
104         abort-stress-1.cs       \
105         abort-stress-2.cs       \
106         abort-stress-3.cs       \
107         domain-stress.cs        \
108         gchandle-stress.cs      \
109         monitor-stress.cs       \
110         thread-stress.cs        \
111         gc-stress.cs            \
112         gc-copy-stress.cs       \
113         gc-graystack-stress.cs          \
114         exit-stress.cs          \
115         process-stress.cs       \
116         assembly-load-stress.cs
117
118 # Disabled until ?mcs is fixed
119 #       bug-331958.cs
120 TESTS_CS_SRC=           \
121         generic-unloading-sub.2.cs      \
122         create-instance.cs      \
123         bug-2907.cs             \
124         array-init.cs           \
125         arraylist.cs            \
126         assembly-load-remap.cs  \
127         assemblyresolve_event.cs        \
128         assemblyresolve_event3.cs       \
129         assemblyresolve_event4.cs       \
130         assemblyresolve_event5.cs       \
131         checked.cs              \
132         char-isnumber.cs        \
133         field-layout.cs         \
134         pack-layout.cs          \
135         pack-bug.cs             \
136         hash-table.cs           \
137         test-ops.cs             \
138         obj.cs                  \
139         test-dup-mp.cs          \
140         string.cs               \
141         stringbuilder.cs        \
142         switch.cs               \
143         outparm.cs              \
144         delegate.cs             \
145         bitconverter.cs         \
146         exception.cs            \
147         exception2.cs           \
148         exception3.cs           \
149         exception4.cs           \
150         exception5.cs           \
151         exception6.cs           \
152         exception7.cs           \
153         exception8.cs           \
154         exception10.cs          \
155         exception11.cs          \
156         exception12.cs          \
157         exception13.cs          \
158         exception14.cs          \
159         exception15.cs          \
160         exception16.cs          \
161         exception17.cs          \
162         exception18.cs          \
163         typeload-unaligned.cs   \
164         struct.cs               \
165         valuetype-gettype.cs    \
166         typeof-ptr.cs           \
167         static-constructor.cs   \
168         pinvoke.cs              \
169         pinvoke-utf8.cs         \
170         pinvoke3.cs             \
171         pinvoke11.cs            \
172         pinvoke13.cs            \
173         pinvoke17.cs            \
174         invoke.cs               \
175         invoke2.cs              \
176         runtime-invoke.cs               \
177         invoke-string-ctors.cs          \
178         reinit.cs               \
179         box.cs                  \
180         array.cs                \
181         enum.cs                 \
182         enum2.cs                \
183         enum-intrins.cs         \
184         property.cs             \
185         enumcast.cs             \
186         assignable-tests.cs     \
187         array-cast.cs           \
188         array-subtype-attr.cs   \
189         cattr-compile.cs        \
190         cattr-field.cs          \
191         cattr-object.cs         \
192         custom-attr.cs          \
193         double-cast.cs          \
194         newobj-valuetype.cs     \
195         arraylist-clone.cs      \
196         setenv.cs               \
197         vtype.cs                \
198         isvaluetype.cs          \
199         iface6.cs               \
200         iface7.cs               \
201         ipaddress.cs            \
202         array-vt.cs             \
203         interface1.cs           \
204         reflection-enum.cs      \
205         reflection-prop.cs      \
206         reflection4.cs          \
207         reflection5.cs          \
208         reflection-const-field.cs \
209         many-locals.cs          \
210         string-compare.cs       \
211         test-prime.cs           \
212         test-tls.cs             \
213         params.cs               \
214         reflection.cs           \
215         interface.cs            \
216         iface.cs                \
217         iface2.cs               \
218         iface3.cs               \
219         iface4.cs               \
220         iface-large.cs          \
221         virtual-method.cs       \
222         intptrcast.cs           \
223         indexer.cs              \
224         stream.cs               \
225         console.cs              \
226         shift.cs                \
227         jit-int.cs              \
228         jit-uint.cs             \
229         jit-long.cs             \
230         long.cs                 \
231         jit-ulong.cs            \
232         jit-float.cs            \
233         pop.cs                  \
234         time.cs                 \
235         pointer.cs              \
236         hashcode.cs             \
237         delegate1.cs            \
238         delegate2.cs            \
239         delegate3.cs            \
240         delegate5.cs            \
241         delegate6.cs            \
242         delegate7.cs            \
243         delegate8.cs            \
244         delegate10.cs           \
245         delegate11.cs           \
246         delegate12.cs           \
247         delegate13.cs           \
248         largeexp.cs             \
249         largeexp2.cs            \
250         marshalbyref1.cs        \
251         static-ctor.cs          \
252         inctest.cs              \
253         bound.cs                \
254         array-invoke.cs         \
255         test-arr.cs             \
256         decimal.cs              \
257         decimal-array.cs        \
258         marshal.cs              \
259         marshal1.cs             \
260         marshal2.cs             \
261         marshal3.cs             \
262         marshal5.cs             \
263         marshal6.cs             \
264         marshal7.cs             \
265         marshal8.cs             \
266         marshal9.cs             \
267         marshalbool.cs          \
268         test-byval-in-struct.cs \
269         thread.cs               \
270         thread5.cs              \
271         thread-static.cs        \
272         thread-static-init.cs   \
273         context-static.cs       \
274         float-pop.cs            \
275         interfacecast.cs        \
276         array3.cs               \
277         classinit.cs            \
278         classinit2.cs           \
279         classinit3.cs           \
280         synchronized.cs         \
281         async_read.cs           \
282         threadpool.cs           \
283         threadpool1.cs          \
284         threadpool-exceptions1.cs \
285         threadpool-exceptions2.cs \
286         threadpool-exceptions3.cs \
287         threadpool-exceptions4.cs \
288         threadpool-exceptions5.cs \
289         threadpool-exceptions6.cs \
290         base-definition.cs      \
291         bug-27420.cs            \
292         bug-46781.cs            \
293         bug-42136.cs            \
294         bug-59286.cs            \
295         bug-70561.cs            \
296         bug-78311.cs            \
297         bug-78653.cs            \
298         bug-78656.cs            \
299         bug-77127.cs            \
300         bug-323114.cs           \
301         bug-Xamarin-5278.cs     \
302         interlocked.cs          \
303         delegate-async-exit.cs  \
304         delegate-delegate-exit.cs       \
305         delegate-exit.cs        \
306         finalizer-abort.cs      \
307         finalizer-exception.cs  \
308         finalizer-exit.cs       \
309         finalizer-thread.cs     \
310         main-exit.cs    \
311         main-returns-abort-resetabort.cs        \
312         main-returns-background-abort-resetabort.cs     \
313         main-returns-background-resetabort.cs   \
314         main-returns-background.cs      \
315         main-returns-background-change.cs       \
316         main-returns.cs         \
317         subthread-exit.cs       \
318         desweak.cs              \
319         exists.cs               \
320         handleref.cs    \
321         dbnull-missing.cs       \
322         test-type-ctor.cs       \
323         soft-float-tests.cs     \
324         thread-exit.cs          \
325         finalize-parent.cs      \
326         interlocked-2.2.cs      \
327         pinvoke-2.2.cs          \
328         bug-78431.2.cs          \
329         bug-79684.2.cs          \
330         catch-generics.2.cs     \
331         event-get.2.cs          \
332         safehandle.2.cs         \
333         module-cctor-loader.2.cs        \
334         generics-invoke-byref.2.cs      \
335         generic-signature-compare.2.cs  \
336         generics-sharing.2.cs   \
337         shared-generic-methods.2.cs     \
338         shared-generic-synchronized.2.cs        \
339         generic-inlining.2.cs   \
340         generic-initobj.2.cs    \
341         generic-delegate.2.cs   \
342         generic-sizeof.2.cs     \
343         generic-virtual.2.cs    \
344         generic-interface-methods.2.cs  \
345         generic-array-type.2.cs \
346         generic-method-patching.2.cs    \
347         generic-static-methods.2.cs     \
348         generic-null-call.2.cs  \
349         generic-special.2.cs    \
350         generic-special2.2.cs   \
351         generic-exceptions.2.cs \
352         generic-virtual2.2.cs   \
353         generic-valuetype-interface.2.cs        \
354         generic-getgenericarguments.2.cs        \
355         generic-synchronized.2.cs       \
356         generic-delegate-ctor.2.cs      \
357         generic-array-iface-set.2.cs    \
358         generic-typedef.2.cs    \
359         bug-431413.2.cs \
360         bug-459285.2.cs \
361         generic-virtual-invoke.2.cs     \
362         bug-461198.2.cs \
363         generic-sealed-virtual.2.cs     \
364         generic-system-arrays.2.cs      \
365         generic-stack-traces.2.cs       \
366         generic-stack-traces2.2.cs      \
367         bug-472600.2.cs \
368         recursive-generics.2.cs \
369         bug-473482.2.cs \
370         bug-473999.2.cs \
371         bug-479763.2.cs \
372         bug-616463.cs   \
373         bug-80392.2.cs          \
374         bug-82194.2.cs  \
375         anonarray.2.cs  \
376         ienumerator-interfaces.2.cs     \
377         array-enumerator-ifaces.2.cs    \
378         generic_type_definition_encoding.2.cs \
379         bug-333798.2.cs         \
380         bug-348522.2.cs         \
381         bug-340662_bug.cs       \
382         bug-325283.2.cs \
383         thunks.cs \
384         winx64structs.cs \
385         nullable_boxing.2.cs    \
386         valuetype-equals.cs     \
387         custom-modifiers.2.cs   \
388         bug-382986.cs   \
389         test-inline-call-stack.cs       \
390         bug-324535.cs   \
391         modules.cs      \
392         bug-81673.cs    \
393         bug-81691.cs    \
394         bug-415577.cs   \
395         filter-stack.cs \
396         vararg.cs       \
397         vararg2.cs      \
398         bug-461867.cs   \
399         bug-461941.cs   \
400         bug-461261.cs   \
401         bug-400716.cs   \
402         bug-459094.cs   \
403         bug-467456.cs   \
404         bug-508538.cs   \
405         bug-472692.2.cs         \
406         gchandles.cs    \
407         interlocked-3.cs        \
408         interlocked-4.2.cs      \
409         w32message.cs   \
410         gc-altstack.cs  \
411         large-gc-bitmap.cs      \
412         bug-561239.cs   \
413         bug-562150.cs   \
414         bug-599469.cs   \
415         monitor-resurrection.cs \
416         monitor-wait-abort.cs   \
417         monitor-abort.cs        \
418         bug-666008.cs   \
419         bug-685908.cs   \
420         sgen-long-vtype.cs      \
421         delegate-invoke.cs      \
422         bug-696593.cs   \
423         bug-705140.cs   \
424         bug-1147.cs     \
425         mono-path.cs    \
426         bug-bxc-795.cs  \
427         bug-3903.cs     \
428         async-with-cb-throws.cs \
429         bug-6148.cs     \
430         bug-10127.cs    \
431         bug-18026.cs    \
432         allow-synchronous-major.cs      \
433         block_guard_restore_aligment_on_exit.cs \
434         thread_static_gc_layout.cs \
435         sleep.cs \
436         bug-27147.cs    \
437         bug-30085.cs    \
438         bug-17537.cs    \
439         pinvoke_ppcc.cs \
440         pinvoke_ppcs.cs \
441         pinvoke_ppci.cs \
442         pinvoke_ppcf.cs \
443         pinvoke_ppcd.cs \
444         bug-29585.cs    \
445         priority.cs     \
446         abort-cctor.cs  \
447         thread-native-exit.cs \
448         reference-loader.cs \
449         thread-suspend-suspended.cs \
450         thread-suspend-selfsuspended.cs \
451         remoting4.cs    \
452         remoting1.cs    \
453         remoting2.cs    \
454         remoting3.cs    \
455         remoting5.cs    \
456         appdomain.cs    \
457         appdomain-client.cs     \
458         appdomain-unload.cs     \
459         appdomain-async-invoke.cs       \
460         appdomain-thread-abort.cs       \
461         appdomain1.cs   \
462         appdomain2.cs   \
463         appdomain-exit.cs       \
464         appdomain-serialize-exception.cs \
465         assemblyresolve_event2.2.cs     \
466         appdomain-unload-callback.cs    \
467         appdomain-unload-doesnot-raise-pending-events.cs        \
468         appdomain-unload-asmload.cs     \
469         unload-appdomain-on-shutdown.cs \
470         bug-47295.cs    \
471         loader.cs       \
472         pinvoke2.cs     \
473         generic-type-builder.2.cs       \
474         dynamic-generic-size.cs \
475         cominterop.cs   \
476         dynamic-method-access.2.cs      \
477         dynamic-method-finalize.2.cs    \
478         dynamic-method-stack-traces.cs  \
479         generic_type_definition.2.cs    \
480         bug-333798-tb.2.cs      \
481         bug-335131.2.cs \
482         bug-322722_patch_bx.2.cs        \
483         bug-322722_dyn_method_throw.2.cs        \
484         bug-389886-2.cs \
485         bug-349190.2.cs \
486         bug-389886-sre-generic-interface-instances.cs   \
487         bug-462592.cs   \
488         bug-575941.cs   \
489         bug-389886-3.cs \
490         constant-division.cs    \
491         dynamic-method-resurrection.cs  \
492         bug-80307.cs    \
493         assembly_append_ordering.cs     \
494         bug-544446.cs   \
495         bug-36848.cs    \
496         generic-marshalbyref.2.cs       \
497         stackframes-async.2.cs  \
498         transparentproxy.cs     \
499         bug-48015.cs    \
500         delegate9.cs    \
501         marshal-valuetypes.cs   \
502         xdomain-threads.cs      \
503         monitor.cs      \
504         generic-xdomain.2.cs    \
505         threadpool-exceptions7.cs       \
506         cross-domain.cs \
507         generic-unloading.2.cs  \
508         namedmutex-destroy-race.cs      \
509         thread6.cs      \
510         appdomain-threadpool-unload.cs  \
511         process-unref-race.cs   \
512         bug-46661.cs    \
513         w32message.cs \
514         runtime-invoke.gen.cs \
515         imt_big_iface_test.cs
516
517 if AMD64
518 TESTS_CS_SRC += async-exc-compilation.cs finally_guard.cs finally_block_ending_in_dead_bb.cs
519 endif
520
521 if X86
522 TESTS_CS_SRC += async-exc-compilation.cs finally_guard.cs finally_block_ending_in_dead_bb.cs
523 endif
524
525 TESTS_IL_SRC=                   \
526         field-access.il         \
527         method-access.il        \
528         ldftn-access.il         \
529         cpblkTest.il            \
530         vbinterface.il          \
531         calliTest.il            \
532         calliGenericTest.il             \
533         ckfiniteTest.il         \
534         fault-handler.il                \
535         locallocTest.il         \
536         initblkTest.il          \
537         qt-instance.il          \
538         vararg.il               \
539         bug-29859.il            \
540         bug-78549.il            \
541         static-fields-nonconst.il       \
542         reload-at-bb-end.il     \
543         test-enum-indstoreil.il \
544         filter-bug.il           \
545         even-odd.il             \
546         bug-82022.il    \
547         vt-sync-method.il       \
548         enum_types.il   \
549         invalid-token.il        \
550         call_missing_method.il  \
551         call_missing_class.il   \
552         ldfld_missing_field.il  \
553         ldfld_missing_class.il  \
554         find-method.2.il        \
555         bug-79215.2.il  \
556         bug-79956.2.il  \
557         bug-327438.2.il \
558         bug-387274.2.il \
559         bug-426309.2.il \
560         ldtoken_with_byref_typespec.2.il \
561         resolve_method_bug.2.il \
562         resolve_field_bug.2.il \
563         resolve_type_bug.2.il   \
564         generics-sharing-other-exc.2.il \
565         generic-ldobj.2.il      \
566         generic-mkrefany.2.il   \
567         generic-refanyval.2.il  \
568         generic-ldtoken.2.il    \
569         generic-ldtoken-method.2.il     \
570         generic-ldtoken-field.2.il      \
571         generic-tailcall.2.il   \
572         generic-tailcall2.2.il  \
573         generic-array-exc.2.il  \
574         generic-valuetype-newobj2.2.il  \
575         generic-valuetype-newobj.2.il   \
576         generic-constrained.2.il        \
577         generic-type-load-exception.2.il        \
578         bug-81466.il    \
579         bug457574.il    \
580         bug445361.il    \
581         bug-463303.il   \
582         bug469742.2.il  \
583         bug-528055.il   \
584         array_load_exception.il \
585         bug-481403.il   \
586         interface-with-static-method.il \
587         bug-633291.il   \
588         delegate-with-null-target.il    \
589         bug-318677.il   \
590         gsharing-valuetype-layout.il    \
591         invalid_generic_instantiation.il \
592         bug-45841-fpstack-exceptions.il \
593         instance_tailrec.il
594
595 TESTS_GSHARED_SRC = \
596         generics-sharing.2.cs   \
597         shared-generic-methods.2.cs     \
598         shared-generic-synchronized.2.cs        \
599         generic-initobj.2.cs            \
600         generics-sharing-other-exc.2.cs \
601         generic-box.2.cs                \
602         generic-unbox.2.cs      \
603         generic-delegate.2.cs   \
604         generic-sizeof.2.cs     \
605         generic-ldobj.2.cs      \
606         generic-mkrefany.2.cs                   \
607         generic-refanyval.2.cs  \
608         generic-ldtoken.2.cs                    \
609         generic-ldtoken-method.2.cs     \
610         generic-ldtoken-field.2.cs      \
611         generic-virtual.2.cs    \
612         generic-tailcall.2.cs                   \
613         generic-interface-methods.2.cs  \
614         generic-array-type.2.cs \
615         generic-method-patching.2.cs    \
616         generic-static-methods.2.cs     \
617         generic-null-call.2.cs  \
618         generic-tailcall2.2.cs                  \
619         generic-array-exc.2.cs  \
620         generic-special.2.cs                    \
621         generic-special2.2.cs   \
622         generic-exceptions.2.cs \
623         generic-delegate2.2.cs          \
624         generic-virtual2.2.cs   \
625         generic-valuetype-interface.2.cs        \
626         generic-valuetype-newobj.2.cs   \
627         generic-valuetype-newobj2.2.cs  \
628         generic-getgenericarguments.2.cs        \
629         generic-synchronized.2.cs       \
630         generic-delegate-ctor.2.cs              \
631         generic-constrained.2.cs        \
632         bug-431413.2.cs                 \
633         generic-virtual-invoke.2.cs     \
634         generic-typedef.2.cs            \
635         generic-marshalbyref.2.cs       \
636         bug-459285.2.cs \
637         bug-461198.2.cs \
638         generic-sealed-virtual.2.cs     \
639         generic-system-arrays.2.cs      \
640         generic-stack-traces.2.cs       \
641         generic-stack-traces2.2.cs              \
642         bug-472600.2.cs \
643         bug-473482.2.cs \
644         bug-473999.2.cs         \
645         bug-479763.2.cs                         \
646         generic-type-load-exception.2.cs        \
647         bug-616463.cs   \
648         bug-1147.cs     \
649         generic-type-builder.2.cs
650
651 if AMD64
652 # #651684
653 PLATFORM_DISABLED_TESTS = finally_guard.exe
654
655 if HOST_WIN32
656 PLATFORM_DISABLED_TESTS += w32message.exe
657 endif
658
659 endif
660
661 if X86
662
663 if HOST_WIN32
664 PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe finally_block_ending_in_dead_bb.exe \
665         bug-18026.exe monitor.exe threadpool-exceptions5.exe process-unref-race.exe w32message.exe \
666         unhandled-exception-1.exe unhandled-exception-2.exe unhandled-exception-3.exe unhandled-exception-4.exe \
667         unhandled-exception-5.exe unhandled-exception-6.exe unhandled-exception-7.exe unhandled-exception-8.exe
668 endif
669
670 endif
671
672 if POWERPC
673 # bug #71274
674 PLATFORM_DISABLED_TESTS=finalizer-abort.exe finalizer-exception.exe finalizer-exit.exe
675 endif
676
677 if POWERPC64
678 # FIXME: These tests hang/fail for unknown reasons
679 PLATFORM_DISABLED_TESTS=monitor.exe threadpool-exceptions5.exe appdomain-thread-abort.exe appdomain-unload.exe \
680         pinvoke2.exe pinvoke3.exe pinvoke11.exe threadpool-exceptions7.exe winx64structs.exe bug-10127.exe pinvoke_ppcc.exe \
681         pinvoke_ppcs.exe pinvoke_ppci.exe pinvoke_ppcf.exe pinvoke_ppcd.exe abort-cctor.exe load-exceptions.exe \
682         sgen-domain-unload-2.exe sgen-weakref-stress.exe sgen-cementing-stress.exe sgen-new-threads-dont-join-stw.exe \
683         sgen-new-threads-dont-join-stw-2.exe sgen-new-threads-collect.exe sgen-bridge.exe
684 endif
685
686 if ARM
687 PLATFORM_DISABLED_TESTS=filter-stack.exe
688 INTERP_DISABLED_TESTS_PLATFORM=finalizer-exception.exe main-returns-abort-resetabort.exe block_guard_restore_aligment_on_exit.exe \
689         delegate-exit.exe delegate-exit.exe delegate-delegate-exit.exe delegate-async-exit.exe delegate3.exe delegate1.exe
690 endif
691
692 if ARM64
693 INTERP_DISABLED_TESTS_PLATFORM=finalizer-exception.exe main-returns-abort-resetabort.exe block_guard_restore_aligment_on_exit.exe
694 endif
695
696 if MIPS
697 # monitor.exe is racy
698 PLATFORM_DISABLED_TESTS=filter-stack.exe monitor.exe
699 endif
700
701 if S390X
702 PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe
703 #PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe exception17.exe
704
705 PLATFORM_DISABLED_TESTS += \
706         sgen-toggleref.exe \
707         sgen-bridge.exe \
708         sgen-bridge-major-fragmentation.exe \
709         sgen-bridge-xref.exe
710 endif
711
712 if ENABLE_COOP
713 COOP_DISABLED_TESTS= thunks.exe
714 else
715 COOP_DISABLED_TESTS= 
716 endif
717
718 PROFILE_DISABLED_TESTS=
719
720 if FULL_AOT_TESTS
721 # Tests which rely on TypeLoadExceptions
722 # In full-aot mode, these cause the relevant methods to be not AOTed.
723 PROFILE_DISABLED_TESTS += \
724         typeload-unaligned.exe \
725         field-access.exe \
726         invalid_generic_instantiation.exe \
727         bug-481403.exe \
728         array_ldelema.exe \
729         array_load_exception.exe \
730         bug445361.exe \
731         generic-type-load-exception.2.exe \
732         invalid-token.exe \
733         call_missing_method.exe \
734         call_missing_class.exe \
735         ldfld_missing_field.exe \
736         ldfld_missing_class.exe \
737         vt-sync-method.exe \
738         resolve_method_bug.2.exe \
739         resolve_field_bug.2.exe \
740         resolve_type_bug.2.exe \
741         bug-81691.exe \
742         bug-327438.2.exe
743
744 # Tests which rely on remoting
745 PROFILE_DISABLED_TESTS += \
746         context-static.exe \
747         bug-415577.exe \
748         generic-marshalbyref.2.exe \
749         unhandled-exception-7.exe
750
751 # Tests which use unsupported pinvoke+full aot
752 # functionality
753 PROFILE_DISABLED_TESTS += \
754         marshal.exe \
755         marshal2.exe \
756         marshal6.exe \
757         marshal7.exe \
758         marshal8.exe \
759         pinvoke-2.2.exe \
760         pinvoke3.exe \
761         thunks.exe
762
763 # Tests which load assemblies which are not
764 # in the testing_aot_full profile
765 PROFILE_DISABLED_TESTS += \
766         assembly-load-remap.exe
767
768 # Test which needs remoting support
769 PROFILE_DISABLED_TESTS += \
770         remoting4.exe   \
771         remoting1.exe   \
772         remoting2.exe   \
773         remoting3.exe   \
774         remoting5.exe
775
776 # Tests which needs AppDomain support
777 PROFILE_DISABLED_TESTS += \
778         appdomain.exe   \
779         appdomain-client.exe    \
780         appdomain-unload.exe    \
781         appdomain-async-invoke.exe      \
782         appdomain-thread-abort.exe      \
783         appdomain1.exe  \
784         appdomain2.exe  \
785         appdomain-exit.exe      \
786         appdomain-unload-asmload.exe \
787         appdomain-unload-callback.exe   \
788         appdomain-unload-doesnot-raise-pending-events.exe       \
789         unload-appdomain-on-shutdown.exe        \
790         assemblyresolve_event2.2.exe    \
791         bug-544446.exe  \
792         bug-36848.exe   \
793         generic-marshalbyref.2.exe      \
794         stackframes-async.2.exe \
795         transparentproxy.exe    \
796         bug-48015.exe   \
797         delegate9.exe   \
798         marshal-valuetypes.exe  \
799         xdomain-threads.exe     \
800         monitor.exe     \
801         generic-xdomain.2.exe   \
802         threadpool-exceptions7.exe      \
803         cross-domain.exe        \
804         generic-unloading.2.exe \
805         appdomain-threadpool-unload.exe
806
807 # Tests which needs System.Reflection.Emit support
808 PROFILE_DISABLED_TESTS += \
809         bug-47295.exe   \
810         loader.exe      \
811         pinvoke2.exe    \
812         generic-type-builder.2.exe      \
813         dynamic-generic-size.exe        \
814         cominterop.exe  \
815         dynamic-method-access.2.exe     \
816         dynamic-method-finalize.2.exe   \
817         dynamic-method-stack-traces.exe \
818         generic_type_definition.2.exe   \
819         bug-333798-tb.2.exe     \
820         bug-335131.2.exe        \
821         bug-322722_patch_bx.2.exe       \
822         bug-322722_dyn_method_throw.2.exe       \
823         bug-389886-2.exe        \
824         bug-349190.2.exe        \
825         bug-389886-sre-generic-interface-instances.exe  \
826         bug-462592.exe  \
827         bug-575941.exe  \
828         bug-389886-3.exe        \
829         constant-division.exe   \
830         dynamic-method-resurrection.exe \
831         assembly_append_ordering.exe \
832         assemblyresolve_event5.exe
833
834 # Test which needs System.Web support
835 PROFILE_DISABLED_TESTS += \
836         bug-80307.exe
837
838 # Tests which needs named Mutex support
839 PROFILE_DISABLED_TESTS += \
840         namedmutex-destroy-race.exe
841
842 # ThreadAbortException doesn't have necessary field for this test
843 PROFILE_DISABLED_TESTS += \
844         thread6.exe
845
846 # can't AOT the TestingReferenceAssembly.dll which is a dependency
847 # of reference-loader.exe because it contains the [ReferenceAssemblyAttribute]
848 # and the runtime errors out with "File does not contain a valid CIL image."
849 PROFILE_DISABLED_TESTS += \
850         reference-loader.exe
851
852 # constraints-load.il: 
853 # Failed to load method 0x6000007 from '..../mono/tests/constraints-load.exe' due to 
854 # Could not resolve type with token 01000002 assembly:mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.BrokenIComparable`1 member:<none>.
855 PROFILE_DISABLED_TESTS += \
856         constraints-load.exe \
857         bug-515884.exe
858
859 PROFILE_DISABLED_TESTS += \
860         generic-type-builder.2.exe
861
862 PROFILE_DISABLED_TESTS += \
863         sgen-domain-unload.exe  \
864         sgen-domain-unload-2.exe
865
866 PROFILE_DISABLED_TESTS += \
867         appdomain-loader.exe \
868         assemblyresolve_event3.exe \
869         appdomain-serialize-exception.exe
870 endif
871
872 if HYBRID_AOT_TESTS
873 PROFILE_DISABLED_TESTS += \
874         bug-80307.exe \
875         namedmutex-destroy-race.exe
876 endif
877
878 AOT_DISABLED_TESTS= \
879         constraints-load.exe
880
881 CI_DISABLED_TESTS = \
882         main-returns-background-resetabort.exe \
883         main-returns-background-abort-resetabort.exe    \
884         assemblyresolve_event3.exe \
885         delegate2.exe   \
886         finally_guard.exe \
887         generic-xdomain.2.exe
888
889 # failing tests which we temporarily disable for PRs
890 # so they don't interfere with other people's work
891 CI_PR_DISABLED_TESTS = \
892         appdomain-threadpool-unload.exe \
893         appdomain-thread-abort.exe
894
895 # appdomain-threadpool-unload.exe creates 100 appdomains, takes too long with llvm
896 LLVM_DISABLED_TESTS = \
897         finally_block_ending_in_dead_bb.exe \
898         appdomain-threadpool-unload.exe
899
900 LLVM = $(filter --llvm, $(MONO_ENV_OPTIONS))
901
902 # The two finalizer tests only work under sgen
903 # gc-altstack.exe fails under boehm because it has no support for altstack
904 # bug-459094.exe creates an extremely deep directory tree
905 # delegate-invoke.exe depends on 929c6bc9b6d76a273f251e6f5dfacac36e9c38bd which was
906 # reverted.
907 # bug-Xamarin-5278.exe got broken by 5d26590e79da139a284459299aee95c25f4cd835
908 # appdomain-thread-abort.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47054
909 KNOWN_FAILING_TESTS = \
910         delegate-async-exception.exe    \
911         bug-348522.2.exe        \
912         bug-459094.exe \
913         delegate-invoke.exe \
914         bug-Xamarin-5278.exe \
915         appdomain-thread-abort.exe
916
917 DISABLED_TESTS = \
918         $(KNOWN_FAILING_TESTS) \
919         $(PLATFORM_DISABLED_TESTS) \
920         $(EXTRA_DISABLED_TESTS) \
921         $(COOP_DISABLED_TESTS) \
922         $(PROFILE_DISABLED_TESTS) \
923         $(if $(AOT),$(AOT_DISABLED_TESTS)) \
924         $(if $(CI),$(CI_DISABLED_TESTS)) \
925         $(if $(CI_PR),$CI_PR_DISABLED_TESTS) \
926         $(if $(LLVM),$(LLVM_DISABLED_TESTS))
927
928 INTERP_DISABLED_TESTS = \
929         $(CI_PR_DISABLED_TESTS) \
930         $(CI_DISABLED_TESTS) \
931         $(KNOWN_FAILING_TESTS) \
932         $(INTERP_DISABLED_TESTS_PLATFORM) \
933         abort-cctor.exe \
934         appdomain-async-invoke.exe \
935         appdomain-exit.exe \
936         appdomain-serialize-exception.exe \
937         appdomain-unload-asmload.exe \
938         appdomain-unload-callback.exe \
939         appdomain-unload-doesnot-raise-pending-events.exe \
940         appdomain-unload.exe \
941         appdomain.exe \
942         appdomain1.exe \
943         appdomain2.exe \
944         array_load_exception.exe \
945         assembly_append_ordering.exe \
946         assemblyresolve_event4.exe \
947         async-exc-compilation.exe \
948         async-with-cb-throws.exe \
949         async_read.exe \
950         bug-18026.exe \
951         bug-2907.exe \
952         bug-323114.exe \
953         bug-327438.2.exe \
954         bug-335131.2.exe \
955         bug-415577.exe \
956         bug-45841-fpstack-exceptions.exe \
957         bug-461867.exe \
958         bug-461941.exe \
959         bug-46661.exe \
960         bug-47295.exe \
961         bug-48015.exe \
962         bug-544446.exe \
963         bug-685908.exe \
964         bug-80307.exe \
965         bug-80392.2.exe \
966         bug-81673.exe \
967         bug-82022.exe \
968         bug445361.exe \
969         call_missing_class.exe \
970         call_missing_method.exe \
971         calliGenericTest.exe \
972         cominterop.exe \
973         context-static.exe \
974         cross-domain.exe \
975         delegate-with-null-target.exe \
976         delegate9.exe \
977         dynamic-method-stack-traces.exe \
978         even-odd.exe \
979         exception18.exe \
980         field-access.exe \
981         finally_block_ending_in_dead_bb.exe \
982         generic-array-exc.2.exe \
983         generic-marshalbyref.2.exe \
984         generic-mkrefany.2.exe \
985         generic-refanyval.2.exe \
986         generic-stack-traces2.2.exe \
987         generic-type-load-exception.2.exe \
988         generic-unloading.2.exe \
989         generics-invoke-byref.2.exe \
990         generics-sharing.2.exe \
991         handleref.exe \
992         invalid-token.exe \
993         invalid_generic_instantiation.exe \
994         ldfld_missing_class.exe \
995         ldfld_missing_field.exe \
996         ldftn-access.exe \
997         main-returns-background-change.exe \
998         marshal-valuetypes.exe \
999         marshal.exe \
1000         marshal2.exe \
1001         marshal8.exe \
1002         marshal9.exe \
1003         marshalbool.exe \
1004         method-access.exe \
1005         monitor.exe \
1006         nullable_boxing.2.exe \
1007         pinvoke-2.2.exe \
1008         pinvoke-utf8.exe \
1009         pinvoke.exe \
1010         pinvoke11.exe \
1011         pinvoke2.exe \
1012         pinvoke3.exe \
1013         pinvoke_ppcc.exe \
1014         pinvoke_ppcd.exe \
1015         pinvoke_ppcf.exe \
1016         pinvoke_ppci.exe \
1017         pinvoke_ppcs.exe \
1018         process-unref-race.exe \
1019         reload-at-bb-end.exe \
1020         remoting1.exe \
1021         remoting2.exe \
1022         remoting3.exe \
1023         remoting4.exe \
1024         remoting5.exe \
1025         safehandle.2.exe \
1026         stackframes-async.2.exe \
1027         static-constructor.exe \
1028         test-inline-call-stack.exe \
1029         test-type-ctor.exe \
1030         thread6.exe \
1031         threadpool-exceptions1.exe \
1032         threadpool-exceptions2.exe \
1033         threadpool-exceptions3.exe \
1034         threadpool-exceptions4.exe \
1035         threadpool-exceptions5.exe \
1036         threadpool-exceptions6.exe \
1037         threadpool-exceptions7.exe \
1038         threadpool.exe \
1039         threadpool1.exe \
1040         thunks.exe \
1041         transparentproxy.exe \
1042         typeload-unaligned.exe \
1043         unload-appdomain-on-shutdown.exe \
1044         vararg.exe \
1045         vararg2.exe \
1046         vt-sync-method.exe \
1047         winx64structs.exe \
1048         xdomain-threads.exe
1049
1050 TESTS_CS=$(filter-out $(DISABLED_TESTS),$(TESTS_CS_SRC:.cs=.exe))
1051 TESTS_IL=$(filter-out $(DISABLED_TESTS),$(TESTS_IL_SRC:.il=.exe))
1052 TESTS_BENCH=$(filter-out $(DISABLED_TESTS),$(TESTS_BENCH_SRC:.cs=.exe))
1053 TESTS_STRESS=$(filter-out $(DISABLED_TESTS),$(TESTS_STRESS_SRC:.cs=.exe))
1054 TESTS_GSHARED=$(filter-out $(DISABLED_TESTS),$(TESTS_GSHARED_SRC:.cs=.exe))
1055
1056 if FULL_AOT_TESTS
1057 TESTSAOT_CS=$(TESTS_CS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1058 TESTSAOT_IL=$(TESTS_IL:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1059 TESTSAOT_BENCH=$(TESTS_BENCH:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1060 TESTSAOT_STRESS=$(TESTS_STRESS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1061 TESTSAOT_GSHARED=$(TESTS_GSHARED:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1062 endif
1063
1064 if HYBRID_AOT_TESTS
1065 TESTSAOT_CS=$(TESTS_CS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1066 TESTSAOT_IL=$(TESTS_IL:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1067 TESTSAOT_BENCH=$(TESTS_BENCH:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1068 TESTSAOT_STRESS=$(TESTS_STRESS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1069 TESTSAOT_GSHARED=$(TESTS_GSHARED:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1070 endif
1071
1072 EXTRA_DIST=test-driver test-runner.cs $(TESTS_CS_SRC) $(TESTS_IL_SRC) \
1073         $(TESTS_BENCH_SRC) $(TESTS_STRESS_SRC) stress-runner.pl
1074
1075 %.exe: %.il
1076         $(ILASM) -out:$@ $<
1077
1078 if !FULL_AOT_TESTS
1079 if !HYBRID_AOT_TESTS
1080 TEST_DRIVER_HARD_KILL_FEATURE=-r:$(CLASS)/Mono.Posix.dll
1081 endif
1082 endif
1083
1084 if FULL_AOT_TESTS
1085 TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
1086 else
1087 if HYBRID_AOT_TESTS
1088 TEST_DRIVER_DEPEND=TestDriver.dll$(PLATFORM_AOT_SUFFIX)
1089 else
1090 TEST_DRIVER_DEPEND=TestDriver.dll
1091 endif
1092 endif
1093
1094 %.exe: %.cs $(TEST_DRIVER_DEPEND)
1095         $(MCS) -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
1096
1097 # N.B. test-runner.exe references the TOOLS_RUNTIME versions of the framework assemblies
1098 test-runner.exe: test-runner.cs $(TEST_DRIVER_DEPEND)
1099         $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
1100
1101 %.dll: %.cs
1102         $(MCS) -r:$(CLASS)/System.dll -target:library -out:$@ $<
1103 %.dll: %.il
1104         $(ILASM) /dll /output:$@ $<
1105
1106 reference-loader.exe: reference-loader.cs TestingReferenceAssembly.dll TestingReferenceReferenceAssembly.dll $(TEST_DRIVER_DEPEND)
1107         $(MCS) -r:$(CLASS)/System.dll -r:TestDriver.dll -r:TestingReferenceAssembly.dll -r:TestingReferenceReferenceAssembly.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $(srcdir)/reference-loader.cs
1108
1109 TestingReferenceAssembly.dll: TestingReferenceAssembly.cs
1110         $(MCS) -target:library -out:$@ $<
1111
1112 TestingReferenceReferenceAssembly.dll: TestingReferenceReferenceAssembly.cs TestingReferenceAssembly.dll
1113         $(MCS) -r:TestingReferenceAssembly.dll -target:library -out:$@ $<
1114
1115 %.exe$(PLATFORM_AOT_SUFFIX): %.exe 
1116         $(RUNTIME) $(AOT_BUILD_FLAGS) $<
1117
1118 %.dll$(PLATFORM_AOT_SUFFIX): %.dll 
1119         $(RUNTIME) $(AOT_BUILD_FLAGS) $<
1120
1121 # mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
1122 if POWERPC
1123 test-platform:
1124 else
1125 # Can't use mkbundle on win32 since there is no static build there
1126 # Can't run test-unhandled-exception on Windows because of all the debug popups...
1127 if HOST_WIN32
1128 test-platform:
1129 else
1130 # mkbundle uses the installed mono-2.pc so it won't work if there is no system mono
1131 #test-platform: testbundle test-iomap-regression
1132 test-platform:  test-iomap-regression
1133 endif
1134 endif
1135
1136 # Target to precompile the test executables
1137 tests: compile-tests
1138
1139 #
1140 # Test that no symbols are missed in eglib-remap.h
1141 #
1142 if HOST_LINUX
1143 test-platform: test-eglib-remap
1144 else
1145 if HOST_DARWIN
1146 test-platform: test-eglib-remap
1147 endif
1148 endif
1149 # The following regexp describes all symbols that start with "g_" but are not part of eglibc.
1150 # The optional underscore prepending symbol names may or may not appear depending on the
1151 # system and the state of the leading-underscore compiler flag.
1152 OK_G_SYMBOLS='\<_?g_(s?list_(pre|ap)pend_(image|mempool)|concat_dir_and_file|Ctoc)\>'
1153 test-eglib-remap:
1154         @echo "Testing eglib remap..."
1155         @if which nm > /dev/null; then if nm $(top_builddir)/mono/mini/mono | grep -Ev $(OK_G_SYMBOLS) | grep -E 't _?g_'; then exit 1; else exit 0; fi; fi
1156
1157 test-env-options:
1158         MONO_ENV_OPTIONS="--version" $(RUNTIME) array-init.exe | grep -q Architecture:
1159
1160 # Precompile the test assemblies in parallel
1161 compile-tests:
1162         $(MAKE) -j4 $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH) $(TESTS_STRESS) $(TESTS_GSHARED) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) $(TESTSAOT_GSHARED) compile-gac-loading
1163
1164 # Remove empty .stdout and .stderr files for wrench
1165 rm-empty-logs:
1166         @echo "Removing empty logs..."
1167         find . '(' -name "*.stdout" -o -name "*.stderr" ')' -size 0 -exec rm {} \;
1168
1169 TestDriver.dll:
1170         $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs $(srcdir)/../mini/TestHelpers.cs
1171
1172 runtest: compile-tests
1173         @failed=0; \
1174         passed=0; \
1175         failed_tests="";\
1176         if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
1177         rm -f testlist testlist.sorted; \
1178         for i in $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH); do echo $${i} >> testlist; sort testlist > testlist.sorted; done; \
1179         for i in `cat testlist.sorted`; do \
1180                 rm -f $${i}.so; \
1181                 $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $${i} > $${i}.aotlog 2>&1 || exit 1; \
1182                 if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" "$${dump_action}" $(RUNTIME_ARGS); \
1183                 then \
1184                         passed=`expr $${passed} + 1`; \
1185                 else \
1186                         if [ $$? = 2 ]; then break; fi; \
1187                         failed=`expr $${failed} + 1`; \
1188                         failed_tests="$${failed_tests} $$i"; \
1189                 fi \
1190         done; \
1191         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1192         rm -f testlist testlist.sorted; \
1193         if [ $${failed} != 0 ]; then \
1194           echo -e "\nFailed tests:\n"; \
1195           for i in $${failed_tests}; do \
1196             echo $${i}; \
1197             if [ "x$$V" = "x1" ]; then \
1198               cat $${i}.stdout; \
1199               cat $${i}.stderr; \
1200             fi; \
1201           done; \
1202           exit 1; \
1203         fi
1204
1205 runtest-managed: test-runner.exe compile-tests
1206         $(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j a --testsuite-name "runtime" --timeout 300 --disabled "$(DISABLED_TESTS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
1207
1208 runtest-managed-serial: test-runner.exe compile-tests
1209         $(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j 1 --testsuite-name "runtime" --disabled "$(DISABLED_TESTS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
1210
1211 test-jit:
1212         @if test x$(M) != x0; then $(MAKE) runtest-managed; else $(MAKE) runtest; fi
1213
1214 testaot:
1215         @$(MAKE) AOT=1 runtest
1216
1217 testtrace:
1218         @$(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" runtest
1219
1220 testinterp: test-runner.exe compile-tests
1221         $(TOOLS_RUNTIME) --debug $(TEST_RUNNER) -j a --runtime-args "--interpreter" --testsuite-name "runtime-interp" --timeout 300 --disabled "$(INTERP_DISABLED_TESTS)" $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH)
1222
1223 testjitspeed: $(JITTEST_PROG) compile-tests
1224         for i in $(TESTS_BENCH); do     \
1225                 echo $$i;       \
1226                 time $(JITTEST_PROG) $$i;       \
1227         done
1228
1229 test-iomap-regression: exists.exe
1230         @echo "Testing exists.exe..."
1231         @MONO_IOMAP=all $(RUNTIME) exists.exe
1232
1233 stresstest: compile-tests
1234         @failed=0; \
1235         passed=0; \
1236         failed_tests="";\
1237         for i in $(TESTS_STRESS); do    \
1238                 if $(srcdir)/stress-runner.pl $$i ../mini/mono $(RUNTIME_ARGS); \
1239                 then \
1240                         passed=`expr $${passed} + 1`; \
1241                 else \
1242                         if [ $$? = 2 ]; then break; fi; \
1243                         failed=`expr $${failed} + 1`; \
1244                         failed_tests="$${failed_tests} $$i"; \
1245                 fi \
1246         done; \
1247         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1248         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
1249           for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
1250
1251 testbundle: console.exe
1252         @echo "Testing mkbundle..."
1253         @$(MKBUNDLE) --static console.exe > mkbundle.stdout
1254         @$(with_mono_path) MONO_CFG_DIR=$(mono_cfg_dir) ./a.out >> mkbundle.stdout
1255         @- rm -rf a.out
1256
1257 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
1258
1259 load-missing.dll: load-missing.il
1260         $(Q) $(ILASM) /dll /output:$@ $<
1261
1262 load-exceptions.exe t.dll: load-exceptions.cs t-missing.cs load-missing.dll $(TEST_DRIVER_DEPEND)
1263         $(Q) $(MCS) -t:library -out:t.dll -d:FOUND t-missing.cs
1264         $(Q) $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:$@ $<
1265         $(Q) $(MCS) -t:library -out:t.dll t-missing.cs
1266
1267 test-type-load: load-exceptions.exe
1268 if !POWERPC64
1269         $(Q) $(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
1270 endif
1271
1272 EXTRA_DIST += test-multi-netmodule-1-netmodule.cs test-multi-netmodule-2-dll1.cs test-multi-netmodule-3-dll2.cs test-multi-netmodule-4-exe.cs
1273
1274 test-multi-netmodule-1-netmodule.netmodule: test-multi-netmodule-1-netmodule.cs
1275         $(Q) $(MCS) -t:module -out:$@ $<
1276 test-multi-netmodule-2-dll1.dll: test-multi-netmodule-2-dll1.cs test-multi-netmodule-1-netmodule.netmodule
1277         $(Q) $(MCS) -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library  -out:$@ $<
1278 test-multi-netmodule-3-dll2.dll: test-multi-netmodule-3-dll2.cs test-multi-netmodule-1-netmodule.netmodule
1279         $(Q) $(MCS) -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library -out:$@ $<
1280 test-multi-netmodule-4-exe.exe: test-multi-netmodule-4-exe.cs test-multi-netmodule-2-dll1.dll test-multi-netmodule-3-dll2.dll
1281         $(Q) $(MCS) -r:test-multi-netmodule-2-dll1.dll -out:$@ $<
1282
1283 test-multi-netmodule: test-multi-netmodule-4-exe.exe
1284         $(Q) $(RUNTIME) test-multi-netmodule-4-exe.exe > test-multi-netmodule-4-exe.exe.stdout 2> test-multi-netmodule-4-exe.exe.stderr
1285
1286 EXTRA_DIST += custom-attr-errors.cs custom-attr-errors-lib.cs
1287
1288 custom-attr-errors.exe custom-attr-errors-lib.dll: custom-attr-errors.cs custom-attr-errors-lib.cs $(TEST_DRIVER_DEPEND)
1289         $(Q) $(MCS) /t:library -D:WITH_MEMBERS custom-attr-errors-lib.cs
1290         $(Q) $(MCS) -r:TestDriver.dll -r:custom-attr-errors-lib.dll custom-attr-errors.cs
1291         $(Q) $(MCS) /t:library custom-attr-errors-lib.cs
1292
1293 test-cattr-type-load: custom-attr-errors.exe
1294         $(Q) $(RUNTIME) custom-attr-errors.exe > custom-attr-errors.exe.stdout 2> custom-attr-errors.exe.stderr
1295
1296 EXTRA_DIST += reflection-load-with-context-lib.cs reflection-load-with-context-second-lib.cs reflection-load-with-context.cs
1297
1298 reflection-load-with-context-second-lib.dll: reflection-load-with-context-second-lib.cs
1299         $(Q) $(MCS) /t:library -out:$@ $<
1300 reflection-load-with-context-lib.dll: reflection-load-with-context-lib.cs reflection-load-with-context-second-lib.dll
1301         $(Q) $(MCS) /t:library -r:reflection-load-with-context-second-lib.dll -out:$@ $<
1302 reflection-load-with-context.exe: reflection-load-with-context-lib.dll
1303
1304 test-reflection-load-with-context: reflection-load-with-context.exe
1305         $(Q) $(RUNTIME) reflection-load-with-context.exe > reflection-load-with-context.exe.stdout 2> reflection-load-with-context.exe.stderr
1306
1307
1308 EXTRA_DIST += debug-casts.cs
1309 # This depends on TLS, so its not ran by default
1310 debug-casts: debug-casts.exe
1311         $(Q) $(RUNTIME) --debug=casts debug-casts.exe
1312
1313 EXTRA_DIST += sgen-bridge.cs sgen-descriptors.cs sgen-gshared-vtype.cs sgen-bridge-major-fragmentation.cs sgen-domain-unload.cs sgen-weakref-stress.cs sgen-cementing-stress.cs sgen-case-23400.cs      finalizer-wait.cs critical-finalizers.cs sgen-domain-unload-2.cs sgen-suspend.cs sgen-new-threads-dont-join-stw.cs sgen-new-threads-dont-join-stw-2.cs sgen-new-threads-collect.cs sgen-bridge-xref.cs bug-17590.cs sgen-toggleref.cs sgen-bridge-gchandle.cs
1314
1315 test-sgen:
1316         ok=; \
1317         $(MAKE) test-sgen-regular || ok=false; \
1318         $(MAKE) test-sgen-toggleref || ok=false; \
1319         $(MAKE) test-sgen-bridge || ok=false; \
1320         $(MAKE) test-sgen-bridge2 || ok=false; \
1321         $(MAKE) test-sgen-bridge3 || ok=false; \
1322         $$ok
1323
1324 test-stress-sgen:
1325         ok=; \
1326         $(MAKE) test-stress-sgen-regular || ok=false; \
1327         $(MAKE) test-stress-sgen-toggleref || ok=false; \
1328         $(MAKE) test-stress-sgen-bridge || ok=false; \
1329         $(MAKE) test-stress-sgen-bridge2 || ok=false; \
1330         $(MAKE) test-stress-sgen-bridge3 || ok=false; \
1331         $$ok
1332
1333 TESTS_SGEN_REGULAR_SRC =        \
1334         finalizer-wait.cs       \
1335         critical-finalizers.cs  \
1336         sgen-descriptors.cs     \
1337         sgen-gshared-vtype.cs   \
1338         sgen-weakref-stress.cs  \
1339         sgen-cementing-stress.cs        \
1340         sgen-case-23400.cs      \
1341         sgen-new-threads-dont-join-stw.cs       \
1342         sgen-new-threads-dont-join-stw-2.cs     \
1343         sgen-new-threads-collect.cs     \
1344         gc-graystack-stress.cs  \
1345         bug-17590.cs    \
1346         sgen-domain-unload.cs   \
1347         sgen-domain-unload-2.cs
1348
1349 TESTS_SGEN_REGULAR=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_REGULAR_SRC:.cs=.exe))
1350
1351 if FULL_AOT_TESTS
1352 TESTSAOT_SGEN_REGULAR=$(TESTS_SGEN_REGULAR:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1353 endif
1354
1355 if HYBRID_AOT_TESTS
1356 TESTSAOT_SGEN_REGULAR=$(TESTS_SGEN_REGULAR:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1357 endif
1358
1359 test-sgen-regular: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR)
1360         ok=; \
1361         $(MAKE) test-sgen-regular-ms-simple || ok=false; \
1362         $(MAKE) test-sgen-regular-ms-conc-simple || ok=false; \
1363         $$ok
1364
1365 test-stress-sgen-regular: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR)
1366         ok=; \
1367         $(MAKE) test-sgen-regular-ms-simple MONO_TESTS_STRESS=1 || ok=false; \
1368         $(MAKE) test-sgen-regular-ms-conc-simple MONO_TESTS_STRESS=1 || ok=false; \
1369         $(MAKE) test-sgen-regular-ms-conc-par-simple MONO_TESTS_STRESS=1 || ok=false; \
1370         $(MAKE) test-sgen-regular-ms-conc-split MONO_TESTS_STRESS=1 || ok=false; \
1371         $(MAKE) test-sgen-regular-ms-conc-split-95-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
1372         $(MAKE) test-sgen-regular-ms-conc-par-simple-par-dyn MONO_TESTS_STRESS=1 || ok=false; \
1373         $(MAKE) test-sgen-regular-ms-conc-par-simple-par-512k MONO_TESTS_STRESS=1 || ok=false; \
1374         $(MAKE) test-sgen-regular-ms-conc-par-simple-par-32m MONO_TESTS_STRESS=1 || ok=false; \
1375         $(MAKE) test-sgen-regular-ms-conc-par-simple-par-dyn-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
1376         $$ok
1377
1378 test-sgen-regular-ms-simple: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1379         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep,minor=simple" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1380 test-sgen-regular-ms-conc-simple: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1381         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc,minor=simple" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1382 test-sgen-regular-ms-conc-par-simple: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1383         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc-par,minor=simple" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1384 test-sgen-regular-ms-conc-split: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1385         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1386 test-sgen-regular-ms-conc-split-95-clear-at-gc: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1387         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=major=marksweep-conc,minor=split,alloc-ratio=95" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1388 test-sgen-regular-ms-conc-par-simple-par-dyn: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1389         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc-par,minor=simple-par,dynamic-nursery" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1390 test-sgen-regular-ms-conc-par-simple-par-512k: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1391         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc-par,minor=simple-par,nursery-size=512k" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1392 test-sgen-regular-ms-conc-par-simple-par-32m: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1393         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=major=marksweep-conc-par,minor=simple-par,nursery-size=32m" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1394 test-sgen-regular-ms-conc-par-simple-par-dyn-clear-at-gc: $(TESTS_SGEN_REGULAR) $(TESTSAOT_SGEN_REGULAR) test-runner.exe
1395         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=major=marksweep-conc-par,minor=simple-par,dynamic-nursery" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_REGULAR)
1396
1397 TESTS_SGEN_TOGGLEREF_SRC=       \
1398         sgen-toggleref.cs
1399
1400 TESTS_SGEN_TOGGLEREF=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_TOGGLEREF_SRC:.cs=.exe))
1401
1402 if FULL_AOT_TESTS
1403 TESTSAOT_SGEN_TOGGLEREF=$(TESTS_SGEN_TOGGLEREF:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1404 endif
1405
1406 if HYBRID_AOT_TESTS
1407 TESTSAOT_SGEN_TOGGLEREF=$(TESTS_SGEN_TOGGLEREF:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1408 endif
1409
1410 test-sgen-toggleref: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF)
1411         ok=; \
1412         $(MAKE) test-sgen-toggleref-ms-simple || ok=false; \
1413         $(MAKE) test-sgen-toggleref-ms-conc-simple || ok=false; \
1414         $$ok
1415
1416 test-stress-sgen-toggleref: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF)
1417         ok=; \
1418         $(MAKE) test-sgen-toggleref-ms-simple MONO_TESTS_STRESS=1 || ok=false; \
1419         $(MAKE) test-sgen-toggleref-ms-conc-simple MONO_TESTS_STRESS=1 || ok=false; \
1420         $(MAKE) test-sgen-toggleref-ms-conc-par-simple MONO_TESTS_STRESS=1 || ok=false; \
1421         $(MAKE) test-sgen-toggleref-ms-conc-split MONO_TESTS_STRESS=1 || ok=false; \
1422         $(MAKE) test-sgen-toggleref-ms-conc-split-95-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
1423         $(MAKE) test-sgen-toggleref-ms-conc-par-simple-par-dyn MONO_TESTS_STRESS=1 || ok=false; \
1424         $(MAKE) test-sgen-toggleref-ms-conc-par-simple-par-512k MONO_TESTS_STRESS=1 || ok=false; \
1425         $(MAKE) test-sgen-toggleref-ms-conc-par-simple-par-32m MONO_TESTS_STRESS=1 || ok=false; \
1426         $(MAKE) test-sgen-toggleref-ms-conc-par-simple-par-dyn-clear-at-gc MONO_TESTS_STRESS=1 || ok=false; \
1427         $$ok
1428
1429 test-sgen-toggleref-ms-simple: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1430         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep,minor=simple" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1431 test-sgen-toggleref-ms-conc-simple: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1432         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep-conc,minor=simple" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1433 test-sgen-toggleref-ms-conc-par-simple: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1434         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep-conc-par,minor=simple" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1435 test-sgen-toggleref-ms-conc-split: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1436         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep-conc,minor=split" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1437 test-sgen-toggleref-ms-conc-split-95-clear-at-gc: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1438         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=toggleref-test,major=marksweep-conc,minor=split,alloc-ratio=95" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1439 test-sgen-toggleref-ms-conc-par-simple-par-dyn: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1440         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep-conc-par,minor=simple-par,dynamic-nursery" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1441 test-sgen-toggleref-ms-conc-par-simple-par-512k: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1442         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep-conc-par,minor=simple-par,nursery-size=512k" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1443 test-sgen-toggleref-ms-conc-par-simple-par-32m: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1444         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug= --gc-params=toggleref-test,major=marksweep-conc-par,minor=simple-par,nursery-size=32m" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1445 test-sgen-toggleref-ms-conc-par-simple-par-dyn-clear-at-gc: $(TESTS_SGEN_TOGGLEREF) $(TESTSAOT_SGEN_TOGGLEREF) test-runner.exe
1446         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=clear-at-gc --gc-params=toggleref-test,major=marksweep-conc-par,minor=simple-par,dynamic-nursery" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_TOGGLEREF)
1447
1448 TESTS_SGEN_BRIDGE_SRC=  \
1449         sgen-bridge.cs  \
1450         sgen-bridge-major-fragmentation.cs
1451
1452 TESTS_SGEN_BRIDGE=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_BRIDGE_SRC:.cs=.exe))
1453
1454 if FULL_AOT_TESTS
1455 TESTSAOT_SGEN_BRIDGE=$(TESTS_SGEN_BRIDGE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1456 endif
1457
1458 if HYBRID_AOT_TESTS
1459 TESTSAOT_SGEN_BRIDGE=$(TESTS_SGEN_BRIDGE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1460 endif
1461
1462 test-sgen-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE)
1463         ok=; \
1464         $(MAKE) test-sgen-bridge-ms-simple-tarjan-bridge || ok=false; \
1465         $(MAKE) test-sgen-bridge-ms-conc-simple-tarjan-bridge || ok=false; \
1466         $$ok
1467
1468 test-stress-sgen-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE)
1469         ok=; \
1470         $(MAKE) test-sgen-bridge-ms-simple-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1471         $(MAKE) test-sgen-bridge-ms-conc-simple-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1472         $(MAKE) test-sgen-bridge-ms-conc-split-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1473         $(MAKE) test-sgen-bridge-ms-conc-simple-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
1474         $(MAKE) test-sgen-bridge-ms-conc-simple-old-bridge MONO_TESTS_STRESS=1 || ok=false; \
1475         $(MAKE) test-sgen-bridge-ms-conc-par-simple-par-dyn-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1476         $(MAKE) test-sgen-bridge-ms-conc-par-simple-par-512k-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1477         $(MAKE) test-sgen-bridge-ms-conc-par-simple-par-32m-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1478         $$ok
1479
1480 test-sgen-bridge-ms-simple-tarjan-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1481         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=Bridge --gc-params=major=marksweep,minor=simple,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1482 test-sgen-bridge-ms-conc-simple-tarjan-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1483         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1484 test-sgen-bridge-ms-conc-split-tarjan-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1485         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=Bridge --gc-params=major=marksweep-conc,minor=split,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1486 test-sgen-bridge-ms-conc-simple-new-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1487         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=new" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1488 test-sgen-bridge-ms-conc-simple-old-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1489         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=old" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1490 test-sgen-bridge-ms-conc-par-simple-par-dyn-tarjan-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1491         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,dynamic-nursery,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1492 test-sgen-bridge-ms-conc-par-simple-par-512k-tarjan-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1493         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,nursery-size=512k,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1494 test-sgen-bridge-ms-conc-par-simple-par-32m-tarjan-bridge: $(TESTS_SGEN_BRIDGE) $(TESTSAOT_SGEN_BRIDGE) test-runner.exe
1495         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,nursery-size=32m,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE)
1496
1497 TESTS_SGEN_BRIDGE2_SRC= \
1498         sgen-bridge-xref.cs
1499
1500 TESTS_SGEN_BRIDGE2=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_BRIDGE2_SRC:.cs=.exe))
1501
1502 if FULL_AOT_TESTS
1503 TESTSAOT_SGEN_BRIDGE2=$(TESTS_SGEN_BRIDGE2:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1504 endif
1505
1506 if HYBRID_AOT_TESTS
1507 TESTSAOT_SGEN_BRIDGE2=$(TESTS_SGEN_BRIDGE2:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1508 endif
1509
1510 test-sgen-bridge2: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2)
1511         ok=; \
1512         $(MAKE) test-sgen-bridge2-ms-simple-tarjan-bridge || ok=false; \
1513         $(MAKE) test-sgen-bridge2-ms-conc-simple-tarjan-bridge || ok=false; \
1514         $$ok
1515
1516 test-stress-sgen-bridge2: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2)
1517         ok=; \
1518         $(MAKE) test-sgen-bridge2-ms-simple-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1519         $(MAKE) test-sgen-bridge2-ms-conc-simple-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1520         $(MAKE) test-sgen-bridge2-ms-conc-split-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1521         $(MAKE) test-sgen-bridge2-ms-conc-simple-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
1522         $(MAKE) test-sgen-bridge2-ms-conc-simple-old-bridge MONO_TESTS_STRESS=1 || ok=false; \
1523         $(MAKE) test-sgen-bridge2-ms-conc-par-simple-par-dyn-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1524         $(MAKE) test-sgen-bridge2-ms-conc-par-simple-par-512k-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1525         $(MAKE) test-sgen-bridge2-ms-conc-par-simple-par-32m-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1526         $$ok
1527
1528 test-sgen-bridge2-ms-simple-tarjan-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1529         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep,minor=simple,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1530 test-sgen-bridge2-ms-conc-simple-tarjan-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1531         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1532 test-sgen-bridge2-ms-conc-split-tarjan-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1533         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep-conc,minor=split,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1534 test-sgen-bridge2-ms-conc-simple-new-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1535         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=new" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1536 test-sgen-bridge2-ms-conc-simple-old-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1537         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=old" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1538 test-sgen-bridge2-ms-conc-par-simple-par-dyn-tarjan-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1539         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,dynamic-nursery,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1540 test-sgen-bridge2-ms-conc-par-simple-par-512k-tarjan-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1541         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,nursery-size=512k,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1542 test-sgen-bridge2-ms-conc-par-simple-par-32m-tarjan-bridge: $(TESTS_SGEN_BRIDGE2) $(TESTSAOT_SGEN_BRIDGE2) test-runner.exe
1543         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=2Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,nursery-size=32m,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE2)
1544
1545 TESTS_SGEN_BRIDGE3_SRC= \
1546         sgen-bridge-gchandle.cs
1547
1548 TESTS_SGEN_BRIDGE3=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_BRIDGE3_SRC:.cs=.exe))
1549
1550 if FULL_AOT_TESTS
1551 TESTSAOT_SGEN_BRIDGE3=$(TESTS_SGEN_BRIDGE3:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1552 endif
1553
1554 if HYBRID_AOT_TESTS
1555 TESTSAOT_SGEN_BRIDGE3=$(TESTS_SGEN_BRIDGE3:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1556 endif
1557
1558 test-sgen-bridge3: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3)
1559         ok=; \
1560         $(MAKE) test-sgen-bridge3-ms-simple-tarjan-bridge || ok=false; \
1561         $(MAKE) test-sgen-bridge3-ms-conc-simple-tarjan-bridge || ok=false; \
1562         $$ok
1563
1564 test-stress-sgen-bridge3: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3)
1565         ok=; \
1566         $(MAKE) test-sgen-bridge3-ms-simple-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1567         $(MAKE) test-sgen-bridge3-ms-conc-simple-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1568         $(MAKE) test-sgen-bridge3-ms-conc-split-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1569         $(MAKE) test-sgen-bridge3-ms-conc-simple-new-bridge MONO_TESTS_STRESS=1 || ok=false; \
1570         $(MAKE) test-sgen-bridge3-ms-conc-simple-old-bridge MONO_TESTS_STRESS=1 || ok=false; \
1571         $(MAKE) test-sgen-bridge3-ms-conc-par-simple-par-dyn-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1572         $(MAKE) test-sgen-bridge3-ms-conc-par-simple-par-512k-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1573         $(MAKE) test-sgen-bridge3-ms-conc-par-simple-par-32m-tarjan-bridge MONO_TESTS_STRESS=1 || ok=false; \
1574         $$ok
1575
1576 test-sgen-bridge3-ms-simple-tarjan-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1577         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep,minor=simple,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1578 test-sgen-bridge3-ms-conc-simple-tarjan-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1579         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1580 test-sgen-bridge3-ms-conc-split-tarjan-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1581         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc,minor=split,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1582 test-sgen-bridge3-ms-conc-simple-new-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1583         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=new" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1584 test-sgen-bridge3-ms-conc-simple-old-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1585         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc,minor=simple,bridge-implementation=old" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1586 test-sgen-bridge3-ms-conc-par-simple-par-dyn-tarjan-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1587         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,dynamic-nursery,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1588 test-sgen-bridge3-ms-conc-par-simple-par-512k-tarjan-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1589         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,nursery-size=512k,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1590 test-sgen-bridge3-ms-conc-par-simple-par-32m-tarjan-bridge: $(TESTS_SGEN_BRIDGE3) $(TESTSAOT_SGEN_BRIDGE3) test-runner.exe
1591         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=bridge=3Bridge --gc-params=major=marksweep-conc-par,minor=simple-par,nursery-size=32m,bridge-implementation=tarjan" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_BRIDGE3)
1592
1593 TESTS_SGEN_OOM_SRC =    \
1594         sgen-oom-cementing-stress.cs    \
1595         sgen-oom-new-threads-dont-join-stw-2.cs \
1596         sgen-oom-bridge-major-fragmentation.cs \
1597         gc-oom-handling.cs      \
1598         gc-oom-handling2.cs
1599
1600 TESTS_SGEN_OOM=$(filter-out $(DISABLED_TESTS),$(TESTS_SGEN_OOM_SRC:.cs=.exe))
1601
1602 if FULL_AOT_TESTS
1603 TESTSAOT_SGEN_OOM=$(TESTS_SGEN_OOM:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1604 endif
1605
1606 if HYBRID_AOT_TESTS
1607 TESTSAOT_SGEN_OOM=$(TESTS_SGEN_OOM:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1608 endif
1609
1610 tests-sgen-oom: $(TESTS_SGEN_OOM) $(TESTSAOT_SGEN_OOM) test-runner.exe sgen-cementing-stress.exe sgen-new-threads-dont-join-stw-2.exe sgen-bridge-major-fragmentation.exe
1611         $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --runtime-args "--gc=sgen --gc-debug=max-valloc-size=50M,bridge=Bridge" --disabled "$(DISABLED_TESTS)" --timeout 900 $(TESTS_SGEN_OOM)
1612
1613 AOT_CONFIGURATIONS=     \
1614         "|regular"      \
1615         "--gc=boehm|boehm"
1616
1617 #LLVM crashes, got to fix it first.
1618 #       "--llvm|llvm"   \
1619 #       "--llvm --gc=boehm|llvm+boehm"
1620
1621
1622 test-aot:
1623         @failed=0; \
1624         passed=0; \
1625         failed_tests="";\
1626         profile=$(DEFAULT_PROFILE);     \
1627         tmpfile=`mktemp -t mono_aot_outputXXXXXX` || exit 1;    \
1628         rm -f test-aot-$${name}.stdout test-aot-$${name}.stderr; \
1629         for assembly in $(mcs_topdir)/class/lib/$$profile/*.dll ; do    \
1630                 asm_name=`basename $$assembly`; \
1631                 echo "... $$asm_name";  \
1632                 for conf in $(AOT_CONFIGURATIONS); do   \
1633                         name=`echo $$conf | cut -d\| -f 2`;     \
1634                         params=`echo $$conf | cut -d\| -f 1`;   \
1635                         test_name="$${asm_name}|$${name}";      \
1636                         echo "  $$test_name";   \
1637                         if MONO_PATH=$(mcs_topdir)/class/lib/$$profile $(JITTEST_PROG_RUN) $$params --aot=outfile=$$tmpfile $$assembly >> test-aot-$${name}.stdout 2>> test-aot-$${name}.stderr;        \
1638                         then \
1639                                 passed=`expr $${passed} + 1`; \
1640                         else \
1641                                 failed=`expr $${failed} + 1`; \
1642                                 failed_tests="$${failed_tests} $$test_name"; \
1643                         fi \
1644                 done;   \
1645         done;   \
1646         rm      $$tmpfile;      \
1647         echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
1648         if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
1649         for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
1650
1651
1652 # Generated tests for runtime invoke
1653 EXTRA_DIST += gen-runtime-invoke.cs
1654
1655 runtime-invoke.gen.cs: gen-runtime-invoke.exe
1656         $(Q) $(RUNTIME) gen-runtime-invoke.exe > runtime-invoke.gen.cs
1657
1658 EXTRA_DIST += make-imt-test.cs
1659
1660 imt_big_iface_test.cs: make-imt-test.exe
1661         $(Q) $(RUNTIME) make-imt-test.exe > imt_big_iface_test.cs
1662
1663 EXTRA_DIST += test-inline-call-stack-library.cs test-inline-call-stack.cs
1664
1665 test-inline-call-stack-library.dll: $(srcdir)/test-inline-call-stack-library.cs
1666         $(MCS) -t:library -out:$@ $<
1667
1668 test-inline-call-stack.exe$(PLATFORM_AOT_SUFFIX): test-inline-call-stack-library.dll$(PLATFORM_AOT_SUFFIX)
1669 test-inline-call-stack.exe: test-inline-call-stack.cs test-inline-call-stack-library.dll $(TEST_DRIVER_DEPEND)
1670         $(MCS) -r:TestDriver.dll -r:test-inline-call-stack-library.dll -out:$@ $<
1671
1672 EXTRA_DIST += unhandled-exception-base-configuration.config
1673 EXTRA_DIST += unhandled-exception-legacy-configuration.config
1674 EXTRA_DIST += appdomain-unload.exe.config
1675 EXTRA_DIST += unhandled-exception-test-case.2.cs
1676 EXTRA_DIST += unhandled-exception-test-runner.2.cs
1677 unhandled-exception-test-case.1.cs: unhandled-exception-test-case.2.cs
1678         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case.1.cs
1679 unhandled-exception-test-case-legacy.1.cs: unhandled-exception-test-case.1.cs
1680         cp unhandled-exception-test-case.1.cs unhandled-exception-test-case-legacy.1.cs
1681 unhandled-exception-test-case-legacy.2.cs: unhandled-exception-test-case.2.cs
1682         cp unhandled-exception-test-case.2.cs unhandled-exception-test-case-legacy.2.cs
1683 unhandled-exception-config_files: unhandled-exception-base-configuration.config unhandled-exception-legacy-configuration.config
1684         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.1.exe.config
1685         cp unhandled-exception-base-configuration.config unhandled-exception-test-case.2.exe.config
1686         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.1.exe.config
1687         cp unhandled-exception-legacy-configuration.config unhandled-exception-test-case-legacy.2.exe.config
1688
1689 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
1690
1691 test-unhandled-exception: unhandled-exception-test-runner.2.exe
1692         $(Q) $(RUNTIME) unhandled-exception-test-runner.2.exe RUNTIME:../mini/mono,GTC:F
1693
1694 safehandle.2.exe winx64structs.exe thunks.exe pinvoke3.exe pinvoke2.exe pinvoke-2.2.exe pinvoke17.exe pinvoke13.exe \
1695         pinvoke11.exe pinvoke_ppcs.exe pinvoke_ppci.exe pinvoke_ppcf.exe pinvoke_ppcd.exe pinvoke_ppcc.exe pinvoke.exe \
1696         marshalbool.exe marshal9.exe marshal5.exe marshal.exe handleref.exe cominterop.exe bug-Xamarin-5278.exe: libtest.la
1697
1698 event-get.2.exe$(PLATFORM_AOT_SUFFIX): event-il.exe$(PLATFORM_AOT_SUFFIX)
1699 event-get.2.exe: event-il.exe
1700
1701 module-cctor-loader.2.exe$(PLATFORM_AOT_SUFFIX): module-cctor.exe$(PLATFORM_AOT_SUFFIX)
1702 module-cctor-loader.2.exe: module-cctor.exe
1703
1704 reference-loader.exe$(PLATFORM_AOT_SUFFIX): TestingReferenceAssembly.dll$(PLATFORM_AOT_SUFFIX) TestingReferenceReferenceAssembly.dll$(PLATFORM_AOT_SUFFIX)
1705 reference-loader.exe: TestingReferenceAssembly.dll TestingReferenceReferenceAssembly.dll
1706
1707 assemblyresolve_asm.dll$(PLATFORM_AOT_SUFFIX): assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX)
1708         MONO_PATH="assemblyresolve_deps:$(CLASS)" $(top_builddir)/runtime/mono-wrapper $(AOT_BUILD_FLAGS) assemblyresolve_asm.dll
1709 assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX): assemblyresolve_deps/TestBase.dll$(PLATFORM_AOT_SUFFIX)
1710
1711 EXTRA_DIST += assemblyresolve_TestBase.cs assemblyresolve_Test.cs assemblyresolve_asm.cs 
1712 assemblyresolve_deps:
1713         mkdir -p assemblyresolve_deps
1714 assemblyresolve_deps/TestBase.dll: assemblyresolve_deps $(srcdir)/assemblyresolve_TestBase.cs
1715         $(MCS) -target:library -out:assemblyresolve_deps/TestBase.dll $(srcdir)/assemblyresolve_TestBase.cs
1716 assemblyresolve_deps/Test.dll: assemblyresolve_deps assemblyresolve_deps/TestBase.dll $(srcdir)/assemblyresolve_Test.cs
1717         $(MCS) -target:library -r:assemblyresolve_deps/TestBase.dll -out:assemblyresolve_deps/Test.dll $(srcdir)/assemblyresolve_Test.cs
1718 assemblyresolve_asm.dll: assemblyresolve_deps/Test.dll $(srcdir)/assemblyresolve_asm.cs
1719         $(MCS) -target:library -r:assemblyresolve_deps/TestBase.dll -r:assemblyresolve_deps/Test.dll -out:assemblyresolve_asm.dll $(srcdir)/assemblyresolve_asm.cs
1720
1721 assemblyresolve_event3.exe$(PLATFORM_AOT_SUFFIX): assemblyresolve_asm.dll$(PLATFORM_AOT_SUFFIX) assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX) assemblyresolve_deps/TestBase.dll$(PLATFORM_AOT_SUFFIX)
1722 assemblyresolve_event3.exe: assemblyresolve_asm.dll assemblyresolve_deps/Test.dll assemblyresolve_deps/TestBase.dll
1723
1724 assemblyresolve_event4.exe$(PLATFORM_AOT_SUFFIX): assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX) assemblyresolve_deps/TestBase.dll$(PLATFORM_AOT_SUFFIX)
1725 assemblyresolve_event4.exe: assemblyresolve_deps/Test.dll assemblyresolve_deps/TestBase.dll
1726
1727 EXTRA_DIST += assemblyresolve_event5_label.cs assemblyresolve_event5_helper.cs
1728 assemblyresolve_deps/assemblyresolve_event5_label.dll: assemblyresolve_event5_label.cs assemblyresolve_deps 
1729         $(MCS) -target:library -out:assemblyresolve_deps/assemblyresolve_event5_label.dll $(srcdir)/assemblyresolve_event5_label.cs
1730 assemblyresolve_event5_helper.dll: assemblyresolve_event5_helper.cs assemblyresolve_deps/assemblyresolve_event5_label.dll
1731         $(MCS) -target:library -out:assemblyresolve_event5_helper.dll -r:assemblyresolve_deps/assemblyresolve_event5_label.dll $(srcdir)/assemblyresolve_event5_helper.cs
1732 assemblyresolve_event5.exe: assemblyresolve_event5_helper.dll
1733
1734 # We use 'test-support-files' to handle an ordering issue between the 'mono/' and 'runtime/' directories
1735 bug-80307.exe: $(srcdir)/bug-80307.cs
1736         $(MCS) -r:$(CLASS)/System.Web.dll -out:$@ $(srcdir)/bug-80307.cs
1737         cd $(top_builddir)/runtime && $(MAKE) test-support-files
1738
1739 EXTRA_DIST += bug-81673-interface.cs
1740
1741 bug-81673.exe$(PLATFORM_AOT_SUFFIX): bug-81673-interface.dll$(PLATFORM_AOT_SUFFIX)
1742 bug-81673.exe bug-81673-interface.dll: $(srcdir)/bug-81673.cs $(srcdir)/bug-81673-interface.cs
1743         $(MCS) -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
1744         $(MCS) -r:bug-81673-interface.dll -out:bug-81673.exe $(srcdir)/bug-81673.cs
1745         $(MCS) -define:WITH_STOP -target:library -out:bug-81673-interface.dll $(srcdir)/bug-81673-interface.cs
1746
1747 EXTRA_DIST += bug-36848-a.cs
1748
1749 bug-36848.exe$(PLATFORM_AOT_SUFFIX): bug-36848-a.dll$(PLATFORM_AOT_SUFFIX)
1750 bug-36848.exe bug-36848-a.dll: $(srcdir)/bug-36848.cs $(srcdir)/bug-36848-a.cs
1751         $(MCS) -target:library -out:bug-36848-a.dll $(srcdir)/bug-36848-a.cs
1752         $(MCS) -r:bug-36848-a.dll -out:bug-36848.exe $(srcdir)/bug-36848.cs
1753         $(MCS) -define:WITH_STOP -target:library -out:bug-36848-a.dll $(srcdir)/bug-36848-a.cs
1754
1755 EXTRA_DIST += bug-81691-a.cs bug-81691-b.cs
1756
1757 bug-81691.exe$(PLATFORM_AOT_SUFFIX): bug-81691-b.dll$(PLATFORM_AOT_SUFFIX)
1758 bug-81691.exe bug-81691-a.dll bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
1759         $(MCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs 
1760         $(MCS) -r:bug-81691-a.dll -target:library -out:bug-81691-b.dll $(srcdir)/bug-81691-b.cs
1761         $(MCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
1762         rm -f bug-81691-a.dll
1763
1764 EXTRA_DIST += bug-81466-lib.il
1765
1766 bug-81466.exe$(PLATFORM_AOT_SUFFIX): bug-81466-lib.dll$(PLATFORM_AOT_SUFFIX)
1767 bug-81466.exe bug-81466-lib.dll: $(srcdir)/bug-81466.il $(srcdir)/bug-81466-lib.il
1768         $(ILASM) /dll /output:bug-81466-lib.dll $(srcdir)/bug-81466-lib.il
1769         $(ILASM) /exe /output:bug-81466.exe $(srcdir)/bug-81466.il
1770
1771 EXTRA_DIST += bug-324535-il.il
1772
1773 bug-324535.exe$(PLATFORM_AOT_SUFFIX): bug-324535-il.dll$(PLATFORM_AOT_SUFFIX)
1774 bug-324535.exe bug-324535-il.dll: $(srcdir)/bug-324535.cs $(srcdir)/bug-324535-il.il
1775         $(ILASM) /dll /output:bug-324535-il.dll $(srcdir)/bug-324535-il.il
1776         $(MCS) -r:bug-324535-il.dll -out:bug-324535.exe $(srcdir)/bug-324535.cs
1777
1778 EXTRA_DIST += custom-modifiers.2.cs custom-modifiers-lib.il
1779
1780 custom-modifiers.2.exe$(PLATFORM_AOT_SUFFIX): custom-modifiers-lib.dll$(PLATFORM_AOT_SUFFIX)
1781 custom-modifiers.2.exe custom-modifiers-lib.dll: $(srcdir)/custom-modifiers.2.cs $(srcdir)/custom-modifiers-lib.il
1782         $(ILASM) /dll /output:custom-modifiers-lib.dll $(srcdir)/custom-modifiers-lib.il
1783         $(MCS) -r:custom-modifiers-lib.dll -out:custom-modifiers.2.exe $(srcdir)/custom-modifiers.2.cs
1784
1785 EXTRA_DIST += bug-382986-lib.cs
1786
1787 bug-382986.exe$(PLATFORM_AOT_SUFFIX): bug-382986-lib.dll$(PLATFORM_AOT_SUFFIX)
1788 bug-382986.exe bug-382986-lib.dll: $(srcdir)/bug-382986.cs $(srcdir)/bug-382986-lib.cs
1789         $(MCS) -target:library -out:bug-382986-lib.dll $(srcdir)/bug-382986-lib.cs
1790         $(MCS) -r:bug-382986-lib.dll -out:bug-382986.exe $(srcdir)/bug-382986.cs
1791
1792 EXTRA_DIST += bug-17537-helper.cs
1793
1794 bug-17537.exe$(PLATFORM_AOT_SUFFIX): bug-17537-helper.exe$(PLATFORM_AOT_SUFFIX)
1795 bug-17537-helper.exe: $(srcdir)/bug-17537-helper.cs
1796         $(MCS) -out:$@ $<
1797         chmod -x $@
1798 bug-17537.exe: bug-17537-helper.exe
1799
1800 EXTRA_DIST += coreclr-security.cs
1801
1802 test-coreclr-security : coreclr-security.exe
1803         @$(RUNTIME_MOONLIGHT) --security=core-clr-test coreclr-security.exe
1804
1805 EXTRA_DIST += generic-unboxing.2.il generic-boxing.2.il
1806
1807 generic-unboxing.2.dll: $(srcdir)/generic-unboxing.2.il
1808         $(ILASM) /dll /output:$@ $<
1809 generic-boxing.2.dll: $(srcdir)/generic-boxing.2.il generic-unboxing.2.dll
1810         $(ILASM) /dll /output:$@ $<
1811
1812 EXTRA_DIST += generic-unbox.2.cs
1813
1814 generic-unbox.2.exe$(PLATFORM_AOT_SUFFIX): generic-unboxing.2.dll$(PLATFORM_AOT_SUFFIX)
1815 generic-unbox.2.exe: $(srcdir)/generic-unbox.2.cs generic-unboxing.2.dll
1816         $(MCS) -r:generic-unboxing.2.dll -out:$@ $<
1817
1818 EXTRA_DIST += generic-box.2.cs
1819
1820 generic-box.2.exe$(PLATFORM_AOT_SUFFIX): generic-unboxing.2.dll$(PLATFORM_AOT_SUFFIX) generic-boxing.2.dll$(PLATFORM_AOT_SUFFIX)
1821 generic-box.2.exe : $(srcdir)/generic-box.2.cs generic-unboxing.2.dll generic-boxing.2.dll
1822         $(MCS) -r:generic-unboxing.2.dll,generic-boxing.2.dll -out:$@ $<
1823
1824 EXTRA_DIST += generic-delegate2.2.cs generic-delegate2-lib.2.il
1825
1826 generic-delegate2-lib.2.dll: $(srcdir)/generic-delegate2-lib.2.il
1827         $(ILASM) /dll /output:$@ $<
1828
1829 generic-delegate2.2.exe$(PLATFORM_AOT_SUFFIX): generic-delegate2-lib.2.dll$(PLATFORM_AOT_SUFFIX)
1830 generic-delegate2.2.exe: $(srcdir)/generic-delegate2.2.cs generic-delegate2-lib.2.dll
1831         $(MCS) -r:generic-delegate2-lib.2.dll -out:$@ $<
1832
1833 bug-3903.exe: bug-3903.cs
1834         $(MCS_NO_LIB)  $(srcdir)/bug-3903.cs -nostdlib -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/mscorlib.dll -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/System.Core.dll -out:$@
1835
1836 gshared:
1837         $(MAKE) test-generic-sharing
1838
1839 gshared-aot:
1840         @$(MAKE) AOT=1 gshared
1841
1842 test-generic-sharing-normal: $(TESTS_GSHARED) $(TESTSAOT_GSHARED)
1843         @for fn in $+ ; do      \
1844                 echo "Testing $$fn ...";        \
1845                 $(RUNTIME) -O=gshared                $$fn > $$fn.stdout || exit 1;      \
1846                 $(RUNTIME) -O=gshared,shared         $$fn > $$fn.stdout || exit 1;      \
1847                 $(RUNTIME) -O=gshared,-inline        $$fn > $$fn.stdout || exit 1;      \
1848                 $(RUNTIME) -O=gshared,-inline,shared $$fn > $fn.stdout || exit 1;       \
1849                 if [ x$(AOT) = x1 ]; then $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $$fn > /dev/null || exit 1; $(RUNTIME) $$fn > $$fn.stdout || exit 1; fi; \
1850         done
1851
1852 test-generic-sharing-managed: test-runner.exe $(TESTS_GSHARED) $(TESTSAOT_GSHARED) 
1853         $(Q) $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name "gshared" --disabled "$(DISABLED_TESTS)" --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(TESTS_GSHARED)
1854
1855 test-generic-sharing:
1856         @if test x$(M) != x0; then $(MAKE) test-generic-sharing-managed; else $(MAKE) test-generic-sharing-normal; fi
1857
1858 EXTRA_DIST += async-exceptions.cs
1859 async-exceptions.exe : async-exceptions.cs
1860         $(MCS) -out:async-exceptions.exe $(srcdir)/async-exceptions.cs
1861 test-async-exceptions : async-exceptions.exe
1862         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
1863         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
1864
1865 EXTRA_DIST += modules.cs modules-m1.cs
1866 modules-m1.netmodule: modules-m1.cs
1867         $(MCS) -out:$@ /target:module $(srcdir)/modules-m1.cs
1868 modules.exe: modules.cs modules-m1.netmodule $(TEST_DRIVER_DEPEND) 
1869         $(MCS) -out:$@ /addmodule:modules-m1.netmodule -r:TestDriver.dll $(srcdir)/modules.cs
1870
1871 # Useful if mono is compiled with --enable-shared=no
1872 patch-libtool:
1873         cp "../../libtool" .
1874         sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool
1875         sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 && echo "LIBTOOL = bash ./libtool" > 1 && cat 1 2 > Makefile
1876         touch libtest.c
1877
1878
1879 EXTRA_DIST += threadpool-in-processexit.cs threadpool-in-processexit.exe.stdout.expected
1880 test-process-exit:
1881         @$(MCS) $(srcdir)/threadpool-in-processexit.cs -out:threadpool-in-processexit.exe
1882         @echo "Testing threadpool-in-processexit.exe..."
1883         @$(RUNTIME) threadpool-in-processexit.exe > threadpool-in-processexit.exe.stdout
1884         @diff -w threadpool-in-processexit.exe.stdout $(srcdir)/threadpool-in-processexit.exe.stdout.expected
1885
1886 # tests that expect a 1 exit code
1887 TESTS_UNHANDLED_EXCEPTION_1_SRC =       \
1888         unhandled-exception-1.cs
1889
1890 # tests that expect a 255 exit code
1891 TESTS_UNHANDLED_EXCEPTION_255_SRC =     \
1892         unhandled-exception-2.cs        \
1893         unhandled-exception-3.cs        \
1894         unhandled-exception-4.cs        \
1895         unhandled-exception-5.cs        \
1896         unhandled-exception-6.cs        \
1897         unhandled-exception-7.cs        \
1898         unhandled-exception-8.cs
1899
1900 TESTS_UNHANDLED_EXCEPTION_1=$(filter-out $(DISABLED_TESTS),$(TESTS_UNHANDLED_EXCEPTION_1_SRC:.cs=.exe))
1901 TESTS_UNHANDLED_EXCEPTION_255=$(filter-out $(DISABLED_TESTS),$(TESTS_UNHANDLED_EXCEPTION_255_SRC:.cs=.exe))
1902
1903 if FULL_AOT_TESTS
1904 TESTSAOT_UNHANDLED_EXCEPTION_1=$(TESTS_UNHANDLED_EXCEPTION_1:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1905 TESTSAOT_UNHANDLED_EXCEPTION_255=$(TESTS_UNHANDLED_EXCEPTION_255:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1906 endif
1907
1908 if HYBRID_AOT_TESTS
1909 TESTSAOT_UNHANDLED_EXCEPTION_1=$(TESTS_UNHANDLED_EXCEPTION_1:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1910 TESTSAOT_UNHANDLED_EXCEPTION_255=$(TESTS_UNHANDLED_EXCEPTION_255:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1911 endif
1912
1913 test-unhandled-exception-2: $(TESTS_UNHANDLED_EXCEPTION_1) $(TESTS_UNHANDLED_EXCEPTION_255) $(TESTSAOT_UNHANDLED_EXCEPTION_1) $(TESTSAOT_UNHANDLED_EXCEPTION_255)
1914         ok=; \
1915         $(MAKE) test-unhandled-exception-2-1-with-managed-handler || ok=false; \
1916         $(MAKE) test-unhandled-exception-2-1-without-managed-handler || ok=false; \
1917         $(MAKE) test-unhandled-exception-2-255-with-managed-handler || ok=false; \
1918         $(MAKE) test-unhandled-exception-2-255-without-managed-handler || ok=false; \
1919         $$ok
1920
1921 test-unhandled-exception-2-1-with-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_1) $(TESTSAOT_UNHANDLED_EXCEPTION_1) test-runner.exe
1922         $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(TESTS_UNHANDLED_EXCEPTION_1)
1923 test-unhandled-exception-2-1-without-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_1) $(TESTSAOT_UNHANDLED_EXCEPTION_1) test-runner.exe
1924         TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 1 $(TESTS_UNHANDLED_EXCEPTION_1)
1925 test-unhandled-exception-2-255-with-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_255) $(TESTSAOT_UNHANDLED_EXCEPTION_255) test-runner.exe
1926         $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 255 $(TESTS_UNHANDLED_EXCEPTION_255)
1927 test-unhandled-exception-2-255-without-managed-handler: $(TESTS_UNHANDLED_EXCEPTION_255) $(TESTSAOT_UNHANDLED_EXCEPTION_255) test-runner.exe
1928         TEST_UNHANDLED_EXCEPTION_HANDLER=1 $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --expected-exit-code 255 $(TESTS_UNHANDLED_EXCEPTION_255)
1929
1930 EXTRA_DIST += appdomain-loader.cs appdomain-tester.cs
1931
1932 if FULL_AOT_TESTS
1933 test-appdomain-unload:
1934 else
1935 appdomain-loader.exe: appdomain-tester.exe
1936
1937 test-appdomain-unload: appdomain-loader.exe appdomain-tester.exe
1938         $(RUNTIME) -O=gshared appdomain-loader.exe > appdomain-loader.exe.1.stdout || exit 1;
1939         $(RUNTIME) appdomain-loader.exe > appdomain-loader.exe.2.stdout || exit 1;
1940         MONO_DEBUG_ASSEMBLY_UNLOAD=1 $(RUNTIME) -O=gshared appdomain-loader.exe > appdomain-loader.exe.3.stdout || exit 1;
1941         MONO_DEBUG_ASSEMBLY_UNLOAD=1 $(RUNTIME) appdomain-loader.exe > appdomain-loader.exe.4.stdout || exit 1;
1942 endif
1943
1944 EXTRA_DIST += console-output.cs console-output.exe.stderr.expected console-output.exe.stdout.expected
1945 test-console-output: console-output.exe
1946         @$(RUNTIME) console-output.exe 1>console-output.exe.stdout
1947         @$(RUNTIME) console-output.exe 2>console-output.exe.stderr
1948         @diff -w console-output.exe.stdout $(srcdir)/console-output.exe.stdout.expected \
1949                 && diff -w console-output.exe.stderr $(srcdir)/console-output.exe.stderr.expected
1950
1951 test-pedump: test-runner.exe
1952         $(with_mono_path) $(mono_build_root)/tools/pedump/pedump --verify error test-runner.exe
1953
1954 .PHONY: test-gac-loading test-eglib-remap
1955
1956 runtest-gac-loading: test-runner.exe
1957         $(MAKE) -C testing_gac runtest
1958
1959 compile-gac-loading:
1960         $(MAKE) -C testing_gac compile-tests
1961
1962 TESTS_STRESS_PROCESS_SRC=       \
1963                 process-stress-1.cs     \
1964                 process-stress-2.cs     \
1965                 process-stress-3.cs     \
1966                 process-leak.cs
1967
1968 TESTS_STRESS_PROCESS=$(filter-out $(DISABLED_TESTS),$(TESTS_STRESS_PROCESS_SRC:.cs=.exe))
1969
1970 if FULL_AOT_TESTS
1971 TESTSAOT_STRESS_PROCESS=$(TESTS_STRESS_PROCESS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1972 endif
1973
1974 if HYBRID_AOT_TESTS
1975 TESTSAOT_STRESS_PROCESS=$(TESTS_STRESS_PROCESS:.exe=.exe$(PLATFORM_AOT_SUFFIX))
1976 endif
1977
1978 test-process-stress: $(TESTS_STRESS_PROCESS) $(TESTSAOT_STRESS_PROCESS) test-runner.exe
1979         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 600 $(TESTS_STRESS_PROCESS)
1980
1981 coreclr-gcstress:
1982         $(MAKE) -C $(mono_build_root)/acceptance-tests coreclr-gcstress
1983
1984 # Tests for the Mono lldb plugin
1985 EXTRA_DIST += test_lldb.py test-lldb.cs
1986 test-lldb: test-lldb.exe
1987         python test_lldb.py $(JITTEST_PROG)
1988
1989 noinst_LTLIBRARIES = libtest.la
1990
1991 AM_CPPFLAGS = $(GLIB_CFLAGS)
1992
1993 if HOST_WIN32
1994 # gcc-3.4.4 emits incorrect code when making indirect calls to stdcall functions using a tail call
1995 # This shows up when compiling mono_test_marshal_delegate ()
1996 libtest_la_CFLAGS=-fno-optimize-sibling-calls
1997 # the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET
1998 # can't find them. So we use --kill-at to remove the @ suffix as well.
1999 libtest_la_LDFLAGS=-no-undefined -rpath `pwd` -Wl,--kill-at
2000 else
2001 libtest_la_LDFLAGS = -rpath `pwd`
2002 endif
2003 libtest_la_SOURCES = libtest.c
2004 libtest_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
2005
2006 INTERNALSVISIBLETO_TEST_SRC = \
2007         internalsvisibleto-runtimetest.cs \
2008         internalsvisibleto-compilertest.cs
2009
2010 INTERNALSVISIBLETO_TEST_LIB_SRC = \
2011         internalsvisibleto-library.cs
2012
2013 INTERNALSVISIBLETO_TEST_LIBS = \
2014         internalsvisibleto-correctcase.dll \
2015         internalsvisibleto-wrongcase.dll \
2016         internalsvisibleto-correctcase-2.dll \
2017         internalsvisibleto-wrongcase-2.dll \
2018         internalsvisibleto-correctcase-sign2048.dll \
2019         internalsvisibleto-wrongcase-sign2048.dll \
2020         internalsvisibleto-correctcase-2-sign2048.dll \
2021         internalsvisibleto-wrongcase-2-sign2048.dll
2022
2023
2024 INTERNALSVISIBLETO_TEST = \
2025         $(INTERNALSVISIBLETO_TEST_SRC:.cs=.exe) \
2026         $(INTERNALSVISIBLETO_TEST_SRC:.cs=-sign2048.exe)
2027
2028 if FULL_AOT_TESTS
2029 INTERNALSVISIBLETO_TESTAOT = \
2030         $(INTERNALSVISIBLETO_TEST:.exe=.exe$(PLATFORM_AOT_SUFFIX))
2031 INTERNALSVISIBLETO_TESTAOT_LIBS = \
2032         $(INTERNALSVISIBLETO_TEST_LIBS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
2033 endif
2034
2035 if HYBRID_AOT_TESTS
2036 INTERNALSVISIBLETO_TESTAOT = \
2037         $(INTERNALSVISIBLETO_TEST:.exe=.exe$(PLATFORM_AOT_SUFFIX))
2038 INTERNALSVISIBLETO_TESTAOT_LIBS = \
2039         $(INTERNALSVISIBLETO_TEST_LIBS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
2040 endif
2041
2042 EXTRA_DIST += $(INTERNALSVISIBLETO_TEST_SRC) $(INTERNALSVISIBLETO_TEST_LIB_SRC)
2043
2044 test-internalsvisibleto: test-runner.exe $(INTERNALSVISIBLETO_TEST) $(INTERNALSVISIBLETO_TESTAOT) $(INTERNALSVISIBLETO_TESTAOT_LIBS)
2045         $(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ $(INTERNALSVISIBLETO_TEST)
2046
2047 internalsvisibleto-correctcase.dll internalsvisibleto-wrongcase.dll internalsvisibleto-runtimetest.exe: internalsvisibleto-runtimetest.cs internalsvisibleto-library.cs
2048         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE -d:PERMISSIVE internalsvisibleto-library.cs       
2049         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE -d:PERMISSIVE internalsvisibleto-library.cs
2050         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-runtimetest.exe -warn:0 -r:internalsvisibleto-correctcase.dll -r:internalsvisibleto-wrongcase.dll internalsvisibleto-runtimetest.cs
2051         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs     
2052         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
2053
2054 internalsvisibleto-correctcase-2.dll internalsvisibleto-wrongcase-2.dll  internalsvisibleto-compilertest.exe: internalsvisibleto-compilertest.cs internalsvisibleto-library.cs
2055         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-2.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs   
2056         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-2.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
2057         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-compilertest.exe -warn:0 -r:internalsvisibleto-correctcase-2.dll -r:internalsvisibleto-wrongcase-2.dll internalsvisibleto-compilertest.cs
2058
2059 internalsvisibleto-correctcase-sign2048.dll internalsvisibleto-wrongcase-sign2048.dll internalsvisibleto-runtimetest-sign2048.exe: internalsvisibleto-runtimetest.cs internalsvisibleto-library.cs internalsvisibleto-2048.snk
2060         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-sign2048.dll -target:library -d:CORRECT_CASE -d:PERMISSIVE -d:SIGN2048 internalsvisibleto-library.cs
2061         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-sign2048.dll -target:library -d:WRONG_CASE -d:PERMISSIVE -d:SIGN2048 internalsvisibleto-library.cs
2062         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-runtimetest-sign2048.exe -warn:0 -r:internalsvisibleto-correctcase-sign2048.dll -r:internalsvisibleto-wrongcase-sign2048.dll -d:SIGN2048 internalsvisibleto-runtimetest.cs
2063         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-sign2048.dll -target:library -d:CORRECT_CASE -d:SIGN2048 internalsvisibleto-library.cs
2064         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-sign2048.dll -target:library -d:WRONG_CASE -d:SIGN2048 internalsvisibleto-library.cs
2065
2066 internalsvisibleto-correctcase-2-sign2048.dll internalsvisibleto-wrongcase-2-sign2048.dll internalsvisibleto-compilertest-sign2048.exe: internalsvisibleto-compilertest.cs internalsvisibleto-library.cs internalsvisibleto-2048.snk
2067         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-2-sign2048.dll -target:library -d:CORRECT_CASE -d:SIGN2048 internalsvisibleto-library.cs      
2068         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-2-sign2048.dll -target:library -d:WRONG_CASE -d:SIGN2048 internalsvisibleto-library.cs
2069         $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-compilertest-sign2048.exe -warn:0 -r:internalsvisibleto-correctcase-2-sign2048.dll -r:internalsvisibleto-wrongcase-2-sign2048.dll -d:SIGN2048 internalsvisibleto-compilertest.cs
2070
2071
2072 CLEANFILES = $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH) $(TESTS_STRESS) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) *.dll *.stdout *.aotlog *.exe stest.dat