From 2f41245e436de47b13f2aba6c5fb9449f467dc73 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 14 Sep 2020 19:08:28 +0200 Subject: [PATCH] Commandline test for unimplemented IR. --- scripts/error_codes.py | 1 + test/cmdlineTests.sh | 1 + test/cmdlineTests/yul_unimplemented/args | 1 + test/cmdlineTests/yul_unimplemented/err | 5 +++++ test/cmdlineTests/yul_unimplemented/exit | 1 + test/cmdlineTests/yul_unimplemented/input.sol | 11 +++++++++++ 6 files changed, 20 insertions(+) create mode 100644 test/cmdlineTests/yul_unimplemented/args create mode 100644 test/cmdlineTests/yul_unimplemented/err create mode 100644 test/cmdlineTests/yul_unimplemented/exit create mode 100644 test/cmdlineTests/yul_unimplemented/input.sol diff --git a/scripts/error_codes.py b/scripts/error_codes.py index 69e452b2a..d77fcacaa 100755 --- a/scripts/error_codes.py +++ b/scripts/error_codes.py @@ -188,6 +188,7 @@ def examine_id_coverage(top_dir, source_id_to_file_names, new_ids_only=False): # Warning (1878): SPDX license identifier not provided in source file. .... # Warning (3420): Source file does not specify required compiler version! test_ids |= find_ids_in_cmdline_test_err(path.join(top_dir, "test", "cmdlineTests", "error_codes", "err")) + test_ids |= find_ids_in_cmdline_test_err(path.join(top_dir, "test", "cmdlineTests", "yul_unimplemented", "err")) # white list of ids which are not covered by tests white_ids = { diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index a22fb7339..abb7ab5ba 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -124,6 +124,7 @@ function test_solc_behaviour() sed -i.bak -e '/^Warning (3805): This is a pre-release compiler version, please do not use it in production./d' "$stderr_path" sed -i.bak -e 's/\(^[ ]*auxdata: \)0x[0-9a-f]*$/\1AUXDATA REMOVED/' "$stdout_path" sed -i.bak -e 's/ Consider adding "pragma .*$//' "$stderr_path" + sed -i.bak -e 's/\(Unimplemented feature error: .* in \).*$/\1FILENAME REMOVED/' "$stderr_path" sed -i.bak -e 's/"version": "[^"]*"/"version": "VERSION REMOVED"/' "$stdout_path" # Remove trailing empty lines. Needs a line break to make OSX sed happy. sed -i.bak -e '1{/^$/d diff --git a/test/cmdlineTests/yul_unimplemented/args b/test/cmdlineTests/yul_unimplemented/args new file mode 100644 index 000000000..e869749f2 --- /dev/null +++ b/test/cmdlineTests/yul_unimplemented/args @@ -0,0 +1 @@ +--ir --error-codes diff --git a/test/cmdlineTests/yul_unimplemented/err b/test/cmdlineTests/yul_unimplemented/err new file mode 100644 index 000000000..d6159a1f1 --- /dev/null +++ b/test/cmdlineTests/yul_unimplemented/err @@ -0,0 +1,5 @@ +Error (1834): Unimplemented feature error: setToZero for type t_struct$_S_$4_storage not yet implemented! in FILENAME REMOVED + --> yul_unimplemented/input.sol:9:9: + | +9 | delete str; + | ^^^^^^^^^^ diff --git a/test/cmdlineTests/yul_unimplemented/exit b/test/cmdlineTests/yul_unimplemented/exit new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/test/cmdlineTests/yul_unimplemented/exit @@ -0,0 +1 @@ +1 diff --git a/test/cmdlineTests/yul_unimplemented/input.sol b/test/cmdlineTests/yul_unimplemented/input.sol new file mode 100644 index 000000000..d024eeba0 --- /dev/null +++ b/test/cmdlineTests/yul_unimplemented/input.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract test { + struct S { + uint x; + } + S str; + constructor() { + delete str; + } +} \ No newline at end of file