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-06-17 16:56:54 +00:00
|
|
|
// Flags: --allow-natives-syntax --fuzzing
|
2020-01-30 11:31:37 +00:00
|
|
|
|
2020-06-22 12:35:34 +00:00
|
|
|
// Test allow/block-listed intrinsics in the context of fuzzing.
|
2020-01-30 11:31:37 +00:00
|
|
|
|
2020-06-22 12:35:34 +00:00
|
|
|
// Blocklisted 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
|
|
|
|
2020-06-22 12:35:34 +00:00
|
|
|
// Blocklisted 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());
|
|
|
|
|
2020-06-22 12:35:34 +00:00
|
|
|
// Check allowlisted intrinsic.
|
2020-01-30 11:31:37 +00:00
|
|
|
assertNotEquals(undefined, %IsBeingInterpreted());
|
2020-02-10 13:29:33 +00:00
|
|
|
|
2020-06-22 12:35:34 +00:00
|
|
|
// Allowlisted runtime functions with too few args are ignored.
|
2020-02-10 13:29:33 +00:00
|
|
|
assertEquals(undefined, %DeoptimizeFunction());
|
|
|
|
|
|
|
|
// Superfluous arguments are ignored.
|
|
|
|
%DeoptimizeFunction(function() {}, undefined);
|
|
|
|
assertNotEquals(undefined, %IsBeingInterpreted(1, 2, 3));
|