fstpbug.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function AsmModule(stdlib,foreign) {
  6. "use asm";
  7. var fun2 = foreign.fun2;
  8. function mul(x,y) {
  9. x = +x;
  10. y = +y;
  11. return (+(x*y));
  12. }
  13. function f2(x,y){
  14. x = +x;
  15. y = y|0;
  16. var i = 0, j = 0.0;
  17. j = +mul(+mul(x,1.),+mul(x,1.));
  18. return +j;
  19. }
  20. function f3(x){
  21. x = x|0;
  22. var i = 0.
  23. i = +f2(100.5,1);
  24. i = +f2(5.5,1);
  25. return +i;
  26. }
  27. return f3;
  28. }
  29. var global = {}
  30. var env = {fun2:function(x){print(x);}}
  31. var asmModule = AsmModule(global,env)
  32. print(asmModule ( 1))