From 9eb147a8e28bf2c4a690d00d5c0aabc7bc3e5def Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Sat, 20 Jun 2020 22:35:00 +0200 Subject: [PATCH 01/12] Merge from Re-enable-tests-for-operators --- .../FSharp.Core.UnitTests.fsproj | 19 +- .../FSharp.Core/OperatorsModule1.fs | 802 +++++---------- .../FSharp.Core/OperatorsModule2.fs | 909 +++++++++++------- .../FSharp.Core/OperatorsModuleChecked.fs | 307 ++++++ tests/FSharp.Core.UnitTests/LibraryTestFx.fs | 2 + .../NUnitFrameworkShims.fs | 55 +- 6 files changed, 1197 insertions(+), 897 deletions(-) create mode 100644 tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index 90b1436e398..0706e76eef5 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -33,6 +33,13 @@ + + + + + + + @@ -59,10 +66,6 @@ - - - - @@ -87,9 +90,7 @@ - - - + @@ -106,4 +107,8 @@ + + + + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs index 5aacff670ab..e81ddf29c01 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs @@ -3,360 +3,57 @@ // Various tests for the: // Microsoft.FSharp.Core.Operators module -namespace SystematicUnitTests.FSharp_Core.Microsoft_FSharp_Core +namespace FSharp.Core.UnitTests.Operators open System -open SystematicUnitTests.LibraryTestFx +open FSharp.Core.UnitTests.LibraryTestFx open NUnit.Framework -open Microsoft.FSharp.Core.Operators.Checked [] type OperatorsModule1() = [] - member this.Checkedbyte() = - // int type - let intByte = Operators.Checked.byte 100 - Assert.AreEqual(intByte,(byte)100) - - // char type - let charByte = Operators.Checked.byte '0' - Assert.AreEqual(charByte,(byte)48) - - // boundary value - let boundByte = Operators.Checked.byte 255.0 - Assert.AreEqual(boundByte, (byte)255) - - // overflow exception - try - let overflowByte = Operators.Checked.byte 256.0 - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - - - - - [] - member this.Checkedchar() = - - // number - let numberChar = Operators.Checked.char 48 - Assert.AreEqual(numberChar,'0') - - // letter - let letterChar = Operators.Checked.char 65 - Assert.AreEqual(letterChar,'A') - - // boundary value - let boundchar = Operators.Checked.char 126 - Assert.AreEqual(boundchar, '~') - - // overflow exception - try - let overflowchar = Operators.Checked.char (System.Int64.MaxValue+(int64)2) - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - - [] - member this.CheckedInt() = - - // char - let charInt = Operators.Checked.int '0' - Assert.AreEqual(charInt,48) - - // float - let floatInt = Operators.Checked.int 10.0 - Assert.AreEqual(floatInt,10) - - - // boundary value - let boundInt = Operators.Checked.int 32767.0 - Assert.AreEqual(boundInt, (int)32767) - - // overflow exception - try - let overflowint = Operators.Checked.int 2147483648.0 - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - - () - - [] - member this.CheckedInt16() = - - // char - let charInt16 = Operators.Checked.int16 '0' - Assert.AreEqual(charInt16,(int16)48) - - // float - let floatInt16 = Operators.Checked.int16 10.0 - Assert.AreEqual(floatInt16,(int16)10) - - // boundary value - let boundInt16 = Operators.Checked.int16 32767.0 - Assert.AreEqual(boundInt16, (int16)32767) - - // overflow exception - try - let overflowint16 = Operators.Checked.int16 32768.0 - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - () - - [] - member this.CheckedInt32() = - - // char - let charInt32 = Operators.Checked.int32 '0' - Assert.AreEqual(charInt32,(int32)48) - - // float - let floatInt32 = Operators.Checked.int32 10.0 - Assert.AreEqual(floatInt32,(int32)10) - - // boundary value - let boundInt32 = Operators.Checked.int32 2147483647.0 - Assert.AreEqual(boundInt32, (int32)2147483647) - - // overflow exception - try - let overflowint32 = Operators.Checked.int32 2147483648.0 - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - - () - - [] - member this.CheckedInt64() = - - // char - let charInt64 = Operators.Checked.int64 '0' - Assert.AreEqual(charInt64,(int64)48) - - // float - let floatInt64 = Operators.Checked.int64 10.0 - Assert.AreEqual(floatInt64,(int64)10) - - // boundary value - let boundInt64 = Operators.Checked.int64 9223372036854775807I - let a = 9223372036854775807L - Assert.AreEqual(boundInt64, 9223372036854775807L) - - // overflow exception - try - let overflowint64 = Operators.Checked.int64 (System.Double.MaxValue+2.0) - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - () - - [] - member this.CheckedNativeint() = - - // char - let charnativeint = Operators.Checked.nativeint '0' - Assert.AreEqual(charnativeint,(nativeint)48) - - // float - let floatnativeint = Operators.Checked.nativeint 10.0 - Assert.AreEqual(floatnativeint,(nativeint)10) - - // boundary value - let boundnativeint = Operators.Checked.nativeint 32767.0 - Assert.AreEqual(boundnativeint, (nativeint)32767) - - // overflow exception - try - let overflownativeint = Operators.Checked.nativeint 2147483648.0 - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - () - - [] - member this.Checkedsbyte() = - - // char - let charsbyte = Operators.Checked.sbyte '0' - Assert.AreEqual(charsbyte,(sbyte)48) - - // float - let floatsbyte = Operators.Checked.sbyte -10.0 - Assert.AreEqual(floatsbyte,(sbyte)(-10)) - - // boundary value - let boundsbyte = Operators.Checked.sbyte -127.0 - Assert.AreEqual(boundsbyte, (sbyte)(-127)) - - // overflow exception - try - let overflowsbyte = Operators.Checked.sbyte -256.0 - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - - () - - [] - member this.Checkeduint16() = + member _.KeyValue() = - // char - let charuint16 = Operators.Checked.uint16 '0' - Assert.AreEqual(charuint16,(uint16)48) - - // float - let floatuint16 = Operators.Checked.uint16 10.0 - Assert.AreEqual(floatuint16,(uint16)(10)) - - // boundary value - let bounduint16 = Operators.Checked.uint16 65535.0 - Assert.AreEqual(bounduint16, (uint16)(65535)) - - // overflow exception - try - let overflowuint16 = Operators.Checked.uint16 65536.0 - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - () - - [] - member this.Checkeduint32() = - - // char - let charuint32 = Operators.Checked.uint32 '0' - Assert.AreEqual(charuint32,(uint32)48) - - // float - let floatuint32 = Operators.Checked.uint32 10.0 - Assert.AreEqual(floatuint32,(uint32)(10)) - - // boundary value - let bounduint32 = Operators.Checked.uint32 429496729.0 - Assert.AreEqual(bounduint32, (uint32)(429496729)) - - - // overflow exception - try - let overflowuint32 = Operators.Checked.uint32 uint32.MaxValue+1u - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - () - - [] - member this.Checkeduint64() = - - // char - let charuint64 = Operators.Checked.uint64 '0' - Assert.AreEqual(charuint64,(uint64)48) - - // float - let floatuint64 = Operators.Checked.uint64 10.0 - Assert.AreEqual(floatuint64,(uint64)(10)) - - // boundary value - let bounduint64 = Operators.Checked.uint64 429496729.0 - Assert.AreEqual(bounduint64, (uint64)(429496729)) - - // overflow exception - try - let overflowuint64 = Operators.Checked.uint64 System.UInt64.MaxValue+1UL - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - () - - [] - member this.Checkedunativeint() = - - // char - let charunativeint = Operators.Checked.unativeint '0' - Assert.AreEqual(charunativeint,(unativeint)48) - - // float - let floatunativeint = Operators.Checked.unativeint 10.0 - Assert.AreEqual(floatunativeint,(unativeint)10) - - // boundary value - let boundunativeint = Operators.Checked.unativeint 65353.0 - Assert.AreEqual(boundunativeint, (unativeint)65353) - - // overflow exception - try - let overflowuint64 = Operators.Checked.uint64 System.UInt64.MaxValue+1UL - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") - () - - [] - member this.KeyValue() = - - let funcKeyValue x = match x with | Operators.KeyValue(a) -> a // string int let stringint = funcKeyValue ( new System.Collections.Generic.KeyValuePair("string",1)) - Assert.AreEqual(stringint,("string",1)) + Assert.AreEqual(("string",1), stringint) // float char let floatchar = funcKeyValue ( new System.Collections.Generic.KeyValuePair(1.0,'a')) - Assert.AreEqual(floatchar,(1.0,'a')) + Assert.AreEqual((1.0,'a'), floatchar) // null let nullresult = funcKeyValue ( new System.Collections.Generic.KeyValuePair(null,' ')) let (nullstring:string,blankchar:char) = nullresult CheckThrowsNullRefException(fun () -> nullstring.ToString() |> ignore) - - - () - + [] - member this.OptimizedRangesGetArraySlice() = + member _.OptimizedRangesGetArraySlice() = - let param1 = Some(1) let param2 = Some(2) // int let intslice = Operators.OperatorIntrinsics.GetArraySlice [|1;2;3;4;5;6|] param1 param2 - Assert.AreEqual(intslice,[|2;3|]) + Assert.AreEqual([|2;3|], intslice) // string let stringslice = Operators.OperatorIntrinsics.GetArraySlice [|"1";"2";"3"|] param1 param2 - Assert.AreEqual(stringslice,[|"2";"3"|]) + Assert.AreEqual([|"2";"3"|], stringslice) // null let stringslice = Operators.OperatorIntrinsics.GetArraySlice [|null;null;null|] param1 param2 - Assert.AreEqual(stringslice,[|null;null|]) - - () - + Assert.AreEqual([|null;null|], stringslice) + [] - member this.OptimizedRangesGetArraySlice2D() = + member _.OptimizedRangesGetArraySlice2D() = - let param1D1 = Some(0) let param1D2 = Some(1) let param2D1 = Some(0) @@ -366,36 +63,32 @@ type OperatorsModule1() = let intArray2D = Array2D.init 2 3 (fun i j -> i*100+j) let intslice = Operators.OperatorIntrinsics.GetArraySlice2D intArray2D param1D1 param1D2 param2D1 param2D2 - Assert.AreEqual(intslice.[1,1],101) + Assert.AreEqual(101, intslice.[1,1]) // string let stringArray2D = Array2D.init 2 3 (fun i j -> (i*100+j).ToString()) let stringslice = Operators.OperatorIntrinsics.GetArraySlice2D stringArray2D param1D1 param1D2 param2D1 param2D2 - Assert.AreEqual(stringslice.[1,1],(101).ToString()) + Assert.AreEqual((101).ToString(), stringslice.[1,1]) // null let nullArray2D = Array2D.init 2 3 (fun i j -> null) let nullslice = Operators.OperatorIntrinsics.GetArraySlice2D nullArray2D param1D1 param1D2 param2D1 param2D2 - Assert.AreEqual(nullslice.[1,1],null) - - () - + Assert.AreEqual(null, nullslice.[1,1]) + [] - member this.OptimizedRangesGetStringSlice() = + member _.OptimizedRangesGetStringSlice() = let param1 = Some(4) let param2 = Some(6) // string let stringslice = Operators.OperatorIntrinsics.GetStringSlice "abcdefg" param1 param2 - Assert.AreEqual(stringslice,"efg") + Assert.AreEqual("efg", stringslice) // null CheckThrowsNullRefException(fun () -> Operators.OperatorIntrinsics.GetStringSlice null param1 param2 |> ignore) - () - - + [] - member this.OptimizedRangesSetArraySlice() = + member _.OptimizedRangesSetArraySlice() = let param1 = Some(1) let param2 = Some(2) @@ -403,23 +96,22 @@ type OperatorsModule1() = let intArray1 = [|1;2;3|] let intArray2 = [|4;5;6|] Operators.OperatorIntrinsics.SetArraySlice intArray1 param1 param2 intArray2 - Assert.AreEqual(intArray1,[|1;4;5|]) + Assert.AreEqual([|1;4;5|], intArray1) // string let stringArray1 = [|"1";"2";"3"|] let stringArray2 = [|"4";"5";"6"|] Operators.OperatorIntrinsics.SetArraySlice stringArray1 param1 param2 stringArray2 - Assert.AreEqual(stringArray1,[|"1";"4";"5"|]) + Assert.AreEqual([|"1";"4";"5"|], stringArray1) // null let nullArray1 = [|null;null;null|] let nullArray2 = [|null;null;null|] Operators.OperatorIntrinsics.SetArraySlice nullArray1 param1 param2 nullArray2 CheckThrowsNullRefException(fun () -> nullArray1.[0].ToString() |> ignore) - () - + [] - member this.OptimizedRangesSetArraySlice2D() = + member _.OptimizedRangesSetArraySlice2D() = let param1D1 = Some(0) let param1D2 = Some(1) let param2D1 = Some(0) @@ -429,43 +121,40 @@ type OperatorsModule1() = let intArray1 = Array2D.init 2 3 (fun i j -> i*10+j) let intArray2 = Array2D.init 2 3 (fun i j -> i*100+j) Operators.OperatorIntrinsics.SetArraySlice2D intArray1 param1D1 param1D2 param2D1 param2D2 intArray2 - Assert.AreEqual(intArray1.[1,1],101) + Assert.AreEqual(101, intArray1.[1,1]) // string let stringArray2D1 = Array2D.init 2 3 (fun i j -> (i*10+j).ToString()) let stringArray2D2 = Array2D.init 2 3 (fun i j -> (i*100+j).ToString()) Operators.OperatorIntrinsics.SetArraySlice2D stringArray2D1 param1D1 param1D2 param2D1 param2D2 stringArray2D2 - Assert.AreEqual(stringArray2D1.[1,1],(101).ToString()) + Assert.AreEqual((101).ToString(), stringArray2D1.[1,1]) // null let nullArray2D1 = Array2D.init 2 3 (fun i j -> null) let nullArray2D2 = Array2D.init 2 3 (fun i j -> null) Operators.OperatorIntrinsics.SetArraySlice2D nullArray2D1 param1D1 param1D2 param2D1 param2D2 nullArray2D2 CheckThrowsNullRefException(fun () -> nullArray2D1.[0,0].ToString() |> ignore) - () - + [] - member this.OptimizedRangesSetArraySlice3D() = + member _.OptimizedRangesSetArraySlice3D() = let intArray1 = Array3D.init 2 3 4 (fun i j k -> i*10+j) let intArray2 = Array3D.init 2 3 4 (fun i j k -> i*100+j) Operators.OperatorIntrinsics.SetArraySlice3D intArray1 (Some 0) (Some 1) (Some 0) (Some 1) (Some 0) (Some 1) intArray2 - Assert.AreEqual(intArray1.[1,1,1],101) - () + Assert.AreEqual(101, intArray1.[1,1,1]) [] - member this.OptimizedRangesSetArraySlice4D() = + member _.OptimizedRangesSetArraySlice4D() = let intArray1 = Array4D.init 2 3 4 5 (fun i j k l -> i*10+j) let intArray2 = Array4D.init 2 3 4 5 (fun i j k l -> i*100+j) - Operators.OperatorIntrinsics.SetArraySlice4D intArray1 (Some 0) (Some 1) (Some 0) (Some 1) (Some 0) (Some 1) intArray2 - Assert.AreEqual(intArray1.[1,1,1,1],101) - () - + Operators.OperatorIntrinsics.SetArraySlice4D intArray1 (Some 0) (Some 1) (Some 0) (Some 1) (Some 0) (Some 1) (Some 0) (Some 1) intArray2 + Assert.AreEqual(101, intArray1.[1,1,1,1]) + [] - member this.Uncheckeddefaultof () = + member _.Uncheckeddefaultof () = // int let intdefault = Operators.Unchecked.defaultof - Assert.AreEqual(intdefault, 0) + Assert.AreEqual(0, intdefault) // string let stringdefault = Operators.Unchecked.defaultof @@ -473,433 +162,419 @@ type OperatorsModule1() = // null let structdefault = Operators.Unchecked.defaultof - Assert.AreEqual( structdefault.Day,1) - - () - + Assert.AreEqual(1, structdefault.Day) + [] - member this.abs () = + member _.abs () = // int let intabs = Operators.abs (-7) - Assert.AreEqual(intabs, 7) + Assert.AreEqual(7, intabs) - // float + // float let floatabs = Operators.abs (-100.0) - Assert.AreEqual(floatabs, 100.0) + Assert.AreEqual(100.0, floatabs) // decimal let decimalabs = Operators.abs (-1000M) - Assert.AreEqual(decimalabs, 1000M) - - () - + Assert.AreEqual(1000M, decimalabs) + [] - member this.acos () = + member _.acos () = // min value let minacos = Operators.acos (0.0) - Assert.AreEqual(minacos, 1.5707963267948966) + Assert.AreNearEqual(1.5707963267948966, minacos) // normal value let normalacos = Operators.acos (0.3) - Assert.AreEqual(normalacos, 1.2661036727794992) + Assert.AreNearEqual(1.2661036727794992, normalacos) // max value let maxacos = Operators.acos (1.0) - Assert.AreEqual(maxacos, 0.0) - () - + Assert.AreEqual(0.0, maxacos) + [] - member this.asin () = + member _.asin () = // min value let minasin = Operators.asin (0.0) - Assert.AreEqual(minasin, 0) + Assert.AreEqual(0.0, minasin) // normal value let normalasin = Operators.asin (0.5) - Assert.AreEqual(normalasin, 0.52359877559829893) + Assert.AreNearEqual(0.52359877559829893, normalasin) // max value let maxasin = Operators.asin (1.0) - Assert.AreEqual(maxasin, 1.5707963267948966) - () - - - + Assert.AreNearEqual(1.5707963267948966, maxasin) + [] - member this.atan () = + member _.atan () = // min value let minatan = Operators.atan (0.0) - Assert.AreEqual(minatan, 0) + Assert.AreNearEqual(0.0, minatan) // normal value let normalatan = Operators.atan (1.0) - Assert.AreEqual(normalatan, 0.78539816339744828) + Assert.AreNearEqual(0.78539816339744828, normalatan) // biggish value let maxatan = Operators.atan (infinity) - Assert.AreEqual(maxatan, 1.5707963267948966) - () - + Assert.AreNearEqual(1.5707963267948966, maxatan) + [] - member this.atan2 () = + member _.atan2 () = // min value let minatan2 = Operators.atan2 (0.0) (1.0) - Assert.AreEqual(minatan2, 0) + Assert.AreNearEqual(0.0, minatan2) // normal value let normalatan2 = Operators.atan2 (1.0) (1.0) - Assert.AreEqual(normalatan2, 0.78539816339744828) + Assert.AreNearEqual(0.78539816339744828, normalatan2) // biggish value let maxatan2 = Operators.atan2 (1.0) (0.0) - Assert.AreEqual(maxatan2, 1.5707963267948966) - () - + Assert.AreNearEqual(1.5707963267948966, maxatan2) + [] - member this.box () = + member _.box () = // int value let intbox = Operators.box 1 - Assert.AreEqual(intbox, 1) + Assert.AreEqual(1, intbox) // string value let stringlbox = Operators.box "string" - Assert.AreEqual(stringlbox, "string") + Assert.AreEqual("string", stringlbox) // null value let nullbox = Operators.box null CheckThrowsNullRefException(fun () -> nullbox.ToString() |> ignore) - () - + [] - member this.byte() = - // int type + member _.byte() = + // int type let intByte = Operators.byte 100 - Assert.AreEqual(intByte,(byte)100) + Assert.AreEqual(100uy, intByte) - // char type + // char type let charByte = Operators.byte '0' - Assert.AreEqual(charByte,(byte)48) + Assert.AreEqual(48uy, charByte) // boundary value let boundByte = Operators.byte 255.0 - Assert.AreEqual(boundByte, (byte)255) + Assert.AreEqual(255uy, boundByte) - // overflow exception - try - let overflowbyte = Operators.byte (System.Int64.MaxValue*(int64)2) - Assert.Fail("Expectt overflow exception but not.") - with - | :? System.OverflowException -> () - | _ -> Assert.Fail("Expectt overflow exception but not.") + // Overflow + let result = Operators.byte Int64.MaxValue + Assert.AreEqual(Byte.MaxValue, result) + + // Overflow + let result = Operators.byte Int64.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Double.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Double.MaxValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte (Int64.MaxValue * 8L) + Assert.AreEqual(248uy, result) // bit-complement + + // Overflow + let result = 255uy + 5uy + Assert.AreEqual(4uy, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.byte Decimal.MinValue |> ignore) [] - member this.ceil() = - // min value + member _.ceil() = + // min value let minceil = Operators.ceil 0.1 - Assert.AreEqual(minceil,1.0) + Assert.AreEqual(1.0, minceil) - // normal value + // normal value let normalceil = Operators.ceil 100.0 - Assert.AreEqual(normalceil,100.0) + Assert.AreEqual(100.0, normalceil) // max value let maxceil = Operators.ceil 1.7E+308 - Assert.AreEqual(maxceil, 1.7E+308) + Assert.AreEqual(1.7E+308, maxceil) [] - member this.char() = - // int type + member _.char() = + // int type let intchar = Operators.char 48 - Assert.AreEqual(intchar,'0') + Assert.AreEqual('0', intchar) - // string type + // string type let stringchar = Operators.char " " - Assert.AreEqual(stringchar, ' ') + Assert.AreEqual(' ', stringchar) [] - member this.compare() = - // int type + member _.compare() = + // int type let intcompare = Operators.compare 100 101 - Assert.AreEqual(intcompare,-1) + Assert.AreEqual(-1, intcompare) - // char type + // char type let charcompare = Operators.compare '0' '1' - Assert.AreEqual(charcompare,-1) + Assert.AreEqual(-1, charcompare) // null value let boundcompare = Operators.compare null null - Assert.AreEqual(boundcompare, 0) - - + Assert.AreEqual(0, boundcompare) + [] - member this.cos () = + member _.cos () = // min value let mincos = Operators.cos (0.0) - Assert.AreEqual(mincos, 1) + Assert.AreEqual(1.0, mincos) // normal value let normalcos = Operators.cos (1.0) - Assert.AreEqual(normalcos, 0.54030230586813977) + Assert.AreNearEqual(0.54030230586813977, normalcos) // biggish value let maxcos = Operators.cos (1.57) - Assert.AreEqual(maxcos, 0.00079632671073326335) - () - + Assert.AreNearEqual(0.00079632671073326335, maxcos) + [] - member this.cosh () = - + member _.cosh () = + // min value let mincosh = Operators.cosh (0.0) - Assert.AreEqual(mincosh, 1.0) + Assert.AreEqual(1.0, mincosh) // normal value let normalcosh = Operators.cosh (1.0) - Assert.AreEqual(normalcosh, 1.5430806348152437) + Assert.AreNearEqual(1.5430806348152437, normalcosh) // biggish value let maxcosh = Operators.cosh (1.57) - Assert.AreEqual(maxcosh, 2.5073466880660993) - - - () - - - + Assert.AreNearEqual(2.5073466880660993, maxcosh) + [] - member this.decimal () = + member _.decimal () = // int value let mindecimal = Operators.decimal (1) - Assert.AreEqual(mindecimal, 1) + Assert.AreEqual(1M, mindecimal) // float value let maxdecimal = Operators.decimal (1.0) - Assert.AreEqual(maxdecimal, 1) - () - + Assert.AreEqual(1M, maxdecimal) + [] - member this.decr() = - // zero + member _.decr() = + // zero let zeroref = ref 0 Operators.decr zeroref - Assert.AreEqual(zeroref,(ref -1)) + Assert.AreEqual((ref -1), zeroref) // big number let bigref = ref 32767 Operators.decr bigref - Assert.AreEqual(bigref,(ref 32766)) + Assert.AreEqual((ref 32766), bigref) // normal value let normalref = ref 100 Operators.decr (normalref) - Assert.AreEqual(normalref,(ref 99)) + Assert.AreEqual((ref 99), normalref) [] - member this.defaultArg() = - // zero + member _.defaultArg() = + // zero let zeroOption = Some(0) let intdefaultArg = Operators.defaultArg zeroOption 2 - Assert.AreEqual(intdefaultArg,0) + Assert.AreEqual(0, intdefaultArg) // big number let bigOption = Some(32767) let bigdefaultArg = Operators.defaultArg bigOption 32766 - Assert.AreEqual(bigdefaultArg,32767) + Assert.AreEqual(32767, bigdefaultArg) // normal value let normalOption = Some(100) let normalfaultArg = Operators.defaultArg normalOption 100 - Assert.AreEqual(normalfaultArg, 100) + Assert.AreEqual(100, normalfaultArg) [] - member this.double() = - // int type - let intdouble = Operators.double 100 - Assert.AreEqual(intdouble,100.0) + member _.double() = + // int type + let intdouble = Operators.float 100 + Assert.AreEqual(100.0, intdouble) - // char type - let chardouble = Operators.double '0' - Assert.AreEqual(chardouble,48) - () - + // char type + let chardouble = Operators.float '0' + Assert.AreEqual(48.0, chardouble) + [] - member this.enum() = - // zero + member _.enum() = + // zero let intarg : int32 = 0 let intenum = Operators.enum intarg - Assert.AreEqual(intenum,System.ConsoleColor.Black) + Assert.AreEqual(System.ConsoleColor.Black, intenum) // big number let bigarg : int32 = 15 let charenum = Operators.enum bigarg - Assert.AreEqual(charenum,System.ConsoleColor.White) + Assert.AreEqual(System.ConsoleColor.White, charenum) // normal value let normalarg : int32 = 9 let boundenum = Operators.enum normalarg - Assert.AreEqual(boundenum, System.ConsoleColor.Blue) + Assert.AreEqual(System.ConsoleColor.Blue, boundenum) #if IGNORED [] - member this.exit() = - // zero - try + member _.exit() = + // zero + try let intexit = Operators.exit 1 - () + with | _ -> () - //Assert.AreEqual(intexit,-1) + //Assert.AreEqual(-1, intexit) // big number let charexit = Operators.exit 32767 - //Assert.AreEqual(charexit,-1) + //Assert.AreEqual(-1, charexit) // normal value let boundexit = Operators.exit 100 - Assert.AreEqual(boundexit, 0) + Assert.AreEqual(0, boundexit) #endif [] - member this.exp() = - // zero + member _.exp() = + // zero let zeroexp = Operators.exp 0.0 - Assert.AreEqual(zeroexp,1.0) + Assert.AreEqual(1.0, zeroexp) // big number let bigexp = Operators.exp 32767.0 - Assert.AreEqual(bigexp,infinity) + Assert.AreEqual(infinity, bigexp) // normal value let normalexp = Operators.exp 100.0 - Assert.AreEqual(normalexp, 2.6881171418161356E+43) + Assert.AreEqual(2.6881171418161356E+43, normalexp) [] - member this.failwith() = - try + member _.failwith() = + try let _ = Operators.failwith "failwith" Assert.Fail("Expect fail but not.") - () + with | Failure("failwith") -> () |_ -> Assert.Fail("Throw unexpected exception") - - + [] - member this.float() = - // int type + member _.float() = + // int type let intfloat = Operators.float 100 - Assert.AreEqual(intfloat,(float)100) + Assert.AreEqual((float)100, intfloat) - // char type + // char type let charfloat = Operators.float '0' - Assert.AreEqual(charfloat,(float)48) - - () - - + Assert.AreEqual((float)48, charfloat) + [] - member this.float32() = - // int type + member _.float32() = + // int type let intfloat32 = Operators.float32 100 - Assert.AreEqual(intfloat32,(float32)100) + Assert.AreEqual((float32)100, intfloat32) - // char type + // char type let charfloat32 = Operators.float32 '0' - Assert.AreEqual(charfloat32,(float32)48) - - () - - + Assert.AreEqual((float32)48, charfloat32) + [] - member this.floor() = - // float type - let intfloor = Operators.floor 100.0 - Assert.AreEqual(intfloor,100) + member _.floor() = + // float type + let intfloor = Operators.floor 100.9 + Assert.AreEqual(100.0, intfloor) - // float32 type - let charfloor = Operators.floor ((float32)100.0) - Assert.AreEqual(charfloor,100) + // float32 type + let charfloor = Operators.floor ((float32)100.9) + Assert.AreEqual(100.0f, charfloor) [] - member this.fst() = - // int type + member _.fst() = + // int type let intfst = Operators.fst (100,101) - Assert.AreEqual(intfst,100) + Assert.AreEqual(100, intfst) - // char type + // char type let charfst = Operators.fst ('0','1') - Assert.AreEqual(charfst,'0') + Assert.AreEqual('0', charfst) // null value let boundfst = Operators.fst (null,null) - Assert.AreEqual(boundfst, null) + Assert.AreEqual(null, boundfst) [] - member this.hash() = - // int type + member _.hash() = + // int type (stable between JIT versions) let inthash = Operators.hash 100 - Assert.AreEqual(inthash,100) + Assert.AreEqual(100, inthash) - // char type + // char type (stable between JIT versions) let charhash = Operators.hash '0' - Assert.AreEqual(charhash,3145776) + Assert.AreEqual(3145776, charhash) - // string value - let boundhash = Operators.hash "A" - Assert.AreEqual(boundhash, -842352673) + // string value (test disabled, each JIT and each x86 vs x64 creates a different hash here) + //let boundhash = Operators.hash "A" + //Assert.AreEqual(-842352673, boundhash) [] - member this.id() = - // int type + member _.id() = + // int type let intid = Operators.id 100 - Assert.AreEqual(intid,100) + Assert.AreEqual(100, intid) - // char type + // char type let charid = Operators.id '0' - Assert.AreEqual(charid,'0') + Assert.AreEqual('0', charid) // string value let boundid = Operators.id "A" - Assert.AreEqual(boundid, "A") - - + Assert.AreEqual("A", boundid) + [] - member this.ignore() = - // value type + member _.ignore() = + // value type let result = Operators.ignore 10 - Assert.AreEqual(result,null) + Assert.AreEqual(null, result) // reference type let result = Operators.ignore "A" - Assert.AreEqual(result,null) - - () + Assert.AreEqual(null, result) -#if IGNORED - [] - member this.incr() = - // legit value + [] + member _.incr() = + // legit value let result = ref 10 Operators.incr result - Assert.AreEqual(!result,11) + Assert.AreEqual(11, !result) - // overflow + // Overflow. let result = ref (Operators.Checked.int System.Int32.MaxValue) - CheckThrowsOverflowException(fun() -> Operators.incr result |> ignore) - - () -#endif + Operators.incr result + Assert.AreEqual(System.Int32.MinValue, !result) [] - member this.infinity() = + member _.infinity() = let inf = Operators.infinity let result = inf > System.Double.MaxValue @@ -907,21 +582,18 @@ type OperatorsModule1() = // arithmetic operation let result = infinity + 3.0 - Assert.AreEqual(result,infinity) + Assert.AreEqual(Double.PositiveInfinity, result) let result = infinity - 3.0 - Assert.AreEqual(result,infinity) + Assert.AreEqual(Double.PositiveInfinity, result) let result = infinity * 3.0 - Assert.AreEqual(result,infinity) + Assert.AreEqual(Double.PositiveInfinity, result) let result = infinity / 3.0 - Assert.AreEqual(result,infinity) + Assert.AreEqual(Double.PositiveInfinity, result) let result = infinity / 3.0 - Assert.AreEqual(result,infinity) - - - () - + Assert.AreEqual(Double.PositiveInfinity, result) + [] - member this.infinityf() = + member _.infinityf() = let inf = Operators.infinityf let result = inf > System.Single.MaxValue @@ -929,16 +601,12 @@ type OperatorsModule1() = // arithmetic operation let result = infinityf + 3.0f - Assert.AreEqual(result,infinity) + Assert.AreEqual(Single.PositiveInfinity, result) let result = infinityf - 3.0f - Assert.AreEqual(result,infinity) + Assert.AreEqual(Single.PositiveInfinity, result) let result = infinityf * 3.0f - Assert.AreEqual(result,infinity) + Assert.AreEqual(Single.PositiveInfinity, result) let result = infinityf / 3.0f - Assert.AreEqual(result,infinity) + Assert.AreEqual(Single.PositiveInfinity, result) let result = infinityf / 3.0f - Assert.AreEqual(result,infinityf) - - () - - \ No newline at end of file + Assert.AreEqual(Single.PositiveInfinity, result) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs index 8ac0ebfd9c6..da874ebe118 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs @@ -3,138 +3,194 @@ // Various tests for the: // Microsoft.FSharp.Core.Operators module -namespace SystematicUnitTests.FSharp_Core.Microsoft_FSharp_Core +namespace FSharp.Core.UnitTests.Operators open System -open SystematicUnitTests.LibraryTestFx +open FSharp.Core.UnitTests.LibraryTestFx open NUnit.Framework -open Microsoft.FSharp.Core.Operators.Checked [] type OperatorsModule2() = -#if IGNORED - [] - member this.int() = - // int + [] + member _.int() = + // int let result = Operators.int 10 - Assert.AreEqual(result,10) + Assert.AreEqual(10, result) // string let result = Operators.int "10" - Assert.AreEqual(result,10) + Assert.AreEqual(10, result) // double let result = Operators.int 10.0 - Assert.AreEqual(result,10) + Assert.AreEqual(10, result) // negative let result = Operators.int -10 - Assert.AreEqual(result,-10) + Assert.AreEqual(-10, result) // zero let result = Operators.int 0 - Assert.AreEqual(result,0) + Assert.AreEqual(0, result) - // overflow - CheckThrowsOverflowException(fun() -> Operators.int System.Double.MaxValue |>ignore) + // Overflow + let result = Operators.int Double.MaxValue + Assert.AreEqual(Int32.MinValue, result) - () -#endif + // Overflow + let result = Operators.int Double.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Int64.MaxValue + Assert.AreEqual(-1, result) + + // Overflow + let result = Operators.int Int64.MinValue + Assert.AreEqual(0, result) + + // Overflow + let result = Int32.MaxValue + 1 + Assert.AreEqual(Int32.MinValue, result) -#if IGNORED - [] - member this.int16() = - // int + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.int Decimal.MinValue |> ignore) + + [] + member _.int16() = + // int let result = Operators.int16 10 - Assert.AreEqual(result,10) + Assert.AreEqual(10s, result) // double let result = Operators.int16 10.0 - Assert.AreEqual(result,10) + Assert.AreEqual(10s, result) // negative let result = Operators.int16 -10 - Assert.AreEqual(result,-10) + Assert.AreEqual(-10s, result) // zero let result = Operators.int16 0 - Assert.AreEqual(result,0) + Assert.AreEqual(0s, result) // string let result = Operators.int16 "10" - Assert.AreEqual(result,10) + Assert.AreEqual(10s, result) - // overflow - CheckThrowsOverflowException(fun() -> Operators.int16 System.Double.MaxValue |>ignore) - () -#endif - -#if IGNORED - [] - member this.int32() = - // int + // Overflow + let result = Operators.int16 Double.MaxValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Double.MinValue + Assert.AreEqual(0s, result) + + let result = Operators.int16 Int64.MaxValue + Assert.AreEqual(-1s, result) + + // Overflow + let result = Operators.int16 Int64.MinValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Int16.MaxValue + 1s + Assert.AreEqual(Int16.MinValue, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.int16 Decimal.MinValue |> ignore) + + [] + member _.int32() = + // int let result = Operators.int32 10 - Assert.AreEqual(result,10) + Assert.AreEqual(10, result) // double let result = Operators.int32 10.0 - Assert.AreEqual(result,10) + Assert.AreEqual(10, result) // negative let result = Operators.int32 -10 - Assert.AreEqual(result,-10) + Assert.AreEqual(-10, result) // zero let result = Operators.int32 0 - Assert.AreEqual(result,0) + Assert.AreEqual(0, result) // string let result = Operators.int32 "10" - Assert.AreEqual(result,10) + Assert.AreEqual(10, result) - // overflow - CheckThrowsOverflowException(fun() -> Operators.int32 System.Double.MaxValue |>ignore) - () -#endif - -#if IGNORED - [] - member this.int64() = - // int + // Overflow + let result = Operators.int32 Double.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Double.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Int64.MaxValue + Assert.AreEqual(-1, result) + + // Overflow + let result = Operators.int32 Int64.MinValue + Assert.AreEqual(0, result) + + // Overflow + let result = Int32.MaxValue + 5 + Assert.AreEqual(Int32.MinValue + 4, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.int32 Decimal.MinValue |> ignore) + + [] + member _.int64() = + // int let result = Operators.int64 10 - Assert.AreEqual(result,10) + Assert.AreEqual(10L, result) // double let result = Operators.int64 10.0 - Assert.AreEqual(result,10) + Assert.AreEqual(10L, result) // negative let result = Operators.int64 -10 - Assert.AreEqual(result,-10) + Assert.AreEqual(-10L, result) // zero let result = Operators.int64 0 - Assert.AreEqual(result,0) + Assert.AreEqual(0L, result) // string let result = Operators.int64 "10" - Assert.AreEqual(result,10) + Assert.AreEqual(10L, result) - // overflow - CheckThrowsOverflowException(fun() -> Operators.int64 System.Double.MaxValue |>ignore) - () -#endif + // Overflow. + let result = Operators.int64 Double.MaxValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 Double.MinValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 UInt64.MaxValue + Assert.AreEqual(-1L, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.int64 Decimal.MinValue |> ignore) + + [] + member _.invalidArg() = + CheckThrowsArgumentException(fun() -> Operators.invalidArg "A" "B" |>ignore ) -// [] -// member this.invalidArg() = -// CheckThrowsArgumentException(fun() -> Operators.invalidArg "A" "B" |>ignore ) -// -// () [] - member this.lock() = - // lock + member _.lock() = + // lock printfn "test8 started" let syncRoot = System.Object() let k = ref 0 @@ -142,542 +198,753 @@ type OperatorsModule2() = System.Threading.Thread.Sleep(1) !k ) } let arr = Async.RunSynchronously (Async.Parallel(Seq.map comp [1..50])) - Assert.AreEqual((Array.sort compare arr; arr), [|1..50|]) + Assert.AreEqual([|1..50|], Array.sort arr) // without lock let syncRoot = System.Object() let k = ref 0 let comp _ = async { do incr k - do! System.Threading.Thread.AsyncSleep(10) + do! Async.Sleep (10) return !k } let arr = Async.RunSynchronously (Async.Parallel(Seq.map comp [1..100])) - Assert.AreNotEqual ((Array.sort compare arr; arr) , [|1..100|]) - - () + Assert.AreNotEqual ([|1..100|], Array.sort arr) [] - member this.log() = + member _.log() = // double let result = Operators.log 10.0 - Assert.AreEqual(result.ToString(),"2.30258509299405") + Assert.AreEqual(2.3025850929940459, result) // negative let result = Operators.log -10.0 - Assert.AreEqual(result.ToString(),System.Double.NaN.ToString()) + Assert.AreEqual(Double.NaN, result) // zero let result = Operators.log 0.0 - Assert.AreEqual(result,-infinity) - - () + Assert.AreEqual(Double.NegativeInfinity , result) [] - member this.log10() = + member _.log10() = // double let result = Operators.log10 10.0 - Assert.AreEqual(result,1) + Assert.AreEqual(1.0, result) // negative let result = Operators.log10 -10.0 - Assert.AreEqual(result.ToString(),System.Double.NaN.ToString()) + Assert.AreEqual(System.Double.NaN, result) // zero let result = Operators.log10 0.0 - Assert.AreEqual(result,-infinity) - - () + Assert.AreEqual(Double.NegativeInfinity, result) [] - member this.max() = + member _.max() = // value type let result = Operators.max 10 8 - Assert.AreEqual(result,10) + Assert.AreEqual(10, result) // negative let result = Operators.max -10.0 -8.0 - Assert.AreEqual(result,-8.0) + Assert.AreEqual(-8.0, result) // zero let result = Operators.max 0 0 - Assert.AreEqual(result,0) + Assert.AreEqual(0, result) // reference type let result = Operators.max "A" "ABC" - Assert.AreEqual(result,"ABC") - - // overflow - CheckThrowsOverflowException(fun() -> Operators.max 10 System.Int32.MaxValue+1 |>ignore) - - () + Assert.AreEqual("ABC", result) [] - member this.min() = + member _.min() = // value type let result = Operators.min 10 8 - Assert.AreEqual(result,8) + Assert.AreEqual(8, result) // negative let result = Operators.min -10.0 -8.0 - Assert.AreEqual(result,-10.0) + Assert.AreEqual(-10.0, result) // zero let result = Operators.min 0 0 - Assert.AreEqual(result,0) + Assert.AreEqual(0, result) // reference type let result = Operators.min "A" "ABC" - Assert.AreEqual(result,"A") - - // overflow - CheckThrowsOverflowException(fun() -> Operators.min 10 System.Int32.MinValue - 1 |>ignore) - - () + Assert.AreEqual("A", result) [] - member this.nan() = + member _.nan() = // value type - let result = Operators.nan - Assert.AreEqual(result.ToString(),System.Double.NaN.ToString()) - - () + let result = Operators.nan + Assert.AreEqual(System.Double.NaN, nan) [] - member this.nanf() = + member _.nanf() = // value type - let result = Operators.nanf - Assert.AreEqual(result,System.Single.NaN) + let result = Operators.nanf + Assert.AreEqual(System.Single.NaN, result) - () - -#if IGNORED - [] - member this.nativeint() = - // int + [] + member _.nativeint() = + // int let result = Operators.nativeint 10 - Assert.AreEqual(result,10n) + Assert.AreEqual(10n, result) // double let result = Operators.nativeint 10.0 - Assert.AreEqual(result,10n) + Assert.AreEqual(10n, result) // int64 let result = Operators.nativeint 10L - Assert.AreEqual(result,10n) + Assert.AreEqual(10n, result) // negative let result = Operators.nativeint -10 - Assert.AreEqual(result,-10n) + Assert.AreEqual(-10n, result) // zero let result = Operators.nativeint 0 - Assert.AreEqual(result,0n) - - // overflow - CheckThrowsOverflowException(fun() -> Operators.nativeint System.Double.MaxValue |>ignore) - - () -#endif + Assert.AreEqual(0n, result) + + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.nativeint Double.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Int64.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + if Info.isX86Runtime then + let result = nativeint Int32.MaxValue + 5n + Assert.AreEqual(-2147483644n, result) + else + let result = nativeint Int64.MaxValue + 5n + Assert.AreEqual(-9223372036854775804n, result) + + + // Overflow (depends on pointer size) + let result = Operators.nativeint System.Double.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot express this as a literal, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual("-9223372036854775808", string result) + + let result = Operators.nativeint System.Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot express this as a literal, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual("-9223372036854775808", string result) [] - member this.not() = + member _.not() = let result = Operators.not true Assert.IsFalse(result) let result = Operators.not false - Assert.IsTrue(result) - - () + Assert.IsTrue(result) -// [] -// member this.nullArg() = -// CheckThrowsArgumentNullException(fun() -> Operators.nullArg "A" |> ignore) -// -// () + [] + member _.nullArg() = + CheckThrowsArgumentNullException(fun() -> Operators.nullArg "A" |> ignore) + [] - member this.pown() = - // int + member _.pown() = + // int let result = Operators.pown 10 2 - Assert.AreEqual(result,100) + Assert.AreEqual(100, result) // double let result = Operators.pown 10.0 2 - Assert.AreEqual(result,100) + Assert.AreEqual(100.0, result) // int64 let result = Operators.pown 10L 2 - Assert.AreEqual(result,100) + Assert.AreEqual(100L, result) // decimal let result = Operators.pown 10M 2 - Assert.AreEqual(result,100) + Assert.AreEqual(100M, result) // negative let result = Operators.pown -10 2 - Assert.AreEqual(result,100) + Assert.AreEqual(100, result) // zero let result = Operators.pown 0 2 - Assert.AreEqual(result,0) + Assert.AreEqual(0, result) // overflow let result = Operators.pown System.Double.MaxValue System.Int32.MaxValue - Assert.AreEqual(result,infinity) + Assert.AreEqual(Double.PositiveInfinity, result) CheckThrowsOverflowException(fun() -> Operators.pown System.Int32.MaxValue System.Int32.MaxValue |>ignore) - () - [] - member this.raise() = + member _.raise() = CheckThrowsArgumentException(fun()-> Operators.raise <| new ArgumentException("Invalid Argument ") |> ignore) - - () [] - member this.ref() = + member _.ref() = // value type - let result = Operators.ref 0 - let funInt (x:int) = - result := !result + x - () - Array.iter funInt [|1..10|] + let result = Operators.ref 0 + let funInt (x:int) = + result := !result + x + () + Array.iter funInt [|1..10|] Assert.AreEqual(!result,55) // reference type let result = Operators.ref "" let funStr (x : string) = - result := (!result) + x + result := (!result) + x () Array.iter funStr [|"A";"B";"C";"D"|] Assert.AreEqual(!result,"ABCD") - () - [] - member this.reraise() = - // double + member _.reraise() = + // nothing to reraise should not trigger exception try () with | _ -> Operators.reraise() - () - [] - member this.round() = + member _.round() = // double let result = Operators.round 10.0 - Assert.AreEqual(result,10) + Assert.AreEqual(10.0, result) + + // double + let result = Operators.round 0.6640367702678489 + Assert.AreEqual(1.0, result) + + // double + let result = Operators.round 0.6640367702678489e4 + Assert.AreEqual(6640.0, result) + + // double, show half-to-even + let result = Operators.round 0.6640500000e4 + Assert.AreEqual(6640.0, result) + + // double, show half-to-even + let result = Operators.round 0.6639500000e4 + Assert.AreEqual(6640.0, result) + + // double, show half-to-even + let result = Operators.round 0.6641500000e4 + Assert.AreEqual(6642.0, result) + + // double, show rounding up if anything follows '5' + let result = Operators.round 0.66405000001e4 + Assert.AreEqual(6641.0, result) // decimal let result = Operators.round 10M - Assert.AreEqual(result,10) + Assert.AreEqual(10M, result) + + // decimal, show half-to-even + let result = Operators.round 1233.5M + Assert.AreEqual(1234M, result) + + // decimal, show half-to-even + let result = Operators.round 1234.5M + Assert.AreEqual(1234M, result) + + // decimal, show half-to-even + let result = Operators.round 1235.5M + Assert.AreEqual(1236M, result) + + // decimal, show rounding up if anything follows '5' + let result = Operators.round 1234.500000000001M + Assert.AreEqual(1235M, result) + + // decimal, round up + let result = Operators.round 1234.6M + Assert.AreEqual(1235M, result) - () - [] - member this.sbyte() = - // int + member _.sbyte() = + // int let result = Operators.sbyte 10 - Assert.AreEqual(result,10) + Assert.AreEqual(10y, result) // double let result = Operators.sbyte 10.0 - Assert.AreEqual(result,10) + Assert.AreEqual(10y, result) // negative let result = Operators.sbyte -10 - Assert.AreEqual(result,-10) + Assert.AreEqual(-10y, result) // zero let result = Operators.sbyte 0 - Assert.AreEqual(result,0) + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Int64.MaxValue + Assert.AreEqual(-1y, result) + + // Overflow + let result = Operators.sbyte Int64.MinValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Double.MinValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Double.MaxValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte (Int64.MaxValue * 8L) + Assert.AreEqual(-8y, result) // bit-complement + + // Overflow + let result = 127y + 1y + Assert.AreEqual(-128y, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.sbyte Decimal.MinValue |> ignore) - () - [] - member this.sign() = - // int + member _.sign() = + // int let result = Operators.sign 10 - Assert.AreEqual(result,1) + Assert.AreEqual(1, result) + // negative int + let result = Operators.sign -10 + Assert.AreEqual(-1, result) + + // zero int + let result = Operators.sign 0 + Assert.AreEqual(0, result) + // double let result = Operators.sign 10.0 - Assert.AreEqual(result,1) + Assert.AreEqual(1, result) - // negative - let result = Operators.sign -10 - Assert.AreEqual(result,-1) + // double max + let result = Operators.sign Double.MaxValue + Assert.AreEqual(1, result) - // zero - let result = Operators.sign 0 - Assert.AreEqual(result,0) + // double min + let result = Operators.sign Double.MinValue + Assert.AreEqual(-1, result) + + // double epsilon positive + let result = Operators.sign Double.Epsilon + Assert.AreEqual(1, result) + + // double epsilon negative + let result = Operators.sign (-Double.Epsilon) + Assert.AreEqual(-1, result) + + // double inf + let result = Operators.sign Double.PositiveInfinity + Assert.AreEqual(1, result) + + // double -inf + let result = Operators.sign Double.NegativeInfinity + Assert.AreEqual(-1, result) + + // float32 + let result = Operators.sign 10.0f + Assert.AreEqual(1, result) + + // float32 max + let result = Operators.sign Single.MaxValue + Assert.AreEqual(1, result) + + // float32 min + let result = Operators.sign Single.MinValue + Assert.AreEqual(-1, result) + + // float32 epsilon positive + let result = Operators.sign Single.Epsilon + Assert.AreEqual(1, result) + + // float32 epsilon negative + let result = Operators.sign (-Single.Epsilon) + Assert.AreEqual(-1, result) + + // float32 inf + let result = Operators.sign Single.PositiveInfinity + Assert.AreEqual(1, result) + + // float32 -inf + let result = Operators.sign Single.NegativeInfinity + Assert.AreEqual(-1, result) + + // double nan + CheckThrowsArithmeticException(fun () -> Operators.sign Double.NaN |> ignore) + + // float32 nan + CheckThrowsArithmeticException(fun () -> Operators.sign Single.NaN |> ignore) - () - [] - member this.sin() = + member _.sin() = let result = Operators.sin 0.5 - Assert.AreEqual(result.ToString(),"0.479425538604203") + Assert.AreNearEqual(0.479425538604203, result) + + let result = Operators.sin Double.NaN + Assert.AreEqual(Double.NaN, result) + + let result = Operators.sin Double.PositiveInfinity + Assert.AreEqual(Double.NaN, result) + + let result = Operators.sin Double.NegativeInfinity + Assert.AreEqual(Double.NaN, result) - () - [] - member this.single() = - // int - let result = Operators.single 10 - Assert.AreEqual(result,10) + member _.single() = + // int + let result = Operators.float32 10 + Assert.AreEqual(10f, result) // double - let result = Operators.single 10.0 - Assert.AreEqual(result,10) + let result = Operators.float32 10.0 + Assert.AreEqual(10f, result) // string - let result = Operators.single "10" - Assert.AreEqual(result,10) - - () - + let result = Operators.float32 "10" + Assert.AreEqual(10f, result) + [] - member this.sinh() = + member _.sinh() = let result = Operators.sinh 1.0 - Assert.AreEqual(result.ToString(),"1.1752011936438") + Assert.AreNearEqual(1.1752011936438014, result) - () - + let result = Operators.sinh 0.0 + Assert.AreNearEqual(0.0, result) + + let result = Operators.sinh Double.PositiveInfinity + Assert.AreNearEqual(Double.PositiveInfinity, result) + + let result = Operators.sinh Double.NegativeInfinity + Assert.AreNearEqual(Double.NegativeInfinity, result) + + let result = Operators.sinh Double.NaN + Assert.AreNearEqual(Double.NaN, result) + [] - member this.sizeof() = - // value type + member _.sizeof() = + // value type let result = Operators.sizeof - Assert.AreEqual(result,4) + Assert.AreEqual(4, result) - // System.Int64 + // System.Int64 let result = Operators.sizeof - Assert.AreEqual(result,8) + Assert.AreEqual(8, result) - // reference type + // reference type should have the same size as the IntPtr let result = Operators.sizeof - Assert.AreEqual(result,4) + Assert.AreEqual(IntPtr.Size, result) - // null + // null should have the same size as the IntPtr let result = Operators.sizeof - Assert.AreEqual(result,4) + Assert.AreEqual(IntPtr.Size, result) - () - [] - member this.snd() = - // value type + member _.snd() = + // value type let result = Operators.snd ("ABC",100) - Assert.AreEqual(result,100) + Assert.AreEqual(100, result) - // reference type + // reference type let result = Operators.snd (100,"ABC") - Assert.AreEqual(result,"ABC") + Assert.AreEqual("ABC", result) - // null + // null let result = Operators.snd (100,null) - Assert.AreEqual(result,null) + Assert.AreEqual(null, result) - () - [] - member this.sqrt() = - // double + member _.sqrt() = + // double let result = Operators.sqrt 100.0 - Assert.AreEqual(result,10) + Assert.AreEqual(10.0, result) + + let result = Operators.sqrt -2.0 + Assert.AreEqual(Double.NaN, result) - () - [] - member this.stderr() = - let result = Operators.stderr - Assert.AreEqual(result.WriteLine("go"),null) + member _.stderr() = + let result = Operators.stderr + Assert.AreEqual(null, result.WriteLine("go")) - () - [] - member this.stdin() = - let result = Operators.stdin - Assert.AreEqual(result.Dispose(),null) + member _.stdin() = + let result = Operators.stdin + Assert.AreEqual(null, result.Dispose()) - () - [] - member this.stdout() = - let result = Operators.stdout - Assert.AreEqual(result.WriteLine("go"),null) + member _.stdout() = + let result = Operators.stdout + Assert.AreEqual(null, result.WriteLine("go")) - () - [] - member this.string() = + member _.string() = // value type let result = Operators.string 100 - Assert.AreEqual(result,"100") + Assert.AreEqual("100", result) // reference type let result = Operators.string "ABC" - Assert.AreEqual(result,"ABC") + Assert.AreEqual("ABC", result) - // unit - CheckThrowsNullRefException(fun () -> Operators.string null |>ignore) - - () - [] - member this.tan() = + member _.tan() = // double let result = Operators.tan 1.0 - Assert.AreEqual(result.ToString(),"1.5574077246549") + Assert.AreNearEqual(1.5574077246549023, result) - () - [] - member this.tanh() = - // double + member _.tanh() = + // The x86 runtime uses 64 bit precision, whereas the x64 runtime uses SSE instructions with 80 bit precision + // details can be found here: https://github.com/dotnet/fsharp/issues/9522 let result = Operators.tanh 0.8 - Assert.AreEqual(result,0.664036770267849) + Assert.AreNearEqual(0.66403677026784902, result) + + let result = Operators.tanh 19.06154 + Assert.AreNearEqual(1.0, result) // can be 0.99999999999999989 + + let result = tanh 0.0 + Assert.AreEqual(0.0, result) + + let result = tanh infinity + Assert.AreEqual(1.0, result) + + let result = tanh -infinity + Assert.AreEqual(-1.0, result) - () - [] - member this.truncate() = + member _.truncate() = // double let result = Operators.truncate 10.101 - Assert.AreEqual(result,10) + Assert.AreEqual(10.0, result) // decimal let result = Operators.truncate 10.101M - Assert.AreEqual(result,10M) + Assert.AreEqual(10M, result) // zero let result = Operators.truncate 0.101 - Assert.AreEqual(result,0) + Assert.AreEqual(0.0, result) - () - [] - member this.typedefof() = + member _.typedefof() = // value type let result = Operators.typedefof - Assert.AreEqual(result.FullName,"System.Int32") + Assert.AreEqual("System.Int32", result.FullName) // reference type let result = Operators.typedefof - Assert.AreEqual(result.FullName,"System.String") + Assert.AreEqual("System.String", result.FullName) // unit let result = Operators.typedefof - Assert.AreEqual(result.FullName,"Microsoft.FSharp.Core.Unit") + Assert.AreEqual("Microsoft.FSharp.Core.Unit", result.FullName) - () - [] - member this.typeof() = + member _.typeof() = // value type let result = Operators.typeof - Assert.AreEqual(result.FullName,"System.Int32") + Assert.AreEqual("System.Int32", result.FullName) // reference type let result = Operators.typeof - Assert.AreEqual(result.FullName,"System.String") + Assert.AreEqual("System.String", result.FullName) // unit let result = Operators.typeof - Assert.AreEqual(result.FullName,"Microsoft.FSharp.Core.Unit") + Assert.AreEqual("Microsoft.FSharp.Core.Unit", result.FullName) - () - [] - member this.uint16() = - // int + member _.uint16() = + // int let result = Operators.uint16 100 - Assert.AreEqual(result,100us) + Assert.AreEqual(100us, result) // double let result = Operators.uint16 (100.0:double) - Assert.AreEqual(result,100us) + Assert.AreEqual(100us, result) // decimal let result = Operators.uint16 100M - Assert.AreEqual(result,100us) + Assert.AreEqual(100us, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.uint16 Decimal.MinValue |> ignore) - () - [] - member this.uint32() = + member _.uint32() = // int let result = Operators.uint32 100 - Assert.AreEqual(result,100ul) + Assert.AreEqual(100u, result) // double let result = Operators.uint32 (100.0:double) - Assert.AreEqual(result,100ul) + Assert.AreEqual(100u, result) // decimal let result = Operators.uint32 100M - Assert.AreEqual(result,100ul) + Assert.AreEqual(100u, result) - () - + // Overflow + let result = Operators.uint32 Double.MaxValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Double.MinValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Int64.MaxValue + Assert.AreEqual(UInt32.MaxValue, result) + + // Overflow + let result = Operators.uint32 Int64.MinValue + Assert.AreEqual(0u, result) + + // Overflow + let result = UInt32.MaxValue + 5u + Assert.AreEqual(4u, result) + + // both 'u' and 'ul' are valid numeric suffixes for UInt32 + let result = 42u + 42ul + Assert.AreEqual(84u, result) + Assert.AreEqual(84ul, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.uint32 Decimal.MinValue |> ignore) + [] - member this.uint64() = + member _.uint64() = // int let result = Operators.uint64 100 - Assert.AreEqual(result,100UL) + Assert.AreEqual(100UL, result) // double - let result = Operators.uint64 (100.0:double) - Assert.AreEqual(result,100UL) + let result = Operators.uint64 100.0 + Assert.AreEqual(100UL, result) // decimal let result = Operators.uint64 100M - Assert.AreEqual(result,100UL) - - () - + Assert.AreEqual(100UL, result) + + // Overflow + let result = Operators.uint64 Double.MaxValue + Assert.AreEqual(0UL, result) + + // Overflow + let result = Operators.uint64 Double.MinValue + Assert.AreEqual(9223372036854775808UL, result) // surprising, but true, 2^63 + 1 + + // Overflow + let result = Operators.uint64 Int64.MinValue + Assert.AreEqual(9223372036854775808UL, result) + + // Overflow + let result = Operators.uint64 SByte.MinValue + Assert.AreEqual(UInt64.MaxValue - 127UL, result) + + // Overflow + let result = UInt64.MaxValue + 5UL + Assert.AreEqual(4UL, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun() -> Operators.uint64 Decimal.MinValue |> ignore) + [] - member this.unativeint() = + member _.unativeint() = // int let result = Operators.unativeint 100 - Assert.AreEqual(result,100un) + let x: unativeint = 12un + Assert.AreEqual(100un, result) // double - let result = Operators.unativeint (100.0:double) - Assert.AreEqual(result,100un) - - () - + let result = Operators.unativeint 100.0 + Assert.AreEqual(100un, result) + + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.unativeint Double.MaxValue + Assert.AreEqual(0un, result) + + // Overflow (depends on pointer size) + let result = Operators.unativeint Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) // surprising, but true, 2^63 + 1 + + // Overflow (depends on pointer size) + let result = Operators.unativeint Int64.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) + + // Overflow (depends on pointer size) + let result = 0un - 1un + if Info.isX86Runtime then + Assert.AreEqual(4294967295un, result) + else + Assert.AreEqual(18446744073709551615un, result) + [] - member this.unbox() = + member _.unbox() = // value type let oint = box 100 let result = Operators.unbox oint - Assert.AreEqual(result,100) + Assert.AreEqual(100, result) // reference type let ostr = box "ABC" let result = Operators.unbox ostr - Assert.AreEqual(result,"ABC") + Assert.AreEqual("ABC", result) - // null + // null let onull = box null let result = Operators.unbox onull - Assert.AreEqual(result,null) - - () - + Assert.AreEqual(null, result) + + // None == null + let onone = box None + let result = Operators.unbox onone + Assert.AreEqual(None, result) + Assert.AreEqual(null, result) + [] - member this.using() = + member _.using() = let sr = new System.IO.StringReader("ABCD") Assert.AreEqual(sr.ReadToEnd(),"ABCD") - let result = Operators.using sr (fun x -> x.ToString()) + let _ = Operators.using sr (fun x -> x.ToString()) CheckThrowsObjectDisposedException(fun () -> sr.ReadToEnd() |> ignore) - - () \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs new file mode 100644 index 00000000000..12e33a6b69a --- /dev/null +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// Various tests for the Checked module + +namespace FSharp.Core.UnitTests.Operators + +open System +open FSharp.Core.UnitTests.LibraryTestFx +open NUnit.Framework +open Microsoft.FSharp.Core.Operators.Checked + +[] +type OperatorsModuleChecked() = + + [] + member _.Checkedbyte() = + // int type + let intByte = Operators.Checked.byte 100 + Assert.AreEqual(100uy, intByte) + + // char type + let charByte = Operators.Checked.byte '0' + Assert.AreEqual(48uy, charByte) + + // boundary value + let boundByte = Operators.Checked.byte 255.0 + Assert.AreEqual(255uy, boundByte) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> 255uy + 1uy |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> 0uy - 1uy |> ignore) + + [] + member _.Checkedchar() = + + // number + let numberChar = Operators.Checked.char 48 + Assert.AreEqual('0', numberChar) + + // letter + let letterChar = Operators.Checked.char 65 + Assert.AreEqual('A', letterChar) + + // boundary value + let boundchar = Operators.Checked.char 126 + Assert.AreEqual('~', boundchar) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.char (int64 Char.MaxValue + 1L) |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> '\uFFFF' + '\u0001' |> ignore) + + + [] + member _.CheckedInt() = + + // char + let charInt = Operators.Checked.int '0' + Assert.AreEqual(48, charInt) + + // float + let floatInt = Operators.Checked.int 10.0 + Assert.AreEqual(10, floatInt) + + // boundary value + let boundInt = Operators.Checked.int 32767.0 + Assert.AreEqual(32767, boundInt) + + // overflow exception + CheckThrowsOverflowException(fun() -> Operators.Checked.int 2147483648.0 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MinValue - 1 |> ignore) + + [] + member _.CheckedInt16() = + + // char + let charInt16 = Operators.Checked.int16 '0' + Assert.AreEqual(48s, charInt16) + + // float + let floatInt16 = Operators.Checked.int16 10.0 + Assert.AreEqual(10s, floatInt16) + + // boundary value + let boundInt16 = Operators.Checked.int16 32767.0 + Assert.AreEqual(32767s, boundInt16) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 32768.0 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int16.MaxValue + 1s |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int16.MinValue - 1s |> ignore) + + [] + member _.CheckedInt32() = + + // char + let charInt32 = Operators.Checked.int32 '0' + Assert.AreEqual(48, charInt32) + + // float + let floatInt32 = Operators.Checked.int32 10.0 + Assert.AreEqual(10, floatInt32) + + // boundary value + let boundInt32 = Operators.Checked.int32 2147483647.0 + Assert.AreEqual(2147483647, boundInt32) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 2147483648.0 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MinValue - 1 |> ignore) + + [] + member _.CheckedInt64() = + + // char + let charInt64 = Operators.Checked.int64 '0' + Assert.AreEqual(48L, charInt64) + + // float + let floatInt64 = Operators.Checked.int64 10.0 + Assert.AreEqual(10L, floatInt64) + + // boundary value + let boundInt64 = Operators.Checked.int64 9223372036854775807I + let _ = 9223372036854775807L + Assert.AreEqual(9223372036854775807L, boundInt64) + + // boundary value + let boundInt64 = Operators.Checked.int64 -9223372036854775808I + let _ = -9223372036854775808L + Assert.AreEqual(-9223372036854775808L, boundInt64) + + // overflow exception + CheckThrowsOverflowException(fun() -> Operators.Checked.int64 (float Int64.MaxValue + 1.0) |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int64.MaxValue + 1L |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int64.MinValue - 1L |> ignore) + + [] + member _.CheckedNativeint() = + + // char + let charnativeint = Operators.Checked.nativeint '0' + Assert.AreEqual(48n, charnativeint) + + // float + let floatnativeint = Operators.Checked.nativeint 10.0 + Assert.AreEqual(10n, floatnativeint) + + // boundary value + let boundnativeint = Operators.Checked.nativeint 32767.0 + Assert.AreEqual(32767n, boundnativeint) + + // overflow exception (depends on pointer size) + CheckThrowsOverflowException(fun() -> + if Info.isX86Runtime then + Operators.Checked.nativeint 2147483648.0 |> ignore + else + Operators.Checked.nativeint 9223372036854775808.0 |> ignore) + + + [] + member _.Checkedsbyte() = + + // char + let charsbyte = Operators.Checked.sbyte '0' + Assert.AreEqual(48y, charsbyte) + + // float + let floatsbyte = Operators.Checked.sbyte -10.0 + Assert.AreEqual(-10y, floatsbyte) + + // boundary value + let boundsbyte = Operators.Checked.sbyte -127.0 + Assert.AreEqual(-127y, boundsbyte) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte -256 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> SByte.MaxValue + 1y |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> SByte.MinValue - 1y |> ignore) + + [] + member _.Checkeduint16() = + + // char + let charuint16 = Operators.Checked.uint16 '0' + Assert.AreEqual(48us, charuint16) + + // float + let floatuint16 = Operators.Checked.uint16 10.0 + Assert.AreEqual(10us, floatuint16) + + // boundary value + let bounduint16 = Operators.Checked.uint16 65535.0 + Assert.AreEqual(65535us, bounduint16) + + CheckThrowsOverflowException(fun() -> Operators.Checked.uint16 65536.0 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt16.MaxValue + 1us |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt16.MinValue - 1us |> ignore) + + [] + member _.Checkeduint32() = + + // char + let charuint32 = Operators.Checked.uint32 '0' + Assert.AreEqual(48u, charuint32) + + // float + let floatuint32 = Operators.Checked.uint32 10.0 + Assert.AreEqual(10u, floatuint32) + + // boundary value + let bounduint32 = Operators.Checked.uint32 429496729.0 + Assert.AreEqual(429496729u, bounduint32) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32(float UInt32.MaxValue + 1.0) |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt32.MaxValue + 1u |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt32.MinValue - 1u |> ignore) + + [] + member _.Checkeduint64() = + + // char + let charuint64 = Operators.Checked.uint64 '0' + Assert.AreEqual(48UL, charuint64) + + // float + let floatuint64 = Operators.Checked.uint64 10.0 + Assert.AreEqual(10UL, floatuint64) + + // boundary value + let bounduint64 = Operators.Checked.uint64 429496729.0 + Assert.AreEqual(429496729UL, bounduint64) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 (float System.UInt64.MaxValue + 1.0) |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt64.MaxValue + 1UL |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt64.MinValue - 1UL |> ignore) + + [] + member _.Checkedunativeint() = + + // char + let charunativeint = Operators.Checked.unativeint '0' + Assert.AreEqual(48un, charunativeint) + + // float + let floatunativeint = Operators.Checked.unativeint 10.0 + Assert.AreEqual(10un, floatunativeint) + + // boundary value (dependent on pointer size) + if Info.isX86Runtime then + let boundunativeint = Operators.Checked.unativeint 4294967295.0 + Assert.AreEqual(4294967295un, boundunativeint) + else + let boundnativeint = Operators.Checked.unativeint 1.84467440737095505E+19 // 64 bit max value cannot be expressed exactly as double + Assert.AreEqual(18446744073709549568un, boundnativeint) + + // overflow exception (depends on pointer size) + CheckThrowsOverflowException(fun () -> + if Info.isX86Runtime then + Operators.Checked.unativeint (float UInt32.MaxValue + 1.0) |> ignore + else + Operators.Checked.unativeint (float UInt64.MaxValue + 1.0) |> ignore + ) + + diff --git a/tests/FSharp.Core.UnitTests/LibraryTestFx.fs b/tests/FSharp.Core.UnitTests/LibraryTestFx.fs index f17daba432e..48c12638010 100644 --- a/tests/FSharp.Core.UnitTests/LibraryTestFx.fs +++ b/tests/FSharp.Core.UnitTests/LibraryTestFx.fs @@ -37,6 +37,7 @@ let private CheckThrowsExn2<'a when 'a :> exn> s (f : unit -> unit) = // attribute to flag these exception's usage as a bug. let CheckThrowsNullRefException f = CheckThrowsExn f let CheckThrowsIndexOutRangException f = CheckThrowsExn f +let CheckThrowsObjectDisposedException f = CheckThrowsExn f // Legit exceptions let CheckThrowsNotSupportedException f = CheckThrowsExn f @@ -49,6 +50,7 @@ let CheckThrowsDivideByZeroException f = CheckThrowsExn let CheckThrowsOverflowException f = CheckThrowsExn f let CheckThrowsInvalidOperationExn f = CheckThrowsExn f let CheckThrowsFormatException f = CheckThrowsExn f +let CheckThrowsArithmeticException f = CheckThrowsExn f // Verifies two sequences are equal (same length, equiv elements) let VerifySeqsEqual (seq1 : seq<'T>) (seq2 : seq<'T>) = diff --git a/tests/FSharp.Core.UnitTests/NUnitFrameworkShims.fs b/tests/FSharp.Core.UnitTests/NUnitFrameworkShims.fs index 8b0eec34fed..b91a8bc88e8 100644 --- a/tests/FSharp.Core.UnitTests/NUnitFrameworkShims.fs +++ b/tests/FSharp.Core.UnitTests/NUnitFrameworkShims.fs @@ -5,6 +5,8 @@ namespace NUnit.Framework open System open System.Collections.Generic open System.Linq +open System.Runtime.InteropServices + #if XUNIT open Xunit @@ -39,7 +41,27 @@ type IgnoreAttribute (_comment:string) = // Alias NUnit and XUnit Assert as LocalAssert type TestFrameworkAssert = Assert -exception AssertionException of string +module Info = + /// Use this to distinguish cases where output is deterministically different between x86 runtime or x64 runtime, + /// for instance w.r.t. floating point arithmetic. For more info, see https://github.com/dotnet/roslyn/issues/7333 + let isX86Runtime = sizeof = 4 + + /// Use this to distinguish cases where output is deterministically different between x86 runtime or x64 runtime, + /// for instance w.r.t. floating point arithmetic. For more info, see https://github.com/dotnet/roslyn/issues/7333 + let isX64Runtime = sizeof = 8 + + let framework = RuntimeInformation.FrameworkDescription + + /// Whether a test is run inside a .NET Core Runtime + let isNetCore = framework.StartsWith(".NET Core") + + /// Whether a test is run using a .NET Framework Runtime + let isNetFramework = framework.StartsWith(".NET Framework") + + /// Whether a test is run after being compiled to .NET Native + let isNetNative = framework.StartsWith(".NET Native") + + module private Impl = open FsCheck.Arb @@ -86,10 +108,28 @@ module private Impl = | _ -> Object.Equals(expected, actual) + /// Special treatment of float and float32 to get a somewhat meaningful error message + /// (otherwise, the missing precision leads to different values that are close together looking the same) + let floatStr (flt1: obj) (flt2: obj) = + match flt1, flt2 with + | :? float as flt1, (:? float as flt2) -> + flt1.ToString("R"), flt2.ToString("R") + + | :? float32 as flt1, (:? float32 as flt2) -> + flt1.ToString("R"), flt2.ToString("R") + + | _ -> flt1.ToString(), flt2.ToString() + + type Assert = + static member AreEqual(expected : obj, actual : obj, message : string) = + if not (Impl.equals expected actual) then - let message = sprintf "%s: Expected %A but got %A" message expected actual + let message = + let (exp, act) = Impl.floatStr expected actual + sprintf "%s: Expected %s but got %s" message exp act + AssertionException message |> raise static member AreNotEqual(expected : obj, actual : obj, message : string) = @@ -99,6 +139,17 @@ type Assert = static member AreEqual(expected : obj, actual : obj) = Assert.AreEqual(expected, actual, "Assertion") + /// Use this to compare floats within a delta of 1e-15, useful for discrepancies + /// between 80-bit (dotnet, RyuJIT) and 64-bit (x86, Legacy JIT) floating point calculations + static member AreNearEqual(expected: float, actual: float) = + let delta = 1.0e-15 + let message = + let ((e, a)) = Impl.floatStr expected actual + sprintf "Are near equal: expected %s, but got %s (with delta: %f)" e a delta + + global.NUnit.Framework.Assert.AreEqual(expected, actual, 1.0, message) + Assert.AreEqual(Math.Round(expected, 15), Math.Round(actual, 15), message) + static member AreNotEqual(expected : obj, actual : obj) = Assert.AreNotEqual(expected, actual, "Assertion") static member IsNull(o : obj) = Assert.AreEqual(null, o) From f2fe11760c028e0d026979ad1a317b76b7f54b23 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Wed, 24 Jun 2020 01:52:02 +0200 Subject: [PATCH 02/12] Add tests that cover the changes for fixing FS0670 --- .../FSharp.Core/OperatorsModule2.fs | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs index da874ebe118..9fba8e9bbc1 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs @@ -8,6 +8,19 @@ namespace FSharp.Core.UnitTests.Operators open System open FSharp.Core.UnitTests.LibraryTestFx open NUnit.Framework +open System.Globalization +open System.Threading + +/// If this type compiles without error it is correct +/// Wrong if you see: FS0670 This code is not sufficiently generic. The type variable ^T could not be generalized because it would escape its scope. +type TestFs0670Error<'T> = + | TestFs0670Error of 'T + override this.ToString() = + match this with + | TestFs0670Error x -> + // This used to raise FS0670 because the type is generic, and 'string' was inline + // See: https://github.com/dotnet/fsharp/issues/7958 + Operators.string x [] type OperatorsModule2() = @@ -718,6 +731,53 @@ type OperatorsModule2() = // reference type let result = Operators.string "ABC" Assert.AreEqual("ABC", result) + + // reference type without a `ToString()` overload + let result = Operators.string (obj()) + Assert.AreEqual("System.Object", result) + + let result = Operators.string 1un + Assert.AreEqual("1", result) + + let result = Operators.string (obj()) + Assert.AreEqual("System.Object", result) + + let result = Operators.string 123.456M + Assert.AreEqual("123.456", result) + + // Following tests ensure that InvariantCulture is used if type implements IFormattable + + // safe current culture, then switch culture + let currentCI = Thread.CurrentThread.CurrentCulture + Thread.CurrentThread.CurrentCulture <- CultureInfo.GetCultureInfo("de-DE") + + // make sure the culture switch happened, and verify + let wrongResult = 123.456M.ToString() + Assert.AreEqual("123,456", wrongResult) + + // test that culture has no influence on decimals with `string` + let correctResult = Operators.string 123.456M + Assert.AreEqual("123.456", correctResult) + + // make sure that the German culture is indeed selected for DateTime + let dttm = DateTime(2020, 6, 23) + let wrongResult = dttm.ToString() + Assert.AreEqual("23.06.2020 00:00:00", wrongResult) + + // test that culture has no influence on DateTime types when used with `string` + let correctResult = Operators.string dttm + Assert.AreEqual("06/23/2020 00:00:00", correctResult) + + // reset the culture + Thread.CurrentThread.CurrentCulture <- currentCI + + [] + member _.``string: don't raise FS0670 anymore``() = + // The type used here, when compiled, should not raise this error: + // "FS0670 This code is not sufficiently generic. The type variable ^T could not be generalized because it would escape its scope." + // See: https://github.com/dotnet/fsharp/issues/7958 + let result = TestFs0670Error 32uy |> Operators.string + Assert.AreEqual("32", result) [] member _.tan() = From a291564d5fc028062a390b6ffde2ae93bf220454 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Wed, 24 Jun 2020 01:52:49 +0200 Subject: [PATCH 03/12] Un-inline `string` to allow used in generic overrides and types --- src/fsharp/FSharp.Core/prim-types.fs | 24 ++++++------------------ src/fsharp/FSharp.Core/prim-types.fsi | 6 +++--- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index d0d608f1190..ad52213e37d 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -781,8 +781,8 @@ namespace Microsoft.FSharp.Core let inline anyToString nullStr x = match box x with - | null -> nullStr | :? System.IFormattable as f -> f.ToString(null,System.Globalization.CultureInfo.InvariantCulture) + | null -> nullStr | obj -> obj.ToString() let anyToStringShowingNull x = anyToString "null" x @@ -4457,23 +4457,11 @@ namespace Microsoft.FSharp.Core when ^T : ^T = (^T : (static member op_Explicit: ^T -> nativeint) (value)) [] - let inline string (value: ^T) = - anyToString "" value - // since we have static optimization conditionals for ints below, we need to special-case Enums. - // This way we'll print their symbolic value, as opposed to their integral one (Eg., "A", rather than "1") - when ^T struct = anyToString "" value - when ^T : float = (# "" value : float #).ToString("g",CultureInfo.InvariantCulture) - when ^T : float32 = (# "" value : float32 #).ToString("g",CultureInfo.InvariantCulture) - when ^T : int64 = (# "" value : int64 #).ToString("g",CultureInfo.InvariantCulture) - when ^T : int32 = (# "" value : int32 #).ToString("g",CultureInfo.InvariantCulture) - when ^T : int16 = (# "" value : int16 #).ToString("g",CultureInfo.InvariantCulture) - when ^T : nativeint = (# "" value : nativeint #).ToString() - when ^T : sbyte = (# "" value : sbyte #).ToString("g",CultureInfo.InvariantCulture) - when ^T : uint64 = (# "" value : uint64 #).ToString("g",CultureInfo.InvariantCulture) - when ^T : uint32 = (# "" value : uint32 #).ToString("g",CultureInfo.InvariantCulture) - when ^T : int16 = (# "" value : int16 #).ToString("g",CultureInfo.InvariantCulture) - when ^T : unativeint = (# "" value : unativeint #).ToString() - when ^T : byte = (# "" value : byte #).ToString("g",CultureInfo.InvariantCulture) + let string (value: 'T) = + match box value with + | :? System.IFormattable as f -> f.ToString(null,System.Globalization.CultureInfo.InvariantCulture) + | null -> "" + | obj -> obj.ToString() [] [] diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 3c35192188e..45c57a544af 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -2824,12 +2824,12 @@ namespace Microsoft.FSharp.Core /// Converts the argument to a string using ToString. /// - /// For standard integer and floating point values the ToString conversion - /// uses CultureInfo.InvariantCulture. + /// For standard integer and floating point values the and any type that implements IFormattable + /// ToString conversion uses CultureInfo.InvariantCulture. /// The input value. /// The converted string. [] - val inline string : value:^T -> string + val string : value:'T -> string /// Converts the argument to System.Decimal using a direct conversion for all /// primitive numeric types. For strings, the input is converted using UInt64.Parse() From cbe9123dd159b95c74322397de78f01914e26ba3 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Wed, 24 Jun 2020 20:18:16 +0200 Subject: [PATCH 04/12] Fix 3x C# default impl tests by removing dep. on FSharp.Core.dll --- .../Compiler/Language/DefaultInterfaceMemberTests.fs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs index fbd968178f1..86995d8d39a 100644 --- a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs +++ b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs @@ -813,7 +813,7 @@ type Test () = member __.M(_x: int) = Console.Write("InTest") member __.M<'Item> (x: int, y: 'Item) = - Console.Write(string x) + Console.Write(x.ToString()) Console.Write(y.ToString ()) member __.M<'TTT> (x: 'TTT) = @@ -821,7 +821,7 @@ type Test () = member __.M (x: int, text: string) = Console.Write("ABC") - Console.Write(string x) + Console.Write(x.ToString()) Console.Write(text) member __.M<'U> (_x: 'U, _y: int) = () @@ -1166,7 +1166,8 @@ type Test () = let main _ = let x = Test () :> I1 let y = Test () :> I2 - Console.Write(string (x + y)) + let result = x + y + Console.Write(result.ToString()) 0 """ @@ -4229,7 +4230,7 @@ type Test () = member __.M(_x: int) = Console.Write("InTest") member __.M<'Item> (x: int, y: 'Item) = - Console.Write(string x) + Console.Write(x.ToString()) Console.Write(y.ToString ()) member __.M<'TTT> (x: 'TTT) = @@ -4237,7 +4238,7 @@ type Test () = member __.M (x: int, text: string) = Console.Write("ABC") - Console.Write(string x) + Console.Write(x.ToString()) Console.Write(text) type Test2 () = From fcb21dd8152abe81383cab3a2aec9873310ec8ca Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Sun, 28 Jun 2020 17:15:18 +0200 Subject: [PATCH 05/12] Implement new 'string' ideas from RFC-1089 --- src/fsharp/FSharp.Core/prim-types.fs | 54 ++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index ad52213e37d..3c8e21372a0 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -781,9 +781,9 @@ namespace Microsoft.FSharp.Core let inline anyToString nullStr x = match box x with - | :? System.IFormattable as f -> f.ToString(null,System.Globalization.CultureInfo.InvariantCulture) + | :? System.IFormattable as f -> f.ToString(null, CultureInfo.InvariantCulture) | null -> nullStr - | obj -> obj.ToString() + | _ -> x.ToString() let anyToStringShowingNull x = anyToString "null" x @@ -3746,6 +3746,8 @@ namespace Microsoft.FSharp.Core open System.Diagnostics open System.Collections.Generic open System.Globalization + open System.Text + open System.Numerics open Microsoft.FSharp.Core open Microsoft.FSharp.Core.LanguagePrimitives open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators @@ -4458,10 +4460,50 @@ namespace Microsoft.FSharp.Core [] let string (value: 'T) = - match box value with - | :? System.IFormattable as f -> f.ToString(null,System.Globalization.CultureInfo.InvariantCulture) - | null -> "" - | obj -> obj.ToString() + anyToString "" value + when 'T : string = (# "" value : string #) // force no-op + + // Using 'let x = (# ... #) in x.ToString()' leads to better IL, without it, an extra stloc and ldloca.s (get address-of) + // gets emitted, which are unnecessary. With it, the extra address-of-variable is not created + when 'T : float = let x = (# "" value : float #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : float32 = let x = (# "" value : float32 #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : decimal = let x = (# "" value : decimal #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : BigInteger = let x = (# "" value : BigInteger #) in x.ToString(null, CultureInfo.InvariantCulture) + + // no IFormattable + when 'T : char = let x = (# "" value : char #) in x.ToString() + when 'T : bool = let x = (# "" value : bool #) in x.ToString() + + // For the int-types: + // It is not possible to distinguish statically between Enum and (any type of) int. + // This way we'll print their symbolic value, as opposed to their integral one + // E.g.: 'string ConsoleKey.Backspace' gives "Backspace", rather than "8") + when 'T : sbyte = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) + when 'T : byte = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) + when 'T : int16 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) + when 'T : uint16 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) + when 'T : int32 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) + when 'T : uint32 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) + when 'T : int64 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) + when 'T : uint64 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) + + // native ints cannot be used for enums, and do not implement IFormattable + when 'T : nativeint = (# "" value : nativeint #).ToString() + when 'T : unativeint = (# "" value : unativeint #).ToString() + + // other common mscorlib System struct types + when 'T : DateTime = let x = (# "" value : DateTime #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : DateTimeOffset = let x = (# "" value : DateTimeOffset #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : TimeSpan = let x = (# "" value : TimeSpan #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : Guid = let x = (# "" value : Guid #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T struct = + match box value with + | :? System.IFormattable as f -> f.ToString(null, CultureInfo.InvariantCulture) + | _ -> value.ToString() + + // other commmon mscorlib reference types + when 'T : StringBuilder = let x = (# "" value : StringBuilder #) in x.ToString() + [] [] From 94ca2bb4360a7892e189f8f2c23c9e480cd6931f Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Mon, 29 Jun 2020 19:24:13 +0200 Subject: [PATCH 06/12] Some housekeeping, adding IFormattable to the list --- src/fsharp/FSharp.Core/prim-types.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 3c8e21372a0..c3da18a74e9 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -781,7 +781,7 @@ namespace Microsoft.FSharp.Core let inline anyToString nullStr x = match box x with - | :? System.IFormattable as f -> f.ToString(null, CultureInfo.InvariantCulture) + | :? IFormattable as f -> f.ToString(null, CultureInfo.InvariantCulture) | null -> nullStr | _ -> x.ToString() @@ -4469,7 +4469,7 @@ namespace Microsoft.FSharp.Core when 'T : float32 = let x = (# "" value : float32 #) in x.ToString(null, CultureInfo.InvariantCulture) when 'T : decimal = let x = (# "" value : decimal #) in x.ToString(null, CultureInfo.InvariantCulture) when 'T : BigInteger = let x = (# "" value : BigInteger #) in x.ToString(null, CultureInfo.InvariantCulture) - + // no IFormattable when 'T : char = let x = (# "" value : char #) in x.ToString() when 'T : bool = let x = (# "" value : bool #) in x.ToString() @@ -4498,12 +4498,12 @@ namespace Microsoft.FSharp.Core when 'T : Guid = let x = (# "" value : Guid #) in x.ToString(null, CultureInfo.InvariantCulture) when 'T struct = match box value with - | :? System.IFormattable as f -> f.ToString(null, CultureInfo.InvariantCulture) + | :? IFormattable as f -> f.ToString(null, CultureInfo.InvariantCulture) | _ -> value.ToString() // other commmon mscorlib reference types when 'T : StringBuilder = let x = (# "" value : StringBuilder #) in x.ToString() - + when 'T : IFormattable = let x = (# "" value : IFormattable #) in x.ToString(null, CultureInfo.InvariantCulture) [] [] From 25c5f81edca50f054b9a3625a53dfee3e07db7ac Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Tue, 30 Jun 2020 17:39:00 +0200 Subject: [PATCH 07/12] Further optimizations for unsigned ints and (u)nativeint --- src/fsharp/FSharp.Core/prim-types.fs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index c3da18a74e9..10634ef7362 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -4465,31 +4465,33 @@ namespace Microsoft.FSharp.Core // Using 'let x = (# ... #) in x.ToString()' leads to better IL, without it, an extra stloc and ldloca.s (get address-of) // gets emitted, which are unnecessary. With it, the extra address-of-variable is not created - when 'T : float = let x = (# "" value : float #) in x.ToString(null, CultureInfo.InvariantCulture) - when 'T : float32 = let x = (# "" value : float32 #) in x.ToString(null, CultureInfo.InvariantCulture) - when 'T : decimal = let x = (# "" value : decimal #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : float = let x = (# "" value : float #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : float32 = let x = (# "" value : float32 #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : decimal = let x = (# "" value : decimal #) in x.ToString(null, CultureInfo.InvariantCulture) when 'T : BigInteger = let x = (# "" value : BigInteger #) in x.ToString(null, CultureInfo.InvariantCulture) // no IFormattable - when 'T : char = let x = (# "" value : char #) in x.ToString() - when 'T : bool = let x = (# "" value : bool #) in x.ToString() + when 'T : char = let x = (# "" value : char #) in x.ToString() + when 'T : bool = let x = (# "" value : bool #) in x.ToString() + when 'T : nativeint = let x = (# "" value : nativeint #) in x.ToString() + when 'T : unativeint = let x = (# "" value : unativeint #) in x.ToString() // For the int-types: // It is not possible to distinguish statically between Enum and (any type of) int. // This way we'll print their symbolic value, as opposed to their integral one // E.g.: 'string ConsoleKey.Backspace' gives "Backspace", rather than "8") when 'T : sbyte = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) - when 'T : byte = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) when 'T : int16 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) - when 'T : uint16 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) when 'T : int32 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) - when 'T : uint32 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) when 'T : int64 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) - when 'T : uint64 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) - // native ints cannot be used for enums, and do not implement IFormattable - when 'T : nativeint = (# "" value : nativeint #).ToString() - when 'T : unativeint = (# "" value : unativeint #).ToString() + // unsigned integral types have equal behavior with ToString() vs IFormattable::ToString + // this allows us to issue the 'constrained' opcode with 'callvirt' + when 'T : byte = let x = (# "" value : 'T #) in x.ToString() + when 'T : uint16 = let x = (# "" value : 'T #) in x.ToString() + when 'T : uint32 = let x = (# "" value : 'T #) in x.ToString() + when 'T : uint64 = let x = (# "" value : 'T #) in x.ToString() + // other common mscorlib System struct types when 'T : DateTime = let x = (# "" value : DateTime #) in x.ToString(null, CultureInfo.InvariantCulture) From 2532eb6905502bc512d1874190faf215f1a7415a Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Thu, 2 Jul 2020 15:34:54 +0200 Subject: [PATCH 08/12] Adding back 'inline' but not SRTP --- src/fsharp/FSharp.Core/prim-types.fs | 2 +- src/fsharp/FSharp.Core/prim-types.fsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 10634ef7362..d4711912ab5 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -4459,7 +4459,7 @@ namespace Microsoft.FSharp.Core when ^T : ^T = (^T : (static member op_Explicit: ^T -> nativeint) (value)) [] - let string (value: 'T) = + let inline string (value: 'T) = anyToString "" value when 'T : string = (# "" value : string #) // force no-op diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 45c57a544af..2dd1632cd15 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -2829,7 +2829,7 @@ namespace Microsoft.FSharp.Core /// The input value. /// The converted string. [] - val string : value:'T -> string + val inline string : value:'T -> string /// Converts the argument to System.Decimal using a direct conversion for all /// primitive numeric types. For strings, the input is converted using UInt64.Parse() From 960a60e6d957406946b8e0c6f0a70f0178e195a6 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Fri, 3 Jul 2020 13:34:20 +0200 Subject: [PATCH 09/12] Ignore NCrunch temp files and local user files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index b43741116dc..cd115a43aaa 100644 --- a/.gitignore +++ b/.gitignore @@ -133,3 +133,7 @@ msbuild.binlog /tests/fsharp/regression/5531/compilation.output.test.txt /tests/fsharp/core/fsfromfsviacs/compilation.langversion.old.output.txt /tests/fsharp/core/fsfromfsviacs/compilation.errors.output.txt +*ncrunch*.user +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* From a64a6c57a4da258639ba5fb6c50e2e501520fc1a Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Fri, 3 Jul 2020 13:34:56 +0200 Subject: [PATCH 10/12] Fix string of enum-of-char --- src/fsharp/FSharp.Core/prim-types.fs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index d4711912ab5..50887a459d0 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -4471,21 +4471,21 @@ namespace Microsoft.FSharp.Core when 'T : BigInteger = let x = (# "" value : BigInteger #) in x.ToString(null, CultureInfo.InvariantCulture) // no IFormattable - when 'T : char = let x = (# "" value : char #) in x.ToString() + when 'T : char = let x = (# "" value : 'T #) in x.ToString() // use 'T, because char can be an enum when 'T : bool = let x = (# "" value : bool #) in x.ToString() when 'T : nativeint = let x = (# "" value : nativeint #) in x.ToString() when 'T : unativeint = let x = (# "" value : unativeint #) in x.ToString() - // For the int-types: - // It is not possible to distinguish statically between Enum and (any type of) int. - // This way we'll print their symbolic value, as opposed to their integral one - // E.g.: 'string ConsoleKey.Backspace' gives "Backspace", rather than "8") + // Integral types can be enum: + // It is not possible to distinguish statically between Enum and (any type of) int. For signed types we have + // to use IFormattable::ToString, as the minus sign can be overridden. Using boxing we'll print their symbolic + // value if it's an enum, e.g.: 'ConsoleKey.Backspace' gives "Backspace", rather than "8") when 'T : sbyte = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) when 'T : int16 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) when 'T : int32 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) when 'T : int64 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) - // unsigned integral types have equal behavior with ToString() vs IFormattable::ToString + // unsigned integral types have equal behavior with 'T::ToString() vs IFormattable::ToString // this allows us to issue the 'constrained' opcode with 'callvirt' when 'T : byte = let x = (# "" value : 'T #) in x.ToString() when 'T : uint16 = let x = (# "" value : 'T #) in x.ToString() From 489ab64563ccf243a5814ba1f9acb286208761a3 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Sun, 5 Jul 2020 12:11:22 +0200 Subject: [PATCH 11/12] Fix tests in ExprTests.fs --- tests/service/ExprTests.fs | 96 +++++++------------------------------- 1 file changed, 16 insertions(+), 80 deletions(-) diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index c18232ba7dc..fce0af17745 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -1132,11 +1132,7 @@ let ``Test Operator Declarations for Byte`` () = "let testByteToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; "let testByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,43--54,53)"; "let testByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; -#if DEBUG - @"let testByteToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,43--56,52)"; -#else - "let testByteToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,43--56,52)"; -#endif + "let testByteToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.byte = e1 in copyOfStruct.ToString() @ (56,43--56,52)" ] testOperators "Byte" "byte" excludedTests expectedUnoptimized expectedOptimized @@ -1247,11 +1243,7 @@ let ``Test Operator Declarations for SByte`` () = "let testSByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; "let testSByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; "let testSByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; -#if DEBUG - @"let testSByteToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; -#else - "let testSByteToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; -#endif + "let testSByteToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" ] testOperators "SByte" "sbyte" excludedTests expectedUnoptimized expectedOptimized @@ -1361,11 +1353,7 @@ let ``Test Operator Declarations for Int16`` () = "let testInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; "let testInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; "let testInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; -#if DEBUG - @"let testInt16ToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; -#else - "let testInt16ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; -#endif + "let testInt16ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" ] testOperators "Int16" "int16" excludedTests expectedUnoptimized expectedOptimized @@ -1474,11 +1462,7 @@ let ``Test Operator Declarations for UInt16`` () = "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; "let testUInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; "let testUInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; -#if DEBUG - @"let testUInt16ToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)" -#else - "let testUInt16ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; -#endif + "let testUInt16ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint16 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" ] testOperators "UInt16" "uint16" excludedTests expectedUnoptimized expectedOptimized @@ -1588,11 +1572,7 @@ let ``Test Operator Declarations for Int`` () = "let testIntToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,41--53,49)"; "let testIntToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,41--54,51)"; "let testIntToCharOperator(e1) = Operators.ToChar (e1) @ (55,41--55,48)"; -#if DEBUG - @"let testIntToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,41--56,50)" -#else - "let testIntToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,41--56,50)"; -#endif + "let testIntToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,41--56,50)" ] testOperators "Int" "int" excludedTests expectedUnoptimized expectedOptimized @@ -1702,11 +1682,7 @@ let ``Test Operator Declarations for Int32`` () = "let testInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; "let testInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; "let testInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; -#if DEBUG - @"let testInt32ToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)" -#else - "let testInt32ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; -#endif + "let testInt32ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" ] testOperators "Int32" "int32" excludedTests expectedUnoptimized expectedOptimized @@ -1815,11 +1791,7 @@ let ``Test Operator Declarations for UInt32`` () = "let testUInt32ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; "let testUInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; "let testUInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; -#if DEBUG - @"let testUInt32ToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)" -#else - "let testUInt32ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; -#endif + "let testUInt32ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint32 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" ] testOperators "UInt32" "uint32" excludedTests expectedUnoptimized expectedOptimized @@ -1929,11 +1901,7 @@ let ``Test Operator Declarations for Int64`` () = "let testInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; "let testInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; "let testInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; -#if DEBUG - @"let testInt64ToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)" -#else - "let testInt64ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; -#endif + "let testInt64ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" ] testOperators "Int64" "int64" excludedTests expectedUnoptimized expectedOptimized @@ -2042,11 +2010,7 @@ let ``Test Operator Declarations for UInt64`` () = "let testUInt64ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; "let testUInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; "let testUInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; -#if DEBUG - @"let testUInt64ToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)" -#else - "let testUInt64ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; -#endif + "let testUInt64ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint64 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" ] testOperators "UInt64" "uint64" excludedTests expectedUnoptimized expectedOptimized @@ -2156,11 +2120,7 @@ let ``Test Operator Declarations for IntPtr`` () = "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,50--53,58)"; "let testIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToInt64 (e1)) @ (54,50--54,60)"; "let testIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,50--55,57)"; -#if DEBUG - @"let testIntPtrToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,50--56,59)" -#else - "let testIntPtrToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,50--56,59)"; -#endif + "let testIntPtrToStringOperator(e1) = e1.ToString() @ (56,50--56,59)" ] testOperators "IntPtr" "nativeint" excludedTests expectedUnoptimized expectedOptimized @@ -2269,11 +2229,7 @@ let ``Test Operator Declarations for UIntPtr`` () = "let testUIntPtrToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,52--53,60)"; "let testUIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToUInt64 (e1)) @ (54,52--54,62)"; "let testUIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,52--55,59)"; -#if DEBUG - @"let testUIntPtrToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,52--56,61)" -#else - "let testUIntPtrToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,52--56,61)"; -#endif + "let testUIntPtrToStringOperator(e1) = e1.ToString() @ (56,52--56,61)" ] testOperators "UIntPtr" "unativeint" excludedTests expectedUnoptimized expectedOptimized @@ -2379,11 +2335,7 @@ let ``Test Operator Declarations for Single`` () = "let testSingleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,48--53,56)"; "let testSingleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,48--54,58)"; "let testSingleToCharOperator(e1) = Operators.ToChar (e1) @ (55,48--55,55)"; -#if DEBUG - @"let testSingleToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,48--56,57)" -#else - "let testSingleToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,48--56,57)"; -#endif + "let testSingleToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,48--56,57)" ] testOperators "Single" "float32" excludedTests expectedUnoptimized expectedOptimized @@ -2489,11 +2441,7 @@ let ``Test Operator Declarations for Double`` () = "let testDoubleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,46--53,54)"; "let testDoubleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,46--54,56)"; "let testDoubleToCharOperator(e1) = Operators.ToChar (e1) @ (55,46--55,53)"; -#if DEBUG - @"let testDoubleToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,46--56,55)" -#else - "let testDoubleToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,46--56,55)"; -#endif + "let testDoubleToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,46--56,55)" ] testOperators "Double" "float" excludedTests expectedUnoptimized expectedOptimized @@ -2591,11 +2539,7 @@ let ``Test Operator Declarations for Decimal`` () = "let testDecimalToDoubleOperator(e1) = Convert.ToDouble (e1) @ (53,49--53,57)"; "let testDecimalToDecimalOperator(e1) = e1 @ (54,57--54,59)"; "let testDecimalToCharOperator(e1) = Decimal.op_Explicit (e1) @ (55,49--55,56)"; -#if DEBUG - @"let testDecimalToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,49--56,58)" -#else - "let testDecimalToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,49--56,58)"; -#endif + "let testDecimalToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,49--56,58)" ] testOperators "Decimal" "decimal" excludedTests expectedUnoptimized expectedOptimized @@ -2692,11 +2636,7 @@ let ``Test Operator Declarations for Char`` () = "let testCharToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; "let testCharToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; "let testCharToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; -#if DEBUG - @"let testCharToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,43--56,52)" -#else - "let testCharToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,43--56,52)"; -#endif + "let testCharToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.char = e1 in copyOfStruct.ToString() @ (56,43--56,52)" ] testOperators "Char" "char" excludedTests expectedUnoptimized expectedOptimized @@ -2790,11 +2730,7 @@ let ``Test Operator Declarations for String`` () = "let testStringToDoubleOperator(e1) = Double.Parse ((if Operators.op_Equality (e1,dflt) then dflt else e1.Replace(\"_\",\"\")),167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (53,47--53,55)"; "let testStringToDecimalOperator(e1) = Decimal.Parse (e1,167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (54,47--54,57)"; "let testStringToCharOperator(e1) = Char.Parse (e1) @ (55,47--55,54)"; -#if DEBUG - @"let testStringToStringOperator(e1) = let nullStr: Microsoft.FSharp.Core.string = """" in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)" -#else - "let testStringToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; -#endif + "let testStringToStringOperator(e1) = e1 @ (56,54--56,56)" ] testOperators "String" "string" excludedTests expectedUnoptimized expectedOptimized From 0a762ce7ca16049889ef278441b0046bc031d754 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Sun, 5 Jul 2020 17:42:31 +0200 Subject: [PATCH 12/12] Distinguish between FSharp.Core 4.5, 4.6 and 4.7 in tests in ExprTests.fs --- tests/service/ExprTests.fs | 2960 ++++++++++++++++++------------------ 1 file changed, 1512 insertions(+), 1448 deletions(-) diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index fce0af17745..dc8e3988080 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -20,6 +20,17 @@ open FSharp.Compiler.Service.Tests.Common let internal exprChecker = FSharpChecker.Create(keepAssemblyContents=true) +type FSharpCore = + | FC45 + | FC46 + | FC47 + + static member fsharpVersion fc = + match fc with + | FC45 -> "FSharp.Core 4.5" + | FC46 -> "FSharp.Core 4.6" + | FC47 -> "FSharp.Core 4.7" + [] module internal Utils = @@ -1000,8 +1011,17 @@ let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimi let options = checker.GetProjectOptionsFromCommandLineArgs (projFilePath, args) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunSynchronously - - for r in wholeProjectResults.ProjectContext.GetReferencedAssemblies() do + let referencedAssemblies = wholeProjectResults.ProjectContext.GetReferencedAssemblies() + let currentAssemblyToken = + let fsCore = referencedAssemblies |> List.tryFind (fun asm -> asm.SimpleName = "FSharp.Core") + match fsCore with + | Some core -> + if core.QualifiedName.StartsWith("FSharp.Core, Version=4.7") then FC47 + elif core.QualifiedName.StartsWith("FSharp.Core, Version=4.6") then FC46 + else FC45 + | None -> FC45 + + for r in referencedAssemblies do printfn "Referenced assembly %s: %O" r.QualifiedName r.FileName let errors = StringBuilder() @@ -1012,16 +1032,60 @@ let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimi errors.ToString() |> shouldEqual "" wholeProjectResults.Errors.Length |> shouldEqual 0 - let fileUnoptimized = wholeProjectResults.AssemblyContents.ImplementationFiles.[0] - let fileOptimized = wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.[0] + let resultUnoptimized = + wholeProjectResults.AssemblyContents.ImplementationFiles.[0].Declarations + |> printDeclarations None + |> Seq.toList + + let resultOptimized = + wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.[0].Declarations + |> printDeclarations None + |> Seq.toList + + let mutable countFC45 = 0 + let mutable countFC46 = 0 + let mutable countFC47 = 0 + + /// Filter for allowed FSharp.Core definition. Optimizations can differ between Core versions + let filterTests result expected = + List.zip result expected + |> List.choose (fun (result, (when', s)) -> + if List.isEmpty when' then + countFC45 <- countFC45 + 1 + countFC46 <- countFC46 + 1 + countFC47 <- countFC47 + 1 + Some(result, s) + else + if when' |> List.contains FC45 then countFC45 <- countFC45 + 1 + if when' |> List.contains FC46 then countFC46 <- countFC46 + 1 + if when' |> List.contains FC47 then countFC47 <- countFC47 + 1 + if when' |> List.contains currentAssemblyToken then + Some(result, s) + else + None) + |> List.unzip + + printfn "" + printfn "Running in %O mode (%s)" currentAssemblyToken (FSharpCore.fsharpVersion currentAssemblyToken) + + let resultUnoptFiltered, expectedUnoptFiltered = filterTests resultUnoptimized expectedUnoptimized + printfn "Unoptimized FC45 tests: %i, FC46 tests: %i, FC47 tests: %i" countFC45 countFC46 countFC47 + printfn "Unfiltered unoptimized: %i, filtered: %i" (List.length expectedUnoptimized) (List.length expectedUnoptFiltered) + + countFC45 <- 0 + countFC46 <- 0 + countFC47 <- 0 + let resultOptFiltered, expectedOptFiltered = filterTests resultOptimized expectedOptimized + printfn "Optimized FC45 tests: %i, FC46 tests: %i, FC47 tests: %i" countFC45 countFC46 countFC47 + printfn "Unfiltered optimized: %i, filtered: %i" (List.length expectedOptimized) (List.length expectedOptFiltered) // fail test on first line that fails, show difference in output window - printDeclarations None (List.ofSeq fileUnoptimized.Declarations) - |> shouldPairwiseEqual expectedUnoptimized + resultUnoptFiltered + |> shouldPairwiseEqual expectedUnoptFiltered // fail test on first line that fails, show difference in output window - printDeclarations None (List.ofSeq fileOptimized.Declarations) - |> shouldPairwiseEqual expectedOptimized + resultOptFiltered + |> shouldPairwiseEqual expectedOptFiltered finally Utils.cleanupTempFiles [filePath; dllPath; projFilePath] @@ -1036,103 +1100,103 @@ let ``Test Operator Declarations for Byte`` () = ] let expectedUnoptimized = [ - "type OperatorTestsByte"; - "let testByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,63--4,72)"; - "let testByteNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,63--5,73)"; - "let testByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,63--6,72)"; - "let testByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,63--7,73)"; - "let testByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,63--8,72)"; - "let testByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,63--9,73)"; - "let testByteAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,55--11,64)"; - "let testByteSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,55--12,64)"; - "let testByteMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,55--13,64)"; - "let testByteDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,55--14,64)"; - "let testByteModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,55--15,64)"; - "let testByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,55--16,66)"; - "let testByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,55--17,66)"; - "let testByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,55--18,66)"; - "let testByteShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,54--19,65)"; - "let testByteShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,54--20,65)"; - "let testByteAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,53--24,70)"; - "let testByteSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,53--25,70)"; - "let testByteMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,53--26,70)"; - "let testByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; - "let testByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; - "let testByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; - "let testByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; - "let testByteToIntChecked(e1) = Checked.ToInt (e1) @ (33,43--33,57)"; - "let testByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; - "let testByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; - "let testByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; - "let testByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; - "let testByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; - "let testByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; - "let testByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; - "let testByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; - "let testByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; - "let testByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; - "let testByteToIntOperator(e1) = Operators.ToInt (e1) @ (45,43--45,49)"; - "let testByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; - "let testByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; - "let testByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,43--48,51)"; - "let testByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; - "let testByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; - "let testByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; - "let testByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,43--52,53)"; - "let testByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,43--53,51)"; - "let testByteToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,43--54,53)"; - "let testByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; - "let testByteToStringOperator(e1) = Operators.ToString (e1) @ (56,43--56,52)"; + [], "type OperatorTestsByte"; + [], "let testByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,63--4,72)"; + [], "let testByteNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,63--5,73)"; + [], "let testByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,63--6,72)"; + [], "let testByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,63--7,73)"; + [], "let testByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,63--8,72)"; + [], "let testByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,63--9,73)"; + [], "let testByteAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,55--11,64)"; + [], "let testByteSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,55--12,64)"; + [], "let testByteMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,55--13,64)"; + [], "let testByteDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,55--14,64)"; + [], "let testByteModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,55--15,64)"; + [], "let testByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,55--16,66)"; + [], "let testByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,55--17,66)"; + [], "let testByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,55--18,66)"; + [], "let testByteShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,54--19,65)"; + [], "let testByteShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,54--20,65)"; + [], "let testByteAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,53--24,70)"; + [], "let testByteSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,53--25,70)"; + [], "let testByteMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,53--26,70)"; + [], "let testByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; + [], "let testByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; + [], "let testByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; + [], "let testByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; + [], "let testByteToIntChecked(e1) = Checked.ToInt (e1) @ (33,43--33,57)"; + [], "let testByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; + [], "let testByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; + [], "let testByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; + [], "let testByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; + [], "let testByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; + [], "let testByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; + [], "let testByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; + [], "let testByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; + [], "let testByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; + [], "let testByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; + [], "let testByteToIntOperator(e1) = Operators.ToInt (e1) @ (45,43--45,49)"; + [], "let testByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; + [], "let testByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; + [], "let testByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,43--48,51)"; + [], "let testByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; + [], "let testByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; + [], "let testByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; + [], "let testByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,43--52,53)"; + [], "let testByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,43--53,51)"; + [], "let testByteToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,43--54,53)"; + [], "let testByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; + [], "let testByteToStringOperator(e1) = Operators.ToString (e1) @ (56,43--56,52)"; ] let expectedOptimized = [ - "type OperatorTestsByte"; - "let testByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,63--4,72)"; - "let testByteNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,63--5,73)"; - "let testByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,63--6,72)"; - "let testByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,63--7,73)"; - "let testByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,63--8,72)"; - "let testByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,63--9,73)"; - "let testByteAdditionOperator(e1) (e2) = Operators.ToByte (Operators.op_Addition (e1,e2)) @ (11,55--11,64)"; - "let testByteSubtractionOperator(e1) (e2) = Operators.ToByte (Operators.op_Subtraction (e1,e2)) @ (12,55--12,64)"; - "let testByteMultiplyOperator(e1) (e2) = Operators.ToByte (Operators.op_Multiply (e1,e2)) @ (13,55--13,64)"; - "let testByteDivisionOperator(e1) (e2) = Operators.ToByte (Operators.op_Division (e1,e2)) @ (14,55--14,64)"; - "let testByteModulusOperator(e1) (e2) = Operators.ToByte (Operators.op_Modulus (e1,e2)) @ (15,55--15,64)"; - "let testByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,55--16,66)"; - "let testByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,55--17,66)"; - "let testByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,55--18,66)"; - "let testByteShiftLeftOperator(e1) (e2) = Operators.ToByte (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (19,54--19,65)"; - "let testByteShiftRightOperator(e1) (e2) = Operators.ToByte (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (20,54--20,65)"; - "let testByteAdditionChecked(e1) (e2) = Checked.ToByte (Checked.op_Addition (e1,e2)) @ (24,53--24,70)"; - "let testByteSubtractionChecked(e1) (e2) = Checked.ToByte (Checked.op_Subtraction (e1,e2)) @ (25,53--25,70)"; - "let testByteMultiplyChecked(e1) (e2) = Checked.ToByte (Checked.op_Multiply (e1,e2)) @ (26,53--26,70)"; - "let testByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; - "let testByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; - "let testByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; - "let testByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; - "let testByteToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,43--33,57)"; - "let testByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; - "let testByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; - "let testByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; - "let testByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; - "let testByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; - "let testByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; - "let testByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; - "let testByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; - "let testByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; - "let testByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; - "let testByteToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,43--45,49)"; - "let testByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; - "let testByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; - "let testByteToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,43--48,51)"; - "let testByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; - "let testByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; - "let testByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; - "let testByteToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; - "let testByteToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; - "let testByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,43--54,53)"; - "let testByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; - "let testByteToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.byte = e1 in copyOfStruct.ToString() @ (56,43--56,52)" + [], "type OperatorTestsByte"; + [], "let testByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,63--4,72)"; + [], "let testByteNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,63--5,73)"; + [], "let testByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,63--6,72)"; + [], "let testByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,63--7,73)"; + [], "let testByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,63--8,72)"; + [], "let testByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,63--9,73)"; + [], "let testByteAdditionOperator(e1) (e2) = Operators.ToByte (Operators.op_Addition (e1,e2)) @ (11,55--11,64)"; + [], "let testByteSubtractionOperator(e1) (e2) = Operators.ToByte (Operators.op_Subtraction (e1,e2)) @ (12,55--12,64)"; + [], "let testByteMultiplyOperator(e1) (e2) = Operators.ToByte (Operators.op_Multiply (e1,e2)) @ (13,55--13,64)"; + [], "let testByteDivisionOperator(e1) (e2) = Operators.ToByte (Operators.op_Division (e1,e2)) @ (14,55--14,64)"; + [], "let testByteModulusOperator(e1) (e2) = Operators.ToByte (Operators.op_Modulus (e1,e2)) @ (15,55--15,64)"; + [], "let testByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,55--16,66)"; + [], "let testByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,55--17,66)"; + [], "let testByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,55--18,66)"; + [], "let testByteShiftLeftOperator(e1) (e2) = Operators.ToByte (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (19,54--19,65)"; + [], "let testByteShiftRightOperator(e1) (e2) = Operators.ToByte (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (20,54--20,65)"; + [], "let testByteAdditionChecked(e1) (e2) = Checked.ToByte (Checked.op_Addition (e1,e2)) @ (24,53--24,70)"; + [], "let testByteSubtractionChecked(e1) (e2) = Checked.ToByte (Checked.op_Subtraction (e1,e2)) @ (25,53--25,70)"; + [], "let testByteMultiplyChecked(e1) (e2) = Checked.ToByte (Checked.op_Multiply (e1,e2)) @ (26,53--26,70)"; + [], "let testByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; + [], "let testByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; + [], "let testByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; + [], "let testByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; + [], "let testByteToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,43--33,57)"; + [], "let testByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; + [], "let testByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; + [], "let testByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; + [], "let testByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; + [], "let testByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; + [], "let testByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; + [], "let testByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; + [], "let testByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; + [], "let testByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; + [], "let testByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; + [], "let testByteToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,43--45,49)"; + [], "let testByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; + [], "let testByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; + [], "let testByteToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,43--48,51)"; + [], "let testByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; + [], "let testByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; + [], "let testByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; + [], "let testByteToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; + [], "let testByteToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; + [], "let testByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,43--54,53)"; + [], "let testByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; + [FC47], "let testByteToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.byte = e1 in copyOfStruct.ToString() @ (56,43--56,52)" ] testOperators "Byte" "byte" excludedTests expectedUnoptimized expectedOptimized @@ -1143,107 +1207,107 @@ let ``Test Operator Declarations for SByte`` () = let excludedTests = [ ] let expectedUnoptimized = [ - "type OperatorTestsSByte"; - "let testSByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; - "let testSByteNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,66--5,76)"; - "let testSByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; - "let testSByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,66--7,76)"; - "let testSByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; - "let testSByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,66--9,76)"; - "let testSByteAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; - "let testSByteSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; - "let testSByteMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; - "let testSByteDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; - "let testSByteModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; - "let testSByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; - "let testSByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; - "let testSByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; - "let testSByteShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,56--19,67)"; - "let testSByteShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,56--20,67)"; - "let testSByteUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; - "let testSByteAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; - "let testSByteSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; - "let testSByteMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; - "let testSByteUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; - "let testSByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; - "let testSByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; - "let testSByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; - "let testSByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; - "let testSByteToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; - "let testSByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; - "let testSByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; - "let testSByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; - "let testSByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; - "let testSByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; - "let testSByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; - "let testSByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; - "let testSByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; - "let testSByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; - "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testSByteToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; - "let testSByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; - "let testSByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; - "let testSByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testSByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; - "let testSByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; - "let testSByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; - "let testSByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; - "let testSByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; - "let testSByteToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; - "let testSByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; - "let testSByteToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; + [], "type OperatorTestsSByte"; + [], "let testSByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; + [], "let testSByteNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,66--5,76)"; + [], "let testSByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; + [], "let testSByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,66--7,76)"; + [], "let testSByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; + [], "let testSByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,66--9,76)"; + [], "let testSByteAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; + [], "let testSByteSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; + [], "let testSByteMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + [], "let testSByteDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; + [], "let testSByteModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; + [], "let testSByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; + [], "let testSByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; + [], "let testSByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; + [], "let testSByteShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,56--19,67)"; + [], "let testSByteShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,56--20,67)"; + [], "let testSByteUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; + [], "let testSByteAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + [], "let testSByteSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + [], "let testSByteMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + [], "let testSByteUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; + [], "let testSByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + [], "let testSByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + [], "let testSByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + [], "let testSByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + [], "let testSByteToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; + [], "let testSByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + [], "let testSByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + [], "let testSByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + [], "let testSByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + [], "let testSByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + [], "let testSByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + [], "let testSByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + [], "let testSByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + [], "let testSByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + [], "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + [], "let testSByteToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; + [], "let testSByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + [], "let testSByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + [], "let testSByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + [], "let testSByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + [], "let testSByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + [], "let testSByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; + [], "let testSByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + [], "let testSByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + [], "let testSByteToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; + [], "let testSByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + [], "let testSByteToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; ] let expectedOptimized = [ - "type OperatorTestsSByte"; - "let testSByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; - "let testSByteNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,66--5,76)"; - "let testSByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; - "let testSByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,66--7,76)"; - "let testSByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; - "let testSByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,66--9,76)"; - "let testSByteAdditionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Addition (e1,e2)) @ (11,58--11,67)"; - "let testSByteSubtractionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Subtraction (e1,e2)) @ (12,58--12,67)"; - "let testSByteMultiplyOperator(e1) (e2) = Operators.ToSByte (Operators.op_Multiply (e1,e2)) @ (13,58--13,67)"; - "let testSByteDivisionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Division (e1,e2)) @ (14,58--14,67)"; - "let testSByteModulusOperator(e1) (e2) = Operators.ToSByte (Operators.op_Modulus (e1,e2)) @ (15,58--15,67)"; - "let testSByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; - "let testSByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; - "let testSByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; - "let testSByteShiftLeftOperator(e1) (e2) = Operators.ToSByte (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (19,56--19,67)"; - "let testSByteShiftRightOperator(e1) (e2) = Operators.ToSByte (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (20,56--20,67)"; - "let testSByteUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; - "let testSByteAdditionChecked(e1) (e2) = Checked.ToSByte (Checked.op_Addition (e1,e2)) @ (24,56--24,73)"; - "let testSByteSubtractionChecked(e1) (e2) = Checked.ToSByte (Checked.op_Subtraction (e1,e2)) @ (25,56--25,73)"; - "let testSByteMultiplyChecked(e1) (e2) = Checked.ToSByte (Checked.op_Multiply (e1,e2)) @ (26,56--26,73)"; - "let testSByteUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; - "let testSByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; - "let testSByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; - "let testSByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; - "let testSByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; - "let testSByteToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; - "let testSByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; - "let testSByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; - "let testSByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; - "let testSByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; - "let testSByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; - "let testSByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; - "let testSByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; - "let testSByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; - "let testSByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; - "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testSByteToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; - "let testSByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; - "let testSByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; - "let testSByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testSByteToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; - "let testSByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; - "let testSByteToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; - "let testSByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; - "let testSByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; - "let testSByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; - "let testSByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; - "let testSByteToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" + [], "type OperatorTestsSByte"; + [], "let testSByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; + [], "let testSByteNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,66--5,76)"; + [], "let testSByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; + [], "let testSByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,66--7,76)"; + [], "let testSByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; + [], "let testSByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,66--9,76)"; + [], "let testSByteAdditionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Addition (e1,e2)) @ (11,58--11,67)"; + [], "let testSByteSubtractionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Subtraction (e1,e2)) @ (12,58--12,67)"; + [], "let testSByteMultiplyOperator(e1) (e2) = Operators.ToSByte (Operators.op_Multiply (e1,e2)) @ (13,58--13,67)"; + [], "let testSByteDivisionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Division (e1,e2)) @ (14,58--14,67)"; + [], "let testSByteModulusOperator(e1) (e2) = Operators.ToSByte (Operators.op_Modulus (e1,e2)) @ (15,58--15,67)"; + [], "let testSByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; + [], "let testSByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; + [], "let testSByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; + [], "let testSByteShiftLeftOperator(e1) (e2) = Operators.ToSByte (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (19,56--19,67)"; + [], "let testSByteShiftRightOperator(e1) (e2) = Operators.ToSByte (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (20,56--20,67)"; + [], "let testSByteUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; + [], "let testSByteAdditionChecked(e1) (e2) = Checked.ToSByte (Checked.op_Addition (e1,e2)) @ (24,56--24,73)"; + [], "let testSByteSubtractionChecked(e1) (e2) = Checked.ToSByte (Checked.op_Subtraction (e1,e2)) @ (25,56--25,73)"; + [], "let testSByteMultiplyChecked(e1) (e2) = Checked.ToSByte (Checked.op_Multiply (e1,e2)) @ (26,56--26,73)"; + [], "let testSByteUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; + [], "let testSByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + [], "let testSByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + [], "let testSByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + [], "let testSByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + [], "let testSByteToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; + [], "let testSByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + [], "let testSByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + [], "let testSByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + [], "let testSByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + [], "let testSByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + [], "let testSByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + [], "let testSByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + [], "let testSByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + [], "let testSByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + [], "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + [], "let testSByteToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; + [], "let testSByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + [], "let testSByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + [], "let testSByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + [], "let testSByteToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; + [], "let testSByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + [], "let testSByteToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; + [], "let testSByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + [], "let testSByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + [], "let testSByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; + [], "let testSByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + [FC47], "let testSByteToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" ] testOperators "SByte" "sbyte" excludedTests expectedUnoptimized expectedOptimized @@ -1253,107 +1317,107 @@ let ``Test Operator Declarations for Int16`` () = let excludedTests = [ ] let expectedUnoptimized = [ - "type OperatorTestsInt16"; - "let testInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; - "let testInt16NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,66--5,76)"; - "let testInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; - "let testInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,66--7,76)"; - "let testInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; - "let testInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,66--9,76)"; - "let testInt16AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; - "let testInt16SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; - "let testInt16MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; - "let testInt16DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; - "let testInt16ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; - "let testInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; - "let testInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; - "let testInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; - "let testInt16ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,56--19,67)"; - "let testInt16ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,56--20,67)"; - "let testInt16UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; - "let testInt16AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; - "let testInt16SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; - "let testInt16MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; - "let testInt16UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; - "let testInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; - "let testInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; - "let testInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; - "let testInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; - "let testInt16ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; - "let testInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; - "let testInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; - "let testInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; - "let testInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; - "let testInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; - "let testInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; - "let testInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; - "let testInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; - "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; - "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testInt16ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; - "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; - "let testInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; - "let testInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; - "let testInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; - "let testInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; - "let testInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; - "let testInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; - "let testInt16ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; - "let testInt16ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; + [], "type OperatorTestsInt16"; + [], "let testInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; + [], "let testInt16NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,66--5,76)"; + [], "let testInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; + [], "let testInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,66--7,76)"; + [], "let testInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; + [], "let testInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,66--9,76)"; + [], "let testInt16AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; + [], "let testInt16SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; + [], "let testInt16MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + [], "let testInt16DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; + [], "let testInt16ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; + [], "let testInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; + [], "let testInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; + [], "let testInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; + [], "let testInt16ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,56--19,67)"; + [], "let testInt16ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,56--20,67)"; + [], "let testInt16UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; + [], "let testInt16AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + [], "let testInt16SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + [], "let testInt16MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + [], "let testInt16UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; + [], "let testInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + [], "let testInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + [], "let testInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + [], "let testInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + [], "let testInt16ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; + [], "let testInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + [], "let testInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + [], "let testInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + [], "let testInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + [], "let testInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + [], "let testInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + [], "let testInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + [], "let testInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + [], "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + [], "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + [], "let testInt16ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; + [], "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + [], "let testInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + [], "let testInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + [], "let testInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + [], "let testInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + [], "let testInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; + [], "let testInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + [], "let testInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + [], "let testInt16ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; + [], "let testInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + [], "let testInt16ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; ] let expectedOptimized = [ - "type OperatorTestsInt16"; - "let testInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; - "let testInt16NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,66--5,76)"; - "let testInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; - "let testInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,66--7,76)"; - "let testInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; - "let testInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,66--9,76)"; - "let testInt16AdditionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Addition (e1,e2)) @ (11,58--11,67)"; - "let testInt16SubtractionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Subtraction (e1,e2)) @ (12,58--12,67)"; - "let testInt16MultiplyOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Multiply (e1,e2)) @ (13,58--13,67)"; - "let testInt16DivisionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Division (e1,e2)) @ (14,58--14,67)"; - "let testInt16ModulusOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Modulus (e1,e2)) @ (15,58--15,67)"; - "let testInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; - "let testInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; - "let testInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; - "let testInt16ShiftLeftOperator(e1) (e2) = Operators.ToInt16 (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (19,56--19,67)"; - "let testInt16ShiftRightOperator(e1) (e2) = Operators.ToInt16 (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (20,56--20,67)"; - "let testInt16UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; - "let testInt16AdditionChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Addition (e1,e2)) @ (24,56--24,73)"; - "let testInt16SubtractionChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Subtraction (e1,e2)) @ (25,56--25,73)"; - "let testInt16MultiplyChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Multiply (e1,e2)) @ (26,56--26,73)"; - "let testInt16UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; - "let testInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; - "let testInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; - "let testInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; - "let testInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; - "let testInt16ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; - "let testInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; - "let testInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; - "let testInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; - "let testInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; - "let testInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; - "let testInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; - "let testInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; - "let testInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; - "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; - "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testInt16ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; - "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; - "let testInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; - "let testInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testInt16ToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; - "let testInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; - "let testInt16ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; - "let testInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; - "let testInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; - "let testInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; - "let testInt16ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" + [], "type OperatorTestsInt16"; + [], "let testInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; + [], "let testInt16NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,66--5,76)"; + [], "let testInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; + [], "let testInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,66--7,76)"; + [], "let testInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; + [], "let testInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,66--9,76)"; + [], "let testInt16AdditionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Addition (e1,e2)) @ (11,58--11,67)"; + [], "let testInt16SubtractionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Subtraction (e1,e2)) @ (12,58--12,67)"; + [], "let testInt16MultiplyOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Multiply (e1,e2)) @ (13,58--13,67)"; + [], "let testInt16DivisionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Division (e1,e2)) @ (14,58--14,67)"; + [], "let testInt16ModulusOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Modulus (e1,e2)) @ (15,58--15,67)"; + [], "let testInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; + [], "let testInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; + [], "let testInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; + [], "let testInt16ShiftLeftOperator(e1) (e2) = Operators.ToInt16 (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (19,56--19,67)"; + [], "let testInt16ShiftRightOperator(e1) (e2) = Operators.ToInt16 (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (20,56--20,67)"; + [], "let testInt16UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; + [], "let testInt16AdditionChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Addition (e1,e2)) @ (24,56--24,73)"; + [], "let testInt16SubtractionChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Subtraction (e1,e2)) @ (25,56--25,73)"; + [], "let testInt16MultiplyChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Multiply (e1,e2)) @ (26,56--26,73)"; + [], "let testInt16UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; + [], "let testInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + [], "let testInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + [], "let testInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + [], "let testInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + [], "let testInt16ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; + [], "let testInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + [], "let testInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + [], "let testInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + [], "let testInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + [], "let testInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + [], "let testInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + [], "let testInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + [], "let testInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + [], "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + [], "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + [], "let testInt16ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; + [], "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + [], "let testInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + [], "let testInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + [], "let testInt16ToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; + [], "let testInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + [], "let testInt16ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; + [], "let testInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + [], "let testInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + [], "let testInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; + [], "let testInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + [FC47], "let testInt16ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" ] testOperators "Int16" "int16" excludedTests expectedUnoptimized expectedOptimized @@ -1366,103 +1430,103 @@ let ``Test Operator Declarations for UInt16`` () = ] let expectedUnoptimized = [ - "type OperatorTestsUInt16"; - "let testUInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; - "let testUInt16NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,69--5,79)"; - "let testUInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; - "let testUInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,69--7,79)"; - "let testUInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; - "let testUInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,69--9,79)"; - "let testUInt16AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; - "let testUInt16SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; - "let testUInt16MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; - "let testUInt16DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; - "let testUInt16ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; - "let testUInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; - "let testUInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; - "let testUInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; - "let testUInt16ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,58--19,69)"; - "let testUInt16ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,58--20,69)"; - "let testUInt16AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; - "let testUInt16SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; - "let testUInt16MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; - "let testUInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; - "let testUInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; - "let testUInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; - "let testUInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; - "let testUInt16ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; - "let testUInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; - "let testUInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; - "let testUInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; - "let testUInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; - "let testUInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; - "let testUInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; - "let testUInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; - "let testUInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; - "let testUInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; - "let testUInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; - "let testUInt16ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; - "let testUInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; - "let testUInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; - "let testUInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; - "let testUInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; - "let testUInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; - "let testUInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; - "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; - "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; - "let testUInt16ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; - "let testUInt16ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; + [], "type OperatorTestsUInt16"; + [], "let testUInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; + [], "let testUInt16NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,69--5,79)"; + [], "let testUInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; + [], "let testUInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,69--7,79)"; + [], "let testUInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; + [], "let testUInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,69--9,79)"; + [], "let testUInt16AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; + [], "let testUInt16SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; + [], "let testUInt16MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + [], "let testUInt16DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; + [], "let testUInt16ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; + [], "let testUInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; + [], "let testUInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; + [], "let testUInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; + [], "let testUInt16ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,58--19,69)"; + [], "let testUInt16ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,58--20,69)"; + [], "let testUInt16AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + [], "let testUInt16SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + [], "let testUInt16MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + [], "let testUInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + [], "let testUInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + [], "let testUInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + [], "let testUInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + [], "let testUInt16ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; + [], "let testUInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + [], "let testUInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + [], "let testUInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + [], "let testUInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + [], "let testUInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + [], "let testUInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + [], "let testUInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + [], "let testUInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + [], "let testUInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + [], "let testUInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + [], "let testUInt16ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; + [], "let testUInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + [], "let testUInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + [], "let testUInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + [], "let testUInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + [], "let testUInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; + [], "let testUInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + [], "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; + [], "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; + [], "let testUInt16ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; + [], "let testUInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + [], "let testUInt16ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; ] let expectedOptimized = [ - "type OperatorTestsUInt16"; - "let testUInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; - "let testUInt16NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,69--5,79)"; - "let testUInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; - "let testUInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,69--7,79)"; - "let testUInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; - "let testUInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,69--9,79)"; - "let testUInt16AdditionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Addition (e1,e2)) @ (11,61--11,70)"; - "let testUInt16SubtractionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Subtraction (e1,e2)) @ (12,61--12,70)"; - "let testUInt16MultiplyOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Multiply (e1,e2)) @ (13,61--13,70)"; - "let testUInt16DivisionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Division (e1,e2)) @ (14,61--14,70)"; - "let testUInt16ModulusOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Modulus (e1,e2)) @ (15,61--15,70)"; - "let testUInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; - "let testUInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; - "let testUInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; - "let testUInt16ShiftLeftOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (19,58--19,69)"; - "let testUInt16ShiftRightOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (20,58--20,69)"; - "let testUInt16AdditionChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Addition (e1,e2)) @ (24,59--24,76)"; - "let testUInt16SubtractionChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Subtraction (e1,e2)) @ (25,59--25,76)"; - "let testUInt16MultiplyChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Multiply (e1,e2)) @ (26,59--26,76)"; - "let testUInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; - "let testUInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; - "let testUInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; - "let testUInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; - "let testUInt16ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; - "let testUInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; - "let testUInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; - "let testUInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; - "let testUInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; - "let testUInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; - "let testUInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; - "let testUInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; - "let testUInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; - "let testUInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; - "let testUInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; - "let testUInt16ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; - "let testUInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; - "let testUInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; - "let testUInt16ToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,47--48,55)"; - "let testUInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; - "let testUInt16ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; - "let testUInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; - "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; - "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; - "let testUInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; - "let testUInt16ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint16 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" + [], "type OperatorTestsUInt16"; + [], "let testUInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; + [], "let testUInt16NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,69--5,79)"; + [], "let testUInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; + [], "let testUInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,69--7,79)"; + [], "let testUInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; + [], "let testUInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,69--9,79)"; + [], "let testUInt16AdditionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Addition (e1,e2)) @ (11,61--11,70)"; + [], "let testUInt16SubtractionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Subtraction (e1,e2)) @ (12,61--12,70)"; + [], "let testUInt16MultiplyOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Multiply (e1,e2)) @ (13,61--13,70)"; + [], "let testUInt16DivisionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Division (e1,e2)) @ (14,61--14,70)"; + [], "let testUInt16ModulusOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Modulus (e1,e2)) @ (15,61--15,70)"; + [], "let testUInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; + [], "let testUInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; + [], "let testUInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; + [], "let testUInt16ShiftLeftOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (19,58--19,69)"; + [], "let testUInt16ShiftRightOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (20,58--20,69)"; + [], "let testUInt16AdditionChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Addition (e1,e2)) @ (24,59--24,76)"; + [], "let testUInt16SubtractionChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Subtraction (e1,e2)) @ (25,59--25,76)"; + [], "let testUInt16MultiplyChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Multiply (e1,e2)) @ (26,59--26,76)"; + [], "let testUInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + [], "let testUInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + [], "let testUInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + [], "let testUInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + [], "let testUInt16ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; + [], "let testUInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + [], "let testUInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + [], "let testUInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + [], "let testUInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + [], "let testUInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + [], "let testUInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + [], "let testUInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + [], "let testUInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + [], "let testUInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + [], "let testUInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + [], "let testUInt16ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; + [], "let testUInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + [], "let testUInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + [], "let testUInt16ToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,47--48,55)"; + [], "let testUInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + [], "let testUInt16ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; + [], "let testUInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + [], "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; + [], "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; + [], "let testUInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; + [], "let testUInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + [FC47], "let testUInt16ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint16 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" ] testOperators "UInt16" "uint16" excludedTests expectedUnoptimized expectedOptimized @@ -1472,107 +1536,107 @@ let ``Test Operator Declarations for Int`` () = let excludedTests = [ ] let expectedUnoptimized = [ - "type OperatorTestsInt"; - "let testIntEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,60--4,69)"; - "let testIntNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,60--5,70)"; - "let testIntLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,60--6,69)"; - "let testIntLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,60--7,70)"; - "let testIntGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,60--8,69)"; - "let testIntGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,60--9,70)"; - "let testIntAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,52--11,61)"; - "let testIntSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,52--12,61)"; - "let testIntMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,52--13,61)"; - "let testIntDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,52--14,61)"; - "let testIntModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,52--15,61)"; - "let testIntBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,52--16,63)"; - "let testIntBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,52--17,63)"; - "let testIntBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,52--18,63)"; - "let testIntShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,52--19,63)"; - "let testIntShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,52--20,63)"; - "let testIntUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,41--22,48)"; - "let testIntAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,50--24,67)"; - "let testIntSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,50--25,67)"; - "let testIntMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,50--26,67)"; - "let testIntUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,41--27,56)"; - "let testIntToByteChecked(e1) = Checked.ToByte (e1) @ (29,41--29,56)"; - "let testIntToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,41--30,57)"; - "let testIntToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,41--31,57)"; - "let testIntToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,41--32,58)"; - "let testIntToIntChecked(e1) = Checked.ToInt (e1) @ (33,41--33,55)"; - "let testIntToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,41--34,57)"; - "let testIntToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,41--35,58)"; - "let testIntToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,41--36,57)"; - "let testIntToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,41--37,58)"; - "let testIntToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,41--38,61)"; - "let testIntToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,41--39,62)"; - "let testIntToByteOperator(e1) = Operators.ToByte (e1) @ (41,41--41,48)"; - "let testIntToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,41--42,49)"; - "let testIntToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,41--43,49)"; - "let testIntToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,41--44,50)"; - "let testIntToIntOperator(e1) = Operators.ToInt (e1) @ (45,41--45,47)"; - "let testIntToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,41--46,49)"; - "let testIntToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,41--47,50)"; - "let testIntToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,41--48,49)"; - "let testIntToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,41--49,50)"; - "let testIntToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,41--50,53)"; - "let testIntToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,41--51,54)"; - "let testIntToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,41--52,51)"; - "let testIntToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,41--53,49)"; - "let testIntToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,41--54,51)"; - "let testIntToCharOperator(e1) = Operators.ToChar (e1) @ (55,41--55,48)"; - "let testIntToStringOperator(e1) = Operators.ToString (e1) @ (56,41--56,50)"; + [], "type OperatorTestsInt"; + [], "let testIntEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,60--4,69)"; + [], "let testIntNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,60--5,70)"; + [], "let testIntLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,60--6,69)"; + [], "let testIntLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,60--7,70)"; + [], "let testIntGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,60--8,69)"; + [], "let testIntGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,60--9,70)"; + [], "let testIntAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,52--11,61)"; + [], "let testIntSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,52--12,61)"; + [], "let testIntMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,52--13,61)"; + [], "let testIntDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,52--14,61)"; + [], "let testIntModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,52--15,61)"; + [], "let testIntBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,52--16,63)"; + [], "let testIntBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,52--17,63)"; + [], "let testIntBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,52--18,63)"; + [], "let testIntShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,52--19,63)"; + [], "let testIntShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,52--20,63)"; + [], "let testIntUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,41--22,48)"; + [], "let testIntAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,50--24,67)"; + [], "let testIntSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,50--25,67)"; + [], "let testIntMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,50--26,67)"; + [], "let testIntUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,41--27,56)"; + [], "let testIntToByteChecked(e1) = Checked.ToByte (e1) @ (29,41--29,56)"; + [], "let testIntToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,41--30,57)"; + [], "let testIntToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,41--31,57)"; + [], "let testIntToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,41--32,58)"; + [], "let testIntToIntChecked(e1) = Checked.ToInt (e1) @ (33,41--33,55)"; + [], "let testIntToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,41--34,57)"; + [], "let testIntToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,41--35,58)"; + [], "let testIntToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,41--36,57)"; + [], "let testIntToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,41--37,58)"; + [], "let testIntToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,41--38,61)"; + [], "let testIntToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,41--39,62)"; + [], "let testIntToByteOperator(e1) = Operators.ToByte (e1) @ (41,41--41,48)"; + [], "let testIntToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,41--42,49)"; + [], "let testIntToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,41--43,49)"; + [], "let testIntToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,41--44,50)"; + [], "let testIntToIntOperator(e1) = Operators.ToInt (e1) @ (45,41--45,47)"; + [], "let testIntToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,41--46,49)"; + [], "let testIntToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,41--47,50)"; + [], "let testIntToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,41--48,49)"; + [], "let testIntToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,41--49,50)"; + [], "let testIntToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,41--50,53)"; + [], "let testIntToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,41--51,54)"; + [], "let testIntToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,41--52,51)"; + [], "let testIntToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,41--53,49)"; + [], "let testIntToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,41--54,51)"; + [], "let testIntToCharOperator(e1) = Operators.ToChar (e1) @ (55,41--55,48)"; + [], "let testIntToStringOperator(e1) = Operators.ToString (e1) @ (56,41--56,50)"; ] let expectedOptimized = [ - "type OperatorTestsInt"; - "let testIntEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,60--4,69)"; - "let testIntNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,60--5,70)"; - "let testIntLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,60--6,69)"; - "let testIntLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,60--7,70)"; - "let testIntGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,60--8,69)"; - "let testIntGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,60--9,70)"; - "let testIntAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,52--11,61)"; - "let testIntSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,52--12,61)"; - "let testIntMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,52--13,61)"; - "let testIntDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,52--14,61)"; - "let testIntModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,52--15,61)"; - "let testIntBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,52--16,63)"; - "let testIntBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,52--17,63)"; - "let testIntBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,52--18,63)"; - "let testIntShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,52--19,63)"; - "let testIntShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,52--20,63)"; - "let testIntUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,41--22,48)"; - "let testIntAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,50--24,67)"; - "let testIntSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,50--25,67)"; - "let testIntMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,50--26,67)"; - "let testIntUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,41--27,56)"; - "let testIntToByteChecked(e1) = Checked.ToByte (e1) @ (29,41--29,56)"; - "let testIntToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,41--30,57)"; - "let testIntToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,41--31,57)"; - "let testIntToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,41--32,58)"; - "let testIntToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,41--33,55)"; - "let testIntToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,41--34,57)"; - "let testIntToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,41--35,58)"; - "let testIntToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,41--36,57)"; - "let testIntToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,41--37,58)"; - "let testIntToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,41--38,61)"; - "let testIntToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,41--39,62)"; - "let testIntToByteOperator(e1) = Operators.ToByte (e1) @ (41,41--41,48)"; - "let testIntToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,41--42,49)"; - "let testIntToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,41--43,49)"; - "let testIntToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,41--44,50)"; - "let testIntToIntOperator(e1) = e1 @ (45,45--45,47)"; - "let testIntToInt32Operator(e1) = e1 @ (46,47--46,49)"; - "let testIntToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,41--47,50)"; - "let testIntToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,41--48,49)"; - "let testIntToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,41--49,50)"; - "let testIntToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,41--50,53)"; - "let testIntToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,41--51,54)"; - "let testIntToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,41--52,51)"; - "let testIntToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,41--53,49)"; - "let testIntToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,41--54,51)"; - "let testIntToCharOperator(e1) = Operators.ToChar (e1) @ (55,41--55,48)"; - "let testIntToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,41--56,50)" + [], "type OperatorTestsInt"; + [], "let testIntEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,60--4,69)"; + [], "let testIntNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,60--5,70)"; + [], "let testIntLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,60--6,69)"; + [], "let testIntLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,60--7,70)"; + [], "let testIntGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,60--8,69)"; + [], "let testIntGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,60--9,70)"; + [], "let testIntAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,52--11,61)"; + [], "let testIntSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,52--12,61)"; + [], "let testIntMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,52--13,61)"; + [], "let testIntDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,52--14,61)"; + [], "let testIntModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,52--15,61)"; + [], "let testIntBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,52--16,63)"; + [], "let testIntBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,52--17,63)"; + [], "let testIntBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,52--18,63)"; + [], "let testIntShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,52--19,63)"; + [], "let testIntShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,52--20,63)"; + [], "let testIntUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,41--22,48)"; + [], "let testIntAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,50--24,67)"; + [], "let testIntSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,50--25,67)"; + [], "let testIntMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,50--26,67)"; + [], "let testIntUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,41--27,56)"; + [], "let testIntToByteChecked(e1) = Checked.ToByte (e1) @ (29,41--29,56)"; + [], "let testIntToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,41--30,57)"; + [], "let testIntToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,41--31,57)"; + [], "let testIntToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,41--32,58)"; + [], "let testIntToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,41--33,55)"; + [], "let testIntToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,41--34,57)"; + [], "let testIntToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,41--35,58)"; + [], "let testIntToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,41--36,57)"; + [], "let testIntToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,41--37,58)"; + [], "let testIntToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,41--38,61)"; + [], "let testIntToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,41--39,62)"; + [], "let testIntToByteOperator(e1) = Operators.ToByte (e1) @ (41,41--41,48)"; + [], "let testIntToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,41--42,49)"; + [], "let testIntToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,41--43,49)"; + [], "let testIntToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,41--44,50)"; + [], "let testIntToIntOperator(e1) = e1 @ (45,45--45,47)"; + [], "let testIntToInt32Operator(e1) = e1 @ (46,47--46,49)"; + [], "let testIntToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,41--47,50)"; + [], "let testIntToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,41--48,49)"; + [], "let testIntToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,41--49,50)"; + [], "let testIntToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,41--50,53)"; + [], "let testIntToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,41--51,54)"; + [], "let testIntToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,41--52,51)"; + [], "let testIntToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,41--53,49)"; + [], "let testIntToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,41--54,51)"; + [], "let testIntToCharOperator(e1) = Operators.ToChar (e1) @ (55,41--55,48)"; + [FC47], "let testIntToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,41--56,50)" ] testOperators "Int" "int" excludedTests expectedUnoptimized expectedOptimized @@ -1582,107 +1646,107 @@ let ``Test Operator Declarations for Int32`` () = let excludedTests = [ ] let expectedUnoptimized = [ - "type OperatorTestsInt32"; - "let testInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; - "let testInt32NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,66--5,76)"; - "let testInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; - "let testInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,66--7,76)"; - "let testInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; - "let testInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,66--9,76)"; - "let testInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; - "let testInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; - "let testInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; - "let testInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; - "let testInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; - "let testInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; - "let testInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; - "let testInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; - "let testInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,56--19,67)"; - "let testInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,56--20,67)"; - "let testInt32UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; - "let testInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; - "let testInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; - "let testInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; - "let testInt32UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; - "let testInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; - "let testInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; - "let testInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; - "let testInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; - "let testInt32ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; - "let testInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; - "let testInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; - "let testInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; - "let testInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; - "let testInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; - "let testInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; - "let testInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; - "let testInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; - "let testInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; - "let testInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testInt32ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; - "let testInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; - "let testInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; - "let testInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; - "let testInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; - "let testInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; - "let testInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; - "let testInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; - "let testInt32ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; - "let testInt32ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; + [], "type OperatorTestsInt32"; + [], "let testInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; + [], "let testInt32NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,66--5,76)"; + [], "let testInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; + [], "let testInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,66--7,76)"; + [], "let testInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; + [], "let testInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,66--9,76)"; + [], "let testInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; + [], "let testInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; + [], "let testInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + [], "let testInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; + [], "let testInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; + [], "let testInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; + [], "let testInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; + [], "let testInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; + [], "let testInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,56--19,67)"; + [], "let testInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,56--20,67)"; + [], "let testInt32UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; + [], "let testInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + [], "let testInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + [], "let testInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + [], "let testInt32UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; + [], "let testInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + [], "let testInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + [], "let testInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + [], "let testInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + [], "let testInt32ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; + [], "let testInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + [], "let testInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + [], "let testInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + [], "let testInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + [], "let testInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + [], "let testInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + [], "let testInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + [], "let testInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + [], "let testInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + [], "let testInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + [], "let testInt32ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; + [], "let testInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + [], "let testInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + [], "let testInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + [], "let testInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + [], "let testInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + [], "let testInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; + [], "let testInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + [], "let testInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + [], "let testInt32ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; + [], "let testInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + [], "let testInt32ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; ] let expectedOptimized = [ - "type OperatorTestsInt32"; - "let testInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; - "let testInt32NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,66--5,76)"; - "let testInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; - "let testInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,66--7,76)"; - "let testInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; - "let testInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,66--9,76)"; - "let testInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; - "let testInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; - "let testInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; - "let testInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; - "let testInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; - "let testInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; - "let testInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; - "let testInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; - "let testInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,56--19,67)"; - "let testInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,56--20,67)"; - "let testInt32UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; - "let testInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; - "let testInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; - "let testInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; - "let testInt32UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; - "let testInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; - "let testInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; - "let testInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; - "let testInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; - "let testInt32ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; - "let testInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; - "let testInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; - "let testInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; - "let testInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; - "let testInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; - "let testInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; - "let testInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; - "let testInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; - "let testInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; - "let testInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testInt32ToIntOperator(e1) = e1 @ (45,49--45,51)"; - "let testInt32ToInt32Operator(e1) = e1 @ (46,51--46,53)"; - "let testInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; - "let testInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testInt32ToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; - "let testInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; - "let testInt32ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; - "let testInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; - "let testInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; - "let testInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; - "let testInt32ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" + [], "type OperatorTestsInt32"; + [], "let testInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; + [], "let testInt32NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,66--5,76)"; + [], "let testInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; + [], "let testInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,66--7,76)"; + [], "let testInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; + [], "let testInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,66--9,76)"; + [], "let testInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; + [], "let testInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; + [], "let testInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + [], "let testInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; + [], "let testInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; + [], "let testInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; + [], "let testInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; + [], "let testInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; + [], "let testInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,56--19,67)"; + [], "let testInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,56--20,67)"; + [], "let testInt32UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; + [], "let testInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + [], "let testInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + [], "let testInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + [], "let testInt32UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; + [], "let testInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + [], "let testInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + [], "let testInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + [], "let testInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + [], "let testInt32ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; + [], "let testInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + [], "let testInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + [], "let testInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + [], "let testInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + [], "let testInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + [], "let testInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + [], "let testInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + [], "let testInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + [], "let testInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + [], "let testInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + [], "let testInt32ToIntOperator(e1) = e1 @ (45,49--45,51)"; + [], "let testInt32ToInt32Operator(e1) = e1 @ (46,51--46,53)"; + [], "let testInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + [], "let testInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + [], "let testInt32ToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; + [], "let testInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + [], "let testInt32ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; + [], "let testInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + [], "let testInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + [], "let testInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; + [], "let testInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + [FC47], "let testInt32ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" ] testOperators "Int32" "int32" excludedTests expectedUnoptimized expectedOptimized @@ -1695,103 +1759,103 @@ let ``Test Operator Declarations for UInt32`` () = ] let expectedUnoptimized = [ - "type OperatorTestsUInt32"; - "let testUInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; - "let testUInt32NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,69--5,79)"; - "let testUInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; - "let testUInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,69--7,79)"; - "let testUInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; - "let testUInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,69--9,79)"; - "let testUInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; - "let testUInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; - "let testUInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; - "let testUInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; - "let testUInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; - "let testUInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; - "let testUInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; - "let testUInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; - "let testUInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,58--19,69)"; - "let testUInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,58--20,69)"; - "let testUInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; - "let testUInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; - "let testUInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; - "let testUInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; - "let testUInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; - "let testUInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; - "let testUInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; - "let testUInt32ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; - "let testUInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; - "let testUInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; - "let testUInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; - "let testUInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; - "let testUInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; - "let testUInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; - "let testUInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; - "let testUInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; - "let testUInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; - "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; - "let testUInt32ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; - "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; - "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; - "let testUInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; - "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; - "let testUInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; - "let testUInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; - "let testUInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; - "let testUInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; - "let testUInt32ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; - "let testUInt32ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; + [], "type OperatorTestsUInt32"; + [], "let testUInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; + [], "let testUInt32NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,69--5,79)"; + [], "let testUInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; + [], "let testUInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,69--7,79)"; + [], "let testUInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; + [], "let testUInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,69--9,79)"; + [], "let testUInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; + [], "let testUInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; + [], "let testUInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + [], "let testUInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; + [], "let testUInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; + [], "let testUInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; + [], "let testUInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; + [], "let testUInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; + [], "let testUInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,58--19,69)"; + [], "let testUInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,58--20,69)"; + [], "let testUInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + [], "let testUInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + [], "let testUInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + [], "let testUInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + [], "let testUInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + [], "let testUInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + [], "let testUInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + [], "let testUInt32ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; + [], "let testUInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + [], "let testUInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + [], "let testUInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + [], "let testUInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + [], "let testUInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + [], "let testUInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + [], "let testUInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + [], "let testUInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + [], "let testUInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + [], "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + [], "let testUInt32ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; + [], "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + [], "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + [], "let testUInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + [], "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + [], "let testUInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; + [], "let testUInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + [], "let testUInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; + [], "let testUInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; + [], "let testUInt32ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; + [], "let testUInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + [], "let testUInt32ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; ] let expectedOptimized = [ - "type OperatorTestsUInt32"; - "let testUInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; - "let testUInt32NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,69--5,79)"; - "let testUInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; - "let testUInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,69--7,79)"; - "let testUInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; - "let testUInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,69--9,79)"; - "let testUInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; - "let testUInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; - "let testUInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; - "let testUInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; - "let testUInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; - "let testUInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; - "let testUInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; - "let testUInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; - "let testUInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,58--19,69)"; - "let testUInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,58--20,69)"; - "let testUInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; - "let testUInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; - "let testUInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; - "let testUInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; - "let testUInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; - "let testUInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; - "let testUInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; - "let testUInt32ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; - "let testUInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; - "let testUInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; - "let testUInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; - "let testUInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; - "let testUInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; - "let testUInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; - "let testUInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; - "let testUInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; - "let testUInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; - "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; - "let testUInt32ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; - "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; - "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; - "let testUInt32ToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,47--48,55)"; - "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; - "let testUInt32ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; - "let testUInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; - "let testUInt32ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; - "let testUInt32ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; - "let testUInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; - "let testUInt32ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint32 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" + [], "type OperatorTestsUInt32"; + [], "let testUInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; + [], "let testUInt32NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,69--5,79)"; + [], "let testUInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; + [], "let testUInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,69--7,79)"; + [], "let testUInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; + [], "let testUInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,69--9,79)"; + [], "let testUInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; + [], "let testUInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; + [], "let testUInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + [], "let testUInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; + [], "let testUInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; + [], "let testUInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; + [], "let testUInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; + [], "let testUInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; + [], "let testUInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,58--19,69)"; + [], "let testUInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,58--20,69)"; + [], "let testUInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + [], "let testUInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + [], "let testUInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + [], "let testUInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + [], "let testUInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + [], "let testUInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + [], "let testUInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + [], "let testUInt32ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; + [], "let testUInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + [], "let testUInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + [], "let testUInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + [], "let testUInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + [], "let testUInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + [], "let testUInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + [], "let testUInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + [], "let testUInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + [], "let testUInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + [], "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + [], "let testUInt32ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; + [], "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + [], "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + [], "let testUInt32ToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,47--48,55)"; + [], "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + [], "let testUInt32ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; + [], "let testUInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + [], "let testUInt32ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; + [], "let testUInt32ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; + [], "let testUInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; + [], "let testUInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + [FC47], "let testUInt32ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint32 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" ] testOperators "UInt32" "uint32" excludedTests expectedUnoptimized expectedOptimized @@ -1801,107 +1865,107 @@ let ``Test Operator Declarations for Int64`` () = let excludedTests = [ ] let expectedUnoptimized = [ - "type OperatorTestsInt64"; - "let testInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; - "let testInt64NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,66--5,76)"; - "let testInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; - "let testInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,66--7,76)"; - "let testInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; - "let testInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,66--9,76)"; - "let testInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; - "let testInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; - "let testInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; - "let testInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; - "let testInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; - "let testInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; - "let testInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; - "let testInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; - "let testInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,56--19,67)"; - "let testInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,56--20,67)"; - "let testInt64UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; - "let testInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; - "let testInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; - "let testInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; - "let testInt64UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; - "let testInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; - "let testInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; - "let testInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; - "let testInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; - "let testInt64ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; - "let testInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; - "let testInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; - "let testInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; - "let testInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; - "let testInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; - "let testInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; - "let testInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; - "let testInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; - "let testInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; - "let testInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testInt64ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; - "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; - "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; - "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; - "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; - "let testInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; - "let testInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; - "let testInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; - "let testInt64ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; - "let testInt64ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; + [], "type OperatorTestsInt64"; + [], "let testInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; + [], "let testInt64NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,66--5,76)"; + [], "let testInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; + [], "let testInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,66--7,76)"; + [], "let testInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; + [], "let testInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,66--9,76)"; + [], "let testInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; + [], "let testInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; + [], "let testInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + [], "let testInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; + [], "let testInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; + [], "let testInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; + [], "let testInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; + [], "let testInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; + [], "let testInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,56--19,67)"; + [], "let testInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,56--20,67)"; + [], "let testInt64UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; + [], "let testInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + [], "let testInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + [], "let testInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + [], "let testInt64UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; + [], "let testInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + [], "let testInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + [], "let testInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + [], "let testInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + [], "let testInt64ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; + [], "let testInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + [], "let testInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + [], "let testInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + [], "let testInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + [], "let testInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + [], "let testInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + [], "let testInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + [], "let testInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + [], "let testInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + [], "let testInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + [], "let testInt64ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; + [], "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + [], "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + [], "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + [], "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + [], "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + [], "let testInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; + [], "let testInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + [], "let testInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + [], "let testInt64ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; + [], "let testInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + [], "let testInt64ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; ] let expectedOptimized = [ - "type OperatorTestsInt64"; - "let testInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; - "let testInt64NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,66--5,76)"; - "let testInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; - "let testInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,66--7,76)"; - "let testInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; - "let testInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,66--9,76)"; - "let testInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; - "let testInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; - "let testInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; - "let testInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; - "let testInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; - "let testInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; - "let testInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; - "let testInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; - "let testInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (19,56--19,67)"; - "let testInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (20,56--20,67)"; - "let testInt64UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; - "let testInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; - "let testInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; - "let testInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; - "let testInt64UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; - "let testInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; - "let testInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; - "let testInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; - "let testInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; - "let testInt64ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; - "let testInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; - "let testInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; - "let testInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; - "let testInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; - "let testInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; - "let testInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; - "let testInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; - "let testInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; - "let testInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; - "let testInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; - "let testInt64ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; - "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; - "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; - "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; - "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; - "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; - "let testInt64ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; - "let testInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; - "let testInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; - "let testInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; - "let testInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; - "let testInt64ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" + [], "type OperatorTestsInt64"; + [], "let testInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,66--4,75)"; + [], "let testInt64NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,66--5,76)"; + [], "let testInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,66--6,75)"; + [], "let testInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,66--7,76)"; + [], "let testInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,66--8,75)"; + [], "let testInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,66--9,76)"; + [], "let testInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,58--11,67)"; + [], "let testInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,58--12,67)"; + [], "let testInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + [], "let testInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,58--14,67)"; + [], "let testInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,58--15,67)"; + [], "let testInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,58--16,69)"; + [], "let testInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,58--17,69)"; + [], "let testInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,58--18,69)"; + [], "let testInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (19,56--19,67)"; + [], "let testInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (20,56--20,67)"; + [], "let testInt64UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,45--22,52)"; + [], "let testInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + [], "let testInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + [], "let testInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + [], "let testInt64UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; + [], "let testInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + [], "let testInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + [], "let testInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + [], "let testInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + [], "let testInt64ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; + [], "let testInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + [], "let testInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + [], "let testInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + [], "let testInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + [], "let testInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + [], "let testInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + [], "let testInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + [], "let testInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + [], "let testInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + [], "let testInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + [], "let testInt64ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; + [], "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + [], "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + [], "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + [], "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + [], "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + [], "let testInt64ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; + [], "let testInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + [], "let testInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + [], "let testInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; + [], "let testInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + [FC47], "let testInt64ToStringOperator(e1) = IntrinsicFunctions.UnboxGeneric (Operators.Box (e1)).ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,45--56,54)" ] testOperators "Int64" "int64" excludedTests expectedUnoptimized expectedOptimized @@ -1914,103 +1978,103 @@ let ``Test Operator Declarations for UInt64`` () = ] let expectedUnoptimized = [ - "type OperatorTestsUInt64"; - "let testUInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; - "let testUInt64NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,69--5,79)"; - "let testUInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; - "let testUInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,69--7,79)"; - "let testUInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; - "let testUInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,69--9,79)"; - "let testUInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; - "let testUInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; - "let testUInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; - "let testUInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; - "let testUInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; - "let testUInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; - "let testUInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; - "let testUInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; - "let testUInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,58--19,69)"; - "let testUInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,58--20,69)"; - "let testUInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; - "let testUInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; - "let testUInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; - "let testUInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; - "let testUInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; - "let testUInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; - "let testUInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; - "let testUInt64ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; - "let testUInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; - "let testUInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; - "let testUInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; - "let testUInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; - "let testUInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; - "let testUInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; - "let testUInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; - "let testUInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; - "let testUInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; - "let testUInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; - "let testUInt64ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; - "let testUInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; - "let testUInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; - "let testUInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; - "let testUInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; - "let testUInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; - "let testUInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; - "let testUInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; - "let testUInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; - "let testUInt64ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; - "let testUInt64ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; + [], "type OperatorTestsUInt64"; + [], "let testUInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; + [], "let testUInt64NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,69--5,79)"; + [], "let testUInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; + [], "let testUInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,69--7,79)"; + [], "let testUInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; + [], "let testUInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,69--9,79)"; + [], "let testUInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; + [], "let testUInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; + [], "let testUInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + [], "let testUInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; + [], "let testUInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; + [], "let testUInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; + [], "let testUInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; + [], "let testUInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; + [], "let testUInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,58--19,69)"; + [], "let testUInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,58--20,69)"; + [], "let testUInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + [], "let testUInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + [], "let testUInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + [], "let testUInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + [], "let testUInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + [], "let testUInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + [], "let testUInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + [], "let testUInt64ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; + [], "let testUInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + [], "let testUInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + [], "let testUInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + [], "let testUInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + [], "let testUInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + [], "let testUInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + [], "let testUInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + [], "let testUInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + [], "let testUInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + [], "let testUInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + [], "let testUInt64ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; + [], "let testUInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + [], "let testUInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + [], "let testUInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + [], "let testUInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + [], "let testUInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; + [], "let testUInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + [], "let testUInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; + [], "let testUInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; + [], "let testUInt64ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; + [], "let testUInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + [], "let testUInt64ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; ] let expectedOptimized = [ - "type OperatorTestsUInt64"; - "let testUInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; - "let testUInt64NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,69--5,79)"; - "let testUInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; - "let testUInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,69--7,79)"; - "let testUInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; - "let testUInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,69--9,79)"; - "let testUInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; - "let testUInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; - "let testUInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; - "let testUInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; - "let testUInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; - "let testUInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; - "let testUInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; - "let testUInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; - "let testUInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (19,58--19,69)"; - "let testUInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (20,58--20,69)"; - "let testUInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; - "let testUInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; - "let testUInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; - "let testUInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; - "let testUInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; - "let testUInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; - "let testUInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; - "let testUInt64ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; - "let testUInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; - "let testUInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; - "let testUInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; - "let testUInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; - "let testUInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; - "let testUInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; - "let testUInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; - "let testUInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; - "let testUInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; - "let testUInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; - "let testUInt64ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; - "let testUInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; - "let testUInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; - "let testUInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; - "let testUInt64ToUInt64Operator(e1) = e1 @ (49,54--49,56)"; - "let testUInt64ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; - "let testUInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; - "let testUInt64ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; - "let testUInt64ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; - "let testUInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; - "let testUInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; - "let testUInt64ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint64 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" + [], "type OperatorTestsUInt64"; + [], "let testUInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; + [], "let testUInt64NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,69--5,79)"; + [], "let testUInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; + [], "let testUInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,69--7,79)"; + [], "let testUInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; + [], "let testUInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,69--9,79)"; + [], "let testUInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; + [], "let testUInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,61--12,70)"; + [], "let testUInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + [], "let testUInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,61--14,70)"; + [], "let testUInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,61--15,70)"; + [], "let testUInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,61--16,72)"; + [], "let testUInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,61--17,72)"; + [], "let testUInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,61--18,72)"; + [], "let testUInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (19,58--19,69)"; + [], "let testUInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (20,58--20,69)"; + [], "let testUInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + [], "let testUInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + [], "let testUInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + [], "let testUInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + [], "let testUInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + [], "let testUInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + [], "let testUInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + [], "let testUInt64ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; + [], "let testUInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + [], "let testUInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + [], "let testUInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + [], "let testUInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + [], "let testUInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + [], "let testUInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + [], "let testUInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + [], "let testUInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + [], "let testUInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + [], "let testUInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + [], "let testUInt64ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; + [], "let testUInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + [], "let testUInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + [], "let testUInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + [], "let testUInt64ToUInt64Operator(e1) = e1 @ (49,54--49,56)"; + [], "let testUInt64ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; + [], "let testUInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + [], "let testUInt64ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; + [], "let testUInt64ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; + [], "let testUInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; + [], "let testUInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + [FC47], "let testUInt64ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint64 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" ] testOperators "UInt64" "uint64" excludedTests expectedUnoptimized expectedOptimized @@ -2020,107 +2084,107 @@ let ``Test Operator Declarations for IntPtr`` () = let excludedTests = [ ] let expectedUnoptimized = [ - "type OperatorTestsIntPtr"; - "let testIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,75--4,84)"; - "let testIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,75--5,85)"; - "let testIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,75--6,84)"; - "let testIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,75--7,85)"; - "let testIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,75--8,84)"; - "let testIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,75--9,85)"; - "let testIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,67--11,76)"; - "let testIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,67--12,76)"; - "let testIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,67--13,76)"; - "let testIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,67--14,76)"; - "let testIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,67--15,76)"; - "let testIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,67--16,78)"; - "let testIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,67--17,78)"; - "let testIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,67--18,78)"; - "let testIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,61--19,72)"; - "let testIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,61--20,72)"; - "let testIntPtrUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,50--22,57)"; - "let testIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,65--24,82)"; - "let testIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,65--25,82)"; - "let testIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,65--26,82)"; - "let testIntPtrUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,50--27,65)"; - "let testIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,50--29,65)"; - "let testIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,50--30,66)"; - "let testIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,50--31,66)"; - "let testIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,50--32,67)"; - "let testIntPtrToIntChecked(e1) = Checked.ToInt (e1) @ (33,50--33,64)"; - "let testIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,50--34,66)"; - "let testIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,50--35,67)"; - "let testIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,50--36,66)"; - "let testIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,50--37,67)"; - "let testIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,50--38,70)"; - "let testIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,50--39,71)"; - "let testIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,50--41,57)"; - "let testIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,50--42,58)"; - "let testIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,50--43,58)"; - "let testIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,50--44,59)"; - "let testIntPtrToIntOperator(e1) = Operators.ToInt (e1) @ (45,50--45,56)"; - "let testIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,50--46,58)"; - "let testIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,50--47,59)"; - "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,50--48,58)"; - "let testIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,50--49,59)"; - "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,50--50,62)"; - "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,50--51,63)"; - "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,50--52,60)"; - "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,50--53,58)"; - "let testIntPtrToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,50--54,60)"; - "let testIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,50--55,57)"; - "let testIntPtrToStringOperator(e1) = Operators.ToString (e1) @ (56,50--56,59)"; + [], "type OperatorTestsIntPtr"; + [], "let testIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,75--4,84)"; + [], "let testIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,75--5,85)"; + [], "let testIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,75--6,84)"; + [], "let testIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,75--7,85)"; + [], "let testIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,75--8,84)"; + [], "let testIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,75--9,85)"; + [], "let testIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,67--11,76)"; + [], "let testIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,67--12,76)"; + [], "let testIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,67--13,76)"; + [], "let testIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,67--14,76)"; + [], "let testIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,67--15,76)"; + [], "let testIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,67--16,78)"; + [], "let testIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,67--17,78)"; + [], "let testIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,67--18,78)"; + [], "let testIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,61--19,72)"; + [], "let testIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,61--20,72)"; + [], "let testIntPtrUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,50--22,57)"; + [], "let testIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,65--24,82)"; + [], "let testIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,65--25,82)"; + [], "let testIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,65--26,82)"; + [], "let testIntPtrUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,50--27,65)"; + [], "let testIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,50--29,65)"; + [], "let testIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,50--30,66)"; + [], "let testIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,50--31,66)"; + [], "let testIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,50--32,67)"; + [], "let testIntPtrToIntChecked(e1) = Checked.ToInt (e1) @ (33,50--33,64)"; + [], "let testIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,50--34,66)"; + [], "let testIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,50--35,67)"; + [], "let testIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,50--36,66)"; + [], "let testIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,50--37,67)"; + [], "let testIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,50--38,70)"; + [], "let testIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,50--39,71)"; + [], "let testIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,50--41,57)"; + [], "let testIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,50--42,58)"; + [], "let testIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,50--43,58)"; + [], "let testIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,50--44,59)"; + [], "let testIntPtrToIntOperator(e1) = Operators.ToInt (e1) @ (45,50--45,56)"; + [], "let testIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,50--46,58)"; + [], "let testIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,50--47,59)"; + [], "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,50--48,58)"; + [], "let testIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,50--49,59)"; + [], "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,50--50,62)"; + [], "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,50--51,63)"; + [], "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,50--52,60)"; + [], "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,50--53,58)"; + [], "let testIntPtrToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,50--54,60)"; + [], "let testIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,50--55,57)"; + [], "let testIntPtrToStringOperator(e1) = Operators.ToString (e1) @ (56,50--56,59)"; ] let expectedOptimized = [ - "type OperatorTestsIntPtr"; - "let testIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,75--4,84)"; - "let testIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,75--5,85)"; - "let testIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,75--6,84)"; - "let testIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,75--7,85)"; - "let testIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,75--8,84)"; - "let testIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,75--9,85)"; - "let testIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,67--11,76)"; - "let testIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,67--12,76)"; - "let testIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,67--13,76)"; - "let testIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,67--14,76)"; - "let testIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,67--15,76)"; - "let testIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,67--16,78)"; - "let testIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,67--17,78)"; - "let testIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,67--18,78)"; - "let testIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,61--19,72)"; - "let testIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,61--20,72)"; - "let testIntPtrUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,50--22,57)"; - "let testIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,65--24,82)"; - "let testIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,65--25,82)"; - "let testIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,65--26,82)"; - "let testIntPtrUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,50--27,65)"; - "let testIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,50--29,65)"; - "let testIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,50--30,66)"; - "let testIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,50--31,66)"; - "let testIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,50--32,67)"; - "let testIntPtrToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,50--33,64)"; - "let testIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,50--34,66)"; - "let testIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,50--35,67)"; - "let testIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,50--36,66)"; - "let testIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,50--37,67)"; - "let testIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,50--38,70)"; - "let testIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,50--39,71)"; - "let testIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,50--41,57)"; - "let testIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,50--42,58)"; - "let testIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,50--43,58)"; - "let testIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,50--44,59)"; - "let testIntPtrToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,50--45,56)"; - "let testIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,50--46,58)"; - "let testIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,50--47,59)"; - "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,50--48,58)"; - "let testIntPtrToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,50--49,59)"; - "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,50--50,62)"; - "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,50--51,63)"; - "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,50--52,60)"; - "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,50--53,58)"; - "let testIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToInt64 (e1)) @ (54,50--54,60)"; - "let testIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,50--55,57)"; - "let testIntPtrToStringOperator(e1) = e1.ToString() @ (56,50--56,59)" + [], "type OperatorTestsIntPtr"; + [], "let testIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,75--4,84)"; + [], "let testIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,75--5,85)"; + [], "let testIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,75--6,84)"; + [], "let testIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,75--7,85)"; + [], "let testIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,75--8,84)"; + [], "let testIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,75--9,85)"; + [], "let testIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,67--11,76)"; + [], "let testIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,67--12,76)"; + [], "let testIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,67--13,76)"; + [], "let testIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,67--14,76)"; + [], "let testIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,67--15,76)"; + [], "let testIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,67--16,78)"; + [], "let testIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,67--17,78)"; + [], "let testIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,67--18,78)"; + [], "let testIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,61--19,72)"; + [], "let testIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,61--20,72)"; + [], "let testIntPtrUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,50--22,57)"; + [], "let testIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,65--24,82)"; + [], "let testIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,65--25,82)"; + [], "let testIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,65--26,82)"; + [], "let testIntPtrUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,50--27,65)"; + [], "let testIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,50--29,65)"; + [], "let testIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,50--30,66)"; + [], "let testIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,50--31,66)"; + [], "let testIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,50--32,67)"; + [], "let testIntPtrToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,50--33,64)"; + [], "let testIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,50--34,66)"; + [], "let testIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,50--35,67)"; + [], "let testIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,50--36,66)"; + [], "let testIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,50--37,67)"; + [], "let testIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,50--38,70)"; + [], "let testIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,50--39,71)"; + [], "let testIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,50--41,57)"; + [], "let testIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,50--42,58)"; + [], "let testIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,50--43,58)"; + [], "let testIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,50--44,59)"; + [], "let testIntPtrToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,50--45,56)"; + [], "let testIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,50--46,58)"; + [], "let testIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,50--47,59)"; + [], "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,50--48,58)"; + [], "let testIntPtrToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,50--49,59)"; + [], "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,50--50,62)"; + [], "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,50--51,63)"; + [], "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,50--52,60)"; + [], "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,50--53,58)"; + [], "let testIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToInt64 (e1)) @ (54,50--54,60)"; + [], "let testIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,50--55,57)"; + [FC47], "let testIntPtrToStringOperator(e1) = e1.ToString() @ (56,50--56,59)" ] testOperators "IntPtr" "nativeint" excludedTests expectedUnoptimized expectedOptimized @@ -2133,103 +2197,103 @@ let ``Test Operator Declarations for UIntPtr`` () = ] let expectedUnoptimized = [ - "type OperatorTestsUIntPtr"; - "let testUIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,78--4,87)"; - "let testUIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,78--5,88)"; - "let testUIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,78--6,87)"; - "let testUIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,78--7,88)"; - "let testUIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,78--8,87)"; - "let testUIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,78--9,88)"; - "let testUIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,70--11,79)"; - "let testUIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,70--12,79)"; - "let testUIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,70--13,79)"; - "let testUIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,70--14,79)"; - "let testUIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,70--15,79)"; - "let testUIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,70--16,81)"; - "let testUIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,70--17,81)"; - "let testUIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,70--18,81)"; - "let testUIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,63--19,74)"; - "let testUIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,63--20,74)"; - "let testUIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,68--24,85)"; - "let testUIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,68--25,85)"; - "let testUIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,68--26,85)"; - "let testUIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,52--29,67)"; - "let testUIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,52--30,68)"; - "let testUIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,52--31,68)"; - "let testUIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,52--32,69)"; - "let testUIntPtrToIntChecked(e1) = Checked.ToInt (e1) @ (33,52--33,66)"; - "let testUIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,52--34,68)"; - "let testUIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,52--35,69)"; - "let testUIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,52--36,68)"; - "let testUIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,52--37,69)"; - "let testUIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,52--38,72)"; - "let testUIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,52--39,73)"; - "let testUIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,52--41,59)"; - "let testUIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,52--42,60)"; - "let testUIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,52--43,60)"; - "let testUIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,52--44,61)"; - "let testUIntPtrToIntOperator(e1) = Operators.ToInt (e1) @ (45,52--45,58)"; - "let testUIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,52--46,60)"; - "let testUIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,52--47,61)"; - "let testUIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,52--48,60)"; - "let testUIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,52--49,61)"; - "let testUIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,52--50,64)"; - "let testUIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,52--51,65)"; - "let testUIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,52--52,62)"; - "let testUIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,52--53,60)"; - "let testUIntPtrToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,52--54,62)"; - "let testUIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,52--55,59)"; - "let testUIntPtrToStringOperator(e1) = Operators.ToString (e1) @ (56,52--56,61)"; + [], "type OperatorTestsUIntPtr"; + [], "let testUIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,78--4,87)"; + [], "let testUIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,78--5,88)"; + [], "let testUIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,78--6,87)"; + [], "let testUIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,78--7,88)"; + [], "let testUIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,78--8,87)"; + [], "let testUIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,78--9,88)"; + [], "let testUIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,70--11,79)"; + [], "let testUIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,70--12,79)"; + [], "let testUIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,70--13,79)"; + [], "let testUIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,70--14,79)"; + [], "let testUIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,70--15,79)"; + [], "let testUIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,70--16,81)"; + [], "let testUIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,70--17,81)"; + [], "let testUIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,70--18,81)"; + [], "let testUIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,63--19,74)"; + [], "let testUIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,63--20,74)"; + [], "let testUIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,68--24,85)"; + [], "let testUIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,68--25,85)"; + [], "let testUIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,68--26,85)"; + [], "let testUIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,52--29,67)"; + [], "let testUIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,52--30,68)"; + [], "let testUIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,52--31,68)"; + [], "let testUIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,52--32,69)"; + [], "let testUIntPtrToIntChecked(e1) = Checked.ToInt (e1) @ (33,52--33,66)"; + [], "let testUIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,52--34,68)"; + [], "let testUIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,52--35,69)"; + [], "let testUIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,52--36,68)"; + [], "let testUIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,52--37,69)"; + [], "let testUIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,52--38,72)"; + [], "let testUIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,52--39,73)"; + [], "let testUIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,52--41,59)"; + [], "let testUIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,52--42,60)"; + [], "let testUIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,52--43,60)"; + [], "let testUIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,52--44,61)"; + [], "let testUIntPtrToIntOperator(e1) = Operators.ToInt (e1) @ (45,52--45,58)"; + [], "let testUIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,52--46,60)"; + [], "let testUIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,52--47,61)"; + [], "let testUIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,52--48,60)"; + [], "let testUIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,52--49,61)"; + [], "let testUIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,52--50,64)"; + [], "let testUIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,52--51,65)"; + [], "let testUIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,52--52,62)"; + [], "let testUIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,52--53,60)"; + [], "let testUIntPtrToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,52--54,62)"; + [], "let testUIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,52--55,59)"; + [], "let testUIntPtrToStringOperator(e1) = Operators.ToString (e1) @ (56,52--56,61)"; ] let expectedOptimized = [ - "type OperatorTestsUIntPtr"; - "let testUIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,78--4,87)"; - "let testUIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,78--5,88)"; - "let testUIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,78--6,87)"; - "let testUIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,78--7,88)"; - "let testUIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,78--8,87)"; - "let testUIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,78--9,88)"; - "let testUIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,70--11,79)"; - "let testUIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,70--12,79)"; - "let testUIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,70--13,79)"; - "let testUIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,70--14,79)"; - "let testUIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,70--15,79)"; - "let testUIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,70--16,81)"; - "let testUIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,70--17,81)"; - "let testUIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,70--18,81)"; - "let testUIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,63--19,74)"; - "let testUIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,63--20,74)"; - "let testUIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,68--24,85)"; - "let testUIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,68--25,85)"; - "let testUIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,68--26,85)"; - "let testUIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,52--29,67)"; - "let testUIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,52--30,68)"; - "let testUIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,52--31,68)"; - "let testUIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,52--32,69)"; - "let testUIntPtrToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,52--33,66)"; - "let testUIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,52--34,68)"; - "let testUIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,52--35,69)"; - "let testUIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,52--36,68)"; - "let testUIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,52--37,69)"; - "let testUIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,52--38,72)"; - "let testUIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,52--39,73)"; - "let testUIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,52--41,59)"; - "let testUIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,52--42,60)"; - "let testUIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,52--43,60)"; - "let testUIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,52--44,61)"; - "let testUIntPtrToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,52--45,58)"; - "let testUIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,52--46,60)"; - "let testUIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,52--47,61)"; - "let testUIntPtrToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,52--48,60)"; - "let testUIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,52--49,61)"; - "let testUIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,52--50,64)"; - "let testUIntPtrToUIntPtrOperator(e1) = e1 @ (51,63--51,65)"; - "let testUIntPtrToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,52--52,62)"; - "let testUIntPtrToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,52--53,60)"; - "let testUIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToUInt64 (e1)) @ (54,52--54,62)"; - "let testUIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,52--55,59)"; - "let testUIntPtrToStringOperator(e1) = e1.ToString() @ (56,52--56,61)" + [], "type OperatorTestsUIntPtr"; + [], "let testUIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,78--4,87)"; + [], "let testUIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,78--5,88)"; + [], "let testUIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,78--6,87)"; + [], "let testUIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,78--7,88)"; + [], "let testUIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,78--8,87)"; + [], "let testUIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,78--9,88)"; + [], "let testUIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,70--11,79)"; + [], "let testUIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,70--12,79)"; + [], "let testUIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,70--13,79)"; + [], "let testUIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,70--14,79)"; + [], "let testUIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,70--15,79)"; + [], "let testUIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,70--16,81)"; + [], "let testUIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,70--17,81)"; + [], "let testUIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,70--18,81)"; + [], "let testUIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,63--19,74)"; + [], "let testUIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,63--20,74)"; + [], "let testUIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,68--24,85)"; + [], "let testUIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,68--25,85)"; + [], "let testUIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,68--26,85)"; + [], "let testUIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,52--29,67)"; + [], "let testUIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,52--30,68)"; + [], "let testUIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,52--31,68)"; + [], "let testUIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,52--32,69)"; + [], "let testUIntPtrToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,52--33,66)"; + [], "let testUIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,52--34,68)"; + [], "let testUIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,52--35,69)"; + [], "let testUIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,52--36,68)"; + [], "let testUIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,52--37,69)"; + [], "let testUIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,52--38,72)"; + [], "let testUIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,52--39,73)"; + [], "let testUIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,52--41,59)"; + [], "let testUIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,52--42,60)"; + [], "let testUIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,52--43,60)"; + [], "let testUIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,52--44,61)"; + [], "let testUIntPtrToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,52--45,58)"; + [], "let testUIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,52--46,60)"; + [], "let testUIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,52--47,61)"; + [], "let testUIntPtrToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,52--48,60)"; + [], "let testUIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,52--49,61)"; + [], "let testUIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,52--50,64)"; + [], "let testUIntPtrToUIntPtrOperator(e1) = e1 @ (51,63--51,65)"; + [], "let testUIntPtrToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,52--52,62)"; + [], "let testUIntPtrToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,52--53,60)"; + [], "let testUIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToUInt64 (e1)) @ (54,52--54,62)"; + [], "let testUIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,52--55,59)"; + [FC47], "let testUIntPtrToStringOperator(e1) = e1.ToString() @ (56,52--56,61)" ] testOperators "UIntPtr" "unativeint" excludedTests expectedUnoptimized expectedOptimized @@ -2245,97 +2309,97 @@ let ``Test Operator Declarations for Single`` () = ] let expectedUnoptimized = [ - "type OperatorTestsSingle"; - "let testSingleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,71--4,80)"; - "let testSingleNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,71--5,81)"; - "let testSingleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,71--6,80)"; - "let testSingleLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,71--7,81)"; - "let testSingleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,71--8,80)"; - "let testSingleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,71--9,81)"; - "let testSingleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,63--11,72)"; - "let testSingleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,63--12,72)"; - "let testSingleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,63--13,72)"; - "let testSingleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,63--14,72)"; - "let testSingleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,63--15,72)"; - "let testSingleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,48--22,55)"; - "let testSingleAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,61--24,78)"; - "let testSingleSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,61--25,78)"; - "let testSingleMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,61--26,78)"; - "let testSingleUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,48--27,63)"; - "let testSingleToByteChecked(e1) = Checked.ToByte (e1) @ (29,48--29,63)"; - "let testSingleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,48--30,64)"; - "let testSingleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,48--31,64)"; - "let testSingleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,48--32,65)"; - "let testSingleToIntChecked(e1) = Checked.ToInt (e1) @ (33,48--33,62)"; - "let testSingleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,48--34,64)"; - "let testSingleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,48--35,65)"; - "let testSingleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,48--36,64)"; - "let testSingleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,48--37,65)"; - "let testSingleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,48--38,68)"; - "let testSingleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,48--39,69)"; - "let testSingleToByteOperator(e1) = Operators.ToByte (e1) @ (41,48--41,55)"; - "let testSingleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,48--42,56)"; - "let testSingleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,48--43,56)"; - "let testSingleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,48--44,57)"; - "let testSingleToIntOperator(e1) = Operators.ToInt (e1) @ (45,48--45,54)"; - "let testSingleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,48--46,56)"; - "let testSingleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,48--47,57)"; - "let testSingleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,48--48,56)"; - "let testSingleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,48--49,57)"; - "let testSingleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,48--50,60)"; - "let testSingleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,48--51,61)"; - "let testSingleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,48--52,58)"; - "let testSingleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,48--53,56)"; - "let testSingleToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,48--54,58)"; - "let testSingleToCharOperator(e1) = Operators.ToChar (e1) @ (55,48--55,55)"; - "let testSingleToStringOperator(e1) = Operators.ToString (e1) @ (56,48--56,57)"; + [], "type OperatorTestsSingle"; + [], "let testSingleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,71--4,80)"; + [], "let testSingleNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,71--5,81)"; + [], "let testSingleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,71--6,80)"; + [], "let testSingleLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,71--7,81)"; + [], "let testSingleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,71--8,80)"; + [], "let testSingleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,71--9,81)"; + [], "let testSingleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,63--11,72)"; + [], "let testSingleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,63--12,72)"; + [], "let testSingleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,63--13,72)"; + [], "let testSingleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,63--14,72)"; + [], "let testSingleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,63--15,72)"; + [], "let testSingleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,48--22,55)"; + [], "let testSingleAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,61--24,78)"; + [], "let testSingleSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,61--25,78)"; + [], "let testSingleMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,61--26,78)"; + [], "let testSingleUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,48--27,63)"; + [], "let testSingleToByteChecked(e1) = Checked.ToByte (e1) @ (29,48--29,63)"; + [], "let testSingleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,48--30,64)"; + [], "let testSingleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,48--31,64)"; + [], "let testSingleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,48--32,65)"; + [], "let testSingleToIntChecked(e1) = Checked.ToInt (e1) @ (33,48--33,62)"; + [], "let testSingleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,48--34,64)"; + [], "let testSingleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,48--35,65)"; + [], "let testSingleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,48--36,64)"; + [], "let testSingleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,48--37,65)"; + [], "let testSingleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,48--38,68)"; + [], "let testSingleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,48--39,69)"; + [], "let testSingleToByteOperator(e1) = Operators.ToByte (e1) @ (41,48--41,55)"; + [], "let testSingleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,48--42,56)"; + [], "let testSingleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,48--43,56)"; + [], "let testSingleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,48--44,57)"; + [], "let testSingleToIntOperator(e1) = Operators.ToInt (e1) @ (45,48--45,54)"; + [], "let testSingleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,48--46,56)"; + [], "let testSingleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,48--47,57)"; + [], "let testSingleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,48--48,56)"; + [], "let testSingleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,48--49,57)"; + [], "let testSingleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,48--50,60)"; + [], "let testSingleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,48--51,61)"; + [], "let testSingleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,48--52,58)"; + [], "let testSingleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,48--53,56)"; + [], "let testSingleToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,48--54,58)"; + [], "let testSingleToCharOperator(e1) = Operators.ToChar (e1) @ (55,48--55,55)"; + [], "let testSingleToStringOperator(e1) = Operators.ToString (e1) @ (56,48--56,57)"; ] let expectedOptimized = [ - "type OperatorTestsSingle"; - "let testSingleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,71--4,80)"; - "let testSingleNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,71--5,81)"; - "let testSingleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,71--6,80)"; - "let testSingleLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,71--7,81)"; - "let testSingleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,71--8,80)"; - "let testSingleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,71--9,81)"; - "let testSingleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,63--11,72)"; - "let testSingleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,63--12,72)"; - "let testSingleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,63--13,72)"; - "let testSingleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,63--14,72)"; - "let testSingleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,63--15,72)"; - "let testSingleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,48--22,55)"; - "let testSingleAdditionChecked(e1) (e2) = Operators.op_Addition (e1,e2) @ (24,61--24,78)"; - "let testSingleSubtractionChecked(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (25,61--25,78)"; - "let testSingleMultiplyChecked(e1) (e2) = Operators.op_Multiply (e1,e2) @ (26,61--26,78)"; - "let testSingleUnaryNegChecked(e1) = Operators.op_UnaryNegation (e1) @ (27,48--27,63)"; - "let testSingleToByteChecked(e1) = Checked.ToByte (e1) @ (29,48--29,63)"; - "let testSingleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,48--30,64)"; - "let testSingleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,48--31,64)"; - "let testSingleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,48--32,65)"; - "let testSingleToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,48--33,62)"; - "let testSingleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,48--34,64)"; - "let testSingleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,48--35,65)"; - "let testSingleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,48--36,64)"; - "let testSingleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,48--37,65)"; - "let testSingleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,48--38,68)"; - "let testSingleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,48--39,69)"; - "let testSingleToByteOperator(e1) = Operators.ToByte (e1) @ (41,48--41,55)"; - "let testSingleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,48--42,56)"; - "let testSingleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,48--43,56)"; - "let testSingleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,48--44,57)"; - "let testSingleToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,48--45,54)"; - "let testSingleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,48--46,56)"; - "let testSingleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,48--47,57)"; - "let testSingleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,48--48,56)"; - "let testSingleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,48--49,57)"; - "let testSingleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,48--50,60)"; - "let testSingleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,48--51,61)"; - "let testSingleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,48--52,58)"; - "let testSingleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,48--53,56)"; - "let testSingleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,48--54,58)"; - "let testSingleToCharOperator(e1) = Operators.ToChar (e1) @ (55,48--55,55)"; - "let testSingleToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,48--56,57)" + [], "type OperatorTestsSingle"; + [], "let testSingleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,71--4,80)"; + [], "let testSingleNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,71--5,81)"; + [], "let testSingleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,71--6,80)"; + [], "let testSingleLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,71--7,81)"; + [], "let testSingleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,71--8,80)"; + [], "let testSingleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,71--9,81)"; + [], "let testSingleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,63--11,72)"; + [], "let testSingleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,63--12,72)"; + [], "let testSingleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,63--13,72)"; + [], "let testSingleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,63--14,72)"; + [], "let testSingleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,63--15,72)"; + [], "let testSingleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,48--22,55)"; + [], "let testSingleAdditionChecked(e1) (e2) = Operators.op_Addition (e1,e2) @ (24,61--24,78)"; + [], "let testSingleSubtractionChecked(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (25,61--25,78)"; + [], "let testSingleMultiplyChecked(e1) (e2) = Operators.op_Multiply (e1,e2) @ (26,61--26,78)"; + [], "let testSingleUnaryNegChecked(e1) = Operators.op_UnaryNegation (e1) @ (27,48--27,63)"; + [], "let testSingleToByteChecked(e1) = Checked.ToByte (e1) @ (29,48--29,63)"; + [], "let testSingleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,48--30,64)"; + [], "let testSingleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,48--31,64)"; + [], "let testSingleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,48--32,65)"; + [], "let testSingleToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,48--33,62)"; + [], "let testSingleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,48--34,64)"; + [], "let testSingleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,48--35,65)"; + [], "let testSingleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,48--36,64)"; + [], "let testSingleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,48--37,65)"; + [], "let testSingleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,48--38,68)"; + [], "let testSingleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,48--39,69)"; + [], "let testSingleToByteOperator(e1) = Operators.ToByte (e1) @ (41,48--41,55)"; + [], "let testSingleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,48--42,56)"; + [], "let testSingleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,48--43,56)"; + [], "let testSingleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,48--44,57)"; + [], "let testSingleToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,48--45,54)"; + [], "let testSingleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,48--46,56)"; + [], "let testSingleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,48--47,57)"; + [], "let testSingleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,48--48,56)"; + [], "let testSingleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,48--49,57)"; + [], "let testSingleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,48--50,60)"; + [], "let testSingleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,48--51,61)"; + [], "let testSingleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,48--52,58)"; + [], "let testSingleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,48--53,56)"; + [], "let testSingleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,48--54,58)"; + [], "let testSingleToCharOperator(e1) = Operators.ToChar (e1) @ (55,48--55,55)"; + [FC47], "let testSingleToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,48--56,57)" ] testOperators "Single" "float32" excludedTests expectedUnoptimized expectedOptimized @@ -2351,97 +2415,97 @@ let ``Test Operator Declarations for Double`` () = ] let expectedUnoptimized = [ - "type OperatorTestsDouble"; - "let testDoubleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,76)"; - "let testDoubleNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,67--5,77)"; - "let testDoubleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,76)"; - "let testDoubleLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,67--7,77)"; - "let testDoubleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,76)"; - "let testDoubleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,67--9,77)"; - "let testDoubleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,68)"; - "let testDoubleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,68)"; - "let testDoubleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,59--13,68)"; - "let testDoubleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,68)"; - "let testDoubleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,68)"; - "let testDoubleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,53)"; - "let testDoubleAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,57--24,74)"; - "let testDoubleSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,57--25,74)"; - "let testDoubleMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,57--26,74)"; - "let testDoubleUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,46--27,61)"; - "let testDoubleToByteChecked(e1) = Checked.ToByte (e1) @ (29,46--29,61)"; - "let testDoubleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,46--30,62)"; - "let testDoubleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,46--31,62)"; - "let testDoubleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,46--32,63)"; - "let testDoubleToIntChecked(e1) = Checked.ToInt (e1) @ (33,46--33,60)"; - "let testDoubleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,46--34,62)"; - "let testDoubleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,46--35,63)"; - "let testDoubleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,46--36,62)"; - "let testDoubleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,46--37,63)"; - "let testDoubleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,46--38,66)"; - "let testDoubleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,46--39,67)"; - "let testDoubleToByteOperator(e1) = Operators.ToByte (e1) @ (41,46--41,53)"; - "let testDoubleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,46--42,54)"; - "let testDoubleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,46--43,54)"; - "let testDoubleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,46--44,55)"; - "let testDoubleToIntOperator(e1) = Operators.ToInt (e1) @ (45,46--45,52)"; - "let testDoubleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,46--46,54)"; - "let testDoubleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,46--47,55)"; - "let testDoubleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,46--48,54)"; - "let testDoubleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,46--49,55)"; - "let testDoubleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,46--50,58)"; - "let testDoubleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,46--51,59)"; - "let testDoubleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,46--52,56)"; - "let testDoubleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,46--53,54)"; - "let testDoubleToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,46--54,56)"; - "let testDoubleToCharOperator(e1) = Operators.ToChar (e1) @ (55,46--55,53)"; - "let testDoubleToStringOperator(e1) = Operators.ToString (e1) @ (56,46--56,55)"; + [], "type OperatorTestsDouble"; + [], "let testDoubleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,76)"; + [], "let testDoubleNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,67--5,77)"; + [], "let testDoubleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,76)"; + [], "let testDoubleLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,67--7,77)"; + [], "let testDoubleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,76)"; + [], "let testDoubleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,67--9,77)"; + [], "let testDoubleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,68)"; + [], "let testDoubleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,68)"; + [], "let testDoubleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,59--13,68)"; + [], "let testDoubleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,68)"; + [], "let testDoubleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,68)"; + [], "let testDoubleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,53)"; + [], "let testDoubleAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,57--24,74)"; + [], "let testDoubleSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,57--25,74)"; + [], "let testDoubleMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,57--26,74)"; + [], "let testDoubleUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,46--27,61)"; + [], "let testDoubleToByteChecked(e1) = Checked.ToByte (e1) @ (29,46--29,61)"; + [], "let testDoubleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,46--30,62)"; + [], "let testDoubleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,46--31,62)"; + [], "let testDoubleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,46--32,63)"; + [], "let testDoubleToIntChecked(e1) = Checked.ToInt (e1) @ (33,46--33,60)"; + [], "let testDoubleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,46--34,62)"; + [], "let testDoubleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,46--35,63)"; + [], "let testDoubleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,46--36,62)"; + [], "let testDoubleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,46--37,63)"; + [], "let testDoubleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,46--38,66)"; + [], "let testDoubleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,46--39,67)"; + [], "let testDoubleToByteOperator(e1) = Operators.ToByte (e1) @ (41,46--41,53)"; + [], "let testDoubleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,46--42,54)"; + [], "let testDoubleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,46--43,54)"; + [], "let testDoubleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,46--44,55)"; + [], "let testDoubleToIntOperator(e1) = Operators.ToInt (e1) @ (45,46--45,52)"; + [], "let testDoubleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,46--46,54)"; + [], "let testDoubleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,46--47,55)"; + [], "let testDoubleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,46--48,54)"; + [], "let testDoubleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,46--49,55)"; + [], "let testDoubleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,46--50,58)"; + [], "let testDoubleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,46--51,59)"; + [], "let testDoubleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,46--52,56)"; + [], "let testDoubleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,46--53,54)"; + [], "let testDoubleToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,46--54,56)"; + [], "let testDoubleToCharOperator(e1) = Operators.ToChar (e1) @ (55,46--55,53)"; + [], "let testDoubleToStringOperator(e1) = Operators.ToString (e1) @ (56,46--56,55)"; ] let expectedOptimized = [ - "type OperatorTestsDouble"; - "let testDoubleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,76)"; - "let testDoubleNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,67--5,77)"; - "let testDoubleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,76)"; - "let testDoubleLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,67--7,77)"; - "let testDoubleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,76)"; - "let testDoubleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,67--9,77)"; - "let testDoubleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,68)"; - "let testDoubleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,68)"; - "let testDoubleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,59--13,68)"; - "let testDoubleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,68)"; - "let testDoubleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,68)"; - "let testDoubleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,53)"; - "let testDoubleAdditionChecked(e1) (e2) = Operators.op_Addition (e1,e2) @ (24,57--24,74)"; - "let testDoubleSubtractionChecked(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (25,57--25,74)"; - "let testDoubleMultiplyChecked(e1) (e2) = Operators.op_Multiply (e1,e2) @ (26,57--26,74)"; - "let testDoubleUnaryNegChecked(e1) = Operators.op_UnaryNegation (e1) @ (27,46--27,61)"; - "let testDoubleToByteChecked(e1) = Checked.ToByte (e1) @ (29,46--29,61)"; - "let testDoubleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,46--30,62)"; - "let testDoubleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,46--31,62)"; - "let testDoubleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,46--32,63)"; - "let testDoubleToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,46--33,60)"; - "let testDoubleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,46--34,62)"; - "let testDoubleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,46--35,63)"; - "let testDoubleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,46--36,62)"; - "let testDoubleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,46--37,63)"; - "let testDoubleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,46--38,66)"; - "let testDoubleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,46--39,67)"; - "let testDoubleToByteOperator(e1) = Operators.ToByte (e1) @ (41,46--41,53)"; - "let testDoubleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,46--42,54)"; - "let testDoubleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,46--43,54)"; - "let testDoubleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,46--44,55)"; - "let testDoubleToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,46--45,52)"; - "let testDoubleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,46--46,54)"; - "let testDoubleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,46--47,55)"; - "let testDoubleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,46--48,54)"; - "let testDoubleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,46--49,55)"; - "let testDoubleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,46--50,58)"; - "let testDoubleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,46--51,59)"; - "let testDoubleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,46--52,56)"; - "let testDoubleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,46--53,54)"; - "let testDoubleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,46--54,56)"; - "let testDoubleToCharOperator(e1) = Operators.ToChar (e1) @ (55,46--55,53)"; - "let testDoubleToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,46--56,55)" + [], "type OperatorTestsDouble"; + [], "let testDoubleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,76)"; + [], "let testDoubleNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,67--5,77)"; + [], "let testDoubleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,76)"; + [], "let testDoubleLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,67--7,77)"; + [], "let testDoubleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,76)"; + [], "let testDoubleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,67--9,77)"; + [], "let testDoubleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,68)"; + [], "let testDoubleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,68)"; + [], "let testDoubleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,59--13,68)"; + [], "let testDoubleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,68)"; + [], "let testDoubleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,68)"; + [], "let testDoubleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,53)"; + [], "let testDoubleAdditionChecked(e1) (e2) = Operators.op_Addition (e1,e2) @ (24,57--24,74)"; + [], "let testDoubleSubtractionChecked(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (25,57--25,74)"; + [], "let testDoubleMultiplyChecked(e1) (e2) = Operators.op_Multiply (e1,e2) @ (26,57--26,74)"; + [], "let testDoubleUnaryNegChecked(e1) = Operators.op_UnaryNegation (e1) @ (27,46--27,61)"; + [], "let testDoubleToByteChecked(e1) = Checked.ToByte (e1) @ (29,46--29,61)"; + [], "let testDoubleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,46--30,62)"; + [], "let testDoubleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,46--31,62)"; + [], "let testDoubleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,46--32,63)"; + [], "let testDoubleToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,46--33,60)"; + [], "let testDoubleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,46--34,62)"; + [], "let testDoubleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,46--35,63)"; + [], "let testDoubleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,46--36,62)"; + [], "let testDoubleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,46--37,63)"; + [], "let testDoubleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,46--38,66)"; + [], "let testDoubleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,46--39,67)"; + [], "let testDoubleToByteOperator(e1) = Operators.ToByte (e1) @ (41,46--41,53)"; + [], "let testDoubleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,46--42,54)"; + [], "let testDoubleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,46--43,54)"; + [], "let testDoubleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,46--44,55)"; + [], "let testDoubleToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,46--45,52)"; + [], "let testDoubleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,46--46,54)"; + [], "let testDoubleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,46--47,55)"; + [], "let testDoubleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,46--48,54)"; + [], "let testDoubleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,46--49,55)"; + [], "let testDoubleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,46--50,58)"; + [], "let testDoubleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,46--51,59)"; + [], "let testDoubleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,46--52,56)"; + [], "let testDoubleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,46--53,54)"; + [], "let testDoubleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,46--54,56)"; + [], "let testDoubleToCharOperator(e1) = Operators.ToChar (e1) @ (55,46--55,53)"; + [FC47], "let testDoubleToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,46--56,55)" ] testOperators "Double" "float" excludedTests expectedUnoptimized expectedOptimized @@ -2465,81 +2529,81 @@ let ``Test Operator Declarations for Decimal`` () = ] let expectedUnoptimized = [ - "type OperatorTestsDecimal"; - "let testDecimalEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,72--4,81)"; - "let testDecimalNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,72--5,82)"; - "let testDecimalLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,72--6,81)"; - "let testDecimalLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,72--7,82)"; - "let testDecimalGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,72--8,81)"; - "let testDecimalGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,72--9,82)"; - "let testDecimalAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,64--11,73)"; - "let testDecimalSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,64--12,73)"; - "let testDecimalMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,64--13,73)"; - "let testDecimalDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,64--14,73)"; - "let testDecimalModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,64--15,73)"; - "let testDecimalAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,62--24,79)"; - "let testDecimalToByteChecked(e1) = Checked.ToByte (e1) @ (29,49--29,64)"; - "let testDecimalToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,49--30,65)"; - "let testDecimalToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,49--31,65)"; - "let testDecimalToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,49--32,66)"; - "let testDecimalToIntChecked(e1) = Checked.ToInt (e1) @ (33,49--33,63)"; - "let testDecimalToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,49--34,65)"; - "let testDecimalToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,49--35,66)"; - "let testDecimalToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,49--36,65)"; - "let testDecimalToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,49--37,66)"; - "let testDecimalToByteOperator(e1) = Operators.ToByte (e1) @ (41,49--41,56)"; - "let testDecimalToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,49--42,57)"; - "let testDecimalToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,49--43,57)"; - "let testDecimalToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,49--44,58)"; - "let testDecimalToIntOperator(e1) = Operators.ToInt (e1) @ (45,49--45,55)"; - "let testDecimalToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,49--46,57)"; - "let testDecimalToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,49--47,58)"; - "let testDecimalToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,49--48,57)"; - "let testDecimalToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,49--49,58)"; - "let testDecimalToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,49--52,59)"; - "let testDecimalToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,49--53,57)"; - "let testDecimalToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,49--54,59)"; - "let testDecimalToCharOperator(e1) = Operators.ToChar (e1) @ (55,49--55,56)"; - "let testDecimalToStringOperator(e1) = Operators.ToString (e1) @ (56,49--56,58)"; + [], "type OperatorTestsDecimal"; + [], "let testDecimalEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,72--4,81)"; + [], "let testDecimalNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,72--5,82)"; + [], "let testDecimalLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,72--6,81)"; + [], "let testDecimalLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,72--7,82)"; + [], "let testDecimalGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,72--8,81)"; + [], "let testDecimalGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,72--9,82)"; + [], "let testDecimalAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,64--11,73)"; + [], "let testDecimalSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,64--12,73)"; + [], "let testDecimalMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,64--13,73)"; + [], "let testDecimalDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,64--14,73)"; + [], "let testDecimalModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,64--15,73)"; + [], "let testDecimalAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,62--24,79)"; + [], "let testDecimalToByteChecked(e1) = Checked.ToByte (e1) @ (29,49--29,64)"; + [], "let testDecimalToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,49--30,65)"; + [], "let testDecimalToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,49--31,65)"; + [], "let testDecimalToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,49--32,66)"; + [], "let testDecimalToIntChecked(e1) = Checked.ToInt (e1) @ (33,49--33,63)"; + [], "let testDecimalToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,49--34,65)"; + [], "let testDecimalToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,49--35,66)"; + [], "let testDecimalToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,49--36,65)"; + [], "let testDecimalToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,49--37,66)"; + [], "let testDecimalToByteOperator(e1) = Operators.ToByte (e1) @ (41,49--41,56)"; + [], "let testDecimalToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,49--42,57)"; + [], "let testDecimalToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,49--43,57)"; + [], "let testDecimalToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,49--44,58)"; + [], "let testDecimalToIntOperator(e1) = Operators.ToInt (e1) @ (45,49--45,55)"; + [], "let testDecimalToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,49--46,57)"; + [], "let testDecimalToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,49--47,58)"; + [], "let testDecimalToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,49--48,57)"; + [], "let testDecimalToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,49--49,58)"; + [], "let testDecimalToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,49--52,59)"; + [], "let testDecimalToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,49--53,57)"; + [], "let testDecimalToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,49--54,59)"; + [], "let testDecimalToCharOperator(e1) = Operators.ToChar (e1) @ (55,49--55,56)"; + [], "let testDecimalToStringOperator(e1) = Operators.ToString (e1) @ (56,49--56,58)"; ] let expectedOptimized = [ - "type OperatorTestsDecimal"; - "let testDecimalEqualsOperator(e1) (e2) = Decimal.op_Equality (e1,e2) @ (4,72--4,81)"; - "let testDecimalNotEqualsOperator(e1) (e2) = Operators.op_Equality (Decimal.op_Equality (e1,e2),False) @ (5,72--5,82)"; - "let testDecimalLessThanOperator(e1) (e2) = Decimal.op_LessThan (e1,e2) @ (6,72--6,81)"; - "let testDecimalLessThanOrEqualsOperator(e1) (e2) = Decimal.op_LessThanOrEqual (e1,e2) @ (7,72--7,82)"; - "let testDecimalGreaterThanOperator(e1) (e2) = Decimal.op_GreaterThan (e1,e2) @ (8,72--8,81)"; - "let testDecimalGreaterThanOrEqualsOperator(e1) (e2) = Decimal.op_GreaterThanOrEqual (e1,e2) @ (9,72--9,82)"; - "let testDecimalAdditionOperator(e1) (e2) = Decimal.op_Addition (e1,e2) @ (11,64--11,73)"; - "let testDecimalSubtractionOperator(e1) (e2) = Decimal.op_Subtraction (e1,e2) @ (12,64--12,73)"; - "let testDecimalMultiplyOperator(e1) (e2) = Decimal.op_Multiply (e1,e2) @ (13,64--13,73)"; - "let testDecimalDivisionOperator(e1) (e2) = Decimal.op_Division (e1,e2) @ (14,64--14,73)"; - "let testDecimalModulusOperator(e1) (e2) = Decimal.op_Modulus (e1,e2) @ (15,64--15,73)"; - "let testDecimalAdditionChecked(e1) (e2) = Decimal.op_Addition (e1,e2) @ (24,62--24,79)"; - "let testDecimalToByteChecked(e1) = Decimal.op_Explicit (e1) @ (29,49--29,64)"; - "let testDecimalToSByteChecked(e1) = Decimal.op_Explicit (e1) @ (30,49--30,65)"; - "let testDecimalToInt16Checked(e1) = Decimal.op_Explicit (e1) @ (31,49--31,65)"; - "let testDecimalToUInt16Checked(e1) = Decimal.op_Explicit (e1) @ (32,49--32,66)"; - "let testDecimalToIntChecked(e1) = Decimal.op_Explicit (e1) @ (33,49--33,63)"; - "let testDecimalToInt32Checked(e1) = Decimal.op_Explicit (e1) @ (34,49--34,65)"; - "let testDecimalToUInt32Checked(e1) = Decimal.op_Explicit (e1) @ (35,49--35,66)"; - "let testDecimalToInt64Checked(e1) = Decimal.op_Explicit (e1) @ (36,49--36,65)"; - "let testDecimalToUInt64Checked(e1) = Decimal.op_Explicit (e1) @ (37,49--37,66)"; - "let testDecimalToByteOperator(e1) = Decimal.op_Explicit (e1) @ (41,49--41,56)"; - "let testDecimalToSByteOperator(e1) = Decimal.op_Explicit (e1) @ (42,49--42,57)"; - "let testDecimalToInt16Operator(e1) = Decimal.op_Explicit (e1) @ (43,49--43,57)"; - "let testDecimalToUInt16Operator(e1) = Decimal.op_Explicit (e1) @ (44,49--44,58)"; - "let testDecimalToIntOperator(e1) = Decimal.op_Explicit (e1) @ (45,49--45,55)"; - "let testDecimalToInt32Operator(e1) = Decimal.op_Explicit (e1) @ (46,49--46,57)"; - "let testDecimalToUInt32Operator(e1) = Decimal.op_Explicit (e1) @ (47,49--47,58)"; - "let testDecimalToInt64Operator(e1) = Decimal.op_Explicit (e1) @ (48,49--48,57)"; - "let testDecimalToUInt64Operator(e1) = Decimal.op_Explicit (e1) @ (49,49--49,58)"; - "let testDecimalToSingleOperator(e1) = Decimal.op_Explicit (e1) @ (52,49--52,59)"; - "let testDecimalToDoubleOperator(e1) = Convert.ToDouble (e1) @ (53,49--53,57)"; - "let testDecimalToDecimalOperator(e1) = e1 @ (54,57--54,59)"; - "let testDecimalToCharOperator(e1) = Decimal.op_Explicit (e1) @ (55,49--55,56)"; - "let testDecimalToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,49--56,58)" + [], "type OperatorTestsDecimal"; + [], "let testDecimalEqualsOperator(e1) (e2) = Decimal.op_Equality (e1,e2) @ (4,72--4,81)"; + [], "let testDecimalNotEqualsOperator(e1) (e2) = Operators.op_Equality (Decimal.op_Equality (e1,e2),False) @ (5,72--5,82)"; + [], "let testDecimalLessThanOperator(e1) (e2) = Decimal.op_LessThan (e1,e2) @ (6,72--6,81)"; + [], "let testDecimalLessThanOrEqualsOperator(e1) (e2) = Decimal.op_LessThanOrEqual (e1,e2) @ (7,72--7,82)"; + [], "let testDecimalGreaterThanOperator(e1) (e2) = Decimal.op_GreaterThan (e1,e2) @ (8,72--8,81)"; + [], "let testDecimalGreaterThanOrEqualsOperator(e1) (e2) = Decimal.op_GreaterThanOrEqual (e1,e2) @ (9,72--9,82)"; + [], "let testDecimalAdditionOperator(e1) (e2) = Decimal.op_Addition (e1,e2) @ (11,64--11,73)"; + [], "let testDecimalSubtractionOperator(e1) (e2) = Decimal.op_Subtraction (e1,e2) @ (12,64--12,73)"; + [], "let testDecimalMultiplyOperator(e1) (e2) = Decimal.op_Multiply (e1,e2) @ (13,64--13,73)"; + [], "let testDecimalDivisionOperator(e1) (e2) = Decimal.op_Division (e1,e2) @ (14,64--14,73)"; + [], "let testDecimalModulusOperator(e1) (e2) = Decimal.op_Modulus (e1,e2) @ (15,64--15,73)"; + [], "let testDecimalAdditionChecked(e1) (e2) = Decimal.op_Addition (e1,e2) @ (24,62--24,79)"; + [], "let testDecimalToByteChecked(e1) = Decimal.op_Explicit (e1) @ (29,49--29,64)"; + [], "let testDecimalToSByteChecked(e1) = Decimal.op_Explicit (e1) @ (30,49--30,65)"; + [], "let testDecimalToInt16Checked(e1) = Decimal.op_Explicit (e1) @ (31,49--31,65)"; + [], "let testDecimalToUInt16Checked(e1) = Decimal.op_Explicit (e1) @ (32,49--32,66)"; + [], "let testDecimalToIntChecked(e1) = Decimal.op_Explicit (e1) @ (33,49--33,63)"; + [], "let testDecimalToInt32Checked(e1) = Decimal.op_Explicit (e1) @ (34,49--34,65)"; + [], "let testDecimalToUInt32Checked(e1) = Decimal.op_Explicit (e1) @ (35,49--35,66)"; + [], "let testDecimalToInt64Checked(e1) = Decimal.op_Explicit (e1) @ (36,49--36,65)"; + [], "let testDecimalToUInt64Checked(e1) = Decimal.op_Explicit (e1) @ (37,49--37,66)"; + [], "let testDecimalToByteOperator(e1) = Decimal.op_Explicit (e1) @ (41,49--41,56)"; + [], "let testDecimalToSByteOperator(e1) = Decimal.op_Explicit (e1) @ (42,49--42,57)"; + [], "let testDecimalToInt16Operator(e1) = Decimal.op_Explicit (e1) @ (43,49--43,57)"; + [], "let testDecimalToUInt16Operator(e1) = Decimal.op_Explicit (e1) @ (44,49--44,58)"; + [], "let testDecimalToIntOperator(e1) = Decimal.op_Explicit (e1) @ (45,49--45,55)"; + [], "let testDecimalToInt32Operator(e1) = Decimal.op_Explicit (e1) @ (46,49--46,57)"; + [], "let testDecimalToUInt32Operator(e1) = Decimal.op_Explicit (e1) @ (47,49--47,58)"; + [], "let testDecimalToInt64Operator(e1) = Decimal.op_Explicit (e1) @ (48,49--48,57)"; + [], "let testDecimalToUInt64Operator(e1) = Decimal.op_Explicit (e1) @ (49,49--49,58)"; + [], "let testDecimalToSingleOperator(e1) = Decimal.op_Explicit (e1) @ (52,49--52,59)"; + [], "let testDecimalToDoubleOperator(e1) = Convert.ToDouble (e1) @ (53,49--53,57)"; + [], "let testDecimalToDecimalOperator(e1) = e1 @ (54,57--54,59)"; + [], "let testDecimalToCharOperator(e1) = Decimal.op_Explicit (e1) @ (55,49--55,56)"; + [FC47], "let testDecimalToStringOperator(e1) = e1.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,49--56,58)" ] testOperators "Decimal" "decimal" excludedTests expectedUnoptimized expectedOptimized @@ -2564,79 +2628,79 @@ let ``Test Operator Declarations for Char`` () = ] let expectedUnoptimized = [ - "type OperatorTestsChar"; - "let testCharEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,63--4,72)"; - "let testCharNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,63--5,73)"; - "let testCharLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,63--6,72)"; - "let testCharLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,63--7,73)"; - "let testCharGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,63--8,72)"; - "let testCharGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,63--9,73)"; - "let testCharAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,55--11,64)"; - "let testCharAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,53--24,70)"; - "let testCharToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; - "let testCharToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; - "let testCharToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; - "let testCharToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; - "let testCharToIntChecked(e1) = Checked.ToInt (e1) @ (33,43--33,57)"; - "let testCharToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; - "let testCharToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; - "let testCharToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; - "let testCharToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; - "let testCharToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; - "let testCharToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; - "let testCharToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; - "let testCharToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; - "let testCharToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; - "let testCharToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; - "let testCharToIntOperator(e1) = Operators.ToInt (e1) @ (45,43--45,49)"; - "let testCharToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; - "let testCharToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; - "let testCharToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,43--48,51)"; - "let testCharToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; - "let testCharToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; - "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; - "let testCharToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,43--52,53)"; - "let testCharToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,43--53,51)"; - "let testCharToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; - "let testCharToStringOperator(e1) = Operators.ToString (e1) @ (56,43--56,52)"; + [], "type OperatorTestsChar"; + [], "let testCharEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,63--4,72)"; + [], "let testCharNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,63--5,73)"; + [], "let testCharLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,63--6,72)"; + [], "let testCharLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,63--7,73)"; + [], "let testCharGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,63--8,72)"; + [], "let testCharGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,63--9,73)"; + [], "let testCharAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,55--11,64)"; + [], "let testCharAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,53--24,70)"; + [], "let testCharToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; + [], "let testCharToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; + [], "let testCharToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; + [], "let testCharToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; + [], "let testCharToIntChecked(e1) = Checked.ToInt (e1) @ (33,43--33,57)"; + [], "let testCharToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; + [], "let testCharToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; + [], "let testCharToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; + [], "let testCharToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; + [], "let testCharToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; + [], "let testCharToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; + [], "let testCharToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; + [], "let testCharToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; + [], "let testCharToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; + [], "let testCharToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; + [], "let testCharToIntOperator(e1) = Operators.ToInt (e1) @ (45,43--45,49)"; + [], "let testCharToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; + [], "let testCharToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; + [], "let testCharToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,43--48,51)"; + [], "let testCharToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; + [], "let testCharToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; + [], "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; + [], "let testCharToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,43--52,53)"; + [], "let testCharToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,43--53,51)"; + [], "let testCharToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; + [], "let testCharToStringOperator(e1) = Operators.ToString (e1) @ (56,43--56,52)"; ] let expectedOptimized = [ - "type OperatorTestsChar"; - "let testCharEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,63--4,72)"; - "let testCharNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,63--5,73)"; - "let testCharLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,63--6,72)"; - "let testCharLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,63--7,73)"; - "let testCharGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,63--8,72)"; - "let testCharGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,63--9,73)"; - "let testCharAdditionOperator(e1) (e2) = Operators.ToChar (Operators.op_Addition (e1,e2)) @ (11,55--11,64)"; - "let testCharAdditionChecked(e1) (e2) = Operators.ToChar (Checked.op_Addition (e1,e2)) @ (24,53--24,70)"; - "let testCharToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; - "let testCharToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; - "let testCharToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; - "let testCharToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; - "let testCharToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,43--33,57)"; - "let testCharToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; - "let testCharToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; - "let testCharToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; - "let testCharToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; - "let testCharToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; - "let testCharToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; - "let testCharToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; - "let testCharToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; - "let testCharToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; - "let testCharToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; - "let testCharToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,43--45,49)"; - "let testCharToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; - "let testCharToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; - "let testCharToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,43--48,51)"; - "let testCharToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; - "let testCharToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,43--50,55)"; - "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; - "let testCharToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; - "let testCharToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; - "let testCharToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; - "let testCharToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.char = e1 in copyOfStruct.ToString() @ (56,43--56,52)" + [], "type OperatorTestsChar"; + [], "let testCharEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,63--4,72)"; + [], "let testCharNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,63--5,73)"; + [], "let testCharLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,63--6,72)"; + [], "let testCharLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,63--7,73)"; + [], "let testCharGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,63--8,72)"; + [], "let testCharGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,63--9,73)"; + [], "let testCharAdditionOperator(e1) (e2) = Operators.ToChar (Operators.op_Addition (e1,e2)) @ (11,55--11,64)"; + [], "let testCharAdditionChecked(e1) (e2) = Operators.ToChar (Checked.op_Addition (e1,e2)) @ (24,53--24,70)"; + [], "let testCharToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; + [], "let testCharToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; + [], "let testCharToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; + [], "let testCharToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; + [], "let testCharToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,43--33,57)"; + [], "let testCharToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; + [], "let testCharToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; + [], "let testCharToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; + [], "let testCharToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; + [], "let testCharToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; + [], "let testCharToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; + [], "let testCharToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; + [], "let testCharToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; + [], "let testCharToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; + [], "let testCharToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; + [], "let testCharToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,43--45,49)"; + [], "let testCharToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; + [], "let testCharToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; + [], "let testCharToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,43--48,51)"; + [], "let testCharToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; + [], "let testCharToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,43--50,55)"; + [], "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; + [], "let testCharToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; + [], "let testCharToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; + [], "let testCharToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; + [FC47], "let testCharToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.char = e1 in copyOfStruct.ToString() @ (56,43--56,52)" ] testOperators "Char" "char" excludedTests expectedUnoptimized expectedOptimized @@ -2664,73 +2728,73 @@ let ``Test Operator Declarations for String`` () = ] let expectedUnoptimized = [ - "type OperatorTestsString"; - "let testStringEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; - "let testStringNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,69--5,79)"; - "let testStringLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; - "let testStringLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,69--7,79)"; - "let testStringGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; - "let testStringGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,69--9,79)"; - "let testStringAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; - "let testStringAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; - "let testStringToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; - "let testStringToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; - "let testStringToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; - "let testStringToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; - "let testStringToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; - "let testStringToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; - "let testStringToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; - "let testStringToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; - "let testStringToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; - "let testStringToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; - "let testStringToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; - "let testStringToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; - "let testStringToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; - "let testStringToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; - "let testStringToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; - "let testStringToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; - "let testStringToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; - "let testStringToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; - "let testStringToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; - "let testStringToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; - "let testStringToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; - "let testStringToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; - "let testStringToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; + [], "type OperatorTestsString"; + [], "let testStringEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,69--4,78)"; + [], "let testStringNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,69--5,79)"; + [], "let testStringLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,69--6,78)"; + [], "let testStringLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,69--7,79)"; + [], "let testStringGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,69--8,78)"; + [], "let testStringGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,69--9,79)"; + [], "let testStringAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,61--11,70)"; + [], "let testStringAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + [], "let testStringToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + [], "let testStringToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + [], "let testStringToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + [], "let testStringToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + [], "let testStringToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; + [], "let testStringToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + [], "let testStringToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + [], "let testStringToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + [], "let testStringToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + [], "let testStringToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + [], "let testStringToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + [], "let testStringToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + [], "let testStringToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + [], "let testStringToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; + [], "let testStringToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + [], "let testStringToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + [], "let testStringToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + [], "let testStringToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + [], "let testStringToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; + [], "let testStringToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; + [], "let testStringToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; + [], "let testStringToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + [], "let testStringToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; ] let expectedOptimized = [ - "type OperatorTestsString"; - "let testStringEqualsOperator(e1) (e2) = String.Equals (e1,e2) @ (4,69--4,78)"; - "let testStringNotEqualsOperator(e1) (e2) = Operators.op_Equality (String.Equals (e1,e2),False) @ (5,69--5,79)"; - "let testStringLessThanOperator(e1) (e2) = HashCompare.GenericLessThanIntrinsic (e1,e2) @ (6,69--6,78)"; - "let testStringLessThanOrEqualsOperator(e1) (e2) = HashCompare.GenericLessOrEqualIntrinsic (e1,e2) @ (7,69--7,79)"; - "let testStringGreaterThanOperator(e1) (e2) = HashCompare.GenericGreaterThanIntrinsic (e1,e2) @ (8,69--8,78)"; - "let testStringGreaterThanOrEqualsOperator(e1) (e2) = HashCompare.GenericGreaterOrEqualIntrinsic (e1,e2) @ (9,69--9,79)"; - "let testStringAdditionOperator(e1) (e2) = String.Concat (e1,e2) @ (11,61--11,70)"; - "let testStringAdditionChecked(e1) (e2) = String.Concat (e1,e2) @ (24,59--24,76)"; - "let testStringToByteChecked(e1) = Checked.ToByte (LanguagePrimitives.ParseUInt32 (e1)) @ (29,47--29,62)"; - "let testStringToSByteChecked(e1) = Checked.ToSByte (LanguagePrimitives.ParseInt32 (e1)) @ (30,47--30,63)"; - "let testStringToInt16Checked(e1) = Checked.ToInt16 (LanguagePrimitives.ParseInt32 (e1)) @ (31,47--31,63)"; - "let testStringToUInt16Checked(e1) = Checked.ToUInt16 (LanguagePrimitives.ParseUInt32 (e1)) @ (32,47--32,64)"; - "let testStringToIntChecked(e1) = LanguagePrimitives.ParseInt32 (e1) @ (33,47--33,61)"; - "let testStringToInt32Checked(e1) = LanguagePrimitives.ParseInt32 (e1) @ (34,47--34,63)"; - "let testStringToUInt32Checked(e1) = LanguagePrimitives.ParseUInt32 (e1) @ (35,47--35,64)"; - "let testStringToInt64Checked(e1) = LanguagePrimitives.ParseInt64 (e1) @ (36,47--36,63)"; - "let testStringToUInt64Checked(e1) = LanguagePrimitives.ParseUInt64 (e1) @ (37,47--37,64)"; - "let testStringToByteOperator(e1) = Checked.ToByte (LanguagePrimitives.ParseUInt32 (e1)) @ (41,47--41,54)"; - "let testStringToSByteOperator(e1) = Checked.ToSByte (LanguagePrimitives.ParseInt32 (e1)) @ (42,47--42,55)"; - "let testStringToInt16Operator(e1) = Checked.ToInt16 (LanguagePrimitives.ParseInt32 (e1)) @ (43,47--43,55)"; - "let testStringToUInt16Operator(e1) = Checked.ToUInt16 (LanguagePrimitives.ParseUInt32 (e1)) @ (44,47--44,56)"; - "let testStringToIntOperator(e1) = LanguagePrimitives.ParseInt32 (e1) @ (45,47--45,53)"; - "let testStringToInt32Operator(e1) = LanguagePrimitives.ParseInt32 (e1) @ (46,47--46,55)"; - "let testStringToUInt32Operator(e1) = LanguagePrimitives.ParseUInt32 (e1) @ (47,47--47,56)"; - "let testStringToInt64Operator(e1) = LanguagePrimitives.ParseInt64 (e1) @ (48,47--48,55)"; - "let testStringToUInt64Operator(e1) = LanguagePrimitives.ParseUInt64 (e1) @ (49,47--49,56)"; - "let testStringToSingleOperator(e1) = Single.Parse ((if Operators.op_Equality (e1,dflt) then dflt else e1.Replace(\"_\",\"\")),167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (52,47--52,57)"; - "let testStringToDoubleOperator(e1) = Double.Parse ((if Operators.op_Equality (e1,dflt) then dflt else e1.Replace(\"_\",\"\")),167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (53,47--53,55)"; - "let testStringToDecimalOperator(e1) = Decimal.Parse (e1,167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (54,47--54,57)"; - "let testStringToCharOperator(e1) = Char.Parse (e1) @ (55,47--55,54)"; - "let testStringToStringOperator(e1) = e1 @ (56,54--56,56)" + [], "type OperatorTestsString"; + [], "let testStringEqualsOperator(e1) (e2) = String.Equals (e1,e2) @ (4,69--4,78)"; + [], "let testStringNotEqualsOperator(e1) (e2) = Operators.op_Equality (String.Equals (e1,e2),False) @ (5,69--5,79)"; + [], "let testStringLessThanOperator(e1) (e2) = HashCompare.GenericLessThanIntrinsic (e1,e2) @ (6,69--6,78)"; + [], "let testStringLessThanOrEqualsOperator(e1) (e2) = HashCompare.GenericLessOrEqualIntrinsic (e1,e2) @ (7,69--7,79)"; + [], "let testStringGreaterThanOperator(e1) (e2) = HashCompare.GenericGreaterThanIntrinsic (e1,e2) @ (8,69--8,78)"; + [], "let testStringGreaterThanOrEqualsOperator(e1) (e2) = HashCompare.GenericGreaterOrEqualIntrinsic (e1,e2) @ (9,69--9,79)"; + [], "let testStringAdditionOperator(e1) (e2) = String.Concat (e1,e2) @ (11,61--11,70)"; + [], "let testStringAdditionChecked(e1) (e2) = String.Concat (e1,e2) @ (24,59--24,76)"; + [], "let testStringToByteChecked(e1) = Checked.ToByte (LanguagePrimitives.ParseUInt32 (e1)) @ (29,47--29,62)"; + [], "let testStringToSByteChecked(e1) = Checked.ToSByte (LanguagePrimitives.ParseInt32 (e1)) @ (30,47--30,63)"; + [], "let testStringToInt16Checked(e1) = Checked.ToInt16 (LanguagePrimitives.ParseInt32 (e1)) @ (31,47--31,63)"; + [], "let testStringToUInt16Checked(e1) = Checked.ToUInt16 (LanguagePrimitives.ParseUInt32 (e1)) @ (32,47--32,64)"; + [], "let testStringToIntChecked(e1) = LanguagePrimitives.ParseInt32 (e1) @ (33,47--33,61)"; + [], "let testStringToInt32Checked(e1) = LanguagePrimitives.ParseInt32 (e1) @ (34,47--34,63)"; + [], "let testStringToUInt32Checked(e1) = LanguagePrimitives.ParseUInt32 (e1) @ (35,47--35,64)"; + [], "let testStringToInt64Checked(e1) = LanguagePrimitives.ParseInt64 (e1) @ (36,47--36,63)"; + [], "let testStringToUInt64Checked(e1) = LanguagePrimitives.ParseUInt64 (e1) @ (37,47--37,64)"; + [], "let testStringToByteOperator(e1) = Checked.ToByte (LanguagePrimitives.ParseUInt32 (e1)) @ (41,47--41,54)"; + [], "let testStringToSByteOperator(e1) = Checked.ToSByte (LanguagePrimitives.ParseInt32 (e1)) @ (42,47--42,55)"; + [], "let testStringToInt16Operator(e1) = Checked.ToInt16 (LanguagePrimitives.ParseInt32 (e1)) @ (43,47--43,55)"; + [], "let testStringToUInt16Operator(e1) = Checked.ToUInt16 (LanguagePrimitives.ParseUInt32 (e1)) @ (44,47--44,56)"; + [], "let testStringToIntOperator(e1) = LanguagePrimitives.ParseInt32 (e1) @ (45,47--45,53)"; + [], "let testStringToInt32Operator(e1) = LanguagePrimitives.ParseInt32 (e1) @ (46,47--46,55)"; + [], "let testStringToUInt32Operator(e1) = LanguagePrimitives.ParseUInt32 (e1) @ (47,47--47,56)"; + [], "let testStringToInt64Operator(e1) = LanguagePrimitives.ParseInt64 (e1) @ (48,47--48,55)"; + [], "let testStringToUInt64Operator(e1) = LanguagePrimitives.ParseUInt64 (e1) @ (49,47--49,56)"; + [], "let testStringToSingleOperator(e1) = Single.Parse ((if Operators.op_Equality (e1,dflt) then dflt else e1.Replace(\"_\",\"\")),167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (52,47--52,57)"; + [], "let testStringToDoubleOperator(e1) = Double.Parse ((if Operators.op_Equality (e1,dflt) then dflt else e1.Replace(\"_\",\"\")),167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (53,47--53,55)"; + [], "let testStringToDecimalOperator(e1) = Decimal.Parse (e1,167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (54,47--54,57)"; + [], "let testStringToCharOperator(e1) = Char.Parse (e1) @ (55,47--55,54)"; + [FC47], "let testStringToStringOperator(e1) = e1 @ (56,54--56,56)" ] testOperators "String" "string" excludedTests expectedUnoptimized expectedOptimized