js/src/jit-test/tests/auto-regress/bug702915.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/auto-regress/bug702915.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,85 @@
     1.4 +// Binary: cache/js-dbg-64-d51bd1645a2f-linux
     1.5 +// Flags: -m -n -a
     1.6 +//
     1.7 +gczeal(4);
     1.8 +var callStack = new Array();
     1.9 +var gTestcases = new Array();
    1.10 +var gTc = gTestcases.length;
    1.11 +function TestCase(n, d, e, a) {
    1.12 +  this.name = n;
    1.13 +  this.description = d;
    1.14 +  this.expect = e;
    1.15 +  this.actual = a;
    1.16 +  this.passed = getTestCaseResult(e, a);
    1.17 +  this.reason = '';
    1.18 +  this.bugnumber = '';
    1.19 +  this.type = (typeof window == 'undefined' ? 'shell' : 'browser');
    1.20 +  gTestcases[gTc++] = this;
    1.21 +}
    1.22 +function enterFunc (funcName) {
    1.23 +  try { throw foo; } catch(ex) {}
    1.24 +}
    1.25 +function getTestCaseResult(expected, actual) {}
    1.26 +function writeHeaderToLog( string ) {}
    1.27 +var lfcode = new Array();
    1.28 +lfcode.push("\
    1.29 +	var code = ''; \
    1.30 +	code+=createCode((gczeal(2))); \
    1.31 +	function createCode(i) { \
    1.32 +	  jstop+= +  delete   + i + \" string.';\"; \
    1.33 +	} \
    1.34 +");
    1.35 +lfcode.push("\
    1.36 +var SECTION = '9.9-1'; \
    1.37 +new TestCase( SECTION, '(Object(true)).__proto__',  Boolean.prototype,      (Object(true)).__proto__ ); \
    1.38 +new TestCase( SECTION, '(Object(1)).__proto__',     Number.prototype,      (Object(1)).__proto__ ); \
    1.39 +new TestCase( SECTION, '(Object(-1)).__proto__',    Number.prototype,      (Object(-1)).__proto__ ); \
    1.40 +new TestCase( SECTION, '(Object(Number.MAX_VALUE)).__proto__',  Number.prototype,               (Object(Number.MAX_VALUE)).__proto__ ); \
    1.41 +new TestCase( SECTION, '(Object(Number.MIN_VALUE)).__proto__',  Number.prototype, (Object(Number.MIN_VALUE)).__proto__ ); \
    1.42 +new TestCase( SECTION, '(Object(Number.POSITIVE_INFINITY)).__proto__',  Number.prototype,               (Object(Number.POSITIVE_INFINITY)).__proto__ ); \
    1.43 +new TestCase( SECTION, '(Object(Number.NEGATIVE_INFINITY)).__proto__',  Number.prototype,   (Object(Number.NEGATIVE_INFINITY)).__proto__ ); \
    1.44 +new TestCase( SECTION, '(Object(Number.NaN)).__proto__',    Number.prototype,          (Object(Number.NaN)).__proto__ ); \
    1.45 +new TestCase(  ) ; \
    1.46 +new TestCase( SECTION, '(Object(\"\")).__proto__',   String.prototype,   (Object('')).__proto__ ); \
    1.47 +new TestCase( SECTION, \"(Object('foo')).__proto__\", String.prototype,   (Object('foo')).__proto__ ); \
    1.48 +new TestCase( SECTION,  \"Object( '' ).__proto__\",      String.prototype,   (Object(\"\")).__proto__ ); \
    1.49 +new TestCase( SECTION, '(Object( new MyObject(true) )).toString()',  '[object Object]',       eval('(Object( new MyObject(true) )).toString()') ); \
    1.50 +");
    1.51 +lfcode.push("jsTestDriverEnd();");
    1.52 +lfcode.push("");
    1.53 +lfcode.push("\
    1.54 +	enterFunc ('test'); \
    1.55 +	Array.prototype[1] = 'bar'; \
    1.56 +	var a = [];  \
    1.57 +	exitFunc ('test'); \
    1.58 +");
    1.59 +lfcode.push("");
    1.60 +lfcode.push("\
    1.61 +  var VERSION = 'ECMA_1'; \
    1.62 +var TITLE   = 'Value Properties of the Math Object'; \
    1.63 +writeHeaderToLog( SECTION + ' '+ TITLE); \
    1.64 +new TestCase( '15.8.1.1', 'Math.E',             \
    1.65 +              this  . TITLE     ); \
    1.66 +              'typeof Math.E',      \
    1.67 +new TestCase( '15.8.1.2', \
    1.68 +              'Math.LN10',          \
    1.69 +              'typeof Math.LN10',   \
    1.70 +              typeof Math.LN10 ); \
    1.71 +new TestCase( '15.8.1.3', \
    1.72 +              'Math.LN2',          \
    1.73 +              Math.LN2 ); \
    1.74 +new TestCase( '15.8.1.3', \
    1.75 +              Math.LOG2E ); \
    1.76 +new TestCase( '15.8.1.4', \
    1.77 +              Math.SQRT1_2); \
    1.78 +new TestCase( '15.8.1.7', \
    1.79 +              typeof Math.SQRT2 ); \
    1.80 +new TestCase( SECTION,  \
    1.81 +              eval('var MATHPROPS=\"\";for( p in Math ){ MATHPROPS +=p; };MATHPROPS') ); \
    1.82 +");
    1.83 +while (true) {
    1.84 +	var file = lfcode.shift(); if (file == undefined) { break; }
    1.85 +		try {
    1.86 +				eval(file);
    1.87 +		} catch(exc1) { print(exc1); };
    1.88 +}

mercurial