2
0

neg.js 856 B

1234567891011121314151617181920212223242526272829
  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. function test0(){
  6. var x1 = -(1 << 31);
  7. var x2 = -(0x80000000 | 0);
  8. var x3 = -(0x80000000 + 0);
  9. var x4 = -(0x80000000);
  10. WScript.Echo("x1 = " + x1 + " x2 = " + x2 + " x3 = " + x3 + " x4 = " + x4);
  11. };
  12. // generate profile
  13. test0();
  14. function test1(){
  15. var negate = function(p0){
  16. for(var i=0; i < 2; i++ ) {
  17. p0 =(- p0);
  18. WScript.Echo(p0);
  19. }
  20. }
  21. negate(-2147483648);
  22. negate(-5);
  23. negate(-1073741824);
  24. };
  25. test1();