neq.carbon 868 B

123456789101112131415161718192021222324252627
  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. // EXTRA-ARGS: --no-dump-sem-ir
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/neq.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/int/neq.carbon
  12. // --- int_neq.carbon
  13. fn Neq(a: i32, b: i32) -> bool = "int.neq";
  14. class True {}
  15. class False {}
  16. fn F(true_: True, false_: False) {
  17. false_ as (if Neq(1, 1) then True else False);
  18. true_ as (if Neq(1, 2) then True else False);
  19. }
  20. fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
  21. return Neq(a, b);
  22. }