unreachable.js 649 B

12345678910111213141516
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. var mod = new WebAssembly.Module(readbuffer('unreachable.wasm'));
  6. var a = new WebAssembly.Instance(mod).exports;
  7. try {
  8. a.test_unreachable();
  9. print("FAILED");
  10. }
  11. catch(e) {
  12. print(e.message.includes("Unreachable") ? "PASSED" : "FAILED");
  13. }