Disable few more tests
[mono.git] / mcs / mcs / cfold.cs
index 89b674cdd8bb6f2679a6b6194d506a5c01ca2550..8724e48b52d7196baf82672bb14f3f673a22a225 100644 (file)
@@ -6,7 +6,7 @@
 //   Marek Safar (marek.safar@seznam.cz)
 //
 // Copyright 2002, 2003 Ximian, Inc.
-// Copyright 2003-2008, Novell, Inc.
+// Copyright 2003-2011, Novell, Inc.
 // 
 using System;
 
@@ -149,7 +149,7 @@ namespace Mono.CSharp {
                                        case Binary.Operator.ExclusiveOr:
                                                result = BinaryFold (ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc);
                                                if (result != null)
-                                                       result = result.TryReduce (ec, lt, loc);
+                                                       result = result.TryReduce (ec, lt);
                                                return result;
 
                                        ///
@@ -158,7 +158,7 @@ namespace Mono.CSharp {
                                        case Binary.Operator.Subtraction:
                                                result = BinaryFold (ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc);
                                                if (result != null)
-                                                       result = result.TryReduce (ec, EnumSpec.GetUnderlyingType (lt), loc);
+                                                       result = result.TryReduce (ec, EnumSpec.GetUnderlyingType (lt));
                                                return result;
 
                                        ///
@@ -187,7 +187,7 @@ namespace Mono.CSharp {
                                //
                                if ((lt.BuiltinType == BuiltinTypeSpec.Type.Bool && right is NullLiteral) ||
                                        (rt.BuiltinType == BuiltinTypeSpec.Type.Bool && left is NullLiteral)) {
-                                       var b = new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec);
+                                       var b = new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec);
 
                                        // false | null => null
                                        // null | false => null
@@ -231,7 +231,7 @@ namespace Mono.CSharp {
                                //
                                if ((lt.BuiltinType == BuiltinTypeSpec.Type.Bool && right is NullLiteral) ||
                                        (rt.BuiltinType == BuiltinTypeSpec.Type.Bool && left is NullLiteral)) {
-                                       var b = new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec);
+                                       var b = new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec);
 
                                        // false & null => false
                                        // null & false => false
@@ -340,7 +340,7 @@ namespace Mono.CSharp {
                                        if (result == null)
                                                return null;
 
-                                       result = result.TryReduce (ec, lt, loc);
+                                       result = result.TryReduce (ec, lt);
                                        if (result == null)
                                                return null;
 
@@ -459,7 +459,7 @@ namespace Mono.CSharp {
                                        if (result == null)
                                                return null;
 
-                                       result = result.TryReduce (ec, lt, loc);
+                                       result = result.TryReduce (ec, lt);
                                        if (result == null)
                                                return null;
 
@@ -467,8 +467,9 @@ namespace Mono.CSharp {
                                }
 
                                if (left is NullLiteral && right is NullLiteral) {
-                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                       lifted_int.ResolveAsType (ec);
+                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                }
 
                                if (!DoBinaryNumericPromotions (ec, ref left, ref right))
@@ -563,8 +564,9 @@ namespace Mono.CSharp {
                                
                        case Binary.Operator.Multiply:
                                if (left is NullLiteral && right is NullLiteral) {
-                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                       lifted_int.ResolveAsType (ec);
+                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                }
 
                                if (!DoBinaryNumericPromotions (ec, ref left, ref right))
@@ -658,8 +660,9 @@ namespace Mono.CSharp {
 
                        case Binary.Operator.Division:
                                if (left is NullLiteral && right is NullLiteral) {
-                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                       lifted_int.ResolveAsType (ec);
+                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                }
 
                                if (!DoBinaryNumericPromotions (ec, ref left, ref right))
@@ -757,8 +760,9 @@ namespace Mono.CSharp {
                                
                        case Binary.Operator.Modulus:
                                if (left is NullLiteral && right is NullLiteral) {
-                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                       lifted_int.ResolveAsType (ec);
+                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                }
 
                                if (!DoBinaryNumericPromotions (ec, ref left, ref right))
@@ -846,8 +850,9 @@ namespace Mono.CSharp {
                                //
                        case Binary.Operator.LeftShift:
                                if (left is NullLiteral && right is NullLiteral) {
-                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                       lifted_int.ResolveAsType (ec);
+                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                }
 
                                IntConstant ic = right.ConvertImplicitly (ec.BuiltinTypes.Int) as IntConstant;
@@ -868,7 +873,7 @@ namespace Mono.CSharp {
 
                                // null << value => null
                                if (left is NullLiteral)
-                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec);
+                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec);
 
                                left = left.ConvertImplicitly (ec.BuiltinTypes.Int);
                                if (left.Type.BuiltinType == BuiltinTypeSpec.Type.Int)
@@ -882,8 +887,9 @@ namespace Mono.CSharp {
                                //
                        case Binary.Operator.RightShift:
                                if (left is NullLiteral && right is NullLiteral) {
-                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                       var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                       lifted_int.ResolveAsType (ec);
+                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                }
 
                                IntConstant sic = right.ConvertImplicitly (ec.BuiltinTypes.Int) as IntConstant;
@@ -903,7 +909,7 @@ namespace Mono.CSharp {
 
                                // null >> value => null
                                if (left is NullLiteral)
-                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec);
+                                       return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec);
 
                                left = left.ConvertImplicitly (ec.BuiltinTypes.Int);
                                if (left.Type.BuiltinType == BuiltinTypeSpec.Type.Int)
@@ -913,13 +919,13 @@ namespace Mono.CSharp {
                                break;
 
                        case Binary.Operator.Equality:
-                               if (TypeManager.IsReferenceType (lt) && TypeManager.IsReferenceType (rt) ||
+                               if (TypeSpec.IsReferenceType (lt) && TypeSpec.IsReferenceType (rt) ||
                                        (left is Nullable.LiftedNull && right.IsNull) ||
                                        (right is Nullable.LiftedNull && left.IsNull)) {
                                        if (left.IsNull || right.IsNull) {
                                                return ReducedExpression.Create (
                                                        new BoolConstant (ec.BuiltinTypes, left.IsNull == right.IsNull, left.Location),
-                                                       new Binary (oper, left, right, loc));
+                                                       new Binary (oper, left, right));
                                        }
 
                                        if (left is StringConstant && right is StringConstant)
@@ -957,13 +963,13 @@ namespace Mono.CSharp {
                                return new BoolConstant (ec.BuiltinTypes, bool_res, left.Location);
 
                        case Binary.Operator.Inequality:
-                               if (TypeManager.IsReferenceType (lt) && TypeManager.IsReferenceType (rt) ||
+                               if (TypeSpec.IsReferenceType (lt) && TypeSpec.IsReferenceType (rt) ||
                                        (left is Nullable.LiftedNull && right.IsNull) ||
                                        (right is Nullable.LiftedNull && left.IsNull)) {
                                        if (left.IsNull || right.IsNull) {
                                                return ReducedExpression.Create (
                                                        new BoolConstant (ec.BuiltinTypes, left.IsNull != right.IsNull, left.Location),
-                                                       new Binary (oper, left, right, loc));
+                                                       new Binary (oper, left, right));
                                        }
 
                                        if (left is StringConstant && right is StringConstant)
@@ -1003,12 +1009,13 @@ namespace Mono.CSharp {
                        case Binary.Operator.LessThan:
                                if (right is NullLiteral) {
                                        if (left is NullLiteral) {
-                                               var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                               var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                               lifted_int.ResolveAsType (ec);
+                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                        }
 
                                        if (left is Nullable.LiftedNull) {
-                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec);
+                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec);
                                        }
                                }
 
@@ -1042,12 +1049,13 @@ namespace Mono.CSharp {
                        case Binary.Operator.GreaterThan:
                                if (right is NullLiteral) {
                                        if (left is NullLiteral) {
-                                               var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                               var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                               lifted_int.ResolveAsType (ec);
+                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                        }
 
                                        if (left is Nullable.LiftedNull) {
-                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec);
+                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec);
                                        }
                                }
 
@@ -1081,12 +1089,13 @@ namespace Mono.CSharp {
                        case Binary.Operator.GreaterThanOrEqual:
                                if (right is NullLiteral) {
                                        if (left is NullLiteral) {
-                                               var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                               var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                               lifted_int.ResolveAsType (ec);
+                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                        }
 
                                        if (left is Nullable.LiftedNull) {
-                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec);
+                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec);
                                        }
                                }
 
@@ -1120,12 +1129,13 @@ namespace Mono.CSharp {
                        case Binary.Operator.LessThanOrEqual:
                                if (right is NullLiteral) {
                                        if (left is NullLiteral) {
-                                               var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc).ResolveAsType (ec, false);
-                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right, loc).Resolve (ec);
+                                               var lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);
+                                               lifted_int.ResolveAsType (ec);
+                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, lifted_int, right).Resolve (ec);
                                        }
 
                                        if (left is Nullable.LiftedNull) {
-                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right, loc).Resolve (ec);
+                                               return (Constant) new Nullable.LiftedBinaryOperator (oper, left, right).Resolve (ec);
                                        }
                                }