Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2008-10-03 14:21:44 +0400
committerMarek Safar <marek.safar@gmail.com>2008-10-03 14:21:44 +0400
commitf3320a409ec9164f5d5f4d8d598d6a9c853cb4ef (patch)
treee5edea11d8ac9d75031f3ee51147a354fef9073a /mcs/tests/test-688.cs
parent05f86becee556b7bbda538360d05fee9f4e8e761 (diff)
New tests.
svn path=/trunk/mcs/; revision=114740
Diffstat (limited to 'mcs/tests/test-688.cs')
-rwxr-xr-xmcs/tests/test-688.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/mcs/tests/test-688.cs b/mcs/tests/test-688.cs
new file mode 100755
index 00000000000..5907aee9da9
--- /dev/null
+++ b/mcs/tests/test-688.cs
@@ -0,0 +1,33 @@
+// Compiler options: -unsafe
+
+using System;
+
+unsafe class Test
+{
+ public static unsafe byte* GetFoo ()
+ {
+ byte *one = (byte*)1;
+ return 1 + one;
+ }
+
+ public static unsafe byte* GetFoo2 ()
+ {
+ byte *one = (byte*)3;
+ return one + 3;
+ }
+
+ public static int Main()
+ {
+ int b = (int)GetFoo ();
+ Console.WriteLine (b);
+ if (b != 2)
+ return 1;
+
+ b = (int)GetFoo2 ();
+ Console.WriteLine (b);
+ if (b != 6)
+ return 2;
+
+ return 0;
+ }
+}