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:
Diffstat (limited to 'mcs/tests/unsafe-4.cs')
-rwxr-xr-xmcs/tests/unsafe-4.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/mcs/tests/unsafe-4.cs b/mcs/tests/unsafe-4.cs
new file mode 100755
index 00000000000..730bb4915a1
--- /dev/null
+++ b/mcs/tests/unsafe-4.cs
@@ -0,0 +1,21 @@
+unsafe class X {
+ static int v;
+ static int v_calls;
+
+ static int* get_v ()
+ {
+ v_calls++;
+ return &v;
+ }
+
+ static int Main ()
+ {
+ if ((*get_v ())++ != 0)
+ return 1;
+ if (v != 1)
+ return 2;
+ if (v_calls != 1)
+ return 3;
+ return 0;
+ }
+}