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