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