88031d95585417463e2939d40ff53cc9c8a12221 478 B

12345678910111213141516171819202122
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // CHECK:STDOUT: result: 1
  7. package ExplorerTest;
  8. fn IntDiff(a: i32, b: i32) -> i32 {
  9. if (a == b) {
  10. returned var ret: i32 = a - b;
  11. return var;
  12. } else {
  13. returned var ret2: i32 = b - a;
  14. return var;
  15. }
  16. }
  17. fn Main() -> i32 {
  18. return IntDiff(1, 2);
  19. }