From 72bcbf96c5ba11bd992cce6b6bbe8360447d940d Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 27 Jun 2022 09:53:25 +0200 Subject: [PATCH] Add semantic test --- test/libsolidity/semanticTests/stdlib/sha256.sol | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/libsolidity/semanticTests/stdlib/sha256.sol diff --git a/test/libsolidity/semanticTests/stdlib/sha256.sol b/test/libsolidity/semanticTests/stdlib/sha256.sol new file mode 100644 index 000000000..c5f43885b --- /dev/null +++ b/test/libsolidity/semanticTests/stdlib/sha256.sol @@ -0,0 +1,13 @@ +pragma stdlib; + +import "std/precompiles.sol"; + +contract C { + function f(uint256 a) external returns (bytes32) { + return sha256(abi.encodePacked(a)); + } +} + +// ==== +// ---- +// f(uint256): 1 -> 0xec4916dd28fc4c10d78e287ca5d9cc51ee1ae73cbfde08c6b37324cbfaac8bc5