From 5a56bfc66a54e40159b95996e91814c50dd4037e Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Fri, 20 Sep 2019 16:05:38 +0100 Subject: [PATCH] Add more tests for V8 intrinsics --- .../__snapshots__/jsfmt.spec.js.snap | 26 +++++++++++++++++++ tests/v8_intrinsic/intrinsic_call.js | 19 ++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/tests/v8_intrinsic/__snapshots__/jsfmt.spec.js.snap b/tests/v8_intrinsic/__snapshots__/jsfmt.spec.js.snap index 0d23c5481c37..0248f069144c 100644 --- a/tests/v8_intrinsic/__snapshots__/jsfmt.spec.js.snap +++ b/tests/v8_intrinsic/__snapshots__/jsfmt.spec.js.snap @@ -12,10 +12,36 @@ function doSmth() { foo ) } + function printFunc ( + f +) { + if(% + IsAsmWasmCode(f)) console.log("asm.js"); + if( + + % IsWasmCode( + f)) + console.log ( + "wasm" + ); + + console.log + (% + GetFunctioName(f) + ); +} + =====================================output===================================== function doSmth() { %DebugPrint(foo); } +function printFunc(f) { + if (%IsAsmWasmCode(f)) console.log("asm.js"); + if (%IsWasmCode(f)) console.log("wasm"); + + console.log(%GetFunctioName(f)); +} + ================================================================================ `; diff --git a/tests/v8_intrinsic/intrinsic_call.js b/tests/v8_intrinsic/intrinsic_call.js index f1295de4d241..43f8bbd7e936 100644 --- a/tests/v8_intrinsic/intrinsic_call.js +++ b/tests/v8_intrinsic/intrinsic_call.js @@ -3,3 +3,22 @@ function doSmth() { ( foo ) } + + function printFunc ( + f +) { + if(% + IsAsmWasmCode(f)) console.log("asm.js"); + if( + + % IsWasmCode( + f)) + console.log ( + "wasm" + ); + + console.log + (% + GetFunctioName(f) + ); +}