PageRenderTime 17ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/jaeger/bug643805.js

http://github.com/zpao/v8monkey
JavaScript | 50 lines | 48 code | 1 blank | 1 comment | 7 complexity | 7fcecdbb8631731a3e09c01d43ffd338 MD5 | raw file
 1function _tt_face_get_name() {
 2    var __label__ = -1; 
 3    var $rec;
 4    var $n;
 5    while(true) {
 6        switch(__label__) {
 7        case -1:
 8            $rec=0;
 9            $n=0;
10        case 0:
11            if ($rec == 20) {
12                __label__ = 2;
13                break;
14            }
15            var $63 = $n;
16            var $64 = $63 + 1;
17            $n = $64;
18            var $65 = $rec;
19            $rec = $rec + 1;
20            assertEq($64 < 30, true);
21            __label__ = 0;
22            break;
23        case 1:
24            $rec = 0;
25        case 2:
26            return;
27        }
28    }
29}
30_tt_face_get_name();
31
32/* Test tracking of lifetimes around backedges in nested loops. */
33function nested() {
34  var x = 100;
35  var i = 0;
36  while (i < 10) {
37    while (i < 10) {
38      i++;
39      if (x < 20)
40        break;
41      if (i > 10) {
42        x = 200;
43        i++;
44      }
45    }
46    if (i > 10)
47      x = 100;
48  }
49}
50nested();