Author: kumpera
Date: 2007-09-25 17:02:30 -0400 (Tue, 25 Sep 2007)
New Revision: 86356
Added:
trunk/mono/mono/tests/verifier/valid_generic_params.cs
Modified:
trunk/mono/mono/tests/verifier/ChangeLog
trunk/mono/mono/tests/verifier/Makefile
Log:
2007-09-25 Rodrigo Kumpera <[EMAIL PROTECTED]>
* valid_generic_params.cs (added): Tests for valid use of generic types.
* Makedfile: added valid_generic_params.cs
Modified: trunk/mono/mono/tests/verifier/ChangeLog
===================================================================
--- trunk/mono/mono/tests/verifier/ChangeLog 2007-09-25 20:46:24 UTC (rev
86355)
+++ trunk/mono/mono/tests/verifier/ChangeLog 2007-09-25 21:02:30 UTC (rev
86356)
@@ -1,3 +1,8 @@
+2007-09-25 Rodrigo Kumpera <[EMAIL PROTECTED]>
+
+ * valid_generic_params.cs (added): Tests for valid use of generic types.
+ * Makedfile: added valid_generic_params.cs
+
2007-08-16 Rodrigo Kumpera <[EMAIL PROTECTED]>
* make_newarr_test.sh (added): Generate newarr related tests.
Modified: trunk/mono/mono/tests/verifier/Makefile
===================================================================
--- trunk/mono/mono/tests/verifier/Makefile 2007-09-25 20:46:24 UTC (rev
86355)
+++ trunk/mono/mono/tests/verifier/Makefile 2007-09-25 21:02:30 UTC (rev
86356)
@@ -4,6 +4,7 @@
compile-stamp: generate-stamp
for i in *.il; do ilasm2 $$i; done
+ for i in *.cs; do gmcs $$i; done
touch compile-stamp
clean:
@@ -13,7 +14,7 @@
generate-stamp: make_tests.sh make_bin_test.sh make_exception_branch_test.sh
make_obj_store_test.sh \
make_stack_0_pop_test.sh make_stack_0_test.sh
make_stack_1_pop_test.sh \
- make_stack_merge_test.sh make_store_test.sh make_unary_test.sh
+ make_stack_merge_test.sh make_store_test.sh make_unary_test.sh
./make_tests.sh
touch generate-stamp
Added: trunk/mono/mono/tests/verifier/valid_generic_params.cs
===================================================================
--- trunk/mono/mono/tests/verifier/valid_generic_params.cs 2007-09-25
20:46:24 UTC (rev 86355)
+++ trunk/mono/mono/tests/verifier/valid_generic_params.cs 2007-09-25
21:02:30 UTC (rev 86356)
@@ -0,0 +1,51 @@
+public class GenericClass<T>
+{
+ public void SimpleMethod ()
+ {
+ T a = default (T);
+ T b = a;
+ T c;
+ if (SimpleClass.cond)
+ c = a;
+ else
+ c = b;
+ }
+
+ public void SimpleMethod2 (ref T a)
+ {
+ T b = a;
+ T c;
+ if (SimpleClass.cond)
+ c = a;
+ else
+ c = b;
+ a = c;
+ }
+}
+
+public class SimpleClass
+{
+ public static bool cond;
+ public void GenericMethod<T> () {
+ T a = default (T);
+ T b = a;
+ }
+
+ public void GenericMethod<T> (T t) {
+ T a = t;
+ t = a;
+ }
+
+}
+
+public class Driver
+{
+ public static int Main ()
+ {
+ new GenericClass<int>().SimpleMethod ();
+ new SimpleClass().GenericMethod<int>();
+ new SimpleClass().GenericMethod<int>(10);
+
+ return 0;
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches