summaryrefslogtreecommitdiff
path: root/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt
diff options
context:
space:
mode:
Diffstat (limited to 'BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt')
-rw-r--r--BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt394
1 files changed, 185 insertions, 209 deletions
diff --git a/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt b/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt
index 2453ca20..703c908f 100644
--- a/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt
+++ b/BCT/RegressionTests/TranslationTest/GeneralHeapInput.txt
@@ -214,6 +214,8 @@ type Type;
function $DynamicType(ref) : Type;
+function $TypeOf(Type) : ref;
+
var $Head: [int]int;
var $Next: [int][int]int;
@@ -222,165 +224,6 @@ var $Method: [int][int]int;
var $Receiver: [int][int]int;
-const unique RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap: Type;
-
-const unique RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.x: Field;
-
-const unique RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.y: Field;
-
-procedure RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.M(this: int);
-
-
-
-implementation RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.M(this: int)
-{
- assert {:sourceFile "Class1.cs"} {:sourceLine 130} true;
- $Heap := Write($Heap, this, RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.y, Int2Box(Box2Int(Read($Heap, this, RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.x))));
- assert {:sourceFile "Class1.cs"} {:sourceLine 131} true;
- return;
-}
-
-
-
-procedure RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.#ctor(this: int);
-
-
-
-procedure System.Object.#ctor(this: int);
-
-
-
-implementation RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.#ctor(this: int)
-{
- $Heap := Write($Heap, this, RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.x, Int2Box(0));
- $Heap := Write($Heap, this, RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.y, Int2Box(0));
- call System.Object.#ctor(this);
- return;
-}
-
-
-
-procedure RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.#cctor();
-
-
-
-implementation RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.#cctor()
-{
-}
-
-
-
-const unique RegressionTestInput.AsyncAttribute: Type;
-
-procedure RegressionTestInput.AsyncAttribute.#ctor(this: int);
-
-
-
-procedure System.Attribute.#ctor(this: int);
-
-
-
-implementation RegressionTestInput.AsyncAttribute.#ctor(this: int)
-{
- call System.Attribute.#ctor(this);
- return;
-}
-
-
-
-procedure RegressionTestInput.AsyncAttribute.#cctor();
-
-
-
-implementation RegressionTestInput.AsyncAttribute.#cctor()
-{
-}
-
-
-
-const unique RegressionTestInput.ClassWithBoolTypes: Type;
-
-var RegressionTestInput.ClassWithBoolTypes.staticB: bool;
-
-const unique RegressionTestInput.ClassWithBoolTypes.b: Field;
-
-procedure RegressionTestInput.ClassWithBoolTypes.M$System.Int32$System.Int32(x$in: int, y$in: int) returns ($result: bool);
-
-
-
-implementation RegressionTestInput.ClassWithBoolTypes.M$System.Int32$System.Int32(x$in: int, y$in: int) returns ($result: bool)
-{
- var x: int;
- var y: int;
- var local_0: bool;
-
- x := x$in;
- y := y$in;
- assert {:sourceFile "Class1.cs"} {:sourceLine 69} true;
- local_0 := x < y;
- assert {:sourceFile "Class1.cs"} {:sourceLine 70} true;
- $result := local_0;
- return;
-}
-
-
-
-procedure RegressionTestInput.ClassWithBoolTypes.#ctor$System.Boolean(this: int, z$in: bool);
-
-
-
-implementation RegressionTestInput.ClassWithBoolTypes.#ctor$System.Boolean(this: int, z$in: bool)
-{
- var z: bool;
-
- z := z$in;
- $Heap := Write($Heap, this, RegressionTestInput.ClassWithBoolTypes.b, Bool2Box(false));
- assert {:sourceFile "Class1.cs"} {:sourceLine 72} true;
- call System.Object.#ctor(this);
- assert {:sourceFile "Class1.cs"} {:sourceLine 73} true;
- $Heap := Write($Heap, this, RegressionTestInput.ClassWithBoolTypes.b, Bool2Box(z));
- assert {:sourceFile "Class1.cs"} {:sourceLine 74} true;
- if (z)
- {
- assert {:sourceFile "Class1.cs"} {:sourceLine 74} true;
- RegressionTestInput.ClassWithBoolTypes.staticB := z;
- }
- else
- {
- }
-
- return;
-}
-
-
-
-procedure RegressionTestInput.ClassWithBoolTypes.Main();
-
-
-
-implementation RegressionTestInput.ClassWithBoolTypes.Main()
-{
- var $tmp0: bool;
-
- assert {:sourceFile "Class1.cs"} {:sourceLine 78} true;
- call $tmp0 := RegressionTestInput.ClassWithBoolTypes.M$System.Int32$System.Int32(3, 4);
- assert {:sourceFile "Class1.cs"} {:sourceLine 79} true;
- return;
-}
-
-
-
-procedure RegressionTestInput.ClassWithBoolTypes.#cctor();
-
-
-
-implementation RegressionTestInput.ClassWithBoolTypes.#cctor()
-{
- RegressionTestInput.ClassWithBoolTypes.staticB := false;
-}
-
-
-
const unique RegressionTestInput.ClassWithArrayTypes: Type;
var RegressionTestInput.ClassWithArrayTypes.s: int;
@@ -394,20 +237,20 @@ procedure RegressionTestInput.ClassWithArrayTypes.Main1();
implementation RegressionTestInput.ClassWithArrayTypes.Main1()
{
var local_0: int;
- var $tmp1: int;
+ var $tmp0: int;
var local_1: int;
- var $tmp2: int;
+ var $tmp1: int;
assert {:sourceFile "Class1.cs"} {:sourceLine 86} true;
- call $tmp1 := Alloc();
- local_0 := $tmp1;
+ call $tmp0 := Alloc();
+ local_0 := $tmp0;
assert {:sourceFile "Class1.cs"} {:sourceLine 87} true;
$ArrayContents := $ArrayContents[local_0 := $ArrayContents[local_0][0 := 2]];
assert {:sourceFile "Class1.cs"} {:sourceLine 88} true;
assert $ArrayContents[local_0][0] == 2;
assert {:sourceFile "Class1.cs"} {:sourceLine 90} true;
- call $tmp2 := Alloc();
- local_1 := $tmp2;
+ call $tmp1 := Alloc();
+ local_1 := $tmp1;
assert {:sourceFile "Class1.cs"} {:sourceLine 91} true;
$ArrayContents := $ArrayContents[local_1 := $ArrayContents[local_1][0 := 1]];
assert {:sourceFile "Class1.cs"} {:sourceLine 92} true;
@@ -426,20 +269,20 @@ procedure RegressionTestInput.ClassWithArrayTypes.Main2();
implementation RegressionTestInput.ClassWithArrayTypes.Main2()
{
- var $tmp3: int;
+ var $tmp2: int;
var local_0: int;
- var $tmp4: int;
+ var $tmp3: int;
assert {:sourceFile "Class1.cs"} {:sourceLine 100} true;
- call $tmp3 := Alloc();
- RegressionTestInput.ClassWithArrayTypes.s := $tmp3;
+ call $tmp2 := Alloc();
+ RegressionTestInput.ClassWithArrayTypes.s := $tmp2;
assert {:sourceFile "Class1.cs"} {:sourceLine 101} true;
$ArrayContents := $ArrayContents[RegressionTestInput.ClassWithArrayTypes.s := $ArrayContents[RegressionTestInput.ClassWithArrayTypes.s][0 := 2]];
assert {:sourceFile "Class1.cs"} {:sourceLine 102} true;
assert $ArrayContents[RegressionTestInput.ClassWithArrayTypes.s][0] == 2;
assert {:sourceFile "Class1.cs"} {:sourceLine 104} true;
- call $tmp4 := Alloc();
- local_0 := $tmp4;
+ call $tmp3 := Alloc();
+ local_0 := $tmp3;
assert {:sourceFile "Class1.cs"} {:sourceLine 105} true;
$ArrayContents := $ArrayContents[local_0 := $ArrayContents[local_0][0 := 1]];
assert {:sourceFile "Class1.cs"} {:sourceLine 106} true;
@@ -501,6 +344,10 @@ procedure RegressionTestInput.ClassWithArrayTypes.#ctor(this: int);
+procedure System.Object.#ctor(this: int);
+
+
+
implementation RegressionTestInput.ClassWithArrayTypes.#ctor(this: int)
{
$Heap := Write($Heap, this, RegressionTestInput.ClassWithArrayTypes.a, Int2Box(0));
@@ -532,13 +379,10 @@ procedure RegressionTestInput.Class0.StaticMethod$System.Int32(x$in: int) return
implementation RegressionTestInput.Class0.StaticMethod$System.Int32(x$in: int) returns ($result: int)
{
var x: int;
- var local_0: int;
x := x$in;
- assert {:sourceFile "Class1.cs"} {:sourceLine 17} true;
- local_0 := x + 1;
assert {:sourceFile "Class1.cs"} {:sourceLine 18} true;
- $result := local_0;
+ $result := x + 1;
return;
}
@@ -552,13 +396,13 @@ implementation RegressionTestInput.Class0.M$System.Int32(this: int, x$in: int)
{
var x: int;
var __temp_1: int;
- var $tmp5: int;
+ var $tmp4: int;
var local_0: int;
x := x$in;
- $tmp5 := x;
- assert $tmp5 != 0;
- __temp_1 := 5 / $tmp5;
+ $tmp4 := x;
+ assert $tmp4 != 0;
+ __temp_1 := 5 / $tmp4;
x := 3;
local_0 := __temp_1 + 3;
assert {:sourceFile "Class1.cs"} {:sourceLine 22} true;
@@ -626,14 +470,11 @@ procedure RegressionTestInput.Class0.NonVoid(this: int) returns ($result: int);
implementation RegressionTestInput.Class0.NonVoid(this: int) returns ($result: int)
{
- var local_0: int;
- var $tmp6: int;
+ var $tmp5: int;
- assert {:sourceFile "Class1.cs"} {:sourceLine 33} true;
- call $tmp6 := RegressionTestInput.Class0.StaticMethod$System.Int32(3);
- local_0 := 3 + RegressionTestInput.Class0.StaticInt + $tmp6;
assert {:sourceFile "Class1.cs"} {:sourceLine 34} true;
- $result := local_0;
+ call $tmp5 := RegressionTestInput.Class0.StaticMethod$System.Int32(3);
+ $result := 3 + RegressionTestInput.Class0.StaticInt + $tmp5;
return;
}
@@ -645,14 +486,10 @@ procedure RegressionTestInput.Class0.OutParam$System.Int32$(this: int) returns (
implementation RegressionTestInput.Class0.OutParam$System.Int32$(this: int) returns (x$out: int, $result: int)
{
- var local_0: int;
-
assert {:sourceFile "Class1.cs"} {:sourceLine 37} true;
x$out := 3 + RegressionTestInput.Class0.StaticInt;
- assert {:sourceFile "Class1.cs"} {:sourceLine 38} true;
- local_0 := x$out;
assert {:sourceFile "Class1.cs"} {:sourceLine 39} true;
- $result := local_0;
+ $result := x$out;
return;
}
@@ -664,17 +501,13 @@ procedure RegressionTestInput.Class0.RefParam$System.Int32$(this: int, x$in: int
implementation RegressionTestInput.Class0.RefParam$System.Int32$(this: int, x$in: int) returns (x$out: int, $result: int)
{
- var local_0: int;
-
x$out := x$in;
assert {:sourceFile "Class1.cs"} {:sourceLine 42} true;
x$out := x$out + 1;
assert {:sourceFile "Class1.cs"} {:sourceLine 43} true;
RegressionTestInput.Class0.StaticInt := x$out;
- assert {:sourceFile "Class1.cs"} {:sourceLine 44} true;
- local_0 := x$out;
assert {:sourceFile "Class1.cs"} {:sourceLine 45} true;
- $result := local_0;
+ $result := x$out;
return;
}
@@ -687,17 +520,14 @@ procedure RegressionTestInput.Class0.AssignToInParam$System.Int32(this: int, x$i
implementation RegressionTestInput.Class0.AssignToInParam$System.Int32(this: int, x$in: int) returns ($result: int)
{
var x: int;
- var local_0: int;
x := x$in;
assert {:sourceFile "Class1.cs"} {:sourceLine 48} true;
x := x + 1;
assert {:sourceFile "Class1.cs"} {:sourceLine 49} true;
RegressionTestInput.Class0.StaticInt := x;
- assert {:sourceFile "Class1.cs"} {:sourceLine 50} true;
- local_0 := x;
assert {:sourceFile "Class1.cs"} {:sourceLine 51} true;
- $result := local_0;
+ $result := x;
return;
}
@@ -710,13 +540,10 @@ procedure {:RegressionTestInput.Async} RegressionTestInput.Class0.MethodThatRepr
implementation RegressionTestInput.Class0.MethodThatRepresentsAnAynchronousMethod$System.Int32(this: int, x$in: int) returns ($result: int)
{
var x: int;
- var local_0: int;
x := x$in;
- assert {:sourceFile "Class1.cs"} {:sourceLine 55} true;
- local_0 := x;
assert {:sourceFile "Class1.cs"} {:sourceLine 56} true;
- $result := local_0;
+ $result := x;
return;
}
@@ -729,15 +556,12 @@ procedure RegressionTestInput.Class0.CallAsyncMethod$System.Int32(this: int, y$i
implementation RegressionTestInput.Class0.CallAsyncMethod$System.Int32(this: int, y$in: int) returns ($result: int)
{
var y: int;
- var local_0: int;
- var $tmp7: int;
+ var $tmp6: int;
y := y$in;
- assert {:sourceFile "Class1.cs"} {:sourceLine 59} true;
- call {:async} $tmp7 := RegressionTestInput.Class0.MethodThatRepresentsAnAynchronousMethod$System.Int32(this, y);
- local_0 := $tmp7;
assert {:sourceFile "Class1.cs"} {:sourceLine 60} true;
- $result := local_0;
+ call {:async} $tmp6 := RegressionTestInput.Class0.MethodThatRepresentsAnAynchronousMethod$System.Int32(this, y);
+ $result := $tmp6;
return;
}
@@ -765,3 +589,155 @@ implementation RegressionTestInput.Class0.#cctor()
}
+
+const unique RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap: Type;
+
+const unique RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.x: Field;
+
+const unique RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.y: Field;
+
+procedure RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.M(this: int);
+
+
+
+implementation RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.M(this: int)
+{
+ assert {:sourceFile "Class1.cs"} {:sourceLine 130} true;
+ $Heap := Write($Heap, this, RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.y, Int2Box(Box2Int(Read($Heap, this, RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.x))));
+ assert {:sourceFile "Class1.cs"} {:sourceLine 131} true;
+ return;
+}
+
+
+
+procedure RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.#ctor(this: int);
+
+
+
+implementation RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.#ctor(this: int)
+{
+ $Heap := Write($Heap, this, RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.x, Int2Box(0));
+ $Heap := Write($Heap, this, RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.y, Int2Box(0));
+ call System.Object.#ctor(this);
+ return;
+}
+
+
+
+procedure RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.#cctor();
+
+
+
+implementation RegressionTestInput.WriteToTheHeapAValueReadFromTheHeap.#cctor()
+{
+}
+
+
+
+const unique RegressionTestInput.ClassWithBoolTypes: Type;
+
+var RegressionTestInput.ClassWithBoolTypes.staticB: bool;
+
+const unique RegressionTestInput.ClassWithBoolTypes.b: Field;
+
+procedure RegressionTestInput.ClassWithBoolTypes.M$System.Int32$System.Int32(x$in: int, y$in: int) returns ($result: bool);
+
+
+
+implementation RegressionTestInput.ClassWithBoolTypes.M$System.Int32$System.Int32(x$in: int, y$in: int) returns ($result: bool)
+{
+ var x: int;
+ var y: int;
+
+ x := x$in;
+ y := y$in;
+ assert {:sourceFile "Class1.cs"} {:sourceLine 70} true;
+ $result := x < y;
+ return;
+}
+
+
+
+procedure RegressionTestInput.ClassWithBoolTypes.#ctor$System.Boolean(this: int, z$in: bool);
+
+
+
+implementation RegressionTestInput.ClassWithBoolTypes.#ctor$System.Boolean(this: int, z$in: bool)
+{
+ var z: bool;
+
+ z := z$in;
+ $Heap := Write($Heap, this, RegressionTestInput.ClassWithBoolTypes.b, Bool2Box(false));
+ assert {:sourceFile "Class1.cs"} {:sourceLine 72} true;
+ call System.Object.#ctor(this);
+ assert {:sourceFile "Class1.cs"} {:sourceLine 73} true;
+ $Heap := Write($Heap, this, RegressionTestInput.ClassWithBoolTypes.b, Bool2Box(z));
+ assert {:sourceFile "Class1.cs"} {:sourceLine 74} true;
+ if (z)
+ {
+ assert {:sourceFile "Class1.cs"} {:sourceLine 74} true;
+ RegressionTestInput.ClassWithBoolTypes.staticB := z;
+ }
+ else
+ {
+ }
+
+ return;
+}
+
+
+
+procedure RegressionTestInput.ClassWithBoolTypes.Main();
+
+
+
+implementation RegressionTestInput.ClassWithBoolTypes.Main()
+{
+ var $tmp7: bool;
+
+ assert {:sourceFile "Class1.cs"} {:sourceLine 78} true;
+ call $tmp7 := RegressionTestInput.ClassWithBoolTypes.M$System.Int32$System.Int32(3, 4);
+ assert {:sourceFile "Class1.cs"} {:sourceLine 79} true;
+ return;
+}
+
+
+
+procedure RegressionTestInput.ClassWithBoolTypes.#cctor();
+
+
+
+implementation RegressionTestInput.ClassWithBoolTypes.#cctor()
+{
+ RegressionTestInput.ClassWithBoolTypes.staticB := false;
+}
+
+
+
+const unique RegressionTestInput.AsyncAttribute: Type;
+
+procedure RegressionTestInput.AsyncAttribute.#ctor(this: int);
+
+
+
+procedure System.Attribute.#ctor(this: int);
+
+
+
+implementation RegressionTestInput.AsyncAttribute.#ctor(this: int)
+{
+ call System.Attribute.#ctor(this);
+ return;
+}
+
+
+
+procedure RegressionTestInput.AsyncAttribute.#cctor();
+
+
+
+implementation RegressionTestInput.AsyncAttribute.#cctor()
+{
+}
+
+