brbool.js 821 B

123456789101112131415161718192021222324252627282930313233
  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. let test = (function ()
  6. {
  7. "use asm";
  8. function brbool(a, b, c) {
  9. a = a|0;
  10. b = b|0;
  11. c = c|0;
  12. var d = 0;
  13. var e = 0;
  14. d = (a|0) == (b|0);
  15. e = (d|0) == (c|0);
  16. if((d & e)|0)
  17. {
  18. return 1;
  19. }
  20. return 2;
  21. }
  22. return brbool;
  23. })()
  24. if(test(1,1,1) == 1 && test(1,2,3) == 2)
  25. {
  26. print("PASS");
  27. }
  28. else
  29. {
  30. print("FAIL");
  31. }