v8/tools/clusterfuzz/v8_sanity_checks.js
Michael Achenbach 8140856013 [foozzie] Add sanity check for missing natives suppression
This prevents bug flooding based on differences from calling
%GetOptimizationStatus in correctness tests. It is supposed to
be suppressed with --allow-natives-for-differential-fuzzing.
This ensures early bail-out in case the flag is forgotten at
some point. The v8_sanity_checks.js file is executed before
each correctness test case for this purpose.

NOTRY=true

Bug: chromium:1044942
Change-Id: I74a836a82562604b35e94e5e123a2a8bff939423
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2184294
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67618}
2020-05-06 16:21:47 +00:00

46 lines
1.2 KiB
JavaScript

// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is executed separately before the correctness test case. Add here
// checking of global properties that should never differ in any configuration.
// A difference found in the prints below will prevent any further correctness
// comparison for the selected configurations to avoid flooding bugs.
print("https://crbug.com/932656");
print(Object.getOwnPropertyNames(this));
print("https://crbug.com/935800");
(function () {
function foo() {
"use asm";
function baz() {}
return {bar: baz};
}
print(Object.getOwnPropertyNames(foo().bar));
})();
print("https://crbug.com/985154");
(function () {
"use strict";
function foo() {
"use asm";
function baz() {}
return {bar: baz};
}
print(Object.getOwnPropertyNames(foo().bar));
})();
print("Suppresses sensitive natives");
(function () {
function foo() {}
%PrepareFunctionForOptimization(foo);
foo();
foo();
%OptimizeFunctionOnNextCall(foo);
foo();
print(%GetOptimizationStatus(foo));
const fun = new Function("f", "sync", "return %GetOptimizationStatus(f);");
print(fun(foo));
})();