summaryrefslogtreecommitdiff
path: root/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt
blob: 043ceccf864d234d28260e8a0ea868b127e575ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
// Copyright (c) 2010, Microsoft Corp.
// Bytecode Translator prelude

const null: int;

type HeapType = [int,int]int;

var $Heap: HeapType where IsGoodHeap($Heap);

function IsGoodHeap(HeapType) : bool;

var $ArrayContents: [int][int]int;

var $ArrayLength: [int]int;

var $Alloc: [int]bool;

procedure {:inline 1} Alloc() returns (x: int);
  modifies $Alloc;
  free ensures x != 0;



implementation Alloc() returns (x: int)
{
    assume $Alloc[x] == false;
    $Alloc[x] := true;
}



procedure RegressionTestInput.AsyncAttribute.#ctor(this: int);



implementation RegressionTestInput.AsyncAttribute.#ctor(this: int)
{
    return;
}



var RegressionTestInput.ClassWithBoolTypes.staticB: bool;

var RegressionTestInput.ClassWithBoolTypes.b: [int]bool;

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;
    assert {:sourceFile "Class1.cs"} {:sourceLine 72} true;
    assert {:sourceFile "Class1.cs"} {:sourceLine 73} true;
    RegressionTestInput.ClassWithBoolTypes.b[this] := 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;
}



var RegressionTestInput.ClassWithArrayTypes.s: int;

var RegressionTestInput.ClassWithArrayTypes.a: [int]int;

procedure RegressionTestInput.ClassWithArrayTypes.Main1();



implementation RegressionTestInput.ClassWithArrayTypes.Main1()
{
  var local_0: int;
  var $tmp1: int;
  var local_1: int;
  var $tmp2: int;

    assert {:sourceFile "Class1.cs"} {:sourceLine 86} true;
    call $tmp1 := Alloc();
    local_0 := $tmp1;
    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;
    assert {:sourceFile "Class1.cs"} {:sourceLine 91} true;
    $ArrayContents := $ArrayContents[local_1 := $ArrayContents[local_1][0 := 1]];
    assert {:sourceFile "Class1.cs"} {:sourceLine 92} true;
    assert $ArrayContents[local_1][0] == 1;
    assert {:sourceFile "Class1.cs"} {:sourceLine 94} true;
    assert $ArrayContents[local_0][0] == 2;
    assert {:sourceFile "Class1.cs"} {:sourceLine 95} true;
    return;
}



procedure RegressionTestInput.ClassWithArrayTypes.Main2();



implementation RegressionTestInput.ClassWithArrayTypes.Main2()
{
  var $tmp3: int;
  var local_0: int;
  var $tmp4: int;

    assert {:sourceFile "Class1.cs"} {:sourceLine 100} true;
    call $tmp3 := Alloc();
    RegressionTestInput.ClassWithArrayTypes.s := $tmp3;
    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;
    assert {:sourceFile "Class1.cs"} {:sourceLine 105} true;
    $ArrayContents := $ArrayContents[local_0 := $ArrayContents[local_0][0 := 1]];
    assert {:sourceFile "Class1.cs"} {:sourceLine 106} true;
    assert $ArrayContents[local_0][0] == 1;
    assert {:sourceFile "Class1.cs"} {:sourceLine 108} true;
    assert $ArrayContents[RegressionTestInput.ClassWithArrayTypes.s][0] == 2;
    assert {:sourceFile "Class1.cs"} {:sourceLine 109} true;
    return;
}



procedure RegressionTestInput.ClassWithArrayTypes.Main3$System.Int32(this: int, x$in: int);



implementation RegressionTestInput.ClassWithArrayTypes.Main3$System.Int32(this: int, x$in: int)
{
  var x: int;

    x := x$in;
    assert {:sourceFile "Class1.cs"} {:sourceLine 114} true;
    $ArrayContents := $ArrayContents[RegressionTestInput.ClassWithArrayTypes.a[this] := $ArrayContents[RegressionTestInput.ClassWithArrayTypes.a[this]][x := 42]];
    assert {:sourceFile "Class1.cs"} {:sourceLine 115} true;
    $ArrayContents := $ArrayContents[RegressionTestInput.ClassWithArrayTypes.a[this] := $ArrayContents[RegressionTestInput.ClassWithArrayTypes.a[this]][x + 1 := 43]];
    assert {:sourceFile "Class1.cs"} {:sourceLine 116} true;
    assert $ArrayContents[RegressionTestInput.ClassWithArrayTypes.a[this]][x + 1] == $ArrayContents[RegressionTestInput.ClassWithArrayTypes.a[this]][x] + 1;
    assert {:sourceFile "Class1.cs"} {:sourceLine 117} true;
    return;
}



procedure RegressionTestInput.ClassWithArrayTypes.Main4$System.Int32array(this: int, xs$in: int);



implementation RegressionTestInput.ClassWithArrayTypes.Main4$System.Int32array(this: int, xs$in: int)
{
  var xs: int;

    xs := xs$in;
    if (!(!(xs != 0) || $ArrayLength[xs] <= 0))
    {
        assert {:sourceFile "Class1.cs"} {:sourceLine 121} true;
        $ArrayContents := $ArrayContents[RegressionTestInput.ClassWithArrayTypes.a[this] := $ArrayContents[RegressionTestInput.ClassWithArrayTypes.a[this]][0 := $ArrayContents[xs][0]]];
    }
    else
    {
    }

    assert {:sourceFile "Class1.cs"} {:sourceLine 123} true;
    return;
}



procedure RegressionTestInput.ClassWithArrayTypes.#ctor(this: int);



implementation RegressionTestInput.ClassWithArrayTypes.#ctor(this: int)
{
    return;
}



var RegressionTestInput.Class0.StaticInt: int;

procedure RegressionTestInput.Class0.StaticMethod$System.Int32(x$in: int) returns ($result: int);



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;
    return;
}



procedure RegressionTestInput.Class0.M$System.Int32(this: int, x$in: int);



implementation RegressionTestInput.Class0.M$System.Int32(this: int, x$in: int)
{
  var x: int;
  var __temp_1: int;
  var $tmp5: int;
  var __temp_2: int;
  var __temp_3: int;
  var local_0: int;

    x := x$in;
    $tmp5 := x;
    assert $tmp5 != 0;
    __temp_1 := 5 / $tmp5;
    __temp_2 := 3;
    assert {:sourceFile "Class1.cs"} {:sourceLine 21} true;
    __temp_3 := __temp_2;
    x := __temp_3;
    local_0 := __temp_1 + __temp_2;
    assert {:sourceFile "Class1.cs"} {:sourceLine 22} true;
    assert x == 3 && local_0 <= 8;
    assert {:sourceFile "Class1.cs"} {:sourceLine 23} true;
    RegressionTestInput.Class0.StaticInt := local_0;
    assert {:sourceFile "Class1.cs"} {:sourceLine 24} true;
    assert local_0 == RegressionTestInput.Class0.StaticInt;
    assert {:sourceFile "Class1.cs"} {:sourceLine 25} true;
    return;
}



procedure RegressionTestInput.Class0.M$System.Int32$System.Int32(this: int, x$in: int, y$in: int);



implementation RegressionTestInput.Class0.M$System.Int32$System.Int32(this: int, x$in: int, y$in: int)
{
  var x: int;
  var y: int;

    x := x$in;
    y := y$in;
    assert {:sourceFile "Class1.cs"} {:sourceLine 28} true;
    return;
}



procedure RegressionTestInput.Class0.M$System.Boolean(this: int, b$in: bool);



implementation RegressionTestInput.Class0.M$System.Boolean(this: int, b$in: bool)
{
  var b: bool;

    b := b$in;
    assert {:sourceFile "Class1.cs"} {:sourceLine 29} true;
    return;
}



procedure RegressionTestInput.Class0.M$RegressionTestInput.Class0(this: int, c$in: int);



implementation RegressionTestInput.Class0.M$RegressionTestInput.Class0(this: int, c$in: int)
{
  var c: int;

    c := c$in;
    assert {:sourceFile "Class1.cs"} {:sourceLine 30} true;
    return;
}



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;

    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;
    return;
}



procedure RegressionTestInput.Class0.OutParam$System.Int32@(this: int) returns (x$out: int, $result: int);



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;
    return;
}



procedure RegressionTestInput.Class0.RefParam$System.Int32@(this: int, x$in: int) returns (x$out: int, $result: 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;
    return;
}



procedure RegressionTestInput.Class0.AssignToInParam$System.Int32(this: int, x$in: int) returns ($result: int);



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;
    return;
}



procedure RegressionTestInput.Class0.MethodThatRepresentsAnAynchronousMethod$System.Int32(this: int, x$in: int) returns ($result: int);



implementation {:RegressionTestInput.Async} 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;
    return;
}



procedure RegressionTestInput.Class0.CallAsyncMethod$System.Int32(this: int, y$in: int) returns ($result: int);



implementation RegressionTestInput.Class0.CallAsyncMethod$System.Int32(this: int, y$in: int) returns ($result: int)
{
  var y: int;
  var local_0: int;
  var $tmp7: 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;
    return;
}



procedure RegressionTestInput.Class0.#ctor(this: int);



implementation RegressionTestInput.Class0.#ctor(this: int)
{
    return;
}