dropteelocal.wast 822 B

123456789101112131415161718192021
  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. (module
  6. (func $tee (export "tee") (param i32) (result i32)
  7. (local i32 i32)
  8. (set_local 1 (get_local 0))
  9. (set_local 2 (i32.const 1))
  10. (block
  11. (set_local 2 (i32.mul (get_local 1) (get_local 2)))
  12. (drop (get_local 2))
  13. (if (i32.eqz (tee_local 1 (i32.sub (get_local 1) (i32.const 1))))
  14. (set_local 2 (i32.const 100))
  15. (set_local 2 (i32.const 200)))
  16. )
  17. (get_local 2)
  18. )
  19. )