Debian Codegraph @

js/src/jit-test/tests/wasm/single-cpu.js

raw
1 // |jit-test| --test-wasm-await-tier2; --cpu-count=1
2
3 // Test that compilation works when there's only one core available.
4
5 // This is fac-opt from fac.wast in the official testsuite, changed to use
6 // i32 instead of i64.
7 assertEq(wasmEvalText(`(module
8 (func $fac-opt (param i32) (result i32)
9 (local i32)
10 (local.set 1 (i32.const 1))
11 (block
12 (br_if 0 (i32.lt_s (local.get 0) (i32.const 2)))
13 (loop
14 (local.set 1 (i32.mul (local.get 1) (local.get 0)))
15 (local.set 0 (i32.add (local.get 0) (i32.const -1)))
16 (br_if 0 (i32.gt_s (local.get 0) (i32.const 1)))
17 )
18 )
19 (local.get 1)
20 )
21
22 (export "" (func 0))
23 )`).exports[""](10), 3628800);