File: i64-setTempRet0.asm.js

package info (click to toggle)
binaryen 68-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 34,900 kB
  • sloc: cpp: 57,351; ansic: 3,562; python: 2,898; sh: 700; makefile: 6
file content (24 lines) | stat: -rw-r--r-- 627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
// Test i64 support in wasm-only builds. In this case, fastcomp emits code that is
// not asm.js, it will only ever run as wasm, and contains special intrinsics for
// asm2wasm that map LLVM IR into i64s.
//

function asm(global, env, buffer) {
  "use asm";

  var illegalImportResult = env.illegalImportResult;

  var tempRet0 = 0; // this should be used to legalize the illegal result

  function illegalResult() { // illegal result, exported
    return i64_const(1, 2);
  }

  function imports() {
    return i64_trunc(i64(illegalImportResult())) | 0;
  }

  return { illegalResult: illegalResult, imports: imports };
}