failnativecodeinstall.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. // Confirm that we can continue executing function calls and loop bodies when we fail
  6. // to install jitted code after the native code gen job has succeeded. (Written to run
  7. // with /mic:2 /lic:1 /on:failnativecodeinstall.)
  8. var x = 0;
  9. var y;
  10. try {
  11. try {
  12. x++;
  13. // Interpret f, throw on jitting of loop body
  14. f();
  15. }
  16. catch (e) {
  17. WScript.Echo('caught call ' + x++);
  18. // Interpret f, throw on jitting of loop body
  19. f();
  20. }
  21. }
  22. catch (e) {
  23. WScript.Echo('caught call ' + x);
  24. try {
  25. try {
  26. x++;
  27. // Throw trying to jit function body
  28. f();
  29. }
  30. catch (e) {
  31. WScript.Echo('caught call ' + x++);
  32. // Throw trying to jit function body
  33. f();
  34. }
  35. }
  36. catch (e) {
  37. WScript.Echo('done');
  38. }
  39. }
  40. function f() {
  41. WScript.Echo('call ' + x);
  42. while (1) {
  43. y++;
  44. }
  45. }