2020-01-30 11:31:37 +00:00
|
|
|
// Copyright 2020 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.
|
|
|
|
|
2020-04-15 09:08:41 +00:00
|
|
|
// Flags: --allow-natives-for-fuzzing --fuzzing
|
2020-01-30 11:31:37 +00:00
|
|
|
|
|
|
|
// Test whitelisted/blacklisted intrinsics in the context of fuzzing.
|
|
|
|
|
|
|
|
// Blacklisted intrinsics are replaced with undefined.
|
2020-04-15 09:08:41 +00:00
|
|
|
assertEquals(undefined, %ConstructConsString("a", "b"));
|
2020-01-30 11:31:37 +00:00
|
|
|
|
|
|
|
// Blacklisted intrinsics can have wrong arguments.
|
2020-04-15 09:08:41 +00:00
|
|
|
assertEquals(undefined, %ConstructConsString(1, 2, 3, 4));
|
2020-01-30 11:31:37 +00:00
|
|
|
|
|
|
|
// We don't care if an intrinsic actually exists.
|
|
|
|
assertEquals(undefined, %FooBar());
|
|
|
|
|
|
|
|
// Check whitelisted intrinsic.
|
|
|
|
assertNotEquals(undefined, %IsBeingInterpreted());
|
2020-02-10 13:29:33 +00:00
|
|
|
|
|
|
|
// Whitelisted runtime functions with too few args are ignored.
|
|
|
|
assertEquals(undefined, %DeoptimizeFunction());
|
|
|
|
|
|
|
|
// Superfluous arguments are ignored.
|
|
|
|
%DeoptimizeFunction(function() {}, undefined);
|
|
|
|
assertNotEquals(undefined, %IsBeingInterpreted(1, 2, 3));
|