From f859751c6a612205740698d67e083efe5cc4ee5e Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 5 Sep 2022 22:18:43 -0700 Subject: feat(tvix/eval): Support builtins.bitXor Bitwise "exclusive-or" on integers. Change-Id: I90a0a15afb3a58662d70e82ea14e48b877476e04 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6550 Autosubmit: wpcarro Reviewed-by: wpcarro Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.nix (limited to 'tvix/eval/src/tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.exp new file mode 100644 index 000000000000..457157d45970 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.exp @@ -0,0 +1 @@ +[ 0 1 1 0 8 8 0 0 0 0 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.nix new file mode 100644 index 000000000000..80e363fb0748 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.nix @@ -0,0 +1,12 @@ +[ + (builtins.bitXor 0 0) + (builtins.bitXor 1 0) + (builtins.bitXor 0 1) + (builtins.bitXor 1 1) + (builtins.bitXor 8 0) + (builtins.bitXor 0 8) + (builtins.bitXor 8 8) + (builtins.bitXor 8 (builtins.add 4 4)) + (builtins.bitXor (builtins.add 4 4) 8) + (builtins.bitXor (builtins.add 4 4) (builtins.add 4 4)) +] -- cgit 1.4.1