js/src/jit-test/tests/baseline/bug852801.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/baseline/bug852801.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,103 @@
     1.4 +// |jit-test| allow-oom
     1.5 +var STATUS = "STATUS: ";
     1.6 +var callStack = new Array();
     1.7 +function startTest() { }
     1.8 +function TestCase(n, d, e, a) {
     1.9 +    this.name = n;
    1.10 +}
    1.11 +TestCase.prototype.dump = function () {};
    1.12 +TestCase.prototype.testPassed = (function TestCase_testPassed() { return this.passed; });
    1.13 +TestCase.prototype.testFailed = (function TestCase_testFailed() { return !this.passed; });
    1.14 +function printStatus (msg) {
    1.15 +    var lines = msg.split ("\n");
    1.16 +    for (var i=0; i<lines.length; i++)
    1.17 +	print (STATUS + lines[i]);
    1.18 +}
    1.19 +function printBugNumber (num) {}
    1.20 +function toPrinted(value)
    1.21 +function escapeString (str) {}
    1.22 +function reportCompare (expected, actual, description) {
    1.23 +    var actual_t = typeof actual;
    1.24 +    var output = "";
    1.25 +    printStatus (
    1.26 +	"Expected value '"
    1.27 +	    + toPrinted(expected)
    1.28 +	    + toPrinted(actual)
    1.29 +    );
    1.30 +    var testcase = new TestCase("unknown-test-name", description, expected, actual);
    1.31 +    testcase.reason = output;
    1.32 +    if (typeof document != "object" ||      !document.location.href.match(/jsreftest.html/)) {
    1.33 +	if (testcase.passed)    {    }
    1.34 +    }
    1.35 +    return testcase.passed;
    1.36 +}
    1.37 +function reportMatch (expectedRegExp, actual, description) {}
    1.38 +function enterFunc (funcName)
    1.39 +function BigO(data) {
    1.40 +    function LinearRegression(data)   {  }
    1.41 +}
    1.42 +function compareSource(expect, actual, summary) {}
    1.43 +function optionsInit() {
    1.44 +    var optionNames = options().split(',');
    1.45 +}
    1.46 +function optionsClear() {}
    1.47 +function optionsPush() {}
    1.48 +optionsInit();
    1.49 +optionsClear();
    1.50 +function getTestCaseResult(expected, actual)
    1.51 +function test() {
    1.52 +    for ( gTc=0; gTc < gTestcases.length; gTc++ ) {}
    1.53 +}
    1.54 +var lfcode = new Array();
    1.55 +lfcode.push("4");
    1.56 +lfcode.push("gcparam(\"maxBytes\", gcparam(\"gcBytes\") + 1024);");
    1.57 +lfcode.push("");
    1.58 +lfcode.push("\
    1.59 +var UBound = 0;\n\
    1.60 +var BUGNUMBER = 74474;\n\
    1.61 +var actual = '';\n\
    1.62 +var actualvalues = [ ];\n\
    1.63 +var expectedvalues = [ ];\n\
    1.64 +addThis();\n\
    1.65 +addThis();\n\
    1.66 +tryThis(1);\n\
    1.67 +function tryThis(x)\n\
    1.68 +addThis();\n\
    1.69 +test();\n\
    1.70 +function addThis() {\n\
    1.71 +actualvalues[UBound] = actual;\n\
    1.72 +UBound++;\n\
    1.73 +}\n\
    1.74 +function test() {\n\
    1.75 +enterFunc ('test');\n\
    1.76 +printBugNumber(BUGNUMBER);\n\
    1.77 +for (var i = 0; i < UBound; i++)\n\
    1.78 +reportCompare(expectedvalues[i], actualvalues[i], getStatus(i));\n\
    1.79 +}\n\
    1.80 +function getStatus(i) {}\n\
    1.81 +");
    1.82 +delete Debugger;
    1.83 +while (true) {
    1.84 +    var file = lfcode.shift(); if (file == undefined) { break; }
    1.85 +    if (file == "evaluate") {
    1.86 +    } else {
    1.87 +        loadFile(file)
    1.88 +    }
    1.89 +}
    1.90 +function loadFile(lfVarx) {
    1.91 +    try {
    1.92 +        if (lfVarx.substr(-3) != ".js" && lfVarx.length != 1) {
    1.93 +            switch (lfRunTypeId) {
    1.94 +            case 3: function newFunc(x) { new Function(x)(); }; newFunc(lfVarx); break;
    1.95 +            case 4: eval("(function() { " + lfVarx + " })();"); break;
    1.96 +            }
    1.97 +        } else if (!isNaN(lfVarx)) {
    1.98 +            lfRunTypeId = parseInt(lfVarx);
    1.99 +            switch (lfRunTypeId) {
   1.100 +            case 3: function newFunc(x) { new Function(x)(); }; newFunc(lfVarx); break;
   1.101 +            }
   1.102 +	}
   1.103 +    } catch (lfVare) {
   1.104 +        if (lfVare instanceof SyntaxError) {        }
   1.105 +    }
   1.106 +}

mercurial