Implement XamlNodeQueue, and add couple of missing files.
[mono.git] / mcs / tests / test-40.cs
index a258d0718a58ef1c27bd46c73571ad2b33954b23..d62f1adabdc68275f4a573ec32c7e75d3d4552b1 100644 (file)
@@ -4,12 +4,15 @@ public class Blah {
 
        enum Bar {
                a = MyEnum.Foo,
-               b = A.c
+               b = A.c,
+               c = MyEnum.Bar,
+               d = myconstant,
+               e = myconstant | 0x1fff
        }
        
        public enum MyEnum : byte {
                Foo = 254,
-               Bar
+               Bar = (byte) B.y
        }
 
        enum A {
@@ -21,7 +24,29 @@ public class Blah {
        }
        
        enum AA : byte { a, b }
-       enum BB : ulong { x, y }
+       enum BB : ulong { x = ulong.MaxValue - 1, y }
+
+       const int myconstant = 30;
+
+       enum Compute : ulong { 
+               two = AA.b + B.y,
+               three = AA.b - B.y,
+               four = A.a * BB.x,
+               five = AA.b >> B.y,
+       }
+       
+       internal enum WindowAttributes : uint {
+               kWindowNoAttributes = 0,
+               kWindowCloseBoxAttribute = (1u << 0),
+               kWindowHorizontalZoomAttribute = (1u << 1),
+               kWindowVerticalZoomAttribute = (1u << 2),
+               kWindowCollapseBoxAttribute = (1u << 3),
+               kWindowNoConstrainAttribute = (1u << 31),
+               kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
+       }
+       
+       // The constant assignment follows a different path             
+       const Bar bar_assignment = 0;
        
        public static int Main ()
        {
@@ -37,6 +62,8 @@ public class Blah {
                int k = (int) A.c;
                int l = (int) AA.b + 1;
 
+               if ((int) Compute.two != 2)
+                       return 10;
                if (i != j)
                        return 1;
 
@@ -55,6 +82,34 @@ public class Blah {
                if (i != 2)
                        return 1;
 
+               j = (int) Bar.c;
+
+               if (j != 1)
+                       return 1;
+
+               j = (int) Bar.d;
+
+               if (j != 30)
+                       return 1;
+
+               Enum e = Bar.d;
+               if (e.ToString () != "d")
+                       return 15;
+
+               //
+               // Test "U operator (E x, E x)"
+               //
+               // Notice that the Microsoft C# compiler wont compile the following
+               // code, that is a bug in their compiler, see section 14.7.5 of the
+               // spec.
+
+               if ((A.c - A.a) != 2)
+                       return 16;
+
+               if ((A.c - 1) != A.b)
+                       return 17;
+               
+               Console.WriteLine ("Value: " + e.ToString ());
                Console.WriteLine ("Enum emission test okay");
                return 0;
        }