Michael Holman %!s(int64=8) %!d(string=hai) anos
pai
achega
0db8e86dfb
Modificáronse 2 ficheiros con 35 adicións e 0 borrados
  1. 28 0
      test/wasm/polyinline.js
  2. 7 0
      test/wasm/rlexe.xml

+ 28 - 0
test/wasm/polyinline.js

@@ -0,0 +1,28 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft Corporation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+const buf = WebAssembly.wabt.convertWast2Wasm(`
+(module
+  (func (export "min") (param f64 f64) (result f64)
+    (f64.min (get_local 0) (get_local 1))
+  )
+
+  (func (export "max") (param f64 f64) (result f64)
+    (f64.max (get_local 0) (get_local 1))
+  )
+)`);
+const view = new Uint8Array(buf);
+view[buf.byteLength - 1] = 6;
+var mod = new WebAssembly.Module(buf);
+var {min, max} = new WebAssembly.Instance(mod).exports;
+
+function foo(fn) {
+  fn();
+}
+
+try {foo(min);} catch (e) {}
+try {foo(max);} catch (e) {}
+try {foo(min);} catch (e) {}
+print("Pass");

+ 7 - 0
test/wasm/rlexe.xml

@@ -288,6 +288,13 @@
     <tags>exclude_xplat</tags>
   </default>
 </test>
+<test>
+  <default>
+    <files>polyinline.js</files>
+    <compile-flags>-maxinterpretcount:2 -off:simplejit</compile-flags>
+    <tags>exclude_xplat,exclude_jshost,exclude_win7</tags>
+  </default>
+</test>
 <test>
   <default>
     <files>limits.js</files>