complement.carbon 857 B

1234567891011121314151617181920212223
  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/complement.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/int/complement.carbon
  12. // --- int_complement.carbon
  13. fn Complement(a: i32) -> i32 = "int.complement";
  14. fn And(a: i32, b: i32) -> i32 = "int.and";
  15. var arr: [i32; And(Complement(0x123456), 0xFFFFFF)];
  16. let arr_p: [i32; 0xEDCBA9]* = &arr;
  17. fn RuntimeCallIsValid(a: i32) -> i32 {
  18. return Complement(a);
  19. }