xref: /third_party/node/test/parallel/test-arm-math-illegal-instruction.js (revision 1cb0ef41)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_cirequire('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ci// This test ensures Math functions don't fail with an "illegal instruction"
51cb0ef41Sopenharmony_ci// error on ARM devices (primarily on the Raspberry Pi 1)
61cb0ef41Sopenharmony_ci// See https://github.com/nodejs/node/issues/1376
71cb0ef41Sopenharmony_ci// and https://code.google.com/p/v8/issues/detail?id=4019
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci// Iterate over all Math functions
101cb0ef41Sopenharmony_ciObject.getOwnPropertyNames(Math).forEach((functionName) => {
111cb0ef41Sopenharmony_ci  if (!/[A-Z]/.test(functionName)) {
121cb0ef41Sopenharmony_ci    // The function names don't have capital letters.
131cb0ef41Sopenharmony_ci    Math[functionName](-0.5);
141cb0ef41Sopenharmony_ci  }
151cb0ef41Sopenharmony_ci});
16

Indexes created Thu Nov 07 10:32:03 CST 2024