2
0

BugFixRegression_MaxInterpret.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. // A non-helper block may fall through into a helper block (in this case, an unconditional bailout caused by the switch opt)
  6. function test0(a) {
  7. var b = -1;
  8. switch(a ? a * 1 : a * 0.1) {
  9. case 0:
  10. b = 0;
  11. break;
  12. case 1:
  13. b = 1;
  14. break;
  15. case 2:
  16. b = 2;
  17. break;
  18. case 3:
  19. b = 3;
  20. }
  21. return b;
  22. }
  23. test0(1);
  24. test0(0);
  25. // - Should be able to successfully create an airlock block on a multi-branch edge
  26. // - A multi-branch involving multiple of the same target block should create only one airlock block per target block
  27. function test1(a, b) {
  28. ++b;
  29. switch(a) {
  30. case "0":
  31. b += 0.1;
  32. break;
  33. case "1":
  34. case "2":
  35. case "3":
  36. }
  37. return b;
  38. }
  39. test1("1", 0);
  40. test1("1", 0);
  41. WScript.Echo("pass");