diff --git a/.circleci/config.yml b/.circleci/config.yml index 96379499c9f6..c11b5f8b45a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,24 +9,24 @@ version: 2.1 parameters: ubuntu-2004-docker-image: type: string - # solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-16 - default: "solbuildpackpusher/solidity-buildpack-deps@sha256:ee1def5806f40c35d583234e172ec5769bb9a08b6f5bbc713c1a2658846dbced" + # solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-19 + default: "solbuildpackpusher/solidity-buildpack-deps@sha256:9c7d3be930936a70f0340d5e9fa9a0b8bf69e11192e7e2d37807afe1b7f55534" ubuntu-2204-docker-image: type: string - # solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-1 - default: "solbuildpackpusher/solidity-buildpack-deps@sha256:07419ed58537cbca9d4c30701fb84f6bb517ce2fce7f3b5dccb3db8bf1c30183" + # solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-4 + default: "solbuildpackpusher/solidity-buildpack-deps@sha256:7555c26c82fd0dcbc02cbd422b74468f8de1b7f2972b84fadcfa90f7371d6de5" ubuntu-2204-clang-docker-image: type: string - # solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-1 - default: "solbuildpackpusher/solidity-buildpack-deps@sha256:e515710752bfb38ee0e9b2f92ca71612c03ed85290c36c3b3c0a3d9f90187aef" - ubuntu-1604-clang-ossfuzz-docker-image: + # solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-3 + default: "solbuildpackpusher/solidity-buildpack-deps@sha256:3d5efffd1e4c381041d1dff6331add86976373bde1c9dfca97ebd3d735e09dab" + ubuntu-clang-ossfuzz-docker-image: type: string - # solbuildpackpusher/solidity-buildpack-deps:ubuntu1604.clang.ossfuzz-22 - default: "solbuildpackpusher/solidity-buildpack-deps@sha256:baf46ad78b131eb6b0bf98d50e9330437a338c6893b53af3853b36f6f4ab18ae" + # solbuildpackpusher/solidity-buildpack-deps:ubuntu.clang.ossfuzz-1 + default: "solbuildpackpusher/solidity-buildpack-deps@sha256:d1bba750ab3f9ad9d28d45e332c2ec2126d248c1d619af369a3ef0c29f5936c3" emscripten-docker-image: type: string - # solbuildpackpusher/solidity-buildpack-deps:emscripten-14 - default: "solbuildpackpusher/solidity-buildpack-deps@sha256:d7d4ec28cdc3e61fc6a048b88ebdff1c5e67f3353cf1739cbaea07ec2481eb16" + # solbuildpackpusher/solidity-buildpack-deps:emscripten-15 + default: "solbuildpackpusher/solidity-buildpack-deps@sha256:e2729bd6c0734bb49d04e2688fec3dcf880394f351f69358dd2bd92c0f6fd309" evm-version: type: string default: london @@ -35,8 +35,8 @@ orbs: win: circleci/windows@2.2.0 commands: - gitter_notify_unless_pr: - description: "Posts a notification to the main room on Gitter (if not running on a PR)." + matrix_notify_unless_pr: + description: "Posts a notification to the solidity-dev room on Matrix (if not running on a PR)." parameters: event: type: enum @@ -45,54 +45,28 @@ commands: type: string steps: - run: - name: "Gitter notification" + name: "Matrix notification" when: << parameters.condition >> - command: | - # FIXME: Checking $CIRCLE_PULL_REQUEST would be better than hard-coding branch names - # but it's broken. CircleCI associates runs on develop/breaking with random old PRs. - [[ $CIRCLE_BRANCH == develop || $CIRCLE_BRANCH == breaking ]] || { echo "Running on a PR or a feature branch - notification skipped."; exit 0; } - - # Workflow name is not exposed as an env variable. Has to be queried from the API. - # The name is not critical so if anything fails, use the raw workflow ID as a fallback. - workflow_info=$(curl --silent "https://circleci.com/api/v2/workflow/${CIRCLE_WORKFLOW_ID}") || true - workflow_name=$(echo "$workflow_info" | grep -E '"\s*name"\s*:\s*".*"' | cut -d \" -f 4 || echo "$CIRCLE_WORKFLOW_ID") - - [[ $CIRCLE_NODE_TOTAL == 1 ]] && job="**${CIRCLE_JOB}**" - [[ $CIRCLE_NODE_TOTAL != 1 ]] && job="**${CIRCLE_JOB}** (run $((CIRCLE_NODE_INDEX + 1))/${CIRCLE_NODE_TOTAL})" - - [[ "<< parameters.event >>" == "failure" ]] && message=" ❌ [${workflow_name}] Job ${job} failed on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details." - [[ "<< parameters.event >>" == "success" ]] && message=" ✅ [${workflow_name}] Job ${job} succeeded on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details." - [[ "<< parameters.event >>" == "release" ]] && message=" 📦 Release binaries for version **${CIRCLE_TAG}** are ready and attached as artifacts to [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}). **Please make sure the whole workflow succeeded before using them.**" - - # The release notification only makes sense on tagged commits. If the commit is untagged, just bail out. - [[ "<< parameters.event >>" == "release" ]] && { [[ $CIRCLE_TAG != "" ]] || { echo "Not a tagged commit - notification skipped."; exit 0; } } - - curl "https://api.gitter.im/v1/rooms/${GITTER_NOTIFY_ROOM_ID}/chatMessages" \ - --request POST \ - --include \ - --header "Content-Type: application/json" \ - --header "Accept: application/json" \ - --header "Authorization: Bearer ${GITTER_API_TOKEN}" \ - --data "{\"text\":\"${message}\"}" - - gitter_notify_failure_unless_pr: - description: "Posts a failure notification to the main room on Gitter (if not running on a PR)." + command: scripts/ci/notification/matrix_notification.sh << parameters.event >> + + matrix_notify_failure_unless_pr: + description: "Posts a failure notification to the main room on Matrix (if not running on a PR)." steps: - - gitter_notify_unless_pr: + - matrix_notify_unless_pr: event: failure condition: on_fail - gitter_notify_success_unless_pr: - description: "Posts a success notification to the main room on Gitter (if not running on a PR)." + matrix_notify_success_unless_pr: + description: "Posts a success notification to the main room on Matrix (if not running on a PR)." steps: - - gitter_notify_unless_pr: + - matrix_notify_unless_pr: event: success condition: on_success - gitter_notify_release_unless_pr: - description: "Posts a release notification to the main room on Gitter (if not running on a PR)." + matrix_notify_release_unless_pr: + description: "Posts a release notification to the main room on Matrix (if not running on a PR)." steps: - - gitter_notify_unless_pr: + - matrix_notify_unless_pr: event: release condition: on_success @@ -117,7 +91,74 @@ commands: paths: - bytecode-report-<< parameters.label >>-json.txt - bytecode-report-<< parameters.label >>-cli.txt - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr + + install_python3: + description: "Install python3 and given packages." + parameters: + packages: + description: "List of extra Python packages to be installed (separated by space)." + type: string + default: "" + steps: + - run: + name: Install python and dependencies + command: | + sudo apt update + sudo apt install python3 python3-pip --assume-yes --no-install-recommends + if [[ "<< parameters.packages >>" != "" ]] + then + echo "Installing additional packages..." + python3 -m pip install --user << parameters.packages >> + fi + + install_foundry: + description: "Install Foundry." + parameters: + version: + type: string + default: "nightly" + install_path: + type: string + default: /home/circleci/bin + steps: + - run: + name: Setup Foundry environment variables + command: | + FOUNDRY_REPO="foundry-rs/foundry" + FOUNDRY_VERSION="<< parameters.version >>" + FOUNDRY_RELEASE_SHA=$(curl \ + --silent \ + --fail \ + --show-error \ + "https://api.github.com/repos/${FOUNDRY_REPO}/git/refs/tags/${FOUNDRY_VERSION}" \ + | jq --raw-output .object.sha \ + ) + echo "export FOUNDRY_REPO=$FOUNDRY_REPO" >> "$BASH_ENV" + echo "export FOUNDRY_VERSION=$FOUNDRY_VERSION" >> "$BASH_ENV" + echo "export FOUNDRY_RELEASE_TAG='nightly-${FOUNDRY_RELEASE_SHA}'" >> "$BASH_ENV" + # Save commit sha for caching + echo "$FOUNDRY_RELEASE_SHA" > /tmp/workspace/foundry-release-sha + - restore_cache: + keys: + - foundry-<< parameters.version >>-{{ arch }}-{{ checksum "/tmp/workspace/foundry-release-sha" }} + # WARNING! If you edit anything between here and save_cache, remember to invalidate the cache manually. + - run: + name: Install foundry + command: | + ! forge --version 2> /dev/null + curl \ + --fail \ + --location \ + --output /tmp/foundry.tar.gz \ + "https://github.com/${FOUNDRY_REPO}/releases/download/${FOUNDRY_RELEASE_TAG}/foundry_${FOUNDRY_VERSION}_linux_amd64.tar.gz" + cd "<< parameters.install_path >>" + tar --extract --gzip --file /tmp/foundry.tar.gz --one-top-level + ln --symbolic --force foundry/{forge,anvil,cast,chisel} . + - save_cache: + key: foundry-<< parameters.version >>-{{ arch }}-{{ checksum "/tmp/workspace/foundry-release-sha" }} + paths: + - << parameters.install_path >> defaults: @@ -164,12 +205,6 @@ defaults: # -------------------------------------------------------------------------- # Artifacts Templates - # the whole build directory - - artifacts_build_dir: &artifacts_build_dir - root: build - paths: - - "*" - # compiled solc executable target - artifacts_solc: &artifacts_solc path: build/solc/solc @@ -232,7 +267,7 @@ defaults: - run: *run_soltest - store_test_results: *store_test_results - store_artifacts: *artifacts_test_results - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr - steps_test_lsp: &steps_test_lsp steps: @@ -245,7 +280,7 @@ defaults: - run: name: Executing solc LSP test suite command: ./test/lsp.py ./build/solc/solc --non-interactive - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr - steps_build: &steps_build steps: @@ -254,7 +289,7 @@ defaults: - store_artifacts: *artifacts_solc - store_artifacts: *artifact_yul_phaser - persist_to_workspace: *artifacts_executables - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr - steps_soltest_all: &steps_soltest_all steps: @@ -264,7 +299,7 @@ defaults: - run: *run_soltest_all - store_test_results: *store_test_results - store_artifacts: *artifacts_test_results - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr - steps_cmdline_tests: &steps_cmdline_tests steps: @@ -274,7 +309,7 @@ defaults: - run: *run_cmdline_tests - store_test_results: *store_test_results - store_artifacts: *artifacts_test_results - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr - steps_install_dependencies_osx: &steps_install_dependencies_osx steps: @@ -287,45 +322,90 @@ defaults: # -------------------------------------------------------------------------- # Base Image Templates - - base_ubuntu1604_clang: &base_ubuntu1604_clang + - base_archlinux: &base_archlinux docker: - - image: << pipeline.parameters.ubuntu-1604-clang-ossfuzz-docker-image >> + - image: archlinux:base environment: TERM: xterm MAKEFLAGS: -j 3 - - base_ubuntu1604_clang_small: &base_ubuntu1604_clang_small - <<: *base_ubuntu1604_clang + - base_archlinux_large: &base_archlinux_large + docker: + - image: archlinux:base + resource_class: large + environment: + TERM: xterm + MAKEFLAGS: -j 5 + + - base_cimg_small: &base_cimg_small + docker: + - image: cimg/base:current resource_class: small environment: TERM: xterm MAKEFLAGS: -j 2 - - base_ubuntu2204_clang: &base_ubuntu2204_clang + - base_ems_large: &base_ems_large docker: - - image: << pipeline.parameters.ubuntu-2204-clang-docker-image >> + - image: << pipeline.parameters.emscripten-docker-image >> + resource_class: large environment: TERM: xterm - CC: clang - CXX: clang++ - MAKEFLAGS: -j 3 + MAKEFLAGS: -j 5 - - base_ubuntu2204_clang_large: &base_ubuntu2204_clang_large - <<: *base_ubuntu2204_clang + - base_node_small: &base_node_small + docker: + - image: cimg/node:current + resource_class: small + environment: + TERM: xterm + MAKEFLAGS: -j 2 + + - base_osx: &base_osx + macos: + xcode: "14.2.0" + resource_class: macos.x86.medium.gen2 + environment: + TERM: xterm + MAKEFLAGS: -j5 + + - base_osx_large: &base_osx_large + macos: + xcode: "14.2.0" resource_class: large environment: TERM: xterm - CC: clang - CXX: clang++ - MAKEFLAGS: -j 5 + MAKEFLAGS: -j10 - - base_ubuntu2004: &base_ubuntu2004 + - base_python_small: &base_python_small docker: - - image: << pipeline.parameters.ubuntu-2004-docker-image >> + - image: cimg/python:3.6 + resource_class: small + environment: + TERM: xterm + MAKEFLAGS: -j 2 + + - base_ubuntu_clang: &base_ubuntu_clang + docker: + - image: << pipeline.parameters.ubuntu-clang-ossfuzz-docker-image >> environment: TERM: xterm MAKEFLAGS: -j 3 + - base_ubuntu_clang_small: &base_ubuntu_clang_small + <<: *base_ubuntu_clang + resource_class: small + environment: + TERM: xterm + MAKEFLAGS: -j 2 + + - base_ubuntu2004: &base_ubuntu2004 + docker: + - image: << pipeline.parameters.ubuntu-2004-docker-image >> + environment: + TERM: xterm + MAKEFLAGS: -j 3 + - base_ubuntu2004_small: &base_ubuntu2004_small <<: *base_ubuntu2004 resource_class: small @@ -347,6 +427,24 @@ defaults: TERM: xterm MAKEFLAGS: -j 3 + - base_ubuntu2204_clang: &base_ubuntu2204_clang + docker: + - image: << pipeline.parameters.ubuntu-2204-clang-docker-image >> + environment: + TERM: xterm + CC: clang + CXX: clang++ + MAKEFLAGS: -j 3 + + - base_ubuntu2204_clang_large: &base_ubuntu2204_clang_large + <<: *base_ubuntu2204_clang + resource_class: large + environment: + TERM: xterm + CC: clang + CXX: clang++ + MAKEFLAGS: -j 5 + - base_ubuntu2204_small: &base_ubuntu2204_small <<: *base_ubuntu2204 resource_class: small @@ -368,166 +466,103 @@ defaults: TERM: xterm MAKEFLAGS: -j 10 - - base_cimg_small: &base_cimg_small - docker: - - image: cimg/base:current - resource_class: small - environment: - TERM: xterm - MAKEFLAGS: -j 2 - - - base_archlinux: &base_archlinux - docker: - - image: archlinux:base - environment: - TERM: xterm - MAKEFLAGS: -j 3 - - - base_archlinux_large: &base_archlinux_large - docker: - - image: archlinux:base - resource_class: large - environment: - TERM: xterm - MAKEFLAGS: -j 5 - - - base_win_powershell: &base_win_powershell + - base_win: &base_win executor: name: win/default - shell: powershell.exe + shell: bash.exe - - base_win_powershell_large: &base_win_powershell_large + - base_win_large: &base_win_large executor: name: win/default - shell: powershell.exe size: large - - - base_win_bash: &base_win_bash - executor: - name: win/default shell: bash.exe - - base_osx: &base_osx - macos: - xcode: "13.2.0" - environment: - TERM: xterm - MAKEFLAGS: -j5 - - - base_osx_large: &base_osx_large - macos: - xcode: "13.2.0" - resource_class: large - environment: - TERM: xterm - MAKEFLAGS: -j10 - - - base_ems_large: &base_ems_large - docker: - - image: << pipeline.parameters.emscripten-docker-image >> - resource_class: large - environment: - TERM: xterm - MAKEFLAGS: -j 5 - - - base_python_small: &base_python_small - docker: - - image: cimg/python:3.6 - resource_class: small - environment: - TERM: xterm - MAKEFLAGS: -j 2 - - - base_node_small: &base_node_small - docker: - - image: cimg/node:current - resource_class: small - environment: - TERM: xterm - MAKEFLAGS: -j 2 - # -------------------------------------------------------------------------- # Workflow Templates - - workflow_trigger_on_tags: &workflow_trigger_on_tags + - on_all_tags_and_branches: &on_all_tags_and_branches filters: tags: only: /.*/ - - workflow_trigger_on_releases: &workflow_trigger_on_releases + - on_version_tags: &on_version_tags filters: tags: only: /^tv.*/ branches: ignore: /.*/ - - workflow_ubuntu2204: &workflow_ubuntu2204 - <<: *workflow_trigger_on_tags - requires: - - b_ubu + - on_develop: &on_develop + filters: + branches: + only: + - develop + + - requires_nothing: &requires_nothing + <<: *on_all_tags_and_branches - - workflow_ubuntu1604_clang: &workflow_ubuntu1604_clang - <<: *workflow_trigger_on_tags + - requires_b_ubu: &requires_b_ubu + <<: *on_all_tags_and_branches requires: - - b_ubu_ossfuzz + - b_ubu - - workflow_ubuntu2204_clang: &workflow_ubuntu2204_clang - <<: *workflow_trigger_on_tags + - requires_b_ubu_clang: &requires_b_ubu_clang + <<: *on_all_tags_and_branches requires: - b_ubu_clang - - workflow_ubuntu2204_force_release: &workflow_ubuntu2204_force_release - <<: *workflow_trigger_on_tags + - requires_b_ubu_force_release: &requires_b_ubu_force_release + <<: *on_all_tags_and_branches requires: - b_ubu_force_release - - workflow_ubuntu2004_static: &workflow_ubuntu2004_static - <<: *workflow_trigger_on_tags + - requires_b_ubu_static: &requires_b_ubu_static + <<: *on_all_tags_and_branches requires: - b_ubu_static - - workflow_archlinux: &workflow_archlinux - <<: *workflow_trigger_on_tags + - requires_b_archlinux: &requires_b_archlinux + <<: *on_all_tags_and_branches requires: - b_archlinux - - workflow_ubuntu2204_codecov: &workflow_ubuntu2204_codecov - <<: *workflow_trigger_on_tags + - requires_b_ubu_codecov: &requires_b_ubu_codecov + <<: *on_all_tags_and_branches requires: - b_ubu_codecov - - workflow_osx: &workflow_osx - <<: *workflow_trigger_on_tags + - requires_b_osx: &requires_b_osx + <<: *on_all_tags_and_branches requires: - b_osx - - workflow_ubuntu2204_asan: &workflow_ubuntu2204_asan - <<: *workflow_trigger_on_tags + - requires_b_ubu_asan: &requires_b_ubu_asan + <<: *on_all_tags_and_branches requires: - b_ubu_asan - - workflow_ubuntu2204_asan_clang: &workflow_ubuntu2204_asan_clang - <<: *workflow_trigger_on_tags + - requires_b_ubu_asan_clang: &requires_b_ubu_asan_clang + <<: *on_all_tags_and_branches requires: - b_ubu_asan_clang - - workflow_ubuntu2204_ubsan_clang: &workflow_ubuntu2204_ubsan_clang - <<: *workflow_trigger_on_tags + - requires_b_ubu_ubsan_clang: &requires_b_ubu_ubsan_clang + <<: *on_all_tags_and_branches requires: - b_ubu_ubsan_clang - - workflow_emscripten: &workflow_emscripten - <<: *workflow_trigger_on_tags + - requires_b_ems: &requires_b_ems + <<: *on_all_tags_and_branches requires: - b_ems - - workflow_ubuntu1604_ossfuzz: &workflow_ubuntu1604_ossfuzz - <<: *workflow_trigger_on_tags + - requires_b_ubu_ossfuzz: &requires_b_ubu_ossfuzz + <<: *on_all_tags_and_branches requires: - b_ubu_ossfuzz - - workflow_win: &workflow_win - <<: *workflow_trigger_on_tags + - requires_b_win: &requires_b_win + <<: *on_all_tags_and_branches requires: - b_win @@ -536,121 +571,137 @@ defaults: # Separate compile-only runs of those external tests where a full run takes much longer. - job_ems_compile_ext_colony: &job_ems_compile_ext_colony - <<: *workflow_emscripten + <<: *requires_b_ems name: t_ems_compile_ext_colony project: colony binary_type: solcjs compile_only: 1 - nodejs_version: '14.20' + image: cimg/node:14.20 python2: true - job_native_test_ext_gnosis: &job_native_test_ext_gnosis - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_gnosis project: gnosis binary_type: native - nodejs_version: '16.18' + image: cimg/node:16.18 + - job_native_test_ext_zeppelin: &job_native_test_ext_zeppelin - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_zeppelin project: zeppelin binary_type: native resource_class: large + - job_native_test_ext_ens: &job_native_test_ext_ens - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_ens project: ens binary_type: native - nodejs_version: '18.11' + image: cimg/node:18.11 + - job_native_test_ext_trident: &job_native_test_ext_trident - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_trident project: trident binary_type: native - nodejs_version: '16.18' + image: cimg/node:16.18 + - job_native_test_ext_euler: &job_native_test_ext_euler - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_euler project: euler binary_type: native resource_class: medium + - job_native_test_ext_yield_liquidator: &job_native_test_ext_yield_liquidator - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_yield_liquidator project: yield-liquidator binary_type: native + - job_native_test_ext_bleeps: &job_native_test_ext_bleeps - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_bleeps project: bleeps binary_type: native resource_class: medium + - job_native_test_ext_pool_together: &job_native_test_ext_pool_together - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_pool_together project: pool-together binary_type: native - nodejs_version: '16.18' + image: cimg/node:16.18 + - job_native_test_ext_perpetual_pools: &job_native_test_ext_perpetual_pools - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_perpetual_pools project: perpetual-pools binary_type: native - nodejs_version: '18.11' + image: cimg/node:18.11 + - job_native_test_ext_uniswap: &job_native_test_ext_uniswap - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_uniswap project: uniswap binary_type: native - nodejs_version: '16.18' + image: cimg/node:16.18 + - job_native_test_ext_prb_math: &job_native_test_ext_prb_math - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_prb_math project: prb-math binary_type: native - nodejs_version: '18.11' + image: cimg/node:18.11 + - job_native_test_ext_elementfi: &job_native_test_ext_elementfi - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_elementfi project: elementfi binary_type: native resource_class: medium + - job_native_test_ext_brink: &job_native_test_ext_brink - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_brink project: brink binary_type: native - nodejs_version: '18.11' + image: cimg/node:18.11 + - job_native_test_ext_chainlink: &job_native_test_ext_chainlink - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_chainlink project: chainlink binary_type: native - nodejs_version: '16.18' + image: cimg/node:16.18 resource_class: large # Tests run out of memory on a smaller machine + - job_native_test_ext_gp2: &job_native_test_ext_gp2 - <<: *workflow_ubuntu2004_static + <<: *requires_b_ubu_static name: t_native_test_ext_gp2 project: gp2 binary_type: native - nodejs_version: '18.11' + image: cimg/node:18.11 + - job_ems_test_ext_colony: &job_ems_test_ext_colony - <<: *workflow_emscripten + <<: *requires_b_ems name: t_ems_test_ext_colony project: colony binary_type: solcjs - nodejs_version: '14.20' + image: cimg/node:14.20 resource_class: medium python2: true - job_b_ubu_asan_clang: &job_b_ubu_asan_clang - <<: *workflow_trigger_on_tags + <<: *on_all_tags_and_branches name: b_ubu_asan_clang cmake_options: -DSANITIZE=address + - job_b_ubu_ubsan_clang: &job_b_ubu_ubsan_clang - <<: *workflow_trigger_on_tags + <<: *on_all_tags_and_branches name: b_ubu_ubsan_clang - cmake_options: -DSANITIZE=address + cmake_options: -DSANITIZE=undefined # ----------------------------------------------------------------------------------------------- jobs: @@ -668,7 +719,7 @@ jobs: - run: name: Check spelling command: ~/.local/bin/codespell --skip "*.enc,.git,Dockerfile*,LICENSE,codespell_whitelist.txt,codespell_ignored_lines.txt" --ignore-words ./scripts/codespell_whitelist.txt --exclude-file ./scripts/codespell_ignored_lines.txt - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr chk_docs_examples: <<: *base_node_small @@ -682,7 +733,7 @@ jobs: - run: name: Test Docs examples command: ./test/docsCodeStyle.sh - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr chk_coding_style: <<: *base_cimg_small @@ -702,7 +753,7 @@ jobs: - run: name: Check for broken symlinks command: ./scripts/check_symlinks.sh - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr chk_errorcodes: <<: *base_python_small @@ -711,20 +762,14 @@ jobs: - run: name: Check for error codes command: ./scripts/error_codes.py --check - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr chk_pylint: <<: *base_cimg_small steps: - checkout - - run: - name: Install pip - command: | - sudo apt -q update - sudo apt install -y python3-pip - - run: - name: Install pylint and dependencies of the scripts that will be linted - command: python3 -m pip install + - install_python3: + packages: > pylint z3-solver pygments-lexer-solidity @@ -737,7 +782,7 @@ jobs: - run: name: Linting Python Scripts command: ./scripts/pylint_all.py - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr chk_antlr_grammar: <<: *base_cimg_small @@ -751,7 +796,7 @@ jobs: - run: name: Run tests command: ./scripts/test_antlr_grammar.sh - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr chk_buglist: <<: *base_node_small @@ -766,27 +811,23 @@ jobs: - run: name: Test buglist command: ./test/buglistTests.js - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr chk_proofs: <<: *base_cimg_small steps: - checkout - - run: - name: Z3 python deps - command: | - sudo apt-get -qq update - sudo apt-get -qy install python3-pip - pip3 install --user z3-solver + - install_python3: + packages: z3-solver - run: *run_proofs - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr chk_docs_pragma_min_version: <<: *base_ubuntu2204_small steps: - checkout - run: *run_docs_pragma_min_version - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_ubu_pyscripts: <<: *base_ubuntu2204_small @@ -795,17 +836,17 @@ jobs: - run: name: Python unit tests command: python3 test/pyscriptTests.py - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_win_pyscripts: - <<: *base_win_powershell + <<: *base_win steps: - run: git config --global core.autocrlf false - checkout - run: name: Python unit tests command: python.exe test/pyscriptTests.py - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr b_ubu: &b_ubu # this runs 2x faster on xlarge but takes 4x more resources (compared to medium). @@ -876,7 +917,7 @@ jobs: root: build paths: - solc/solc-static-linux - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr b_ubu_codecov: # Runs ~30% faster on large but we only run it nightly so efficiency matters more. @@ -889,7 +930,7 @@ jobs: - checkout - run: *run_build - persist_to_workspace: *artifacts_executables - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_ubu_codecov: <<: *base_ubuntu2204_large @@ -911,7 +952,7 @@ jobs: name: "Coverage: All" command: codecov --flags all --gcov-root build - store_artifacts: *artifacts_test_results - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr # Builds in C++20 mode and uses debug build in order to speed up. # Do *NOT* store any artifacts or workspace as we don't run tests on this build. @@ -924,19 +965,19 @@ jobs: steps: - checkout - run: *run_build - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr b_ubu_ossfuzz: &b_ubu_ossfuzz - <<: *base_ubuntu1604_clang + <<: *base_ubuntu_clang steps: - checkout - run: *setup_prerelease_commit_hash - run: *run_build_ossfuzz - persist_to_workspace: *artifacts_executables_ossfuzz - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_ubu_ossfuzz: &t_ubu_ossfuzz - <<: *base_ubuntu1604_clang_small + <<: *base_ubuntu_clang_small steps: - checkout - attach_workspace: @@ -955,9 +996,8 @@ jobs: environment: TERM: xterm MAKEFLAGS: -j 5 - # Build without Z3. We won't be running SMT tests on Arch because that requires a specific - # version of Z3 and the one with the official repos is often not the one we need. - USE_Z3: OFF + # This can be switched off if we run out of sync with Arch. + USE_Z3: ON steps: - run: name: Install build dependencies @@ -967,7 +1007,7 @@ jobs: - run: *run_build - store_artifacts: *artifacts_solc - persist_to_workspace: *artifacts_executables - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr b_osx: <<: *base_osx @@ -989,7 +1029,7 @@ jobs: - build/solc/solc - build/test/soltest - build/test/tools/solfuzzer - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_osx_soltest: &t_osx_soltest <<: *base_osx @@ -1007,7 +1047,7 @@ jobs: - run: *run_soltest - store_test_results: *store_test_results - store_artifacts: *artifacts_test_results - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_osx_cli: <<: *base_osx @@ -1020,7 +1060,7 @@ jobs: at: . - run: *run_cmdline_tests - store_artifacts: *artifacts_test_results - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr b_ems: <<: *base_ems_large @@ -1044,7 +1084,7 @@ jobs: paths: - soljson.js - version.txt - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr b_docs: <<: *base_ubuntu2204_small @@ -1057,7 +1097,7 @@ jobs: - store_artifacts: path: docs/_build/html/ destination: docs-html - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_ubu_soltest_all: &t_ubu_soltest_all <<: *base_ubuntu2204_large @@ -1116,13 +1156,8 @@ jobs: - checkout - attach_workspace: at: build - - run: - name: Install all locales - command: | - apt update --assume-yes - apt install locales-all --assume-yes --no-install-recommends - run: test/localeTest.sh build/solc/solc - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_ubu_asan_cli: # Runs slightly faster on medium but we only run it nightly so efficiency matters more. @@ -1189,7 +1224,7 @@ jobs: node --version npm --version test/externalTests/solc-js/solc-js.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt) - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_ems_ext_hardhat: <<: *base_node_small @@ -1217,9 +1252,9 @@ jobs: # NOTE: This is expected to work without running `yarn build` first. cd hardhat/packages/hardhat-core yarn test - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr - t_ems_ext: + t_ext: parameters: project: type: string @@ -1231,9 +1266,9 @@ jobs: compile_only: type: integer default: 0 - nodejs_version: + image: type: string - default: current + default: cimg/node:current resource_class: type: string default: small @@ -1241,18 +1276,21 @@ jobs: type: boolean default: false docker: - - image: cimg/node:<> - resource_class: <> + - image: << parameters.image >> + resource_class: << parameters.resource_class >> # NOTE: Each external test runs up to 6 independent settings presets. If parallelism is higher than # actual preset count, some runs will exit immediately. If it's lower, some runs will get more than one preset. parallelism: 6 environment: TERM: xterm - COMPILE_ONLY: <> + COMPILE_ONLY: << parameters.compile_only >> steps: - checkout - attach_workspace: at: /tmp/workspace + - install_foundry + - install_python3: + packages: requests - run: name: Install lsof command: | @@ -1274,17 +1312,17 @@ jobs: equal: [<< parameters.binary_type >>, "solcjs"] steps: - run: - name: External <> tests (solcjs) + name: External << parameters.project >> tests (<< parameters.binary_type >>) command: | - test/externalTests/<>.sh solcjs /tmp/workspace/soljson.js + test/external_tests.py test --solc-binary-type "<< parameters.binary_type >>" --solc-binary-path /tmp/workspace/soljson.js --run "<< parameters.project >>" - when: condition: equal: [<< parameters.binary_type >>, "native"] steps: - run: - name: External <> tests (native) + name: External << parameters.project >> tests (<< parameters.binary_type >>) command: | - test/externalTests/<>.sh native /tmp/workspace/solc/solc-static-linux + test/external_tests.py test --solc-binary-type "<< parameters.binary_type >>" --solc-binary-path /tmp/workspace/solc/solc-static-linux --run "<< parameters.project >>" - store_artifacts: path: reports/externalTests/ # persist_to_workspace fails if the directory does not exist and the test script will create @@ -1294,20 +1332,16 @@ jobs: root: . paths: - reports/externalTests/ - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr c_ext_benchmarks: <<: *base_node_small steps: + - install_python3: + packages: requests - checkout - attach_workspace: at: . - - run: - name: Install dependencies of helper scripts - command: | - sudo apt update - sudo apt install python3-pip --assume-yes --no-install-recommends - python3 -m pip install requests --user - run: name: Combine benchmark reports command: cat reports/externalTests/benchmark-*.json | scripts/externalTests/merge_benchmarks.sh > reports/externalTests/all-benchmarks.json @@ -1368,7 +1402,7 @@ jobs: path: reports/externalTests/base-branch/ b_win: &b_win - <<: *base_win_powershell_large + <<: *base_win_large steps: # NOTE: Not disabling git's core.autocrlf here because we want to build using the typical Windows config. - checkout @@ -1380,6 +1414,7 @@ jobs: - run: name: "Installing dependencies" command: .\scripts\install_deps.ps1 + shell: powershell.exe - save_cache: key: dependencies-win-{{ arch }}-{{ checksum "scripts/install_deps.ps1" }} paths: @@ -1387,19 +1422,21 @@ jobs: - run: name: "Building solidity" command: .circleci/build_win.ps1 + shell: powershell.exe - run: name: "Run solc.exe to make sure build was successful." command: .\build\solc\Release\solc.exe --version + shell: powershell.exe - store_artifacts: *artifact_solc_windows - persist_to_workspace: root: build paths: - .\solc\*\solc.exe - .\test\*\soltest.exe - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_win_soltest: &t_win_soltest - <<: *base_win_powershell + <<: *base_win steps: # NOTE: Git's default core.autocrlf is fine for running soltest. We get additional coverage # for files using CRLF that way. @@ -1409,21 +1446,21 @@ jobs: - run: name: "Install evmone" command: scripts/install_evmone.ps1 + shell: powershell.exe - run: name: "Run soltest" command: .circleci/soltest.ps1 + shell: powershell.exe - run: name: Install LSP test dependencies command: python -m pip install --user deepdiff colorama - - run: - name: Inspect lsp.py - command: Get-Content ./test/lsp.py - run: name: Executing solc LSP test suite command: python ./test/lsp.py .\build\solc\Release\solc.exe --non-interactive + shell: powershell.exe - store_test_results: *store_test_results - store_artifacts: *artifacts_test_results - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr # Note: b_bytecode_ubu_static is required because b_ubu_static and b_ubu # are currently built on different Ubuntu base images. @@ -1471,7 +1508,7 @@ jobs: binary_path: "../build/solc/solc" b_bytecode_win: - <<: *base_win_bash + <<: *base_win environment: LC_ALL: C steps: @@ -1503,7 +1540,7 @@ jobs: root: . paths: - bytecode-report-emscripten.txt - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr t_bytecode_compare: <<: *base_ubuntu2204_small @@ -1528,12 +1565,6 @@ jobs: name: Print diff when: on_fail command: diff --unified=0 --report-identical-files --from-file $REPORT_FILES | head --lines 50 - - run: - name: Install zip - when: on_fail - command: | - apt update --quiet - apt install zip --assume-yes - run: name: Bundle reports into a single package when: on_fail @@ -1542,7 +1573,7 @@ jobs: # NOTE: store_artifacts does not support the 'when' attribute. # Fortunately when the artifact does not exist it just says "No artifact files found" and ignores it. path: all-bytecode-reports.zip - - gitter_notify_failure_unless_pr + - matrix_notify_failure_unless_pr c_release_binaries: <<: *base_ubuntu2204 @@ -1582,8 +1613,8 @@ jobs: tar --create --file ../solc-bin-binaries.tar * - store_artifacts: path: solc-bin-binaries.tar - - gitter_notify_failure_unless_pr - - gitter_notify_release_unless_pr + - matrix_notify_failure_unless_pr + - matrix_notify_release_unless_pr workflows: version: 2 @@ -1591,120 +1622,124 @@ workflows: main: jobs: # basic checks - - chk_spelling: *workflow_trigger_on_tags - - chk_coding_style: *workflow_trigger_on_tags - # DISABLED FOR 0.6.0 - chk_docs_examples: *workflow_trigger_on_tags - - chk_buglist: *workflow_trigger_on_tags - - chk_proofs: *workflow_trigger_on_tags - - chk_pylint: *workflow_trigger_on_tags - - chk_errorcodes: *workflow_trigger_on_tags - - chk_antlr_grammar: *workflow_trigger_on_tags - - chk_docs_pragma_min_version: *workflow_trigger_on_tags - - t_ubu_pyscripts: *workflow_trigger_on_tags - - t_win_pyscripts: *workflow_trigger_on_tags + - chk_spelling: *requires_nothing + - chk_coding_style: *requires_nothing + # DISABLED FOR 0.6.0 - chk_docs_examples: *requires_nothing + - chk_buglist: *requires_nothing + - chk_proofs: *requires_nothing + - chk_pylint: *requires_nothing + - chk_errorcodes: *requires_nothing + - chk_antlr_grammar: *requires_nothing + - chk_docs_pragma_min_version: *requires_nothing + - t_ubu_pyscripts: *requires_nothing + - t_win_pyscripts: *requires_nothing # build-only - - b_docs: *workflow_trigger_on_tags - # DISABLED FOR 0.8.18 - b_ubu_cxx20: *workflow_trigger_on_tags + - b_docs: *requires_nothing + # DISABLED FOR 0.8.18 - b_ubu_cxx20: *requires_nothing # Issue: https://github.com/ethereum/solidity/issues/13868 - - b_ubu_ossfuzz: *workflow_trigger_on_tags + - b_ubu_ossfuzz: *requires_nothing # OS/X build and tests - - b_osx: *workflow_trigger_on_tags - - t_osx_cli: *workflow_osx - - t_osx_soltest: *workflow_osx + - b_osx: *requires_nothing + - t_osx_cli: *requires_b_osx + - t_osx_soltest: *requires_b_osx # ArchLinux build and tests - - b_archlinux: *workflow_trigger_on_tags - - t_archlinux_soltest: *workflow_archlinux + - b_archlinux: *requires_nothing + - t_archlinux_soltest: *requires_b_archlinux # Static build - - b_ubu_static: *workflow_trigger_on_tags + - b_ubu_static: *requires_nothing # Ubuntu build and tests - - b_ubu: *workflow_trigger_on_tags - - t_ubu_cli: *workflow_ubuntu2204 - - t_ubu_locale: *workflow_ubuntu2204 - - t_ubu_soltest_all: *workflow_ubuntu2204 - - b_ubu_clang: *workflow_trigger_on_tags - - t_ubu_clang_soltest: *workflow_ubuntu2204_clang - - t_ubu_lsp: *workflow_ubuntu2204 + - b_ubu: *requires_nothing + - t_ubu_cli: *requires_b_ubu + - t_ubu_locale: *requires_b_ubu + - t_ubu_soltest_all: *requires_b_ubu + - b_ubu_clang: *requires_nothing + - t_ubu_clang_soltest: *requires_b_ubu_clang + - t_ubu_lsp: *requires_b_ubu # Ubuntu fake release build and tests - - b_ubu_force_release: *workflow_trigger_on_tags - - t_ubu_force_release_cli: *workflow_ubuntu2204_force_release - - t_ubu_force_release_soltest_all: *workflow_ubuntu2204_force_release + - b_ubu_force_release: *requires_nothing + - t_ubu_force_release_cli: *requires_b_ubu_force_release + - t_ubu_force_release_soltest_all: *requires_b_ubu_force_release # Emscripten build and tests that take 15 minutes or less - - b_ems: *workflow_trigger_on_tags - - t_ems_solcjs: *workflow_emscripten - - t_ems_ext_hardhat: *workflow_emscripten - - - t_ems_ext: *job_ems_compile_ext_colony - - - t_ems_ext: *job_native_test_ext_gnosis - - t_ems_ext: *job_native_test_ext_zeppelin - - t_ems_ext: *job_native_test_ext_ens - - t_ems_ext: *job_native_test_ext_trident - - t_ems_ext: *job_native_test_ext_euler - - t_ems_ext: *job_native_test_ext_yield_liquidator - - t_ems_ext: *job_native_test_ext_bleeps - - t_ems_ext: *job_native_test_ext_pool_together - - t_ems_ext: *job_native_test_ext_perpetual_pools - - t_ems_ext: *job_native_test_ext_uniswap - - t_ems_ext: *job_native_test_ext_prb_math - - t_ems_ext: *job_native_test_ext_elementfi - - t_ems_ext: *job_native_test_ext_brink - - t_ems_ext: *job_native_test_ext_chainlink - - t_ems_ext: *job_native_test_ext_gp2 + - b_ems: *requires_nothing + - t_ems_solcjs: *requires_b_ems + - t_ems_ext_hardhat: *requires_b_ems + + - t_ext: *job_ems_compile_ext_colony + + - t_ext: *job_native_test_ext_gnosis + - t_ext: *job_native_test_ext_zeppelin + - t_ext: *job_native_test_ext_ens + - t_ext: *job_native_test_ext_yield_liquidator + - t_ext: *job_native_test_ext_perpetual_pools + - t_ext: *job_native_test_ext_uniswap + - t_ext: *job_native_test_ext_prb_math + - t_ext: *job_native_test_ext_elementfi + - t_ext: *job_native_test_ext_brink + - t_ext: *job_native_test_ext_gp2 + # NOTE: The external tests below were commented because they + # depend on a specific version of hardhat which does not support shanghai EVM. + #- t_ext: *job_native_test_ext_trident + #- t_ext: *job_native_test_ext_euler + #- t_ext: *job_native_test_ext_bleeps + #- t_ext: *job_native_test_ext_pool_together + #- t_ext: *job_native_test_ext_chainlink - c_ext_benchmarks: - <<: *workflow_trigger_on_tags + <<: *requires_nothing requires: - t_ems_compile_ext_colony - t_native_test_ext_gnosis - t_native_test_ext_zeppelin - t_native_test_ext_ens - - t_native_test_ext_trident - - t_native_test_ext_euler - t_native_test_ext_yield_liquidator - - t_native_test_ext_bleeps - - t_native_test_ext_pool_together - t_native_test_ext_perpetual_pools - t_native_test_ext_uniswap - t_native_test_ext_prb_math - t_native_test_ext_elementfi - t_native_test_ext_brink - - t_native_test_ext_chainlink - t_native_test_ext_gp2 + # NOTE: The external tests below were commented because they + # depend on a specific version of hardhat which does not support shanghai EVM. + #- t_native_test_ext_trident + #- t_native_test_ext_euler + #- t_native_test_ext_bleeps + #- t_native_test_ext_pool_together + #- t_native_test_ext_chainlink # Windows build and tests - - b_win: *workflow_trigger_on_tags - - t_win_soltest: *workflow_win + - b_win: *requires_nothing + - t_win_soltest: *requires_b_win # Bytecode comparison: - b_bytecode_ubu_static: - <<: *workflow_trigger_on_tags + <<: *requires_nothing requires: - b_ubu_static - b_bytecode_ubu: - <<: *workflow_trigger_on_tags + <<: *requires_nothing requires: - b_ubu - b_bytecode_win: - <<: *workflow_trigger_on_tags + <<: *requires_nothing requires: - b_win - b_bytecode_osx: - <<: *workflow_trigger_on_tags + <<: *requires_nothing requires: - b_osx - b_bytecode_ems: - <<: *workflow_trigger_on_tags + <<: *requires_nothing requires: - b_ems - t_bytecode_compare: - <<: *workflow_trigger_on_tags + <<: *requires_nothing requires: - b_bytecode_ubu_static - b_bytecode_ubu @@ -1714,44 +1749,41 @@ workflows: # Final artifacts - c_release_binaries: - <<: *workflow_trigger_on_releases + <<: *on_version_tags requires: - b_ubu_static - b_osx - b_win - b_ems - # nightly: - +# nightly: +# # triggers: # - schedule: # cron: "0 0 * * *" -# filters: -# branches: -# only: -# - develop - +# <<: *on_develop +# # jobs: # # OSSFUZZ builds and (regression) tests -# - b_ubu_ossfuzz: *workflow_trigger_on_tags -# - t_ubu_ossfuzz: *workflow_ubuntu1604_ossfuzz - +# - b_ubu_ossfuzz: *requires_nothing +# - t_ubu_ossfuzz: *requires_b_ubu_ossfuzz +# # # Code Coverage enabled build and tests -# - b_ubu_codecov: *workflow_trigger_on_tags -# - t_ubu_codecov: *workflow_ubuntu2204_codecov - +# - b_ubu_codecov: *requires_nothing +# - t_ubu_codecov: *requires_b_ubu_codecov +# # # ASan build and tests -# - b_ubu_asan: *workflow_trigger_on_tags +# - b_ubu_asan: *requires_nothing # - b_ubu_san_clang: *job_b_ubu_asan_clang -# - t_ubu_asan_soltest: *workflow_ubuntu2204_asan -# - t_ubu_asan_clang_soltest: *workflow_ubuntu2204_asan_clang -# - t_ubu_asan_cli: *workflow_ubuntu2204_asan - +# - t_ubu_asan_soltest: *requires_b_ubu_asan +# - t_ubu_asan_clang_soltest: *requires_b_ubu_asan_clang +# - t_ubu_asan_cli: *requires_b_ubu_asan +# # # UBSan build and tests # - b_ubu_san_clang: *job_b_ubu_ubsan_clang -# - t_ubu_ubsan_clang_soltest: *workflow_ubuntu2204_ubsan_clang -# - t_ubu_ubsan_clang_cli: *workflow_ubuntu2204_ubsan_clang - +# - t_ubu_ubsan_clang_soltest: *requires_b_ubu_ubsan_clang +# - t_ubu_ubsan_clang_cli: *requires_b_ubu_ubsan_clang +# # # Emscripten build and tests that take more than 15 minutes to execute -# - b_ems: *workflow_trigger_on_tags -# - t_ems_ext: *job_ems_test_ext_colony +# - b_ems: *requires_nothing +# - t_ext: *job_ems_test_ext_colony diff --git a/.circleci/osx_install_dependencies.sh b/.circleci/osx_install_dependencies.sh index f742d131b20d..5e779700c9f6 100755 --- a/.circleci/osx_install_dependencies.sh +++ b/.circleci/osx_install_dependencies.sh @@ -52,7 +52,6 @@ function validate_checksum { if [ ! -f /usr/local/lib/libz3.a ] # if this file does not exists (cache was not restored), rebuild dependencies then - brew unlink python brew install boost brew install cmake brew install wget @@ -61,11 +60,11 @@ then ./scripts/install_obsolete_jsoncpp_1_7_4.sh # z3 - z3_version="4.11.2" + z3_version="4.12.1" z3_dir="z3-${z3_version}-x64-osx-10.16" z3_package="${z3_dir}.zip" wget "https://github.com/Z3Prover/z3/releases/download/z3-${z3_version}/${z3_package}" - validate_checksum "$z3_package" a56b6c40d9251a963aabe1f15731dd88ad1cb801d0e7b16e45f8b232175e165c + validate_checksum "$z3_package" 7601f844de6d906235140d0f76cca58be7ac716f3e2c29c35845aa24b24f73b9 unzip "$z3_package" rm "$z3_package" cp "${z3_dir}/bin/libz3.a" /usr/local/lib @@ -74,10 +73,10 @@ then rm -r "$z3_dir" # evmone - evmone_version="0.9.1" + evmone_version="0.10.0" evmone_package="evmone-${evmone_version}-darwin-x86_64.tar.gz" wget "https://github.com/ethereum/evmone/releases/download/v${evmone_version}/${evmone_package}" - validate_checksum "$evmone_package" 70420a893a9b1036fcb63526b806d97658db8c373bcab1c3e8382594dc8593e4 + validate_checksum "$evmone_package" 1b7773779287d7908baca6b8d556a98800cbd7d6e5c910b55fa507642bc0a15c tar xzpf "$evmone_package" -C /usr/local rm "$evmone_package" diff --git a/.circleci/soltest_all.sh b/.circleci/soltest_all.sh index b3544a08c5d1..4be427f192d2 100755 --- a/.circleci/soltest_all.sh +++ b/.circleci/soltest_all.sh @@ -31,8 +31,8 @@ REPODIR="$(realpath "$(dirname "$0")"/..)" # shellcheck source=scripts/common.sh source "${REPODIR}/scripts/common.sh" -EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin london paris) -DEFAULT_EVM=paris +EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin london paris shanghai) +DEFAULT_EVM=shanghai [[ " ${EVM_VALUES[*]} " =~ $DEFAULT_EVM ]] OPTIMIZE_VALUES=(0 1) diff --git a/.clang-format b/.clang-format index edd5de4d26bc..95b0feba1eb4 100644 --- a/.clang-format +++ b/.clang-format @@ -12,7 +12,7 @@ Language: Cpp BasedOnStyle: LLVM AccessModifierOffset: -4 AlignAfterOpenBracket: AlwaysBreak -AlignEscapedNewlinesLeft: true +AlignEscapedNewlines: Left AlwaysBreakAfterReturnType: None AlwaysBreakTemplateDeclarations: Yes BinPackArguments: false diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 36e25b1f0935..49acab231fa4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,5 +1,10 @@ --- name: Bug Report +about: Problems, deficiencies, inaccuracies or crashes discovered on Solidity. +title: '' +labels: 'bug :bug:' +assignees: '' + --- model_checker_contracts_inexistent_contract/input.sol:5:3: + | +5 | assert(x > 0); + | ^^^^^^^^^^^^^ + +Warning: CHC: Assertion violation happens here. +Counterexample: + +y = 0 + +Transaction trace: +A.constructor() +A.g(0) + --> model_checker_contracts_inexistent_contract/input.sol:10:3: + | +10 | assert(y > 0); + | ^^^^^^^^^^^^^ diff --git a/test/cmdlineTests/model_checker_contracts_only_one/err b/test/cmdlineTests/model_checker_contracts_only_one/err index 9c8ade6931c3..2088e19c7a2f 100644 --- a/test/cmdlineTests/model_checker_contracts_only_one/err +++ b/test/cmdlineTests/model_checker_contracts_only_one/err @@ -4,7 +4,7 @@ Counterexample: x = 0 Transaction trace: -A.constructor() +B.constructor() B.f(0) --> model_checker_contracts_only_one/input.sol:5:3: | diff --git a/test/cmdlineTests/model_checker_divModSlacks_default_all/err b/test/cmdlineTests/model_checker_divModSlacks_default_all/err new file mode 100644 index 000000000000..4ad4ce384755 --- /dev/null +++ b/test/cmdlineTests/model_checker_divModSlacks_default_all/err @@ -0,0 +1 @@ +Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_divModSlacks_default_bmc/err b/test/cmdlineTests/model_checker_divModSlacks_default_bmc/err new file mode 100644 index 000000000000..d849d45f9cca --- /dev/null +++ b/test/cmdlineTests/model_checker_divModSlacks_default_bmc/err @@ -0,0 +1 @@ +Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_divModSlacks_default_chc/err b/test/cmdlineTests/model_checker_divModSlacks_default_chc/err new file mode 100644 index 000000000000..4ad4ce384755 --- /dev/null +++ b/test/cmdlineTests/model_checker_divModSlacks_default_chc/err @@ -0,0 +1 @@ +Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_divModSlacks_false_all/err b/test/cmdlineTests/model_checker_divModSlacks_false_all/err index 3e4759a941cb..8de36b1ee4e8 100644 --- a/test/cmdlineTests/model_checker_divModSlacks_false_all/err +++ b/test/cmdlineTests/model_checker_divModSlacks_false_all/err @@ -11,3 +11,5 @@ Warning: CHC: Error trying to invoke SMT solver. | ^^^^^ Warning: CHC: 2 verification condition(s) could not be proved. Enable the model checker option "show unproved" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query. + +Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_divModSlacks_false_bmc/err b/test/cmdlineTests/model_checker_divModSlacks_false_bmc/err new file mode 100644 index 000000000000..d849d45f9cca --- /dev/null +++ b/test/cmdlineTests/model_checker_divModSlacks_false_bmc/err @@ -0,0 +1 @@ +Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_ext_calls_empty_arg/args b/test/cmdlineTests/model_checker_ext_calls_empty_arg/args new file mode 100644 index 000000000000..b0c065ef7b5a --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_empty_arg/args @@ -0,0 +1 @@ +--model-checker-engine chc --model-checker-ext-calls diff --git a/test/cmdlineTests/model_checker_ext_calls_empty_arg/err b/test/cmdlineTests/model_checker_ext_calls_empty_arg/err new file mode 100644 index 000000000000..7d7481c80ebe --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_empty_arg/err @@ -0,0 +1 @@ +No input files given. If you wish to use the standard input please specify "-" explicitly. diff --git a/test/cmdlineTests/model_checker_ext_calls_empty_arg/exit b/test/cmdlineTests/model_checker_ext_calls_empty_arg/exit new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_empty_arg/exit @@ -0,0 +1 @@ +1 diff --git a/test/cmdlineTests/model_checker_ext_calls_empty_arg/input.sol b/test/cmdlineTests/model_checker_ext_calls_empty_arg/input.sol new file mode 100644 index 000000000000..bd341cea6058 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_empty_arg/input.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +contract Ext { + function f() public view returns (uint) { + return 42; + } +} + +contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 42); + } +} \ No newline at end of file diff --git a/test/cmdlineTests/model_checker_ext_calls_trusted_chc/args b/test/cmdlineTests/model_checker_ext_calls_trusted_chc/args new file mode 100644 index 000000000000..a6240ee19fbb --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_trusted_chc/args @@ -0,0 +1 @@ +--model-checker-engine chc --model-checker-ext-calls trusted diff --git a/test/cmdlineTests/model_checker_ext_calls_trusted_chc/err b/test/cmdlineTests/model_checker_ext_calls_trusted_chc/err new file mode 100644 index 000000000000..e9c2d70a9739 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_trusted_chc/err @@ -0,0 +1,7 @@ +Warning: Function state mutability can be restricted to pure + --> model_checker_ext_calls_trusted_chc/input.sol:5:2: + | +5 | function f() public view returns (uint) { + | ^ (Relevant source part starts here and spans across multiple lines). + +Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_ext_calls_trusted_chc/input.sol b/test/cmdlineTests/model_checker_ext_calls_trusted_chc/input.sol new file mode 100644 index 000000000000..bd341cea6058 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_trusted_chc/input.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +contract Ext { + function f() public view returns (uint) { + return 42; + } +} + +contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 42); + } +} \ No newline at end of file diff --git a/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/args b/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/args new file mode 100644 index 000000000000..e249f0250329 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/args @@ -0,0 +1 @@ +--model-checker-engine chc --model-checker-ext-calls untrusted diff --git a/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/err b/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/err new file mode 100644 index 000000000000..b06333e43bd5 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/err @@ -0,0 +1,14 @@ +Warning: CHC: Assertion violation happens here. +Counterexample: + +e = 0 +x = 1 + +Transaction trace: +test.constructor() +test.g(0) + e.f() -- untrusted external call + --> model_checker_ext_calls_untrusted_chc/input.sol:11:3: + | +11 | assert(x == 0); + | ^^^^^^^^^^^^^^ diff --git a/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/input.sol b/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/input.sol new file mode 100644 index 000000000000..0d28d1c18bb8 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_untrusted_chc/input.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +abstract contract Ext { + function f() virtual public view returns (uint); +} + +contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 0); + } +} \ No newline at end of file diff --git a/test/cmdlineTests/model_checker_ext_calls_wrong_arg/args b/test/cmdlineTests/model_checker_ext_calls_wrong_arg/args new file mode 100644 index 000000000000..478aa5e1d3a9 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_wrong_arg/args @@ -0,0 +1 @@ +--model-checker-engine chc --model-checker-ext-calls what diff --git a/test/cmdlineTests/model_checker_ext_calls_wrong_arg/err b/test/cmdlineTests/model_checker_ext_calls_wrong_arg/err new file mode 100644 index 000000000000..746a0b525229 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_wrong_arg/err @@ -0,0 +1 @@ +Invalid option for --model-checker-ext-calls: what diff --git a/test/cmdlineTests/model_checker_ext_calls_wrong_arg/exit b/test/cmdlineTests/model_checker_ext_calls_wrong_arg/exit new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_wrong_arg/exit @@ -0,0 +1 @@ +1 diff --git a/test/cmdlineTests/model_checker_ext_calls_wrong_arg/input.sol b/test/cmdlineTests/model_checker_ext_calls_wrong_arg/input.sol new file mode 100644 index 000000000000..bd341cea6058 --- /dev/null +++ b/test/cmdlineTests/model_checker_ext_calls_wrong_arg/input.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +contract Ext { + function f() public view returns (uint) { + return 42; + } +} + +contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 42); + } +} \ No newline at end of file diff --git a/test/cmdlineTests/model_checker_invariants_all/err b/test/cmdlineTests/model_checker_invariants_all/err index 2f80a8a2abf9..347f40325d14 100644 --- a/test/cmdlineTests/model_checker_invariants_all/err +++ b/test/cmdlineTests/model_checker_invariants_all/err @@ -4,6 +4,8 @@ Warning: Return value of low-level calls not used. 6 | _a.call(""); | ^^^^^^^^^^^ +Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. + Info: Contract invariant(s) for model_checker_invariants_all/input.sol:test: (!(x >= 1) || true) Reentrancy property(ies) for model_checker_invariants_all/input.sol:test: diff --git a/test/cmdlineTests/model_checker_invariants_contract/err b/test/cmdlineTests/model_checker_invariants_contract/err index 6c700a40536a..f6b01e9b2cbf 100644 --- a/test/cmdlineTests/model_checker_invariants_contract/err +++ b/test/cmdlineTests/model_checker_invariants_contract/err @@ -1,2 +1,4 @@ +Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. + Info: Contract invariant(s) for model_checker_invariants_contract/input.sol:test: (!(x >= 1) || true) diff --git a/test/cmdlineTests/model_checker_invariants_contract_reentrancy/err b/test/cmdlineTests/model_checker_invariants_contract_reentrancy/err index 8bf527172ce1..c6d149f15a40 100644 --- a/test/cmdlineTests/model_checker_invariants_contract_reentrancy/err +++ b/test/cmdlineTests/model_checker_invariants_contract_reentrancy/err @@ -4,6 +4,8 @@ Warning: Return value of low-level calls not used. 6 | _a.call(""); | ^^^^^^^^^^^ +Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. + Info: Contract invariant(s) for model_checker_invariants_contract_reentrancy/input.sol:test: (!(x >= 1) || true) Reentrancy property(ies) for model_checker_invariants_contract_reentrancy/input.sol:test: diff --git a/test/cmdlineTests/model_checker_invariants_reentrancy/err b/test/cmdlineTests/model_checker_invariants_reentrancy/err index 003d5d389580..bdd19fa18fa9 100644 --- a/test/cmdlineTests/model_checker_invariants_reentrancy/err +++ b/test/cmdlineTests/model_checker_invariants_reentrancy/err @@ -4,6 +4,8 @@ Warning: Return value of low-level calls not used. 6 | _a.call(""); | ^^^^^^^^^^^ +Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. + Info: Reentrancy property(ies) for model_checker_invariants_reentrancy/input.sol:test: (((!(x <= 0) || !(x' >= 1)) && (!(x <= 0) || !( >= 1))) || true) = 0 -> no errors diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/args b/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/args new file mode 100644 index 000000000000..5aeb1490ed43 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/args @@ -0,0 +1 @@ +--model-checker-engine all diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/err b/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/err new file mode 100644 index 000000000000..b896b21bc7f9 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/err @@ -0,0 +1,7 @@ +Warning: Function state mutability can be restricted to pure + --> model_checker_show_proved_safe_default_all_engines/input.sol:4:5: + | +4 | function f(uint8 x) public { + | ^ (Relevant source part starts here and spans across multiple lines). + +Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/input.sol b/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/input.sol new file mode 100644 index 000000000000..ea7397027786 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_all_engines/input.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } +} diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/args b/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/args new file mode 100644 index 000000000000..549f20236336 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/args @@ -0,0 +1 @@ +--model-checker-engine bmc diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/err b/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/err new file mode 100644 index 000000000000..f4a2d33e053b --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/err @@ -0,0 +1,7 @@ +Warning: Function state mutability can be restricted to pure + --> model_checker_show_proved_safe_default_bmc/input.sol:4:5: + | +4 | function f(uint8 x) public { + | ^ (Relevant source part starts here and spans across multiple lines). + +Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/input.sol b/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/input.sol new file mode 100644 index 000000000000..ea7397027786 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_bmc/input.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } +} diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_chc/args b/test/cmdlineTests/model_checker_show_proved_safe_default_chc/args new file mode 100644 index 000000000000..7458a47d35b9 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_chc/args @@ -0,0 +1 @@ +--model-checker-engine chc diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_chc/err b/test/cmdlineTests/model_checker_show_proved_safe_default_chc/err new file mode 100644 index 000000000000..ab73c6bf56cd --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_chc/err @@ -0,0 +1,7 @@ +Warning: Function state mutability can be restricted to pure + --> model_checker_show_proved_safe_default_chc/input.sol:4:5: + | +4 | function f(uint8 x) public { + | ^ (Relevant source part starts here and spans across multiple lines). + +Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_show_proved_safe_default_chc/input.sol b/test/cmdlineTests/model_checker_show_proved_safe_default_chc/input.sol new file mode 100644 index 000000000000..ea7397027786 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_default_chc/input.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } +} diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/args b/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/args new file mode 100644 index 000000000000..ea8cde3e6f70 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/args @@ -0,0 +1 @@ +--model-checker-engine all --model-checker-show-proved-safe diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/err b/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/err new file mode 100644 index 000000000000..297eb497a34d --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/err @@ -0,0 +1,17 @@ +Warning: Function state mutability can be restricted to pure + --> model_checker_show_proved_safe_true_all_engines/input.sol:4:5: + | +4 | function f(uint8 x) public { + | ^ (Relevant source part starts here and spans across multiple lines). + +Info: CHC: Assertion violation check is safe! + --> model_checker_show_proved_safe_true_all_engines/input.sol:5:9: + | +5 | assert(x >= 0); + | ^^^^^^^^^^^^^^ + +Info: CHC: Assertion violation check is safe! + --> model_checker_show_proved_safe_true_all_engines/input.sol:6:9: + | +6 | assert(x < 1000); + | ^^^^^^^^^^^^^^^^ diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/input.sol b/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/input.sol new file mode 100644 index 000000000000..ea7397027786 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_all_engines/input.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } +} diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/args b/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/args new file mode 100644 index 000000000000..83385f6ba859 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/args @@ -0,0 +1 @@ +--model-checker-engine bmc --model-checker-show-proved-safe diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/err b/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/err new file mode 100644 index 000000000000..bcec557f61ae --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/err @@ -0,0 +1,17 @@ +Warning: Function state mutability can be restricted to pure + --> model_checker_show_proved_safe_true_bmc/input.sol:4:5: + | +4 | function f(uint8 x) public { + | ^ (Relevant source part starts here and spans across multiple lines). + +Info: BMC: Assertion violation check is safe! + --> model_checker_show_proved_safe_true_bmc/input.sol:5:9: + | +5 | assert(x >= 0); + | ^^^^^^^^^^^^^^ + +Info: BMC: Assertion violation check is safe! + --> model_checker_show_proved_safe_true_bmc/input.sol:6:9: + | +6 | assert(x < 1000); + | ^^^^^^^^^^^^^^^^ diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/input.sol b/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/input.sol new file mode 100644 index 000000000000..ea7397027786 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_bmc/input.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } +} diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_chc/args b/test/cmdlineTests/model_checker_show_proved_safe_true_chc/args new file mode 100644 index 000000000000..b49ef31bc5b9 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_chc/args @@ -0,0 +1 @@ +--model-checker-engine chc --model-checker-show-proved-safe diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_chc/err b/test/cmdlineTests/model_checker_show_proved_safe_true_chc/err new file mode 100644 index 000000000000..fc14f494676f --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_chc/err @@ -0,0 +1,17 @@ +Warning: Function state mutability can be restricted to pure + --> model_checker_show_proved_safe_true_chc/input.sol:4:5: + | +4 | function f(uint8 x) public { + | ^ (Relevant source part starts here and spans across multiple lines). + +Info: CHC: Assertion violation check is safe! + --> model_checker_show_proved_safe_true_chc/input.sol:5:9: + | +5 | assert(x >= 0); + | ^^^^^^^^^^^^^^ + +Info: CHC: Assertion violation check is safe! + --> model_checker_show_proved_safe_true_chc/input.sol:6:9: + | +6 | assert(x < 1000); + | ^^^^^^^^^^^^^^^^ diff --git a/test/cmdlineTests/model_checker_show_proved_safe_true_chc/input.sol b/test/cmdlineTests/model_checker_show_proved_safe_true_chc/input.sol new file mode 100644 index 000000000000..ea7397027786 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_proved_safe_true_chc/input.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } +} diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/args b/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/args new file mode 100644 index 000000000000..5aeb1490ed43 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/args @@ -0,0 +1 @@ +--model-checker-engine all diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/err b/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/err new file mode 100644 index 000000000000..578846b36228 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/err @@ -0,0 +1 @@ +Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option "show unsupported" to see all of them. diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/input.sol b/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/input.sol new file mode 100644 index 000000000000..72a8049c1722 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_all_engines/input.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f() external pure { + assembly {} + } +} diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_bmc/args b/test/cmdlineTests/model_checker_show_unsupported_default_bmc/args new file mode 100644 index 000000000000..549f20236336 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_bmc/args @@ -0,0 +1 @@ +--model-checker-engine bmc diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_bmc/err b/test/cmdlineTests/model_checker_show_unsupported_default_bmc/err new file mode 100644 index 000000000000..578846b36228 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_bmc/err @@ -0,0 +1 @@ +Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option "show unsupported" to see all of them. diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_bmc/input.sol b/test/cmdlineTests/model_checker_show_unsupported_default_bmc/input.sol new file mode 100644 index 000000000000..72a8049c1722 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_bmc/input.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f() external pure { + assembly {} + } +} diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_chc/args b/test/cmdlineTests/model_checker_show_unsupported_default_chc/args new file mode 100644 index 000000000000..7458a47d35b9 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_chc/args @@ -0,0 +1 @@ +--model-checker-engine chc diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_chc/err b/test/cmdlineTests/model_checker_show_unsupported_default_chc/err new file mode 100644 index 000000000000..578846b36228 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_chc/err @@ -0,0 +1 @@ +Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option "show unsupported" to see all of them. diff --git a/test/cmdlineTests/model_checker_show_unsupported_default_chc/input.sol b/test/cmdlineTests/model_checker_show_unsupported_default_chc/input.sol new file mode 100644 index 000000000000..72a8049c1722 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_default_chc/input.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f() external pure { + assembly {} + } +} diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/args b/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/args new file mode 100644 index 000000000000..c0e876742bec --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/args @@ -0,0 +1 @@ +--model-checker-engine all --model-checker-show-unsupported diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/err b/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/err new file mode 100644 index 000000000000..53c664ffc764 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/err @@ -0,0 +1,5 @@ +Warning: Inline assembly may cause SMTChecker to produce spurious warnings (false positives). + --> model_checker_show_unsupported_true_all_engines/input.sol:5:9: + | +5 | assembly {} + | ^^^^^^^^^^^ diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/input.sol b/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/input.sol new file mode 100644 index 000000000000..72a8049c1722 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_all_engines/input.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f() external pure { + assembly {} + } +} diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_bmc/args b/test/cmdlineTests/model_checker_show_unsupported_true_bmc/args new file mode 100644 index 000000000000..ab152ae20833 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_bmc/args @@ -0,0 +1 @@ +--model-checker-engine bmc --model-checker-show-unsupported diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_bmc/err b/test/cmdlineTests/model_checker_show_unsupported_true_bmc/err new file mode 100644 index 000000000000..013a7b0f118c --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_bmc/err @@ -0,0 +1,5 @@ +Warning: Inline assembly may cause SMTChecker to produce spurious warnings (false positives). + --> model_checker_show_unsupported_true_bmc/input.sol:5:9: + | +5 | assembly {} + | ^^^^^^^^^^^ diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_bmc/input.sol b/test/cmdlineTests/model_checker_show_unsupported_true_bmc/input.sol new file mode 100644 index 000000000000..72a8049c1722 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_bmc/input.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f() external pure { + assembly {} + } +} diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_chc/args b/test/cmdlineTests/model_checker_show_unsupported_true_chc/args new file mode 100644 index 000000000000..16821838d75b --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_chc/args @@ -0,0 +1 @@ +--model-checker-engine chc --model-checker-show-unsupported diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_chc/err b/test/cmdlineTests/model_checker_show_unsupported_true_chc/err new file mode 100644 index 000000000000..8dad0cc65bce --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_chc/err @@ -0,0 +1,5 @@ +Warning: Inline assembly may cause SMTChecker to produce spurious warnings (false positives). + --> model_checker_show_unsupported_true_chc/input.sol:5:9: + | +5 | assembly {} + | ^^^^^^^^^^^ diff --git a/test/cmdlineTests/model_checker_show_unsupported_true_chc/input.sol b/test/cmdlineTests/model_checker_show_unsupported_true_chc/input.sol new file mode 100644 index 000000000000..72a8049c1722 --- /dev/null +++ b/test/cmdlineTests/model_checker_show_unsupported_true_chc/input.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; +contract C { + function f() external pure { + assembly {} + } +} diff --git a/test/cmdlineTests/model_checker_timeout_all/err b/test/cmdlineTests/model_checker_timeout_all/err index 45c38ef3594a..651dc83b88e1 100644 --- a/test/cmdlineTests/model_checker_timeout_all/err +++ b/test/cmdlineTests/model_checker_timeout_all/err @@ -1,3 +1,5 @@ Warning: CHC: 1 verification condition(s) could not be proved. Enable the model checker option "show unproved" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query. +Info: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. + Warning: BMC: 1 verification condition(s) could not be proved. Enable the model checker option "show unproved" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query. diff --git a/test/cmdlineTests/model_checker_timeout_bmc/err b/test/cmdlineTests/model_checker_timeout_bmc/err index f8d0af2f4f72..eb20e7eff52d 100644 --- a/test/cmdlineTests/model_checker_timeout_bmc/err +++ b/test/cmdlineTests/model_checker_timeout_bmc/err @@ -1 +1,3 @@ Warning: BMC: 1 verification condition(s) could not be proved. Enable the model checker option "show unproved" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query. + +Info: BMC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/model_checker_timeout_chc/err b/test/cmdlineTests/model_checker_timeout_chc/err index 77083185f9c8..f6ca5c2af96f 100644 --- a/test/cmdlineTests/model_checker_timeout_chc/err +++ b/test/cmdlineTests/model_checker_timeout_chc/err @@ -1 +1,3 @@ Warning: CHC: 1 verification condition(s) could not be proved. Enable the model checker option "show unproved" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query. + +Info: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/cmdlineTests/no_cbor_metadata/output b/test/cmdlineTests/no_cbor_metadata/output index 16025d06147c..0328ece3f27c 100644 --- a/test/cmdlineTests/no_cbor_metadata/output +++ b/test/cmdlineTests/no_cbor_metadata/output @@ -1,4 +1,4 @@ ======= no_cbor_metadata/input.sol:C ======= Binary: -608080604052346013576004908160198239f35b600080fdfe600080fd +608080604052346013576003908160188239f35b5f80fdfe5f80fd diff --git a/test/cmdlineTests/no_contract_combined_json/output b/test/cmdlineTests/no_contract_combined_json/output index af7300896046..e0caa6fa1acc 100644 --- a/test/cmdlineTests/no_contract_combined_json/output +++ b/test/cmdlineTests/no_contract_combined_json/output @@ -29,7 +29,8 @@ } ], "src": "36:22:0" - } + }, + "id": 0 } }, "version": "" diff --git a/test/cmdlineTests/object_compiler/output b/test/cmdlineTests/object_compiler/output index 93d7b779553b..5dd572272a6a 100644 --- a/test/cmdlineTests/object_compiler/output +++ b/test/cmdlineTests/object_compiler/output @@ -23,7 +23,7 @@ object "MyContract" { Binary representation: -33600055600b8060106000396000f3fe60005460005260206000f3 +335f55600880600d5f395ff3fe5f545f5260205ff3 Text representation: /* "object_compiler/input.yul":128:136 */ diff --git a/test/cmdlineTests/recovery_ast_constructor/output b/test/cmdlineTests/recovery_ast_constructor/output index 33c07b4c1ed9..fd92fb7fa630 100644 --- a/test/cmdlineTests/recovery_ast_constructor/output +++ b/test/cmdlineTests/recovery_ast_constructor/output @@ -180,7 +180,8 @@ JSON AST (compact format): ], "scope": 19, "src": "62:399:0", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "36:426:0" diff --git a/test/cmdlineTests/recovery_standard_json/output.json b/test/cmdlineTests/recovery_standard_json/output.json index 68415ac0cb87..110b70616907 100644 --- a/test/cmdlineTests/recovery_standard_json/output.json +++ b/test/cmdlineTests/recovery_standard_json/output.json @@ -90,7 +90,8 @@ "nodes": [], "scope": 4, "src": "59:35:0", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "36:84:0" diff --git a/test/cmdlineTests/standard_function_debug_info/output.json b/test/cmdlineTests/standard_function_debug_info/output.json index d4f6651863ae..bbbb6b96faf3 100644 --- a/test/cmdlineTests/standard_function_debug_info/output.json +++ b/test/cmdlineTests/standard_function_debug_info/output.json @@ -17,154 +17,154 @@ { "@f_19": { - "entryPoint": 96, + "entryPoint": 93, "id": 19, "parameterSlots": 1, "returnSlots": 1 }, "abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr": { - "entryPoint": 439, + "entryPoint": 421, "id": null, "parameterSlots": 3, "returnSlots": 1 }, "abi_decode_t_array$_t_uint256_$dyn_memory_ptr": { - "entryPoint": 544, + "entryPoint": 525, "id": null, "parameterSlots": 2, "returnSlots": 1 }, "abi_decode_t_uint256": { - "entryPoint": 418, + "entryPoint": 401, "id": null, "parameterSlots": 2, "returnSlots": 1 }, "abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr": { - "entryPoint": 590, + "entryPoint": 570, "id": null, "parameterSlots": 2, "returnSlots": 1 }, "abi_encode_t_uint256_to_t_uint256_fromStack": { - "entryPoint": 663, + "entryPoint": 641, "id": null, "parameterSlots": 2, "returnSlots": 0 }, "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": { - "entryPoint": 678, + "entryPoint": 656, "id": null, "parameterSlots": 2, "returnSlots": 1 }, "allocate_memory": { - "entryPoint": 309, + "entryPoint": 297, "id": null, "parameterSlots": 1, "returnSlots": 1 }, "allocate_unbounded": { - "entryPoint": 171, + "entryPoint": 166, "id": null, "parameterSlots": 0, "returnSlots": 1 }, "array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr": { - "entryPoint": 336, + "entryPoint": 323, "id": null, "parameterSlots": 1, "returnSlots": 1 }, "checked_add_t_uint256": { - "entryPoint": 799, + "entryPoint": 771, "id": null, "parameterSlots": 2, "returnSlots": 1 }, "cleanup_t_uint256": { - "entryPoint": 385, + "entryPoint": 370, "id": null, "parameterSlots": 1, "returnSlots": 1 }, "finalize_allocation": { - "entryPoint": 260, + "entryPoint": 248, "id": null, "parameterSlots": 2, "returnSlots": 0 }, "panic_error_0x11": { - "entryPoint": 752, + "entryPoint": 726, "id": null, "parameterSlots": 0, "returnSlots": 0 }, "panic_error_0x32": { - "entryPoint": 705, + "entryPoint": 681, "id": null, "parameterSlots": 0, "returnSlots": 0 }, "panic_error_0x41": { - "entryPoint": 213, + "entryPoint": 203, "id": null, "parameterSlots": 0, "returnSlots": 0 }, "revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d": { - "entryPoint": 191, + "entryPoint": 183, "id": null, "parameterSlots": 0, "returnSlots": 0 }, "revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef": { - "entryPoint": 380, + "entryPoint": 366, "id": null, "parameterSlots": 0, "returnSlots": 0 }, "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": { - "entryPoint": 186, + "entryPoint": 179, "id": null, "parameterSlots": 0, "returnSlots": 0 }, "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { - "entryPoint": 181, + "entryPoint": 175, "id": null, "parameterSlots": 0, "returnSlots": 0 }, "round_up_to_mul_of_32": { - "entryPoint": 196, + "entryPoint": 187, "id": null, "parameterSlots": 1, "returnSlots": 1 }, "validator_revert_t_uint256": { - "entryPoint": 395, + "entryPoint": 379, "id": null, "parameterSlots": 1, "returnSlots": 0 diff --git a/test/cmdlineTests/standard_import_ast/input.json b/test/cmdlineTests/standard_import_ast/input.json new file mode 100644 index 000000000000..5ae7a5297d29 --- /dev/null +++ b/test/cmdlineTests/standard_import_ast/input.json @@ -0,0 +1,94 @@ +{ + "language": "SolidityAST", + "sources": { + "A": { + "ast": { + "absolutePath": "A", + "exportedSymbols": { + "C": [ + 6 + ] + }, + "id": 7, + "license": "GPL-3.0", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + ">=", + "0.0" + ], + "nodeType": "PragmaDirective", + "src": "36:22:0" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 6, + "linearizedBaseContracts": [ + 6 + ], + "name": "C", + "nameLocation": "68:1:0", + "nodeType": "ContractDefinition", + "nodes": [ + { + "body": { + "id": 4, + "nodeType": "Block", + "src": "97:2:0", + "statements": [] + }, + "functionSelector": "26121ff0", + "id": 5, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "81:1:0", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "82:2:0" + }, + "returnParameters": { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "97:0:0" + }, + "scope": 6, + "src": "72:27:0", + "stateMutability": "pure", + "virtual": false, + "visibility": "public" + } + ], + "scope": 7, + "src": "59:42:0", + "usedErrors": [] + } + ], + "src": "36:65:0" + }, + "id": 0 + } + }, + "settings": { + "outputSelection": { + "*": { + "": [ + "ast" + ] + } + } + } +} diff --git a/test/cmdlineTests/standard_import_ast/output.json b/test/cmdlineTests/standard_import_ast/output.json new file mode 100644 index 000000000000..6ecac5ca364d --- /dev/null +++ b/test/cmdlineTests/standard_import_ast/output.json @@ -0,0 +1,97 @@ +{ + "sources": + { + "A": + { + "ast": + { + "absolutePath": "A", + "exportedSymbols": + { + "C": + [ + 6 + ] + }, + "id": 7, + "license": "GPL-3.0", + "nodeType": "SourceUnit", + "nodes": + [ + { + "id": 1, + "literals": + [ + "solidity", + ">=", + "0.0" + ], + "nodeType": "PragmaDirective", + "src": "36:22:0" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 6, + "linearizedBaseContracts": + [ + 6 + ], + "name": "C", + "nameLocation": "68:1:0", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 4, + "nodeType": "Block", + "src": "97:2:0", + "statements": [] + }, + "functionSelector": "26121ff0", + "id": 5, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "81:1:0", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "82:2:0" + }, + "returnParameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "97:0:0" + }, + "scope": 6, + "src": "72:27:0", + "stateMutability": "pure", + "virtual": false, + "visibility": "public" + } + ], + "scope": 7, + "src": "59:42:0", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "36:65:0" + }, + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_import_ast_select_bytecode/input.json b/test/cmdlineTests/standard_import_ast_select_bytecode/input.json new file mode 100644 index 000000000000..6458cb7e151e --- /dev/null +++ b/test/cmdlineTests/standard_import_ast_select_bytecode/input.json @@ -0,0 +1,50 @@ +{ + "language": "SolidityAST", + "sources": { + "A": { + "ast": { + "absolutePath": "empty_contract.sol", + "exportedSymbols": { + "test": [ + 1 + ] + }, + "id": 2, + "nodeType": "SourceUnit", + "nodes": [ + { + "abstract": false, + "baseContracts": [], + "canonicalName": "test", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 1, + "linearizedBaseContracts": [ + 1 + ], + "name": "test", + "nameLocation": "9:4:0", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 2, + "src": "0:17:0", + "usedErrors": [] + } + ], + "src": "0:124:0" + }, + "id": 0 + } + }, + "settings": { + "outputSelection": { + "*": { + "*": [ + "evm.bytecode", + "evm.bytecode.sourceMap" + ] + } + } + } +} diff --git a/test/cmdlineTests/standard_import_ast_select_bytecode/output.json b/test/cmdlineTests/standard_import_ast_select_bytecode/output.json new file mode 100644 index 000000000000..0fca3f2715a3 --- /dev/null +++ b/test/cmdlineTests/standard_import_ast_select_bytecode/output.json @@ -0,0 +1,30 @@ +{ + "contracts": + { + "A": + { + "test": + { + "evm": + { + "bytecode": + { + "functionDebugData": {}, + "generatedSources": [], + "linkReferences": {}, + "object": "", + "opcodes":"", + "sourceMap":"" + } + } + } + } + }, + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_contracts_inexistent_contract/output.json b/test/cmdlineTests/standard_model_checker_contracts_inexistent_contract/output.json index e3714e8e685f..7ff30950c1ba 100644 --- a/test/cmdlineTests/standard_model_checker_contracts_inexistent_contract/output.json +++ b/test/cmdlineTests/standard_model_checker_contracts_inexistent_contract/output.json @@ -10,6 +10,74 @@ "message": "Requested contract \"C\" does not exist in source \"Source\".", "severity": "warning", "type": "Warning" + }, + { + "component": "general", + "errorCode": "6328", + "formattedMessage": "Warning: CHC: Assertion violation happens here. +Counterexample: + +y = 0 + +Transaction trace: +B.constructor() +B.g(0) + --> Source:5:7: + | +5 | \t\t\t\t\t\tassert(y > 0); + | \t\t\t\t\t\t^^^^^^^^^^^^^ + +", + "message": "CHC: Assertion violation happens here. +Counterexample: + +y = 0 + +Transaction trace: +B.constructor() +B.g(0)", + "severity": "warning", + "sourceLocation": + { + "end": 137, + "file": "Source", + "start": 124 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "6328", + "formattedMessage": "Warning: CHC: Assertion violation happens here. +Counterexample: + +x = 0 + +Transaction trace: +A.constructor() +A.f(0) + --> Source:10:7: + | +10 | \t\t\t\t\t\tassert(x > 0); + | \t\t\t\t\t\t^^^^^^^^^^^^^ + +", + "message": "CHC: Assertion violation happens here. +Counterexample: + +x = 0 + +Transaction trace: +A.constructor() +A.f(0)", + "severity": "warning", + "sourceLocation": + { + "end": 231, + "file": "Source", + "start": 218 + }, + "type": "Warning" } ], "sources": diff --git a/test/cmdlineTests/standard_model_checker_contracts_multi_source/output.json b/test/cmdlineTests/standard_model_checker_contracts_multi_source/output.json index a875665817d8..cb18875e1bf4 100644 --- a/test/cmdlineTests/standard_model_checker_contracts_multi_source/output.json +++ b/test/cmdlineTests/standard_model_checker_contracts_multi_source/output.json @@ -10,7 +10,7 @@ Counterexample: y = 0 Transaction trace: -A.constructor() +B.constructor() B.g(0) --> Source:5:7: | @@ -24,7 +24,7 @@ Counterexample: y = 0 Transaction trace: -A.constructor() +B.constructor() B.g(0)", "severity": "warning", "sourceLocation": diff --git a/test/cmdlineTests/standard_model_checker_contracts_only_one/output.json b/test/cmdlineTests/standard_model_checker_contracts_only_one/output.json index 57c4f10fac8f..b4bfd66b8489 100644 --- a/test/cmdlineTests/standard_model_checker_contracts_only_one/output.json +++ b/test/cmdlineTests/standard_model_checker_contracts_only_one/output.json @@ -10,7 +10,7 @@ Counterexample: y = 0 Transaction trace: -A.constructor() +B.constructor() B.g(0) --> Source:5:7: | @@ -24,7 +24,7 @@ Counterexample: y = 0 Transaction trace: -A.constructor() +B.constructor() B.g(0)", "severity": "warning", "sourceLocation": diff --git a/test/cmdlineTests/standard_model_checker_divModSlacks_default_all/output.json b/test/cmdlineTests/standard_model_checker_divModSlacks_default_all/output.json index acf3b74ef1de..b8637143b07c 100644 --- a/test/cmdlineTests/standard_model_checker_divModSlacks_default_all/output.json +++ b/test/cmdlineTests/standard_model_checker_divModSlacks_default_all/output.json @@ -1,4 +1,17 @@ { + "errors": + [ + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], "sources": { "A": diff --git a/test/cmdlineTests/standard_model_checker_divModSlacks_default_bmc/output.json b/test/cmdlineTests/standard_model_checker_divModSlacks_default_bmc/output.json index acf3b74ef1de..a6ce9b3c96f9 100644 --- a/test/cmdlineTests/standard_model_checker_divModSlacks_default_bmc/output.json +++ b/test/cmdlineTests/standard_model_checker_divModSlacks_default_bmc/output.json @@ -1,4 +1,17 @@ { + "errors": + [ + { + "component": "general", + "errorCode": "6002", + "formattedMessage": "Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], "sources": { "A": diff --git a/test/cmdlineTests/standard_model_checker_divModSlacks_default_chc/output.json b/test/cmdlineTests/standard_model_checker_divModSlacks_default_chc/output.json index acf3b74ef1de..b8637143b07c 100644 --- a/test/cmdlineTests/standard_model_checker_divModSlacks_default_chc/output.json +++ b/test/cmdlineTests/standard_model_checker_divModSlacks_default_chc/output.json @@ -1,4 +1,17 @@ { + "errors": + [ + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], "sources": { "A": diff --git a/test/cmdlineTests/standard_model_checker_divModSlacks_false_all/output.json b/test/cmdlineTests/standard_model_checker_divModSlacks_false_all/output.json index fccd15838fc8..f7ecf690d82a 100644 --- a/test/cmdlineTests/standard_model_checker_divModSlacks_false_all/output.json +++ b/test/cmdlineTests/standard_model_checker_divModSlacks_false_all/output.json @@ -50,6 +50,16 @@ "message": "CHC: 2 verification condition(s) could not be proved. Enable the model checker option \"show unproved\" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query.", "severity": "warning", "type": "Warning" + }, + { + "component": "general", + "errorCode": "6002", + "formattedMessage": "Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" } ], "sources": diff --git a/test/cmdlineTests/standard_model_checker_divModSlacks_false_bmc/output.json b/test/cmdlineTests/standard_model_checker_divModSlacks_false_bmc/output.json index acf3b74ef1de..a6ce9b3c96f9 100644 --- a/test/cmdlineTests/standard_model_checker_divModSlacks_false_bmc/output.json +++ b/test/cmdlineTests/standard_model_checker_divModSlacks_false_bmc/output.json @@ -1,4 +1,17 @@ { + "errors": + [ + { + "component": "general", + "errorCode": "6002", + "formattedMessage": "Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], "sources": { "A": diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_empty_arg/input.json b/test/cmdlineTests/standard_model_checker_ext_calls_empty_arg/input.json new file mode 100644 index 000000000000..073516ddbda2 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_empty_arg/input.json @@ -0,0 +1,30 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; + contract Ext { + function f() public view returns (uint) { + return 42; + } + } + + contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 42); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "extCalls": "" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_empty_arg/output.json b/test/cmdlineTests/standard_model_checker_ext_calls_empty_arg/output.json new file mode 100644 index 000000000000..4e214a37b2db --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_empty_arg/output.json @@ -0,0 +1,12 @@ +{ + "errors": + [ + { + "component": "general", + "formattedMessage": "Invalid model checker extCalls requested.", + "message": "Invalid model checker extCalls requested.", + "severity": "error", + "type": "JSONError" + } + ] +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_trusted_chc/input.json b/test/cmdlineTests/standard_model_checker_ext_calls_trusted_chc/input.json new file mode 100644 index 000000000000..a03b77f2bbba --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_trusted_chc/input.json @@ -0,0 +1,30 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; + contract Ext { + function f() public view returns (uint) { + return 42; + } + } + + contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 42); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "extCalls": "trusted" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_trusted_chc/output.json b/test/cmdlineTests/standard_model_checker_ext_calls_trusted_chc/output.json new file mode 100644 index 000000000000..7f3993410144 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_trusted_chc/output.json @@ -0,0 +1,42 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:4:7: + | +4 | \t\t\t\t\t\tfunction f() public view returns (uint) { + | \t\t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 152, + "file": "A", + "start": 85 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 1 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_untrusted_chc/input.json b/test/cmdlineTests/standard_model_checker_ext_calls_untrusted_chc/input.json new file mode 100644 index 000000000000..9fadd08fabff --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_untrusted_chc/input.json @@ -0,0 +1,28 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; + abstract contract Ext { + function f() virtual public view returns (uint); + } + + contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 0); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "extCalls": "untrusted" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_untrusted_chc/output.json b/test/cmdlineTests/standard_model_checker_ext_calls_untrusted_chc/output.json new file mode 100644 index 000000000000..c6b072a85863 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_untrusted_chc/output.json @@ -0,0 +1,50 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "6328", + "formattedMessage": "Warning: CHC: Assertion violation happens here. +Counterexample: + +e = 0 +x = 1 + +Transaction trace: +test.constructor() +test.g(0) + e.f() -- untrusted external call + --> A:10:8: + | +10 | \t\t\t\t\t\t\tassert(x == 0); + | \t\t\t\t\t\t\t^^^^^^^^^^^^^^ + +", + "message": "CHC: Assertion violation happens here. +Counterexample: + +e = 0 +x = 1 + +Transaction trace: +test.constructor() +test.g(0) + e.f() -- untrusted external call", + "severity": "warning", + "sourceLocation": + { + "end": 254, + "file": "A", + "start": 240 + }, + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_1/input.json b/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_1/input.json new file mode 100644 index 000000000000..15113c5ad879 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_1/input.json @@ -0,0 +1,30 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; + contract Ext { + function f() public view returns (uint) { + return 42; + } + } + + contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 42); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "extCalls": "what" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_1/output.json b/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_1/output.json new file mode 100644 index 000000000000..4e214a37b2db --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_1/output.json @@ -0,0 +1,12 @@ +{ + "errors": + [ + { + "component": "general", + "formattedMessage": "Invalid model checker extCalls requested.", + "message": "Invalid model checker extCalls requested.", + "severity": "error", + "type": "JSONError" + } + ] +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_2/input.json b/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_2/input.json new file mode 100644 index 000000000000..cda245e7ff25 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_2/input.json @@ -0,0 +1,30 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; + contract Ext { + function f() public view returns (uint) { + return 42; + } + } + + contract test { + function g(Ext e) public view { + uint x = e.f(); + assert(x == 42); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "extCalls": 2 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_2/output.json b/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_2/output.json new file mode 100644 index 000000000000..e869637ed125 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_ext_calls_wrong_arg_2/output.json @@ -0,0 +1,12 @@ +{ + "errors": + [ + { + "component": "general", + "formattedMessage": "settings.modelChecker.extCalls must be a string.", + "message": "settings.modelChecker.extCalls must be a string.", + "severity": "error", + "type": "JSONError" + } + ] +} diff --git a/test/cmdlineTests/standard_model_checker_invariants_contract/output.json b/test/cmdlineTests/standard_model_checker_invariants_contract/output.json index 4023977fbcc3..314b66aae4ae 100644 --- a/test/cmdlineTests/standard_model_checker_invariants_contract/output.json +++ b/test/cmdlineTests/standard_model_checker_invariants_contract/output.json @@ -1,6 +1,16 @@ { "errors": [ + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 1 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + }, { "component": "general", "errorCode": "1180", diff --git a/test/cmdlineTests/standard_model_checker_invariants_reentrancy/output.json b/test/cmdlineTests/standard_model_checker_invariants_reentrancy/output.json index 003fb099e9d3..feb586a3e32b 100644 --- a/test/cmdlineTests/standard_model_checker_invariants_reentrancy/output.json +++ b/test/cmdlineTests/standard_model_checker_invariants_reentrancy/output.json @@ -21,6 +21,16 @@ }, "type": "Warning" }, + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 1 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + }, { "component": "general", "errorCode": "1180", diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_default_all_engines/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_all_engines/input.json new file mode 100644 index 000000000000..0d6db0964244 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_all_engines/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_default_all_engines/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_all_engines/output.json new file mode 100644 index 000000000000..b8118ba16a5d --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_all_engines/output.json @@ -0,0 +1,42 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_default_bmc/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_bmc/input.json new file mode 100644 index 000000000000..e60b02312138 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_bmc/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "bmc" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_default_bmc/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_bmc/output.json new file mode 100644 index 000000000000..eb6ed6e27705 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_bmc/output.json @@ -0,0 +1,42 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "6002", + "formattedMessage": "Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_default_chc/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_chc/input.json new file mode 100644 index 000000000000..9f3abdf55359 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_chc/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_default_chc/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_chc/output.json new file mode 100644 index 000000000000..b8118ba16a5d --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_default_chc/output.json @@ -0,0 +1,42 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_false_all_engines/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_all_engines/input.json new file mode 100644 index 000000000000..37f4ce655a7a --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_all_engines/input.json @@ -0,0 +1,23 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all", + "showProvedSafe": false + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_false_all_engines/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_all_engines/output.json new file mode 100644 index 000000000000..b8118ba16a5d --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_all_engines/output.json @@ -0,0 +1,42 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_false_bmc/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_bmc/input.json new file mode 100644 index 000000000000..cc48fefdfc2c --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_bmc/input.json @@ -0,0 +1,23 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "bmc", + "showProvedSafe": false + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_false_bmc/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_bmc/output.json new file mode 100644 index 000000000000..eb6ed6e27705 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_bmc/output.json @@ -0,0 +1,42 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "6002", + "formattedMessage": "Info: BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "BMC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_false_chc/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_chc/input.json new file mode 100644 index 000000000000..e8a47469cd52 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_chc/input.json @@ -0,0 +1,23 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "showProvedSafe": false + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_false_chc/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_chc/output.json new file mode 100644 index 000000000000..b8118ba16a5d --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_false_chc/output.json @@ -0,0 +1,42 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 2 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_true_all_engines/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_all_engines/input.json new file mode 100644 index 000000000000..baf5f6195a91 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_all_engines/input.json @@ -0,0 +1,23 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all", + "showProvedSafe": true + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_true_all_engines/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_all_engines/output.json new file mode 100644 index 000000000000..8482298559ec --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_all_engines/output.json @@ -0,0 +1,72 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "9576", + "formattedMessage": "Info: CHC: Assertion violation check is safe! + --> A:6:7: + | +6 | \t\t\t\t\t\tassert(x >= 0); + | \t\t\t\t\t\t^^^^^^^^^^^^^^ + +", + "message": "CHC: Assertion violation check is safe!", + "severity": "info", + "sourceLocation": + { + "end": 130, + "file": "A", + "start": 116 + }, + "type": "Info" + }, + { + "component": "general", + "errorCode": "9576", + "formattedMessage": "Info: CHC: Assertion violation check is safe! + --> A:7:7: + | +7 | \t\t\t\t\t\tassert(x < 1000); + | \t\t\t\t\t\t^^^^^^^^^^^^^^^^ + +", + "message": "CHC: Assertion violation check is safe!", + "severity": "info", + "sourceLocation": + { + "end": 154, + "file": "A", + "start": 138 + }, + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_true_bmc/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_bmc/input.json new file mode 100644 index 000000000000..20948ed9dba2 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_bmc/input.json @@ -0,0 +1,23 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "bmc", + "showProvedSafe": true + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_true_bmc/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_bmc/output.json new file mode 100644 index 000000000000..20ddce1fd542 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_bmc/output.json @@ -0,0 +1,72 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "2961", + "formattedMessage": "Info: BMC: Assertion violation check is safe! + --> A:6:7: + | +6 | \t\t\t\t\t\tassert(x >= 0); + | \t\t\t\t\t\t^^^^^^^^^^^^^^ + +", + "message": "BMC: Assertion violation check is safe!", + "severity": "info", + "sourceLocation": + { + "end": 130, + "file": "A", + "start": 116 + }, + "type": "Info" + }, + { + "component": "general", + "errorCode": "2961", + "formattedMessage": "Info: BMC: Assertion violation check is safe! + --> A:7:7: + | +7 | \t\t\t\t\t\tassert(x < 1000); + | \t\t\t\t\t\t^^^^^^^^^^^^^^^^ + +", + "message": "BMC: Assertion violation check is safe!", + "severity": "info", + "sourceLocation": + { + "end": 154, + "file": "A", + "start": 138 + }, + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_true_chc/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_chc/input.json new file mode 100644 index 000000000000..5fb18aac9eee --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_chc/input.json @@ -0,0 +1,23 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "showProvedSafe": true + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_true_chc/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_chc/output.json new file mode 100644 index 000000000000..8482298559ec --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_true_chc/output.json @@ -0,0 +1,72 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "2018", + "formattedMessage": "Warning: Function state mutability can be restricted to pure + --> A:5:6: + | +5 | \t\t\t\t\tfunction f(uint8 x) public { + | \t\t\t\t\t^ (Relevant source part starts here and spans across multiple lines). + +", + "message": "Function state mutability can be restricted to pure", + "severity": "warning", + "sourceLocation": + { + "end": 162, + "file": "A", + "start": 81 + }, + "type": "Warning" + }, + { + "component": "general", + "errorCode": "9576", + "formattedMessage": "Info: CHC: Assertion violation check is safe! + --> A:6:7: + | +6 | \t\t\t\t\t\tassert(x >= 0); + | \t\t\t\t\t\t^^^^^^^^^^^^^^ + +", + "message": "CHC: Assertion violation check is safe!", + "severity": "info", + "sourceLocation": + { + "end": 130, + "file": "A", + "start": 116 + }, + "type": "Info" + }, + { + "component": "general", + "errorCode": "9576", + "formattedMessage": "Info: CHC: Assertion violation check is safe! + --> A:7:7: + | +7 | \t\t\t\t\t\tassert(x < 1000); + | \t\t\t\t\t\t^^^^^^^^^^^^^^^^ + +", + "message": "CHC: Assertion violation check is safe!", + "severity": "info", + "sourceLocation": + { + "end": 154, + "file": "A", + "start": 138 + }, + "type": "Info" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_wrong/input.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_wrong/input.json new file mode 100644 index 000000000000..eea83e140e59 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_wrong/input.json @@ -0,0 +1,23 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f(uint8 x) public { + assert(x >= 0); + assert(x < 1000); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all", + "showProvedSafe": "aaa" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_proved_safe_wrong/output.json b/test/cmdlineTests/standard_model_checker_show_proved_safe_wrong/output.json new file mode 100644 index 000000000000..7c8ccff6e2e5 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_proved_safe_wrong/output.json @@ -0,0 +1,12 @@ +{ + "errors": + [ + { + "component": "general", + "formattedMessage": "settings.modelChecker.showProvedSafe must be a Boolean value.", + "message": "settings.modelChecker.showProvedSafe must be a Boolean value.", + "severity": "error", + "type": "JSONError" + } + ] +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_default_all_engines/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_default_all_engines/input.json new file mode 100644 index 000000000000..c307217c6bd5 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_default_all_engines/input.json @@ -0,0 +1,21 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_default_all_engines/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_default_all_engines/output.json new file mode 100644 index 000000000000..23cf80defb86 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_default_all_engines/output.json @@ -0,0 +1,22 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "5724", + "formattedMessage": "Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them. + +", + "message": "SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them.", + "severity": "warning", + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_default_bmc/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_default_bmc/input.json new file mode 100644 index 000000000000..668a60e007ad --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_default_bmc/input.json @@ -0,0 +1,21 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "bmc" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_default_bmc/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_default_bmc/output.json new file mode 100644 index 000000000000..23cf80defb86 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_default_bmc/output.json @@ -0,0 +1,22 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "5724", + "formattedMessage": "Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them. + +", + "message": "SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them.", + "severity": "warning", + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_default_chc/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_default_chc/input.json new file mode 100644 index 000000000000..360235eb4df2 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_default_chc/input.json @@ -0,0 +1,21 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_default_chc/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_default_chc/output.json new file mode 100644 index 000000000000..23cf80defb86 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_default_chc/output.json @@ -0,0 +1,22 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "5724", + "formattedMessage": "Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them. + +", + "message": "SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them.", + "severity": "warning", + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/input.json new file mode 100644 index 000000000000..10092aa6f256 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all", + "showUnsupported": false + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/output.json new file mode 100644 index 000000000000..23cf80defb86 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/output.json @@ -0,0 +1,22 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "5724", + "formattedMessage": "Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them. + +", + "message": "SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them.", + "severity": "warning", + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/standard_model_checker_show_unsupported_false_all_enginesstandard_model_checker_show_unsupported_false_bmc/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/standard_model_checker_show_unsupported_false_all_enginesstandard_model_checker_show_unsupported_false_bmc/input.json new file mode 100644 index 000000000000..e3a42c295f8c --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/standard_model_checker_show_unsupported_false_all_enginesstandard_model_checker_show_unsupported_false_bmc/input.json @@ -0,0 +1,27 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + struct S { + uint x; + } + S s; + function f(bool b) public { + s.x |= b ? 1 : 2; + assert(s.x > 0); + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all", + "showUnsupported": false + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/standard_model_checker_show_unsupported_false_all_enginesstandard_model_checker_show_unsupported_false_bmc/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/standard_model_checker_show_unsupported_false_all_enginesstandard_model_checker_show_unsupported_false_bmc/output.json new file mode 100644 index 000000000000..fb599d21d2e4 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_false_all_engines/standard_model_checker_show_unsupported_false_all_enginesstandard_model_checker_show_unsupported_false_bmc/output.json @@ -0,0 +1,32 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "5840", + "formattedMessage": "Warning: CHC: 1 verification condition(s) could not be proved. Enable the model checker option \"show unproved\" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query. + +", + "message": "CHC: 1 verification condition(s) could not be proved. Enable the model checker option \"show unproved\" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query.", + "severity": "warning", + "type": "Warning" + }, + { + "component": "general", + "errorCode": "2788", + "formattedMessage": "Warning: BMC: 1 verification condition(s) could not be proved. Enable the model checker option \"show unproved\" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query. + +", + "message": "BMC: 1 verification condition(s) could not be proved. Enable the model checker option \"show unproved\" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query.", + "severity": "warning", + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_false_bmc/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_false_bmc/input.json new file mode 100644 index 000000000000..7d15e6d7f96c --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_false_bmc/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "bmc", + "showUnsupported": false + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_false_bmc/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_false_bmc/output.json new file mode 100644 index 000000000000..23cf80defb86 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_false_bmc/output.json @@ -0,0 +1,22 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "5724", + "formattedMessage": "Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them. + +", + "message": "SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them.", + "severity": "warning", + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_false_chc/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_false_chc/input.json new file mode 100644 index 000000000000..4d5a79c6dbae --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_false_chc/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "showUnsupported": false + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_false_chc/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_false_chc/output.json new file mode 100644 index 000000000000..23cf80defb86 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_false_chc/output.json @@ -0,0 +1,22 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "5724", + "formattedMessage": "Warning: SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them. + +", + "message": "SMTChecker: 1 unsupported language feature(s). Enable the model checker option \"show unsupported\" to see all of them.", + "severity": "warning", + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_true_all_engines/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_true_all_engines/input.json new file mode 100644 index 000000000000..c1fbeab1b9c2 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_true_all_engines/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all", + "showUnsupported": true + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_true_all_engines/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_true_all_engines/output.json new file mode 100644 index 000000000000..13d327d40547 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_true_all_engines/output.json @@ -0,0 +1,32 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "7737", + "formattedMessage": "Warning: Inline assembly may cause SMTChecker to produce spurious warnings (false positives). + --> A:6:7: + | +6 | \t\t\t\t\t\tassembly {} + | \t\t\t\t\t\t^^^^^^^^^^^ + +", + "message": "Inline assembly may cause SMTChecker to produce spurious warnings (false positives).", + "severity": "warning", + "sourceLocation": + { + "end": 127, + "file": "A", + "start": 116 + }, + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_true_bmc/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_true_bmc/input.json new file mode 100644 index 000000000000..38e5cb7a7114 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_true_bmc/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "bmc", + "showUnsupported": true + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_true_bmc/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_true_bmc/output.json new file mode 100644 index 000000000000..13d327d40547 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_true_bmc/output.json @@ -0,0 +1,32 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "7737", + "formattedMessage": "Warning: Inline assembly may cause SMTChecker to produce spurious warnings (false positives). + --> A:6:7: + | +6 | \t\t\t\t\t\tassembly {} + | \t\t\t\t\t\t^^^^^^^^^^^ + +", + "message": "Inline assembly may cause SMTChecker to produce spurious warnings (false positives).", + "severity": "warning", + "sourceLocation": + { + "end": 127, + "file": "A", + "start": 116 + }, + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_true_chc/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_true_chc/input.json new file mode 100644 index 000000000000..f84ca46106f9 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_true_chc/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "chc", + "showUnsupported": true + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_true_chc/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_true_chc/output.json new file mode 100644 index 000000000000..13d327d40547 --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_true_chc/output.json @@ -0,0 +1,32 @@ +{ + "errors": + [ + { + "component": "general", + "errorCode": "7737", + "formattedMessage": "Warning: Inline assembly may cause SMTChecker to produce spurious warnings (false positives). + --> A:6:7: + | +6 | \t\t\t\t\t\tassembly {} + | \t\t\t\t\t\t^^^^^^^^^^^ + +", + "message": "Inline assembly may cause SMTChecker to produce spurious warnings (false positives).", + "severity": "warning", + "sourceLocation": + { + "end": 127, + "file": "A", + "start": 116 + }, + "type": "Warning" + } + ], + "sources": + { + "A": + { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_wrong/input.json b/test/cmdlineTests/standard_model_checker_show_unsupported_wrong/input.json new file mode 100644 index 000000000000..9fa8f5a5932f --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_wrong/input.json @@ -0,0 +1,22 @@ +{ + "language": "Solidity", + "sources": + { + "A": + { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\n\ncontract test { + function f() external pure { + assembly {} + } + }" + } + }, + "settings": + { + "modelChecker": + { + "engine": "all", + "showUnsupported": "aaa" + } + } +} diff --git a/test/cmdlineTests/standard_model_checker_show_unsupported_wrong/output.json b/test/cmdlineTests/standard_model_checker_show_unsupported_wrong/output.json new file mode 100644 index 000000000000..997b005ef7ee --- /dev/null +++ b/test/cmdlineTests/standard_model_checker_show_unsupported_wrong/output.json @@ -0,0 +1,12 @@ +{ + "errors": + [ + { + "component": "general", + "formattedMessage": "settings.modelChecker.showUnsupported must be a Boolean value.", + "message": "settings.modelChecker.showUnsupported must be a Boolean value.", + "severity": "error", + "type": "JSONError" + } + ] +} diff --git a/test/cmdlineTests/standard_model_checker_solvers_smtlib2/output.json b/test/cmdlineTests/standard_model_checker_solvers_smtlib2/output.json index fa8726d55ebb..bf59a0d9daa1 100644 --- a/test/cmdlineTests/standard_model_checker_solvers_smtlib2/output.json +++ b/test/cmdlineTests/standard_model_checker_solvers_smtlib2/output.json @@ -3,14 +3,41 @@ { "smtlib2queries": { - "0x0ebc730de380833af1e52ed063befb32994bc637929c942b7fd089b7cd3ba64e": "(set-logic HORN) - + "0x75b95497d56c30e254a59358d72ddd4e78f9e90db621cfe677e85d05b2252411": "(set-option :produce-models true) +(set-logic ALL) +(declare-fun |x_3_3| () Int) +(declare-fun |error_0| () Int) +(declare-fun |this_0| () Int) +(declare-datatypes ((|bytes_tuple| 0)) (((|bytes_tuple| (|bytes_tuple_accessor_array| (Array Int Int)) (|bytes_tuple_accessor_length| Int))))) +(declare-datatypes ((|tx_type| 0)) (((|tx_type| (|block.basefee| Int) (|block.chainid| Int) (|block.coinbase| Int) (|block.gaslimit| Int) (|block.number| Int) (|block.prevrandao| Int) (|block.timestamp| Int) (|blockhash| (Array Int Int)) (|msg.data| |bytes_tuple|) (|msg.sender| Int) (|msg.sig| Int) (|msg.value| Int) (|tx.gasprice| Int) (|tx.origin| Int))))) +(declare-fun |tx_0| () |tx_type|) +(declare-datatypes ((|ecrecover_input_type| 0)) (((|ecrecover_input_type| (|hash| Int) (|v| Int) (|r| Int) (|s| Int))))) +(declare-datatypes ((|crypto_type| 0)) (((|crypto_type| (|ecrecover| (Array |ecrecover_input_type| Int)) (|keccak256| (Array |bytes_tuple| Int)) (|ripemd160| (Array |bytes_tuple| Int)) (|sha256| (Array |bytes_tuple| Int)))))) +(declare-fun |crypto_0| () |crypto_type|) +(declare-datatypes ((|abi_type| 0)) (((|abi_type|)))) +(declare-fun |abi_0| () |abi_type|) (declare-datatypes ((|state_type| 0)) (((|state_type| (|balances| (Array Int Int)))))) +(declare-fun |state_0| () |state_type|) +(declare-fun |x_3_4| () Int) +(declare-fun |x_3_0| () Int) +(declare-fun |expr_7_0| () Int) +(declare-fun |expr_8_0| () Int) +(declare-fun |expr_9_1| () Bool) + +(assert (and (and (and true true) (and (= expr_9_1 (> expr_7_0 expr_8_0)) (and (=> (and true true) true) (and (= expr_8_0 0) (and (=> (and true true) (and (>= expr_7_0 0) (<= expr_7_0 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (= expr_7_0 x_3_0) (and (and (>= x_3_0 0) (<= x_3_0 115792089237316195423570985008687907853269984665640564039457584007913129639935)) (and (and (and (and (and (and (and (and (and (and (and (and (and (> (|block.prevrandao| tx_0) 18446744073709551616) (and (>= (|block.basefee| tx_0) 0) (<= (|block.basefee| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.chainid| tx_0) 0) (<= (|block.chainid| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.coinbase| tx_0) 0) (<= (|block.coinbase| tx_0) 1461501637330902918203684832716283019655932542975))) (and (>= (|block.prevrandao| tx_0) 0) (<= (|block.prevrandao| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.gaslimit| tx_0) 0) (<= (|block.gaslimit| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.number| tx_0) 0) (<= (|block.number| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.timestamp| tx_0) 0) (<= (|block.timestamp| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|msg.sender| tx_0) 0) (<= (|msg.sender| tx_0) 1461501637330902918203684832716283019655932542975))) (and (>= (|msg.value| tx_0) 0) (<= (|msg.value| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|tx.origin| tx_0) 0) (<= (|tx.origin| tx_0) 1461501637330902918203684832716283019655932542975))) (and (>= (|tx.gasprice| tx_0) 0) (<= (|tx.gasprice| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (and (and (and (and (and (= (|msg.value| tx_0) 0) (= (|msg.sig| tx_0) 3017696395)) (= (select (|bytes_tuple_accessor_array| (|msg.data| tx_0)) 0) 179)) (= (select (|bytes_tuple_accessor_array| (|msg.data| tx_0)) 1) 222)) (= (select (|bytes_tuple_accessor_array| (|msg.data| tx_0)) 2) 100)) (= (select (|bytes_tuple_accessor_array| (|msg.data| tx_0)) 3) 139)) (>= (|bytes_tuple_accessor_length| (|msg.data| tx_0)) 4))) true)))))))) (not expr_9_1))) +(declare-const |EVALEXPR_0| Int) +(assert (= |EVALEXPR_0| x_3_0)) +(check-sat) +(get-value (|EVALEXPR_0| )) +", + "0xa991e3c158410479bc0a0540fb60ce7010aec315a5b0010d254f12f3d1f0a4e5": "(set-logic HORN) + (declare-datatypes ((|bytes_tuple| 0)) (((|bytes_tuple| (|bytes_tuple_accessor_array| (Array Int Int)) (|bytes_tuple_accessor_length| Int))))) (declare-datatypes ((|tx_type| 0)) (((|tx_type| (|block.basefee| Int) (|block.chainid| Int) (|block.coinbase| Int) (|block.gaslimit| Int) (|block.number| Int) (|block.prevrandao| Int) (|block.timestamp| Int) (|blockhash| (Array Int Int)) (|msg.data| |bytes_tuple|) (|msg.sender| Int) (|msg.sig| Int) (|msg.value| Int) (|tx.gasprice| Int) (|tx.origin| Int))))) (declare-datatypes ((|ecrecover_input_type| 0)) (((|ecrecover_input_type| (|hash| Int) (|v| Int) (|r| Int) (|s| Int))))) (declare-datatypes ((|crypto_type| 0)) (((|crypto_type| (|ecrecover| (Array |ecrecover_input_type| Int)) (|keccak256| (Array |bytes_tuple| Int)) (|ripemd160| (Array |bytes_tuple| Int)) (|sha256| (Array |bytes_tuple| Int)))))) (declare-datatypes ((|abi_type| 0)) (((|abi_type|)))) +(declare-datatypes ((|state_type| 0)) (((|state_type| (|balances| (Array Int Int)))))) (declare-fun |interface_0_C_14_0| (Int |abi_type| |crypto_type| |state_type| ) Bool) (declare-fun |nondet_interface_1_C_14_0| (Int Int |abi_type| |crypto_type| |state_type| |state_type| ) Bool) (declare-fun |summary_constructor_2_C_14_0| (Int Int |abi_type| |crypto_type| |tx_type| |state_type| |state_type| ) Bool) @@ -42,7 +69,7 @@ (declare-fun |block_8_function_f__13_14_0| (Int Int |abi_type| |crypto_type| |tx_type| |state_type| Int |state_type| Int ) Bool) (assert (forall ( (abi_0 |abi_type|) (crypto_0 |crypto_type|) (error_0 Int) (error_1 Int) (expr_7_0 Int) (expr_8_0 Int) (expr_9_1 Bool) (state_0 |state_type|) (state_1 |state_type|) (state_2 |state_type|) (this_0 Int) (tx_0 |tx_type|) (x_3_0 Int) (x_3_1 Int)) -(=> (and (and (block_6_f_12_14_0 error_0 this_0 abi_0 crypto_0 tx_0 state_0 x_3_0 state_1 x_3_1) (and (= expr_9_1 (> expr_7_0 expr_8_0)) (and (=> true true) (and (= expr_8_0 0) (and (=> true (and (>= expr_7_0 0) (<= expr_7_0 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (= expr_7_0 x_3_1) (and (and (>= x_3_1 0) (<= x_3_1 115792089237316195423570985008687907853269984665640564039457584007913129639935)) true))))))) (and (not expr_9_1) (= error_1 1))) (block_8_function_f__13_14_0 error_1 this_0 abi_0 crypto_0 tx_0 state_0 x_3_0 state_1 x_3_1)))) +(=> (and (and (block_6_f_12_14_0 error_0 this_0 abi_0 crypto_0 tx_0 state_0 x_3_0 state_1 x_3_1) (and (= expr_9_1 (> expr_7_0 expr_8_0)) (and (=> true true) (and (= expr_8_0 0) (and (=> true (and (>= expr_7_0 0) (<= expr_7_0 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (= expr_7_0 x_3_1) (and (and (>= x_3_1 0) (<= x_3_1 115792089237316195423570985008687907853269984665640564039457584007913129639935)) true))))))) (and (and true (not expr_9_1)) (= error_1 1))) (block_8_function_f__13_14_0 error_1 this_0 abi_0 crypto_0 tx_0 state_0 x_3_0 state_1 x_3_1)))) (assert @@ -97,7 +124,7 @@ (declare-fun |implicit_constructor_entry_13_C_14_0| (Int Int |abi_type| |crypto_type| |tx_type| |state_type| |state_type| ) Bool) (assert (forall ( (abi_0 |abi_type|) (crypto_0 |crypto_type|) (error_0 Int) (error_1 Int) (expr_7_0 Int) (expr_8_0 Int) (expr_9_1 Bool) (funds_2_0 Int) (state_0 |state_type|) (state_1 |state_type|) (state_2 |state_type|) (state_3 |state_type|) (this_0 Int) (tx_0 |tx_type|) (x_3_0 Int) (x_3_1 Int) (x_3_2 Int)) -(=> (and (and (and (and (= state_1 state_0) (= error_0 0)) true) true) (>= (select (|balances| state_1) this_0) (|msg.value| tx_0))) (implicit_constructor_entry_13_C_14_0 error_0 this_0 abi_0 crypto_0 tx_0 state_0 state_1)))) +(=> (and (and (and (and (and (= state_1 state_0) (= error_0 0)) true) true) true) (>= (select (|balances| state_1) this_0) (|msg.value| tx_0))) (implicit_constructor_entry_13_C_14_0 error_0 this_0 abi_0 crypto_0 tx_0 state_0 state_1)))) (assert @@ -124,34 +151,7 @@ (assert (forall ( (abi_0 |abi_type|) (crypto_0 |crypto_type|) (error_0 Int) (error_1 Int) (expr_7_0 Int) (expr_8_0 Int) (expr_9_1 Bool) (funds_2_0 Int) (state_0 |state_type|) (state_1 |state_type|) (state_2 |state_type|) (state_3 |state_type|) (this_0 Int) (tx_0 |tx_type|) (x_3_0 Int) (x_3_1 Int) (x_3_2 Int)) (=> error_target_3_0 false))) -(check-sat)", - "0xcb822e6220a39244d26887a0fa6f62b06718359056555679fb06dd7dff18bb86": "(set-option :produce-models true) -(set-logic ALL) -(declare-fun |x_3_3| () Int) -(declare-fun |error_0| () Int) -(declare-fun |this_0| () Int) -(declare-datatypes ((|state_type| 0)) (((|state_type| (|balances| (Array Int Int)))))) -(declare-fun |state_0| () |state_type|) -(declare-datatypes ((|bytes_tuple| 0)) (((|bytes_tuple| (|bytes_tuple_accessor_array| (Array Int Int)) (|bytes_tuple_accessor_length| Int))))) -(declare-datatypes ((|tx_type| 0)) (((|tx_type| (|block.basefee| Int) (|block.chainid| Int) (|block.coinbase| Int) (|block.gaslimit| Int) (|block.number| Int) (|block.prevrandao| Int) (|block.timestamp| Int) (|blockhash| (Array Int Int)) (|msg.data| |bytes_tuple|) (|msg.sender| Int) (|msg.sig| Int) (|msg.value| Int) (|tx.gasprice| Int) (|tx.origin| Int))))) -(declare-fun |tx_0| () |tx_type|) -(declare-datatypes ((|ecrecover_input_type| 0)) (((|ecrecover_input_type| (|hash| Int) (|v| Int) (|r| Int) (|s| Int))))) -(declare-datatypes ((|crypto_type| 0)) (((|crypto_type| (|ecrecover| (Array |ecrecover_input_type| Int)) (|keccak256| (Array |bytes_tuple| Int)) (|ripemd160| (Array |bytes_tuple| Int)) (|sha256| (Array |bytes_tuple| Int)))))) -(declare-fun |crypto_0| () |crypto_type|) -(declare-datatypes ((|abi_type| 0)) (((|abi_type|)))) -(declare-fun |abi_0| () |abi_type|) -(declare-fun |x_3_4| () Int) -(declare-fun |x_3_0| () Int) -(declare-fun |expr_7_0| () Int) -(declare-fun |expr_8_0| () Int) -(declare-fun |expr_9_1| () Bool) - -(assert (and (and (and true true) (and (= expr_9_1 (> expr_7_0 expr_8_0)) (and (=> (and true true) true) (and (= expr_8_0 0) (and (=> (and true true) (and (>= expr_7_0 0) (<= expr_7_0 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (= expr_7_0 x_3_0) (and (and (>= x_3_0 0) (<= x_3_0 115792089237316195423570985008687907853269984665640564039457584007913129639935)) (and (and (and (and (and (and (and (and (and (and (and (and (and (> (|block.prevrandao| tx_0) 18446744073709551616) (and (>= (|block.basefee| tx_0) 0) (<= (|block.basefee| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.chainid| tx_0) 0) (<= (|block.chainid| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.coinbase| tx_0) 0) (<= (|block.coinbase| tx_0) 1461501637330902918203684832716283019655932542975))) (and (>= (|block.prevrandao| tx_0) 0) (<= (|block.prevrandao| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.gaslimit| tx_0) 0) (<= (|block.gaslimit| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.number| tx_0) 0) (<= (|block.number| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|block.timestamp| tx_0) 0) (<= (|block.timestamp| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|msg.sender| tx_0) 0) (<= (|msg.sender| tx_0) 1461501637330902918203684832716283019655932542975))) (and (>= (|msg.value| tx_0) 0) (<= (|msg.value| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (>= (|tx.origin| tx_0) 0) (<= (|tx.origin| tx_0) 1461501637330902918203684832716283019655932542975))) (and (>= (|tx.gasprice| tx_0) 0) (<= (|tx.gasprice| tx_0) 115792089237316195423570985008687907853269984665640564039457584007913129639935))) (and (and (and (and (and (and (= (|msg.value| tx_0) 0) (= (|msg.sig| tx_0) 3017696395)) (= (select (|bytes_tuple_accessor_array| (|msg.data| tx_0)) 0) 179)) (= (select (|bytes_tuple_accessor_array| (|msg.data| tx_0)) 1) 222)) (= (select (|bytes_tuple_accessor_array| (|msg.data| tx_0)) 2) 100)) (= (select (|bytes_tuple_accessor_array| (|msg.data| tx_0)) 3) 139)) (>= (|bytes_tuple_accessor_length| (|msg.data| tx_0)) 4))) true)))))))) (not expr_9_1))) -(declare-const |EVALEXPR_0| Int) -(assert (= |EVALEXPR_0| x_3_0)) -(check-sat) -(get-value (|EVALEXPR_0| )) -" +(check-sat)" } }, "errors": diff --git a/test/cmdlineTests/standard_model_checker_timeout_all/output.json b/test/cmdlineTests/standard_model_checker_timeout_all/output.json index fb599d21d2e4..73b117145445 100644 --- a/test/cmdlineTests/standard_model_checker_timeout_all/output.json +++ b/test/cmdlineTests/standard_model_checker_timeout_all/output.json @@ -11,6 +11,16 @@ "severity": "warning", "type": "Warning" }, + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 4 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 4 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" + }, { "component": "general", "errorCode": "2788", diff --git a/test/cmdlineTests/standard_model_checker_timeout_bmc/output.json b/test/cmdlineTests/standard_model_checker_timeout_bmc/output.json index 4554ec69e93a..a709ec062c79 100644 --- a/test/cmdlineTests/standard_model_checker_timeout_bmc/output.json +++ b/test/cmdlineTests/standard_model_checker_timeout_bmc/output.json @@ -10,6 +10,16 @@ "message": "BMC: 1 verification condition(s) could not be proved. Enable the model checker option \"show unproved\" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query.", "severity": "warning", "type": "Warning" + }, + { + "component": "general", + "errorCode": "6002", + "formattedMessage": "Info: BMC: 4 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "BMC: 4 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" } ], "sources": diff --git a/test/cmdlineTests/standard_model_checker_timeout_chc/output.json b/test/cmdlineTests/standard_model_checker_timeout_chc/output.json index 7f0e676cb818..553a1b93b62b 100644 --- a/test/cmdlineTests/standard_model_checker_timeout_chc/output.json +++ b/test/cmdlineTests/standard_model_checker_timeout_chc/output.json @@ -10,6 +10,16 @@ "message": "CHC: 1 verification condition(s) could not be proved. Enable the model checker option \"show unproved\" to see all of them. Consider choosing a specific contract to be verified in order to reduce the solving problems. Consider increasing the timeout per query.", "severity": "warning", "type": "Warning" + }, + { + "component": "general", + "errorCode": "1391", + "formattedMessage": "Info: CHC: 4 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them. + +", + "message": "CHC: 4 verification condition(s) proved safe! Enable the model checker option \"show proved safe\" to see all of them.", + "severity": "info", + "type": "Info" } ], "sources": diff --git a/test/cmdlineTests/standard_only_ast_requested/output.json b/test/cmdlineTests/standard_only_ast_requested/output.json index 4caa8a7643fa..6ecac5ca364d 100644 --- a/test/cmdlineTests/standard_only_ast_requested/output.json +++ b/test/cmdlineTests/standard_only_ast_requested/output.json @@ -85,7 +85,8 @@ ], "scope": 7, "src": "59:42:0", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "36:65:0" diff --git a/test/cmdlineTests/strict_asm_optimizer_steps/output b/test/cmdlineTests/strict_asm_optimizer_steps/output index 0f7a59b97792..8fb291b86816 100644 --- a/test/cmdlineTests/strict_asm_optimizer_steps/output +++ b/test/cmdlineTests/strict_asm_optimizer_steps/output @@ -25,7 +25,7 @@ object "C_6" { Binary representation: -608060405234601557600e601b600039600e6000f35b600080fdfe60806040523615600055600080fd +608060405234601357600c60185f39600c5ff35b5f80fdfe608060405236155f555f80fd Text representation: /* "strict_asm_optimizer_steps/input.yul":45:48 */ diff --git a/test/cmdlineTests/strict_asm_output_selection_bin_only/output b/test/cmdlineTests/strict_asm_output_selection_bin_only/output index 3ffa826b8727..86d249576805 100644 --- a/test/cmdlineTests/strict_asm_output_selection_bin_only/output +++ b/test/cmdlineTests/strict_asm_output_selection_bin_only/output @@ -2,4 +2,4 @@ ======= strict_asm_output_selection_bin_only/input.yul (EVM) ======= Binary representation: -602a60005500 +602a5f5500 diff --git a/test/cmdlineTests/yul_function_name_clashes/output b/test/cmdlineTests/yul_function_name_clashes/output index 8a7bec7909ca..cfbb96bfa842 100644 --- a/test/cmdlineTests/yul_function_name_clashes/output +++ b/test/cmdlineTests/yul_function_name_clashes/output @@ -22,7 +22,7 @@ object "object" { Binary representation: -600080600f565b60008035905090565b60156006565b91506025565b6000602035905090565b602b601b565b90508082555050 +5f80600d565b5f8035905090565b60136005565b91506022565b5f602035905090565b60286019565b90508082555050 Text representation: 0x00 diff --git a/test/cmdlineTests/yul_function_name_clashes_different_params/output b/test/cmdlineTests/yul_function_name_clashes_different_params/output index f3dc84340510..cd0dce30c479 100644 --- a/test/cmdlineTests/yul_function_name_clashes_different_params/output +++ b/test/cmdlineTests/yul_function_name_clashes_different_params/output @@ -22,7 +22,7 @@ object "object" { Binary representation: -600080600f565b60008035905090565b60156006565b91506026565b600081359050919050565b602e6070601b565b90508082555050 +5f80600d565b5f8035905090565b60136005565b91506023565b5f81359050919050565b602b60706019565b90508082555050 Text representation: /* "yul_function_name_clashes_different_params/input.yul":37:42 */ diff --git a/test/cmdlineTests/yul_optimize_runs/output b/test/cmdlineTests/yul_optimize_runs/output index 6f4ba83907cd..b7fcabaaca48 100644 --- a/test/cmdlineTests/yul_optimize_runs/output +++ b/test/cmdlineTests/yul_optimize_runs/output @@ -21,7 +21,7 @@ object "RunsTest1" { Binary representation: -602580600c6000396000f3fe7fabc123450000000000000000000000000000000000000000000000000000000060005500 +602480600a5f395ff3fe7fabc12345000000000000000000000000000000000000000000000000000000005f5500 Text representation: /* "yul_optimize_runs/input.yul":115:143 */ diff --git a/test/cmdlineTests/yul_verbatim_msize/output b/test/cmdlineTests/yul_verbatim_msize/output index 991fcbdb0c63..22259fff71a1 100644 --- a/test/cmdlineTests/yul_verbatim_msize/output +++ b/test/cmdlineTests/yul_verbatim_msize/output @@ -14,7 +14,7 @@ object "object" { Binary representation: -61200051506161600260005500 +6120005150616160025f5500 Text representation: /* "yul_verbatim_msize/input.yul":125:131 */ diff --git a/test/evmc/README.md b/test/evmc/README.md index 6b7f76f61c07..cdddb3444083 100644 --- a/test/evmc/README.md +++ b/test/evmc/README.md @@ -1,5 +1,5 @@ # EVMC -This is an import of [EVMC](https://github.com/ethereum/evmc) version [10.0.0](https://github.com/ethereum/evmc/releases/tag/v10.0.0). +This is an import of [EVMC](https://github.com/ethereum/evmc) version [10.1.0](https://github.com/ethereum/evmc/releases/tag/v10.1.0). -Important: The `MockedAccount.storage` is changed to a map from unordered_map as ordering is important for fuzzing. +Important: The `MockedAccount.storage` is changed to a `map` from `unordered_map` as ordering is important for fuzzing. diff --git a/test/evmc/evmc.h b/test/evmc/evmc.h index 16d568660736..60c3aeecc978 100644 --- a/test/evmc/evmc.h +++ b/test/evmc/evmc.h @@ -412,20 +412,21 @@ struct evmc_result /** * The reference to output data. * - * The output contains data coming from RETURN opcode (iff evmc_result::code - * field is ::EVMC_SUCCESS) or from REVERT opcode. + * The output contains data coming from RETURN opcode (iff evmc_result::code + * field is ::EVMC_SUCCESS) or from REVERT opcode. * - * The memory containing the output data is owned by EVM and has to be - * freed with evmc_result::release(). + * The memory containing the output data is owned by EVM and has to be + * freed with evmc_result::release(). * - * This MAY be NULL. + * This pointer MAY be NULL. + * If evmc_result::output_size is 0 this pointer MUST NOT be dereferenced. */ const uint8_t* output_data; /** * The size of the output data. * - * If output_data is NULL this MUST be 0. + * If evmc_result::output_data is NULL this MUST be 0. */ size_t output_size; @@ -463,13 +464,13 @@ struct evmc_result /** * Reserved data that MAY be used by a evmc_result object creator. * - * This reserved 4 bytes together with 20 bytes from create_address form - * 24 bytes of memory called "optional data" within evmc_result struct - * to be optionally used by the evmc_result object creator. + * This reserved 4 bytes together with 20 bytes from create_address form + * 24 bytes of memory called "optional data" within evmc_result struct + * to be optionally used by the evmc_result object creator. * - * @see evmc_result_optional_data, evmc_get_optional_data(). + * @see evmc_result_optional_data, evmc_get_optional_data(). * - * Also extends the size of the evmc_result to 64 bytes (full cache line). + * Also extends the size of the evmc_result to 64 bytes (full cache line). */ uint8_t padding[4]; }; @@ -963,18 +964,26 @@ enum evmc_revision * The Cancun revision. * * The future next revision after Shanghai. + * https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md */ EVMC_CANCUN = 12, + /** + * The Prague revision. + * + * The future next revision after Cancun. + */ + EVMC_PRAGUE = 13, + /** The maximum EVM revision supported. */ - EVMC_MAX_REVISION = EVMC_CANCUN, + EVMC_MAX_REVISION = EVMC_PRAGUE, /** * The latest known EVM revision with finalized specification. * * This is handy for EVM tools to always use the latest revision available. */ - EVMC_LATEST_STABLE_REVISION = EVMC_LONDON + EVMC_LATEST_STABLE_REVISION = EVMC_SHANGHAI }; @@ -1111,7 +1120,7 @@ struct evmc_vm /** * Optional pointer to function modifying VM's options. * - * If the VM does not support this feature the pointer can be NULL. + * If the VM does not support this feature the pointer can be NULL. */ evmc_set_option_fn set_option; }; diff --git a/test/evmc/evmc.hpp b/test/evmc/evmc.hpp index 3d336894f91b..a29f802d27a7 100644 --- a/test/evmc/evmc.hpp +++ b/test/evmc/evmc.hpp @@ -414,6 +414,12 @@ class Result : private evmc_result return *this; } + /// Access the result object as a referenced to ::evmc_result. + evmc_result& raw() noexcept { return *this; } + + /// Access the result object as a const referenced to ::evmc_result. + const evmc_result& raw() const noexcept { return *this; } + /// Releases the ownership and returns the raw copy of evmc_result. /// /// This method drops the ownership of the result diff --git a/test/evmc/helpers.h b/test/evmc/helpers.h index 17db3d1941de..683567ef13ff 100644 --- a/test/evmc/helpers.h +++ b/test/evmc/helpers.h @@ -20,9 +20,11 @@ #ifdef __cplusplus extern "C" { +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #endif +#endif /** * Returns true if the VM has a compatible ABI version. @@ -297,6 +299,8 @@ static inline const char* evmc_revision_to_string(enum evmc_revision rev) return "Shanghai"; case EVMC_CANCUN: return "Cancun"; + case EVMC_PRAGUE: + return "Prague"; } return ""; } @@ -304,6 +308,8 @@ static inline const char* evmc_revision_to_string(enum evmc_revision rev) /** @} */ #ifdef __cplusplus +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif } // extern "C" #endif diff --git a/test/evmc/mocked_host.hpp b/test/evmc/mocked_host.hpp index 0e4ee824f681..173b793ac7a6 100644 --- a/test/evmc/mocked_host.hpp +++ b/test/evmc/mocked_host.hpp @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/test/externalTests.sh b/test/externalTests.sh deleted file mode 100755 index 4746e2a587d6..000000000000 --- a/test/externalTests.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash - -#------------------------------------------------------------------------------ -# Bash script to run external Solidity tests. -# -# Argument: Path to soljson.js to test. -# -# Requires npm, networking access and git to download the tests. -# -# ------------------------------------------------------------------------------ -# This file is part of solidity. -# -# solidity is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# solidity is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with solidity. If not, see -# -# (c) 2016 solidity contributors. -#------------------------------------------------------------------------------ - -set -e - -source scripts/common.sh -source test/externalTests/common.sh - -REPO_ROOT=$(realpath "$(dirname "$0")/..") - -verify_input "$@" - -printTask "Running external tests..." - -"${REPO_ROOT}/test/externalTests/zeppelin.sh" "$@" -"${REPO_ROOT}/test/externalTests/gnosis.sh" "$@" -"${REPO_ROOT}/test/externalTests/colony.sh" "$@" -"${REPO_ROOT}/test/externalTests/ens.sh" "$@" -"${REPO_ROOT}/test/externalTests/trident.sh" "$@" -"${REPO_ROOT}/test/externalTests/euler.sh" "$@" -"${REPO_ROOT}/test/externalTests/yield-liquidator.sh" "$@" -"${REPO_ROOT}/test/externalTests/bleeps.sh" "$@" -"${REPO_ROOT}/test/externalTests/pool-together.sh" "$@" -"${REPO_ROOT}/test/externalTests/perpetual-pools.sh" "$@" -"${REPO_ROOT}/test/externalTests/uniswap.sh" "$@" -"${REPO_ROOT}/test/externalTests/prb-math.sh" "$@" -"${REPO_ROOT}/test/externalTests/elementfi.sh" "$@" -"${REPO_ROOT}/test/externalTests/brink.sh" "$@" -"${REPO_ROOT}/test/externalTests/chainlink.sh" "$@" -"${REPO_ROOT}/test/externalTests/gp2.sh" "$@" diff --git a/test/externalTests/bleeps.sh b/test/externalTests/bleeps.sh index 22e54ac9cea0..939552100495 100755 --- a/test/externalTests/bleeps.sh +++ b/test/externalTests/bleeps.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/brink.sh b/test/externalTests/brink.sh index 901a0cfc0dec..77dd62f940f8 100755 --- a/test/externalTests/brink.sh +++ b/test/externalTests/brink.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/chainlink.sh b/test/externalTests/chainlink.sh index 249a1254cddf..a11266c3b84b 100755 --- a/test/externalTests/chainlink.sh +++ b/test/externalTests/chainlink.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/colony.sh b/test/externalTests/colony.sh index 8582411b998d..402865107a8d 100755 --- a/test/externalTests/colony.sh +++ b/test/externalTests/colony.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/elementfi.sh b/test/externalTests/elementfi.sh index b667a4bbc08f..b3348e339c9a 100755 --- a/test/externalTests/elementfi.sh +++ b/test/externalTests/elementfi.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/ens.sh b/test/externalTests/ens.sh index 77395160d340..7f713f4abd81 100755 --- a/test/externalTests/ens.sh +++ b/test/externalTests/ens.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/euler.sh b/test/externalTests/euler.sh index 78e89d147b82..586526124f31 100755 --- a/test/externalTests/euler.sh +++ b/test/externalTests/euler.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/gnosis.sh b/test/externalTests/gnosis.sh index ab1fbf3e1738..de0624c06c57 100755 --- a/test/externalTests/gnosis.sh +++ b/test/externalTests/gnosis.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") @@ -47,7 +47,8 @@ function gnosis_safe_test "${compile_only_presets[@]}" #ir-no-optimize # Compilation fails with "YulException: Variable var_call_430_mpos is 1 slot(s) too deep inside the stack." #ir-optimize-evm-only # Compilation fails with "YulException: Variable var_call_430_mpos is 1 slot(s) too deep inside the stack." - ir-optimize-evm+yul + # TODO: Uncomment the preset below when the issue: https://github.com/safe-global/safe-contracts/issues/544 is solved. + #ir-optimize-evm+yul # Compilation fails with "YulException: Cannot swap Variable var_operation with Variable _1: too deep in the stack by 4 slots." legacy-no-optimize legacy-optimize-evm-only legacy-optimize-evm+yul @@ -66,15 +67,15 @@ function gnosis_safe_test sed -i 's|"@openzeppelin/contracts": "\^3\.4\.0"|"@openzeppelin/contracts": "^4.0.0"|g' package.json # Disable two tests failing due to Hardhat's heuristics not yet updated to handle solc 0.8.10. - # TODO: Remove this when Hardhat implements them (https://github.com/nomiclabs/hardhat/issues/2051). - sed -i "s|\(it\)\(('should revert if called directly', async () => {\)|\1.skip\2|g" test/handlers/CompatibilityFallbackHandler.spec.ts + # TODO: Remove this when Hardhat implements them (https://github.com/nomiclabs/hardhat/issues/2451). + sed -i "s|\(it\)\((\"should revert if called directly\"\)|\1.skip\2|g" test/handlers/CompatibilityFallbackHandler.spec.ts # Disable tests that won't pass on the ir presets due to Hardhat heuristics. Note that this also disables # them for other presets but that's fine - we want same code run for benchmarks to be comparable. # TODO: Remove this when Hardhat adjusts heuristics for IR (https://github.com/nomiclabs/hardhat/issues/3365). - sed -i "s|\(it\)\(('should not allow to call setup on singleton'\)|\1.skip\2|g" test/core/Safe.Setup.spec.ts - sed -i "s|\(it\)\(('can be used only via DELEGATECALL opcode'\)|\1.skip\2|g" test/libraries/SignMessageLib.spec.ts - sed -i "s|it\(('can only be called from Safe itself'\)|it.skip\1|g" test/libraries/Migration.spec.ts + sed -i "s|\(it\)\((\"should not allow to call setup on singleton\"\)|\1.skip\2|g" test/core/Safe.Setup.spec.ts + sed -i "s|\(it\)\((\"can be used only via DELEGATECALL opcode\"\)|\1.skip\2|g" test/libraries/SignMessageLib.spec.ts + sed -i "s|it\((\"can only be called from Safe itself\"\)|it.skip\1|g" test/libraries/Migration.spec.ts neutralize_package_lock neutralize_package_json_hooks diff --git a/test/externalTests/gp2.sh b/test/externalTests/gp2.sh index 9e9ee72af24b..4dae6f0c3bcc 100755 --- a/test/externalTests/gp2.sh +++ b/test/externalTests/gp2.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") @@ -69,13 +69,6 @@ function gp2_test force_hardhat_unlimited_contract_size "$config_file" "$config_var" yarn - # New hardhat release breaks GP2 tests, and since GP2 repository has been archived, we are pinning hardhat - # to the previous stable version. See https://github.com/ethereum/solidity/pull/13485 - yarn add hardhat@2.10.2 - # hardhat-tenderly@1.2.0 and upwards break the build, hence we are pinning the version to the last stable one. - # See https://github.com/cowprotocol/contracts/issues/32 - yarn add @tenderly/hardhat-tenderly@1.1.6 - # Some dependencies come with pre-built artifacts. We want to build from scratch. rm -r node_modules/@gnosis.pm/safe-contracts/build/ diff --git a/test/externalTests/perpetual-pools.sh b/test/externalTests/perpetual-pools.sh index 18fb308af4af..70a14c499338 100755 --- a/test/externalTests/perpetual-pools.sh +++ b/test/externalTests/perpetual-pools.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/pool-together.sh b/test/externalTests/pool-together.sh index 86cd3ee684e6..77b3ad1499b2 100755 --- a/test/externalTests/pool-together.sh +++ b/test/externalTests/pool-together.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/prb-math.sh b/test/externalTests/prb-math.sh index 78a39519e4c0..99c7c2716cde 100755 --- a/test/externalTests/prb-math.sh +++ b/test/externalTests/prb-math.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/solc-js/solc-js.sh b/test/externalTests/solc-js/solc-js.sh index bf7ca87628bd..af325326c2db 100755 --- a/test/externalTests/solc-js/solc-js.sh +++ b/test/externalTests/solc-js/solc-js.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh SOLJSON="$1" VERSION="$2" diff --git a/test/externalTests/trident.sh b/test/externalTests/trident.sh index b5d48b500a20..f02123217a2b 100755 --- a/test/externalTests/trident.sh +++ b/test/externalTests/trident.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") diff --git a/test/externalTests/uniswap.sh b/test/externalTests/uniswap.sh index 8b07aee84e96..37fed8644310 100755 --- a/test/externalTests/uniswap.sh +++ b/test/externalTests/uniswap.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") @@ -83,8 +83,6 @@ function uniswap_test # "revert SPL" is expected but the message is "reverted with reason string 'SPL'" in 2.5.0. # - Newer versions of ethereumjs/tx have an issue with 'gteHardfork()' method. neutralize_package_lock - yarn add hardhat@2.4.3 - yarn add @ethereumjs/tx@3.1.3 yarn install yarn add hardhat-gas-reporter diff --git a/test/externalTests/yield-liquidator.sh b/test/externalTests/yield-liquidator.sh index a224433117dd..3c7137f7377b 100755 --- a/test/externalTests/yield-liquidator.sh +++ b/test/externalTests/yield-liquidator.sh @@ -22,7 +22,7 @@ set -e source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") @@ -66,9 +66,10 @@ function yield_liquidator_test force_hardhat_unlimited_contract_size "$config_file" "$config_var" npm install - # 2.11.0 Hardhat release breaks contract compilation. - # TODO: remove when https://github.com/yieldprotocol/yield-liquidator-v2/issues/34 is addressed. - npm install hardhat@2.10.2 + # The contract below is not used in any test and it depends on ISwapRouter which does not exists + # in the main repository. + # See: https://github.com/yieldprotocol/yield-liquidator-v2/blob/9a49d9a0e9398f6a6c07bad531e77d1001a1166f/src/swap_router.rs#L94 + rm --force contracts/.YvBasicFlashLiquidator.sol replace_version_pragmas neutralize_packaged_contracts diff --git a/test/externalTests/zeppelin.sh b/test/externalTests/zeppelin.sh index 11e148c1825f..46b3f2d89886 100755 --- a/test/externalTests/zeppelin.sh +++ b/test/externalTests/zeppelin.sh @@ -27,7 +27,7 @@ set -e export NODE_OPTIONS="--max-old-space-size=4096" source scripts/common.sh -source test/externalTests/common.sh +source scripts/externalTests/common.sh REPO_ROOT=$(realpath "$(dirname "$0")/../..") @@ -65,36 +65,23 @@ function zeppelin_test # Disable tests that won't pass on the ir presets due to Hardhat heuristics. Note that this also disables # them for other presets but that's fine - we want same code run for benchmarks to be comparable. - # TODO: Remove this when Hardhat adjusts heuristics for IR (https://github.com/nomiclabs/hardhat/issues/3365). - pushd test/utils/ - sed -i "s|it(\('reverts \)|it.skip(\1|g" math/SafeMath.test.js - sed -i "s|it(\('reverts \)|it.skip(\1|g" math/SignedSafeMath.test.js - sed -i "s|it(\('reverts \)|it.skip(\1|g" structs/EnumerableSet.behavior.js - popd - pushd test/proxy/ - sed -i "s|it(\('proxy admin cannot call delegated functions',\)|it.skip(\1|g" transparent/TransparentUpgradeableProxy.behaviour.js - popd - - + # TODO: Remove the lines below when Hardhat adjusts heuristics for IR (https://github.com/nomiclabs/hardhat/issues/3750). + sed -i "s|it(\('proxy admin cannot call delegated functions',\)|it.skip(\1|g" test/proxy/transparent/TransparentUpgradeableProxy.behaviour.js + sed -i "s|describe(\('when the given implementation is the zero address'\)|describe.skip(\1|g" test/proxy/transparent/TransparentUpgradeableProxy.behaviour.js + sed -i "s|describe(\('when the new proposed admin is the zero address'\)|describe.skip(\1|g" test/proxy/transparent/TransparentUpgradeableProxy.behaviour.js # In some cases Hardhat does not detect revert reasons properly via IR. - # TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/3365 gets fixed. sed -i "s|it(\('reverts if the current value is 0'\)|it.skip(\1|g" test/utils/Counters.test.js sed -i "s|it(\('prevent unauthorized maintenance'\)|it.skip(\1|g" test/governance/TimelockController.test.js sed -i "s|it(\('cannot cancel invalid operation'\)|it.skip(\1|g" test/governance/TimelockController.test.js - sed -i "s|it(\('reverts if block number >= current block'\)|it.skip(\1|g" test/governance/utils/Votes.test.js - sed -i "s|it(\('reverts if block number >= current block'\)|it.skip(\1|g" test/governance/utils/Votes.behavior.js sed -i "s|it(\('cannot call onlyInitializable function outside the scope of an initializable function'\)|it.skip(\1|g" test/proxy/utils/Initializable.test.js sed -i "s|it(\('other accounts cannot unpause'\)|it.skip(\1|g" test/token/ERC20/presets/ERC20PresetMinterPauser.test.js sed -i "s|it(\('other accounts cannot unpause'\)|it.skip(\1|g" test/token/ERC1155/presets/ERC1155PresetMinterPauser.test.js sed -i "s|it(\('other accounts cannot pause'\)|it.skip(\1|g" test/token/ERC20/presets/ERC20PresetMinterPauser.test.js sed -i "s|it(\('other accounts cannot pause'\)|it.skip(\1|g" test/token/ERC1155/presets/ERC1155PresetMinterPauser.test.js - sed -i "s|it(\('reverts when decreasing the allowance'\)|it.skip(\1|g" test/token/ERC20/utils/SafeERC20.test.js - sed -i "s|it(\('reverts when decreasing the allowance to a negative value'\)|it.skip(\1|g" test/token/ERC20/utils/SafeERC20.test.js sed -i "s|it(\('cannot be released before time limit'\)|it.skip(\1|g" test/token/ERC20/utils/TokenTimelock.test.js sed -i "s|it(\('cannot be released just before time limit'\)|it.skip(\1|g" test/token/ERC20/utils/TokenTimelock.test.js sed -i "s|it(\('reverts when sending non-zero amounts'\)|it.skip(\1|g" test/utils/Address.test.js sed -i "s|it(\('reverts when sending more than the balance'\)|it.skip(\1|g" test/utils/Address.test.js - sed -i "s|it(\('reverts if block number >= current block'\)|it.skip(\1|g" test/utils/Checkpoints.test.js sed -i "s|it(\('fails deploying a contract if the bytecode length is zero'\)|it.skip(\1|g" test/utils/Create2.test.js sed -i "s|it(\('fails deploying a contract if factory contract does not have sufficient balance'\)|it.skip(\1|g" test/utils/Create2.test.js sed -i "s|it(\('reverts on withdrawals'\)|it.skip(\1|g" test/utils/escrow/ConditionalEscrow.test.js @@ -102,42 +89,21 @@ function zeppelin_test sed -i "s|it(\('rejects deposits'\)|it.skip(\1|g" test/utils/escrow/RefundEscrow.test.js sed -i "s|it(\('does not allow 0xffffffff'\)|it.skip(\1|g" test/utils/introspection/ERC165Storage.test.js sed -i "s|it(\('reverts when casting -1'\)|it.skip(\1|g" test/utils/math/SafeCast.test.js - sed -i 's|it(\(`reverts when downcasting 2^\${bits} (\${maxValue.addn(1)})`\)|it.skip(\1|g' test/utils/math/SafeCast.test.js - sed -i 's|it(\(`reverts when downcasting 2^\${bits} + 1 (\${maxValue.addn(2)})`\)|it.skip(\1|g' test/utils/math/SafeCast.test.js sed -i 's|it(\(`reverts when casting [^`]\+`\)|it.skip(\1|g' test/utils/math/SafeCast.test.js - sed -i "s|it(\('missing value'\)|it.skip(\1|g" test/utils/structs/EnumerableMap.behavior.js - sed -i "s|it(\('reverts when queried for non existent token id'\)|it.skip(\1|g" test/token/ERC721/ERC721.behavior.js sed -i "s|it(\('reverts if index is greater than supply'\)|it.skip(\1|g" test/token/ERC721/ERC721.behavior.js sed -i "s|it(\('burns all tokens'\)|it.skip(\1|g" test/token/ERC721/ERC721.behavior.js sed -i "s|it(\('other accounts cannot pause'\)|it.skip(\1|g" test/token/ERC721/presets/ERC721PresetMinterPauserAutoId.test.js sed -i "s|it(\('other accounts cannot unpause'\)|it.skip(\1|g" test/token/ERC721/presets/ERC721PresetMinterPauserAutoId.test.js - sed -i "s|it(\('prevents initialization'\)|it.skip(\1|g" test/proxy/utils/Initializable.test.js - sed -i "s|it(\('divide by 0'\)|it.skip(\1|g" test/utils/math/Math.test.js - sed -i "s|it(\('pending owner resets after renouncing ownership'\)|it.skip(\1|g" test/access/Ownable2Step.test.js sed -i "s|it(\('guards transfer against invalid user'\)|it.skip(\1|g" test/access/Ownable2Step.test.js - # CAUTION:: The following two sed commands depend on the order of occurrence of the relevant patterns in the mentioned files. - # Could result in an error in the future. - sed -zi "s|it(\('deposit'\)|it.skip(\1|3" test/token/ERC20/extensions/ERC4626.test.js - sed -zi "s|it(\('withdraw'\)|it.skip(\1|3" test/token/ERC20/extensions/ERC4626.test.js - - # Here only the testToInt(248) and testToInt(256) cases fail so change the loop range to skip them - sed -i "s|range(8, 256, 8)\(.forEach(bits => testToInt(bits));\)|range(8, 240, 8)\1|" test/utils/math/SafeCast.test.js - - - - # TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/3365 gets fixed. - sed -i "s|describe\(('Polygon-Child'\)|describe.skip\1|g" test/crosschain/CrossChainEnabled.test.js - sed -i "s|it(\('revert with invalid multi proof #2'\)|it.skip(\1|g" test/utils/cryptography/MerkleProof.test.js - sed -i "s|describe(\('to a receiver contract that panics'\)|describe.skip(\1|g" test/token/ERC721/ERC721.behavior.js - sed -i "s|context(\('to a receiver contract that panics'\)|context.skip(\1|g" test/token/ERC721/ERC721.behavior.js - sed -i "s|describe(\('to a contract that does not implement the required function'\)|describe.skip(\1|g" test/token/ERC721/ERC721.behavior.js - sed -i "s|context(\('to a contract that does not implement the required function'\)|context.skip(\1|g" test/token/ERC721/ERC721.behavior.js - sed -i "s|it(\('reverts when the called function throws'\)|it.skip(\1|g" test/utils/Address.test.js - sed -i "s|it(\('reverts when function does not exist'\)|it.skip(\1|g" test/utils/Address.test.js sed -i "s|it(\('reverting initialization'\)|it.skip(\1|g" test/proxy/beacon/BeaconProxy.test.js sed -i "s|describe(\('reverting initialization'\)|describe.skip(\1|g" test/proxy/Proxy.behaviour.js sed -i "s|it(\('does not allow remote callback'\)|it.skip(\1|g" test/security/ReentrancyGuard.test.js + sed -i "s|shouldBehaveLikeAccessControlDefaultAdminRules|\/\/&|" test/access/AccessControlDefaultAdminRules.test.js + + # Here only the testToInt(248) and testToInt(256) cases fail so change the loop range to skip them + sed -i "s|range(8, 256, 8)\(.forEach(bits => testToInt(bits));\)|range(8, 240, 8)\1|" test/utils/math/SafeCast.test.js + neutralize_package_lock neutralize_package_json_hooks force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH" force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" diff --git a/test/external_tests.py b/test/external_tests.py new file mode 100755 index 000000000000..59b22af7e584 --- /dev/null +++ b/test/external_tests.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 + +# ------------------------------------------------------------------------------ +# This file is part of solidity. +# +# solidity is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# solidity is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with solidity. If not, see +# +# (c) 2023 solidity contributors. +# ------------------------------------------------------------------------------ + +from argparse import ArgumentParser, Namespace +import os +from pathlib import Path +import sys +import subprocess + +EXTERNAL_TESTS_DIR = Path(__file__).parent / "externalTests" + + +class ExternalTestNotFound(Exception): + pass + + +def detect_external_tests() -> dict: + return { + file_path.stem: file_path + for file_path in Path(EXTERNAL_TESTS_DIR).iterdir() + if file_path.is_file() and file_path.suffix == ".sh" + } + + +def display_available_external_tests(_): + print("Available external tests:") + print(*detect_external_tests().keys()) + + +def run_test_scripts(solc_binary_type: str, solc_binary_path: Path, tests: dict): + for test_name, test_script_path in tests.items(): + print(f"Running {test_name} external test...") + subprocess.run( + [test_script_path, solc_binary_type, solc_binary_path], + check=True + ) + + +def run_external_tests(args: dict): + solc_binary_type = args["solc_binary_type"] + solc_binary_path = args["solc_binary_path"] + + all_test_scripts = detect_external_tests() + selected_tests = args["selected_tests"] + if args["run_all"]: + assert len(selected_tests) == 0 + run_test_scripts(solc_binary_type, solc_binary_path, all_test_scripts) + return + + if len(selected_tests) == 0: + raise ExternalTestNotFound( + "External test was not selected. Please use --run or --run-all option" + ) + + unrecognized_tests = set(selected_tests) - set(all_test_scripts.keys()) + if unrecognized_tests != set(): + raise ExternalTestNotFound( + f"External test(s) not found: {', '.join(unrecognized_tests)}" + ) + run_test_scripts( + solc_binary_type, + solc_binary_path, + {k: all_test_scripts[k] for k in selected_tests}, + ) + + +def parse_commandline() -> Namespace: + script_description = "Script to run external Solidity tests." + + parser = ArgumentParser(description=script_description) + subparser = parser.add_subparsers() + list_command = subparser.add_parser( + "list", + help="List all available external tests.", + ) + list_command.set_defaults(cmd=display_available_external_tests) + + run_command = subparser.add_parser( + "test", + help="Run external tests.", + ) + run_command.set_defaults(cmd=run_external_tests) + + run_command.add_argument( + "--solc-binary-type", + dest="solc_binary_type", + type=str, + required=True, + choices=["native", "solcjs"], + help="Type of the solidity compiler binary to be used.", + ) + run_command.add_argument( + "--solc-binary-path", + dest="solc_binary_path", + type=Path, + required=True, + help="Path to the solidity compiler binary.", + ) + + running_mode = run_command.add_mutually_exclusive_group() + running_mode.add_argument( + "--run", + metavar="TEST_NAME", + dest="selected_tests", + nargs="+", + default=[], + help="List of one or more external tests to run (separated by sapce).", + ) + running_mode.add_argument( + "--run-all", + dest="run_all", + default=False, + action="store_true", + help="Run all available external tests.", + ) + + return parser.parse_args() + + +def main(): + try: + args = parse_commandline() + args.cmd(vars(args)) + return os.EX_OK + except ExternalTestNotFound as exception: + print(f"Error: {exception}", file=sys.stderr) + return os.EX_NOINPUT + except RuntimeError as exception: + print(f"Error: {exception}", file=sys.stderr) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/test/libevmasm/Assembler.cpp b/test/libevmasm/Assembler.cpp index 12c3be67d650..febe4a59b78a 100644 --- a/test/libevmasm/Assembler.cpp +++ b/test/libevmasm/Assembler.cpp @@ -330,12 +330,16 @@ BOOST_AUTO_TEST_CASE(immutable) checkCompilation(_assembly); + string genericPush0 = evmVersion.hasPush0() ? "5f" : "6000"; + // PUSH1 0x1b v/s PUSH1 0x19 + string dataOffset = evmVersion.hasPush0() ? "6019" : "601b" ; + BOOST_CHECK_EQUAL( _assembly.assemble().toHex(), // root.asm // assign "someImmutable" - "602a" // PUSH1 42 - value for someImmutable - "6000" // PUSH1 0 - offset of code into which to insert the immutable + "602a" + // PUSH1 42 - value for someImmutable + genericPush0 + // PUSH1 0 - offset of code into which to insert the immutable "8181" // DUP2 DUP2 "6001" // PUSH1 1 - offset of first someImmutable in sub_0 "01" // ADD - add offset of immutable to offset of code @@ -344,13 +348,13 @@ BOOST_AUTO_TEST_CASE(immutable) "01" // ADD - add offset of immutable to offset of code "52" // MSTORE // assign "someOtherImmutable" - "6017" // PUSH1 23 - value for someOtherImmutable - "6000" // PUSH1 0 - offset of code into which to insert the immutable + "6017" + // PUSH1 23 - value for someOtherImmutable + genericPush0 + // PUSH1 0 - offset of code into which to insert the immutable "6022" // PUSH1 34 - offset of someOtherImmutable in sub_0 "01" // ADD - add offset of immutable to offset of code "52" // MSTORE - "6063" // PUSH1 0x63 - dataSize(sub_0) - "601b" // PUSH1 0x23 - dataOffset(sub_0) + "6063" + // PUSH1 0x63 - dataSize(sub_0) + dataOffset + // PUSH1 0x23 - dataOffset(sub_0) "fe" // INVALID // end of root.asm // sub.asm diff --git a/test/libsolidity/ABIJson/event_emited_in_base_contract.sol b/test/libsolidity/ABIJson/event_emited_in_base_contract.sol new file mode 100644 index 000000000000..f9c3d2019cbe --- /dev/null +++ b/test/libsolidity/ABIJson/event_emited_in_base_contract.sol @@ -0,0 +1,71 @@ +library L { event E(uint8); } + +contract B { + constructor() { + emit L.E(0); + } +} + +contract C is B {} + +// ---- +// :B +// [ +// { +// "inputs": [], +// "stateMutability": "nonpayable", +// "type": "constructor" +// }, +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint8", +// "name": "", +// "type": "uint8" +// } +// ], +// "name": "E", +// "type": "event" +// } +// ] +// +// +// :C +// [ +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint8", +// "name": "", +// "type": "uint8" +// } +// ], +// "name": "E", +// "type": "event" +// } +// ] +// +// +// :L +// [ +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint8", +// "name": "", +// "type": "uint8" +// } +// ], +// "name": "E", +// "type": "event" +// } +// ] diff --git a/test/libsolidity/ABIJson/event_from_aggregated_contract_not_emmited.sol b/test/libsolidity/ABIJson/event_from_aggregated_contract_not_emmited.sol new file mode 100644 index 000000000000..6a930589d542 --- /dev/null +++ b/test/libsolidity/ABIJson/event_from_aggregated_contract_not_emmited.sol @@ -0,0 +1,42 @@ +contract C { + event e(); + function f() public { + emit e(); + } +} + +contract D { + C c; + constructor() { + c = new C(); + c.f(); + } +} + +// ---- +// :C +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// }, +// { +// "inputs": [], +// "name": "f", +// "outputs": [], +// "stateMutability": "nonpayable", +// "type": "function" +// } +// ] +// +// +// :D +// [ +// { +// "inputs": [], +// "stateMutability": "nonpayable", +// "type": "constructor" +// } +// ] diff --git a/test/libsolidity/ABIJson/event_inheritance.sol b/test/libsolidity/ABIJson/event_inheritance.sol new file mode 100644 index 000000000000..e4a8aeea4e0a --- /dev/null +++ b/test/libsolidity/ABIJson/event_inheritance.sol @@ -0,0 +1,62 @@ +interface B { + event EB(); +} + +contract C is B { + event EC(); +} + +contract D is C { + event ED(); +} + +// ---- +// :B +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "EB", +// "type": "event" +// } +// ] +// +// +// :C +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "EB", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "EC", +// "type": "event" +// } +// ] +// +// +// :D +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "EB", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "EC", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "ED", +// "type": "event" +// } +// ] diff --git a/test/libsolidity/ABIJson/events_indirect.sol b/test/libsolidity/ABIJson/events_indirect.sol new file mode 100644 index 000000000000..86368028ccc2 --- /dev/null +++ b/test/libsolidity/ABIJson/events_indirect.sol @@ -0,0 +1,88 @@ +library L { + event e1(uint b); + event e2(); + event e2(uint a); + event e3() anonymous; +} +contract test { + function f() public { + emit L.e1(1); + emit L.e3(); + } +} +// ---- +// :L +// [ +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint256", +// "name": "b", +// "type": "uint256" +// } +// ], +// "name": "e1", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "e2", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint256", +// "name": "a", +// "type": "uint256" +// } +// ], +// "name": "e2", +// "type": "event" +// }, +// { +// "anonymous": true, +// "inputs": [], +// "name": "e3", +// "type": "event" +// } +// ] +// +// +// :test +// [ +// { +// "anonymous": false, +// "inputs": +// [ +// { +// "indexed": false, +// "internalType": "uint256", +// "name": "b", +// "type": "uint256" +// } +// ], +// "name": "e1", +// "type": "event" +// }, +// { +// "anonymous": true, +// "inputs": [], +// "name": "e3", +// "type": "event" +// }, +// { +// "inputs": [], +// "name": "f", +// "outputs": [], +// "stateMutability": "nonpayable", +// "type": "function" +// } +// ] diff --git a/test/libsolidity/ABIJson/events_repetitions.sol b/test/libsolidity/ABIJson/events_repetitions.sol new file mode 100644 index 000000000000..8dd980a6a1a5 --- /dev/null +++ b/test/libsolidity/ABIJson/events_repetitions.sol @@ -0,0 +1,45 @@ +library L { + event e(); +} +contract C { + constructor() { + emit L.e(); + } + function f() public { + emit L.e(); + } +} + +// ---- +// :C +// [ +// { +// "inputs": [], +// "stateMutability": "nonpayable", +// "type": "constructor" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// }, +// { +// "inputs": [], +// "name": "f", +// "outputs": [], +// "stateMutability": "nonpayable", +// "type": "function" +// } +// ] +// +// +// :L +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// } +// ] diff --git a/test/libsolidity/ABIJson/same_event_defined_twice.sol b/test/libsolidity/ABIJson/same_event_defined_twice.sol new file mode 100644 index 000000000000..9a65e61d69a2 --- /dev/null +++ b/test/libsolidity/ABIJson/same_event_defined_twice.sol @@ -0,0 +1,61 @@ +library L1 { event e(); } +library L2 { event e(); } +contract C { + constructor() { + emit L1.e(); + } + function f() public { + emit L2.e(); + } +} + +// ---- +// :C +// [ +// { +// "inputs": [], +// "stateMutability": "nonpayable", +// "type": "constructor" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// }, +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// }, +// { +// "inputs": [], +// "name": "f", +// "outputs": [], +// "stateMutability": "nonpayable", +// "type": "function" +// } +// ] +// +// +// :L1 +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// } +// ] +// +// +// :L2 +// [ +// { +// "anonymous": false, +// "inputs": [], +// "name": "e", +// "type": "event" +// } +// ] diff --git a/test/libsolidity/ASTJSON/abstract_contract.json b/test/libsolidity/ASTJSON/abstract_contract.json index 168433eb96f8..48c20b43584d 100644 --- a/test/libsolidity/ASTJSON/abstract_contract.json +++ b/test/libsolidity/ASTJSON/abstract_contract.json @@ -66,7 +66,8 @@ ], "scope": 6, "src": "0:43:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:44:1" diff --git a/test/libsolidity/ASTJSON/abstract_contract_parseOnly.json b/test/libsolidity/ASTJSON/abstract_contract_parseOnly.json index 51dd803a3687..d9ba04e6cfd0 100644 --- a/test/libsolidity/ASTJSON/abstract_contract_parseOnly.json +++ b/test/libsolidity/ASTJSON/abstract_contract_parseOnly.json @@ -50,7 +50,8 @@ } ], "src": "0:43:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:44:1" diff --git a/test/libsolidity/ASTJSON/address_payable.json b/test/libsolidity/ASTJSON/address_payable.json index 83ba2c6d7c82..adf79823ec30 100644 --- a/test/libsolidity/ASTJSON/address_payable.json +++ b/test/libsolidity/ASTJSON/address_payable.json @@ -571,7 +571,8 @@ ], "scope": 40, "src": "0:258:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:259:1" diff --git a/test/libsolidity/ASTJSON/address_payable_parseOnly.json b/test/libsolidity/ASTJSON/address_payable_parseOnly.json index 9d095dc6869c..02b809cc96da 100644 --- a/test/libsolidity/ASTJSON/address_payable_parseOnly.json +++ b/test/libsolidity/ASTJSON/address_payable_parseOnly.json @@ -378,7 +378,8 @@ } ], "src": "0:258:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:259:1" diff --git a/test/libsolidity/ASTJSON/array_type_name.json b/test/libsolidity/ASTJSON/array_type_name.json index c1bcaa985b34..1cd97e1765a3 100644 --- a/test/libsolidity/ASTJSON/array_type_name.json +++ b/test/libsolidity/ASTJSON/array_type_name.json @@ -72,7 +72,8 @@ ], "scope": 5, "src": "0:24:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:25:1" diff --git a/test/libsolidity/ASTJSON/array_type_name_parseOnly.json b/test/libsolidity/ASTJSON/array_type_name_parseOnly.json index 4248a3f98757..1e0b72ca07f2 100644 --- a/test/libsolidity/ASTJSON/array_type_name_parseOnly.json +++ b/test/libsolidity/ASTJSON/array_type_name_parseOnly.json @@ -45,7 +45,8 @@ } ], "src": "0:24:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:25:1" diff --git a/test/libsolidity/ASTJSON/assembly/call.json b/test/libsolidity/ASTJSON/assembly/call.json index c6e0561ed4d4..7081d2f983fc 100644 --- a/test/libsolidity/ASTJSON/assembly/call.json +++ b/test/libsolidity/ASTJSON/assembly/call.json @@ -164,7 +164,8 @@ ], "scope": 7, "src": "0:98:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:99:1" diff --git a/test/libsolidity/ASTJSON/assembly/call_parseOnly.json b/test/libsolidity/ASTJSON/assembly/call_parseOnly.json index 27d6ac07d0a1..1a9dc74a2839 100644 --- a/test/libsolidity/ASTJSON/assembly/call_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/call_parseOnly.json @@ -148,7 +148,8 @@ } ], "src": "0:98:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:99:1" diff --git a/test/libsolidity/ASTJSON/assembly/empty_block.json b/test/libsolidity/ASTJSON/assembly/empty_block.json index 19779b076b4d..05dc8c0c059a 100644 --- a/test/libsolidity/ASTJSON/assembly/empty_block.json +++ b/test/libsolidity/ASTJSON/assembly/empty_block.json @@ -89,7 +89,8 @@ ], "scope": 7, "src": "0:75:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:76:1" diff --git a/test/libsolidity/ASTJSON/assembly/empty_block_parseOnly.json b/test/libsolidity/ASTJSON/assembly/empty_block_parseOnly.json index 8b07db89371b..4a1d1f61474a 100644 --- a/test/libsolidity/ASTJSON/assembly/empty_block_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/empty_block_parseOnly.json @@ -73,7 +73,8 @@ } ], "src": "0:75:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:76:1" diff --git a/test/libsolidity/ASTJSON/assembly/function.json b/test/libsolidity/ASTJSON/assembly/function.json index e528baa4c929..d8822183c28c 100644 --- a/test/libsolidity/ASTJSON/assembly/function.json +++ b/test/libsolidity/ASTJSON/assembly/function.json @@ -151,7 +151,8 @@ ], "scope": 7, "src": "0:112:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:113:1" diff --git a/test/libsolidity/ASTJSON/assembly/function_parseOnly.json b/test/libsolidity/ASTJSON/assembly/function_parseOnly.json index f89a2fa6d102..8115fc0aecbf 100644 --- a/test/libsolidity/ASTJSON/assembly/function_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/function_parseOnly.json @@ -135,7 +135,8 @@ } ], "src": "0:112:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:113:1" diff --git a/test/libsolidity/ASTJSON/assembly/leave.json b/test/libsolidity/ASTJSON/assembly/leave.json index eefc5105f65f..23ac98ccb34a 100644 --- a/test/libsolidity/ASTJSON/assembly/leave.json +++ b/test/libsolidity/ASTJSON/assembly/leave.json @@ -101,7 +101,8 @@ ], "scope": 7, "src": "0:90:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:91:1" diff --git a/test/libsolidity/ASTJSON/assembly/leave_parseOnly.json b/test/libsolidity/ASTJSON/assembly/leave_parseOnly.json index ba8b54507abf..215266456d17 100644 --- a/test/libsolidity/ASTJSON/assembly/leave_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/leave_parseOnly.json @@ -85,7 +85,8 @@ } ], "src": "0:90:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:91:1" diff --git a/test/libsolidity/ASTJSON/assembly/loop.json b/test/libsolidity/ASTJSON/assembly/loop.json index 8a887a80f7a0..7e684b4a34a6 100644 --- a/test/libsolidity/ASTJSON/assembly/loop.json +++ b/test/libsolidity/ASTJSON/assembly/loop.json @@ -164,7 +164,8 @@ ], "scope": 7, "src": "0:118:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:119:1" diff --git a/test/libsolidity/ASTJSON/assembly/loop_parseOnly.json b/test/libsolidity/ASTJSON/assembly/loop_parseOnly.json index 8ee9367478ef..934afdf42e65 100644 --- a/test/libsolidity/ASTJSON/assembly/loop_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/loop_parseOnly.json @@ -148,7 +148,8 @@ } ], "src": "0:118:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:119:1" diff --git a/test/libsolidity/ASTJSON/assembly/nested_functions.json b/test/libsolidity/ASTJSON/assembly/nested_functions.json index 41a18a1d0ebb..881e7456f1cb 100644 --- a/test/libsolidity/ASTJSON/assembly/nested_functions.json +++ b/test/libsolidity/ASTJSON/assembly/nested_functions.json @@ -169,7 +169,8 @@ ], "scope": 9, "src": "0:154:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:155:1" diff --git a/test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json b/test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json index f5f554608006..a9ac0965aa88 100644 --- a/test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/nested_functions_parseOnly.json @@ -135,7 +135,8 @@ } ], "src": "0:154:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:155:1" diff --git a/test/libsolidity/ASTJSON/assembly/slot_offset.json b/test/libsolidity/ASTJSON/assembly/slot_offset.json index 1e6fe1447acc..e61125cbdb31 100644 --- a/test/libsolidity/ASTJSON/assembly/slot_offset.json +++ b/test/libsolidity/ASTJSON/assembly/slot_offset.json @@ -245,7 +245,8 @@ ], "scope": 13, "src": "0:148:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:149:1" diff --git a/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json b/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json index 4135bb343706..ccf9c53fe133 100644 --- a/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/slot_offset_parseOnly.json @@ -189,7 +189,8 @@ } ], "src": "0:148:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:149:1" diff --git a/test/libsolidity/ASTJSON/assembly/stringlit.json b/test/libsolidity/ASTJSON/assembly/stringlit.json index 64777e947948..33211190e5ae 100644 --- a/test/libsolidity/ASTJSON/assembly/stringlit.json +++ b/test/libsolidity/ASTJSON/assembly/stringlit.json @@ -106,7 +106,8 @@ ], "scope": 7, "src": "0:82:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:83:1" diff --git a/test/libsolidity/ASTJSON/assembly/stringlit_parseOnly.json b/test/libsolidity/ASTJSON/assembly/stringlit_parseOnly.json index e82999a7801e..dd4e1d0610ff 100644 --- a/test/libsolidity/ASTJSON/assembly/stringlit_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/stringlit_parseOnly.json @@ -90,7 +90,8 @@ } ], "src": "0:82:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:83:1" diff --git a/test/libsolidity/ASTJSON/assembly/switch.json b/test/libsolidity/ASTJSON/assembly/switch.json index f78699ef647d..26874da0e978 100644 --- a/test/libsolidity/ASTJSON/assembly/switch.json +++ b/test/libsolidity/ASTJSON/assembly/switch.json @@ -197,7 +197,8 @@ ], "scope": 7, "src": "0:198:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:199:1" diff --git a/test/libsolidity/ASTJSON/assembly/switch_default.json b/test/libsolidity/ASTJSON/assembly/switch_default.json index 16e1f1bf4fe8..d472ea0183a1 100644 --- a/test/libsolidity/ASTJSON/assembly/switch_default.json +++ b/test/libsolidity/ASTJSON/assembly/switch_default.json @@ -128,7 +128,8 @@ ], "scope": 7, "src": "0:102:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:103:1" diff --git a/test/libsolidity/ASTJSON/assembly/switch_default_parseOnly.json b/test/libsolidity/ASTJSON/assembly/switch_default_parseOnly.json index 4539f85963c8..e4a3e1b40c77 100644 --- a/test/libsolidity/ASTJSON/assembly/switch_default_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/switch_default_parseOnly.json @@ -112,7 +112,8 @@ } ], "src": "0:102:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:103:1" diff --git a/test/libsolidity/ASTJSON/assembly/switch_parseOnly.json b/test/libsolidity/ASTJSON/assembly/switch_parseOnly.json index 54d38b6383e1..d7392a8c8c63 100644 --- a/test/libsolidity/ASTJSON/assembly/switch_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/switch_parseOnly.json @@ -181,7 +181,8 @@ } ], "src": "0:198:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:199:1" diff --git a/test/libsolidity/ASTJSON/assembly/var_access.json b/test/libsolidity/ASTJSON/assembly/var_access.json index 9cddf44606d1..c93667df2aa3 100644 --- a/test/libsolidity/ASTJSON/assembly/var_access.json +++ b/test/libsolidity/ASTJSON/assembly/var_access.json @@ -155,7 +155,8 @@ ], "scope": 10, "src": "0:95:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:96:1" diff --git a/test/libsolidity/ASTJSON/assembly/var_access_parseOnly.json b/test/libsolidity/ASTJSON/assembly/var_access_parseOnly.json index 1444a3da11f1..b56324944f26 100644 --- a/test/libsolidity/ASTJSON/assembly/var_access_parseOnly.json +++ b/test/libsolidity/ASTJSON/assembly/var_access_parseOnly.json @@ -121,7 +121,8 @@ } ], "src": "0:95:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:96:1" diff --git a/test/libsolidity/ASTJSON/ast_internal_function_different_ids_export.json b/test/libsolidity/ASTJSON/ast_internal_function_different_ids_export.json new file mode 100644 index 000000000000..07886a166338 --- /dev/null +++ b/test/libsolidity/ASTJSON/ast_internal_function_different_ids_export.json @@ -0,0 +1,1027 @@ +[ +{ + "absolutePath": "L", + "exportedSymbols": + { + "L": + [ + 78 + ], + "free1": + [ + 65 + ], + "free2": + [ + 69 + ] + }, + "id": 79, + "nodeType": "SourceUnit", + "nodes": + [ + { + "body": + { + "id": 64, + "nodeType": "Block", + "src": "17:2:1", + "statements": [] + }, + "id": 65, + "implemented": true, + "kind": "freeFunction", + "modifiers": [], + "name": "free1", + "nameLocation": "9:5:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 62, + "nodeType": "ParameterList", + "parameters": [], + "src": "14:2:1" + }, + "returnParameters": + { + "id": 63, + "nodeType": "ParameterList", + "parameters": [], + "src": "17:0:1" + }, + "scope": 79, + "src": "0:19:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 68, + "nodeType": "Block", + "src": "37:2:1", + "statements": [] + }, + "id": 69, + "implemented": true, + "kind": "freeFunction", + "modifiers": [], + "name": "free2", + "nameLocation": "29:5:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 66, + "nodeType": "ParameterList", + "parameters": [], + "src": "34:2:1" + }, + "returnParameters": + { + "id": 67, + "nodeType": "ParameterList", + "parameters": [], + "src": "37:0:1" + }, + "scope": 79, + "src": "20:19:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "L", + "contractDependencies": [], + "contractKind": "library", + "fullyImplemented": true, + "id": 78, + "linearizedBaseContracts": + [ + 78 + ], + "name": "L", + "nameLocation": "48:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 72, + "nodeType": "Block", + "src": "78:2:1", + "statements": [] + }, + "id": 73, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "g", + "nameLocation": "65:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 70, + "nodeType": "ParameterList", + "parameters": [], + "src": "66:2:1" + }, + "returnParameters": + { + "id": 71, + "nodeType": "ParameterList", + "parameters": [], + "src": "78:0:1" + }, + "scope": 78, + "src": "56:24:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 76, + "nodeType": "Block", + "src": "107:2:1", + "statements": [] + }, + "id": 77, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "h", + "nameLocation": "94:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 74, + "nodeType": "ParameterList", + "parameters": [], + "src": "95:2:1" + }, + "returnParameters": + { + "id": 75, + "nodeType": "ParameterList", + "parameters": [], + "src": "107:0:1" + }, + "scope": 78, + "src": "85:24:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 79, + "src": "40:71:1", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "0:112:1" +}, +{ + "absolutePath": "A", + "exportedSymbols": + { + "A": + [ + 22 + ], + "B": + [ + 37 + ], + "L": + [ + 78 + ], + "free1": + [ + 65 + ], + "free2": + [ + 69 + ] + }, + "id": 38, + "nodeType": "SourceUnit", + "nodes": + [ + { + "absolutePath": "L", + "file": "L", + "id": 1, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 38, + "sourceUnit": 79, + "src": "0:11:2", + "symbolAliases": [], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "A", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 22, + "internalFunctionIDs": + { + "69": 1, + "73": 2, + "77": 3 + }, + "linearizedBaseContracts": + [ + 22 + ], + "name": "A", + "nameLocation": "21:1:2", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 20, + "nodeType": "Block", + "src": "49:60:2", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "expression": + { + "id": 4, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 78, + "src": "60:1:2", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$78_$", + "typeString": "type(library L)" + } + }, + "id": 6, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "62:1:2", + "memberName": "g", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "60:3:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 7, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "59:5:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 8, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "59:7:2", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 9, + "nodeType": "ExpressionStatement", + "src": "59:7:2" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "id": 10, + "name": "free2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 69, + "src": "77:5:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 11, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "76:7:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 12, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "76:9:2", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13, + "nodeType": "ExpressionStatement", + "src": "76:9:2" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "expression": + { + "id": 14, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 78, + "src": "96:1:2", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$78_$", + "typeString": "type(library L)" + } + }, + "id": 16, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "98:1:2", + "memberName": "h", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "96:3:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 17, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "95:5:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 18, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "95:7:2", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 19, + "nodeType": "ExpressionStatement", + "src": "95:7:2" + } + ] + }, + "functionSelector": "26121ff0", + "id": 21, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "38:1:2", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "39:2:2" + }, + "returnParameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "49:0:2" + }, + "scope": 22, + "src": "29:80:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 38, + "src": "12:99:2", + "usedErrors": [], + "usedEvents": [] + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "B", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 37, + "internalFunctionIDs": + { + "69": 1, + "77": 2 + }, + "linearizedBaseContracts": + [ + 37 + ], + "name": "B", + "nameLocation": "121:1:2", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 35, + "nodeType": "Block", + "src": "149:43:2", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "expression": + { + "id": 25, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 78, + "src": "160:1:2", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$78_$", + "typeString": "type(library L)" + } + }, + "id": 27, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "162:1:2", + "memberName": "h", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "160:3:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 28, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "159:5:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 29, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "159:7:2", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 30, + "nodeType": "ExpressionStatement", + "src": "159:7:2" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "id": 31, + "name": "free2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 69, + "src": "177:5:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 32, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "176:7:2", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 33, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "176:9:2", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 34, + "nodeType": "ExpressionStatement", + "src": "176:9:2" + } + ] + }, + "functionSelector": "26121ff0", + "id": 36, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "138:1:2", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 23, + "nodeType": "ParameterList", + "parameters": [], + "src": "139:2:2" + }, + "returnParameters": + { + "id": 24, + "nodeType": "ParameterList", + "parameters": [], + "src": "149:0:2" + }, + "scope": 37, + "src": "129:63:2", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 38, + "src": "112:82:2", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "0:195:2" +}, +{ + "absolutePath": "C", + "exportedSymbols": + { + "C": + [ + 60 + ], + "L": + [ + 78 + ], + "free1": + [ + 65 + ], + "free2": + [ + 69 + ] + }, + "id": 61, + "nodeType": "SourceUnit", + "nodes": + [ + { + "absolutePath": "L", + "file": "L", + "id": 39, + "nameLocation": "-1:-1:-1", + "nodeType": "ImportDirective", + "scope": 61, + "sourceUnit": 79, + "src": "0:11:3", + "symbolAliases": [], + "unitAlias": "" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 60, + "internalFunctionIDs": + { + "69": 1, + "73": 2, + "77": 3 + }, + "linearizedBaseContracts": + [ + 60 + ], + "name": "C", + "nameLocation": "21:1:3", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 58, + "nodeType": "Block", + "src": "49:60:3", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "expression": + { + "id": 42, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 78, + "src": "60:1:3", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$78_$", + "typeString": "type(library L)" + } + }, + "id": 44, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "62:1:3", + "memberName": "g", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "60:3:3", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 45, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "59:5:3", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 46, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "59:7:3", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 47, + "nodeType": "ExpressionStatement", + "src": "59:7:3" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "id": 48, + "name": "free2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 69, + "src": "77:5:3", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 49, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "76:7:3", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 50, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "76:9:3", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 51, + "nodeType": "ExpressionStatement", + "src": "76:9:3" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "expression": + { + "id": 52, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 78, + "src": "96:1:3", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$78_$", + "typeString": "type(library L)" + } + }, + "id": 54, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "98:1:3", + "memberName": "h", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "96:3:3", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 55, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "95:5:3", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 56, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "95:7:3", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 57, + "nodeType": "ExpressionStatement", + "src": "95:7:3" + } + ] + }, + "functionSelector": "26121ff0", + "id": 59, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "38:1:3", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 40, + "nodeType": "ParameterList", + "parameters": [], + "src": "39:2:3" + }, + "returnParameters": + { + "id": 41, + "nodeType": "ParameterList", + "parameters": [], + "src": "49:0:3" + }, + "scope": 60, + "src": "29:80:3", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 61, + "src": "12:99:3", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "0:112:3" +} +] diff --git a/test/libsolidity/ASTJSON/ast_internal_function_different_ids_export.sol b/test/libsolidity/ASTJSON/ast_internal_function_different_ids_export.sol new file mode 100644 index 000000000000..6e0b28c82ac3 --- /dev/null +++ b/test/libsolidity/ASTJSON/ast_internal_function_different_ids_export.sol @@ -0,0 +1,38 @@ +==== Source: L ==== + +function free1() {} +function free2() {} +library L { + function g() internal {} + function h() internal {} +} + +==== Source: A ==== + +import "L"; +contract A { + function f() public { + (L.g)(); + (free2)(); + (L.h)(); + } +} +contract B { + function f() public { + (L.h)(); + (free2)(); + } +} + +==== Source: C ==== + +import "L"; +contract C { + function f() public { + (L.g)(); + (free2)(); + (L.h)(); + } +} + +// ---- diff --git a/test/libsolidity/ASTJSON/ast_internal_function_id_export.json b/test/libsolidity/ASTJSON/ast_internal_function_id_export.json new file mode 100644 index 000000000000..d452f2d99fec --- /dev/null +++ b/test/libsolidity/ASTJSON/ast_internal_function_id_export.json @@ -0,0 +1,1562 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 128 + ], + "D": + [ + 141 + ], + "L": + [ + 53 + ], + "free1": + [ + 4 + ], + "free2": + [ + 8 + ], + "free3": + [ + 12 + ] + }, + "id": 142, + "nodeType": "SourceUnit", + "nodes": + [ + { + "body": + { + "id": 3, + "nodeType": "Block", + "src": "17:2:1", + "statements": [] + }, + "id": 4, + "implemented": true, + "kind": "freeFunction", + "modifiers": [], + "name": "free1", + "nameLocation": "9:5:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "14:2:1" + }, + "returnParameters": + { + "id": 2, + "nodeType": "ParameterList", + "parameters": [], + "src": "17:0:1" + }, + "scope": 142, + "src": "0:19:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 7, + "nodeType": "Block", + "src": "37:2:1", + "statements": [] + }, + "id": 8, + "implemented": true, + "kind": "freeFunction", + "modifiers": [], + "name": "free2", + "nameLocation": "29:5:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 5, + "nodeType": "ParameterList", + "parameters": [], + "src": "34:2:1" + }, + "returnParameters": + { + "id": 6, + "nodeType": "ParameterList", + "parameters": [], + "src": "37:0:1" + }, + "scope": 142, + "src": "20:19:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 11, + "nodeType": "Block", + "src": "57:2:1", + "statements": [] + }, + "id": 12, + "implemented": true, + "kind": "freeFunction", + "modifiers": [], + "name": "free3", + "nameLocation": "49:5:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 9, + "nodeType": "ParameterList", + "parameters": [], + "src": "54:2:1" + }, + "returnParameters": + { + "id": 10, + "nodeType": "ParameterList", + "parameters": [], + "src": "57:0:1" + }, + "scope": 142, + "src": "40:19:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "L", + "contractDependencies": [], + "contractKind": "library", + "fullyImplemented": true, + "id": 53, + "internalFunctionIDs": + { + "20": 3, + "24": 4, + "4": 1, + "8": 2 + }, + "linearizedBaseContracts": + [ + 53 + ], + "name": "L", + "nameLocation": "68:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 15, + "nodeType": "Block", + "src": "100:2:1", + "statements": [] + }, + "functionSelector": "cf9f23b5", + "id": 16, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ext", + "nameLocation": "85:3:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 13, + "nodeType": "ParameterList", + "parameters": [], + "src": "88:2:1" + }, + "returnParameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": [], + "src": "100:0:1" + }, + "scope": 53, + "src": "76:26:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "body": + { + "id": 19, + "nodeType": "Block", + "src": "132:2:1", + "statements": [] + }, + "id": 20, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "inr1", + "nameLocation": "116:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 17, + "nodeType": "ParameterList", + "parameters": [], + "src": "120:2:1" + }, + "returnParameters": + { + "id": 18, + "nodeType": "ParameterList", + "parameters": [], + "src": "132:0:1" + }, + "scope": 53, + "src": "107:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 23, + "nodeType": "Block", + "src": "164:2:1", + "statements": [] + }, + "id": 24, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "inr2", + "nameLocation": "148:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 21, + "nodeType": "ParameterList", + "parameters": [], + "src": "152:2:1" + }, + "returnParameters": + { + "id": 22, + "nodeType": "ParameterList", + "parameters": [], + "src": "164:0:1" + }, + "scope": 53, + "src": "139:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 27, + "nodeType": "Block", + "src": "196:2:1", + "statements": [] + }, + "id": 28, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "inr3", + "nameLocation": "180:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 25, + "nodeType": "ParameterList", + "parameters": [], + "src": "184:2:1" + }, + "returnParameters": + { + "id": 26, + "nodeType": "ParameterList", + "parameters": [], + "src": "196:0:1" + }, + "scope": 53, + "src": "171:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 39, + "nodeType": "Block", + "src": "228:51:1", + "statements": + [ + { + "expression": + { + "id": 31, + "name": "free1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "238:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 32, + "nodeType": "ExpressionStatement", + "src": "238:5:1" + }, + { + "expression": + { + "id": 33, + "name": "inr1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 20, + "src": "253:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 34, + "nodeType": "ExpressionStatement", + "src": "253:4:1" + }, + { + "expression": + { + "expression": + { + "id": 35, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "267:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$53_$", + "typeString": "type(library L)" + } + }, + "id": 37, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "269:3:1", + "memberName": "ext", + "nodeType": "MemberAccess", + "referencedDeclaration": 16, + "src": "267:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_delegatecall_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 38, + "nodeType": "ExpressionStatement", + "src": "267:5:1" + } + ] + }, + "functionSelector": "71907f17", + "id": 40, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "access", + "nameLocation": "212:6:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 29, + "nodeType": "ParameterList", + "parameters": [], + "src": "218:2:1" + }, + "returnParameters": + { + "id": 30, + "nodeType": "ParameterList", + "parameters": [], + "src": "228:0:1" + }, + "scope": 53, + "src": "203:76:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": + { + "id": 51, + "nodeType": "Block", + "src": "313:44:1", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "id": 43, + "name": "free2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8, + "src": "324:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 44, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "323:7:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 45, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "323:9:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 46, + "nodeType": "ExpressionStatement", + "src": "323:9:1" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "id": 47, + "name": "inr2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 24, + "src": "343:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 48, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "342:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 49, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "342:8:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 50, + "nodeType": "ExpressionStatement", + "src": "342:8:1" + } + ] + }, + "functionSelector": "4228dae0", + "id": 52, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "expression", + "nameLocation": "293:10:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 41, + "nodeType": "ParameterList", + "parameters": [], + "src": "303:2:1" + }, + "returnParameters": + { + "id": 42, + "nodeType": "ParameterList", + "parameters": [], + "src": "313:0:1" + }, + "scope": 53, + "src": "284:73:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 142, + "src": "60:299:1", + "usedErrors": [], + "usedEvents": [] + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 128, + "internalFunctionIDs": + { + "20": 3, + "24": 4, + "4": 1, + "69": 5, + "73": 6, + "8": 2 + }, + "linearizedBaseContracts": + [ + 128 + ], + "name": "C", + "nameLocation": "369:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 56, + "nodeType": "Block", + "src": "402:2:1", + "statements": [] + }, + "functionSelector": "05b07a6b", + "id": 57, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ext1", + "nameLocation": "386:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 54, + "nodeType": "ParameterList", + "parameters": [], + "src": "390:2:1" + }, + "returnParameters": + { + "id": 55, + "nodeType": "ParameterList", + "parameters": [], + "src": "402:0:1" + }, + "scope": 128, + "src": "377:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "body": + { + "id": 60, + "nodeType": "Block", + "src": "434:2:1", + "statements": [] + }, + "functionSelector": "5aa6e183", + "id": 61, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ext2", + "nameLocation": "418:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 58, + "nodeType": "ParameterList", + "parameters": [], + "src": "422:2:1" + }, + "returnParameters": + { + "id": 59, + "nodeType": "ParameterList", + "parameters": [], + "src": "434:0:1" + }, + "scope": 128, + "src": "409:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "body": + { + "id": 64, + "nodeType": "Block", + "src": "466:2:1", + "statements": [] + }, + "functionSelector": "0a77b8ef", + "id": 65, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ext3", + "nameLocation": "450:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 62, + "nodeType": "ParameterList", + "parameters": [], + "src": "454:2:1" + }, + "returnParameters": + { + "id": 63, + "nodeType": "ParameterList", + "parameters": [], + "src": "466:0:1" + }, + "scope": 128, + "src": "441:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "external" + }, + { + "body": + { + "id": 68, + "nodeType": "Block", + "src": "498:2:1", + "statements": [] + }, + "id": 69, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "inr1", + "nameLocation": "482:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 66, + "nodeType": "ParameterList", + "parameters": [], + "src": "486:2:1" + }, + "returnParameters": + { + "id": 67, + "nodeType": "ParameterList", + "parameters": [], + "src": "498:0:1" + }, + "scope": 128, + "src": "473:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 72, + "nodeType": "Block", + "src": "530:2:1", + "statements": [] + }, + "id": 73, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "inr2", + "nameLocation": "514:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 70, + "nodeType": "ParameterList", + "parameters": [], + "src": "518:2:1" + }, + "returnParameters": + { + "id": 71, + "nodeType": "ParameterList", + "parameters": [], + "src": "530:0:1" + }, + "scope": 128, + "src": "505:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 76, + "nodeType": "Block", + "src": "562:2:1", + "statements": [] + }, + "id": 77, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "inr3", + "nameLocation": "546:4:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 74, + "nodeType": "ParameterList", + "parameters": [], + "src": "550:2:1" + }, + "returnParameters": + { + "id": 75, + "nodeType": "ParameterList", + "parameters": [], + "src": "562:0:1" + }, + "scope": 128, + "src": "537:27:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 96, + "nodeType": "Block", + "src": "594:86:1", + "statements": + [ + { + "expression": + { + "expression": + { + "id": 80, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "604:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$128", + "typeString": "contract C" + } + }, + "id": 82, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "609:4:1", + "memberName": "ext1", + "nodeType": "MemberAccess", + "referencedDeclaration": 57, + "src": "604:9:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", + "typeString": "function () external" + } + }, + "id": 83, + "nodeType": "ExpressionStatement", + "src": "604:9:1" + }, + { + "expression": + { + "id": 84, + "name": "inr1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 69, + "src": "623:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 85, + "nodeType": "ExpressionStatement", + "src": "623:4:1" + }, + { + "expression": + { + "id": 86, + "name": "free1", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "637:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 87, + "nodeType": "ExpressionStatement", + "src": "637:5:1" + }, + { + "expression": + { + "expression": + { + "id": 88, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "652:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$53_$", + "typeString": "type(library L)" + } + }, + "id": 90, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "654:4:1", + "memberName": "inr1", + "nodeType": "MemberAccess", + "referencedDeclaration": 20, + "src": "652:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 91, + "nodeType": "ExpressionStatement", + "src": "652:6:1" + }, + { + "expression": + { + "expression": + { + "id": 92, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "668:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$53_$", + "typeString": "type(library L)" + } + }, + "id": 94, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "670:3:1", + "memberName": "ext", + "nodeType": "MemberAccess", + "referencedDeclaration": 16, + "src": "668:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_delegatecall_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 95, + "nodeType": "ExpressionStatement", + "src": "668:5:1" + } + ] + }, + "functionSelector": "71907f17", + "id": 97, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "access", + "nameLocation": "578:6:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 78, + "nodeType": "ParameterList", + "parameters": [], + "src": "584:2:1" + }, + "returnParameters": + { + "id": 79, + "nodeType": "ParameterList", + "parameters": [], + "src": "594:0:1" + }, + "scope": 128, + "src": "569:111:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": + { + "id": 126, + "nodeType": "Block", + "src": "714:106:1", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "expression": + { + "id": 100, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -28, + "src": "725:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$128", + "typeString": "contract C" + } + }, + "id": 102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "730:4:1", + "memberName": "ext2", + "nodeType": "MemberAccess", + "referencedDeclaration": 61, + "src": "725:9:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", + "typeString": "function () external" + } + } + ], + "id": 103, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "724:11:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", + "typeString": "function () external" + } + }, + "id": 104, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "724:13:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 105, + "nodeType": "ExpressionStatement", + "src": "724:13:1" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "id": 106, + "name": "inr2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 73, + "src": "748:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 107, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "747:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 108, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "747:8:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 109, + "nodeType": "ExpressionStatement", + "src": "747:8:1" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "id": 110, + "name": "free2", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8, + "src": "766:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 111, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "765:7:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 112, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "765:9:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 113, + "nodeType": "ExpressionStatement", + "src": "765:9:1" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "expression": + { + "id": 114, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "785:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$53_$", + "typeString": "type(library L)" + } + }, + "id": 116, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "787:4:1", + "memberName": "inr2", + "nodeType": "MemberAccess", + "referencedDeclaration": 24, + "src": "785:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 117, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "784:8:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 118, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "784:10:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 119, + "nodeType": "ExpressionStatement", + "src": "784:10:1" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "components": + [ + { + "expression": + { + "id": 120, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "805:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$53_$", + "typeString": "type(library L)" + } + }, + "id": 122, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "807:3:1", + "memberName": "ext", + "nodeType": "MemberAccess", + "referencedDeclaration": 16, + "src": "805:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_delegatecall_nonpayable$__$returns$__$", + "typeString": "function ()" + } + } + ], + "id": 123, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "804:7:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_delegatecall_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "804:9:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 125, + "nodeType": "ExpressionStatement", + "src": "804:9:1" + } + ] + }, + "functionSelector": "4228dae0", + "id": 127, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "expression", + "nameLocation": "694:10:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 98, + "nodeType": "ParameterList", + "parameters": [], + "src": "704:2:1" + }, + "returnParameters": + { + "id": 99, + "nodeType": "ParameterList", + "parameters": [], + "src": "714:0:1" + }, + "scope": 128, + "src": "685:135:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 142, + "src": "360:462:1", + "usedErrors": [], + "usedEvents": [] + }, + { + "abstract": false, + "baseContracts": + [ + { + "baseName": + { + "id": 129, + "name": "C", + "nameLocations": + [ + "837:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 128, + "src": "837:1:1" + }, + "id": 130, + "nodeType": "InheritanceSpecifier", + "src": "837:1:1" + } + ], + "canonicalName": "D", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 141, + "internalFunctionIDs": + { + "20": 3, + "24": 4, + "4": 1, + "69": 5, + "73": 6, + "8": 2 + }, + "linearizedBaseContracts": + [ + 141, + 128 + ], + "name": "D", + "nameLocation": "832:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 139, + "nodeType": "Block", + "src": "859:47:1", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 133, + "name": "access", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 97, + "src": "869:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 134, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "869:8:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 135, + "nodeType": "ExpressionStatement", + "src": "869:8:1" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 136, + "name": "expression", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 127, + "src": "887:10:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 137, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "887:12:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 138, + "nodeType": "ExpressionStatement", + "src": "887:12:1" + } + ] + }, + "id": 140, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 131, + "nodeType": "ParameterList", + "parameters": [], + "src": "856:2:1" + }, + "returnParameters": + { + "id": 132, + "nodeType": "ParameterList", + "parameters": [], + "src": "859:0:1" + }, + "scope": 141, + "src": "845:61:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 142, + "src": "823:85:1", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "0:909:1" +} diff --git a/test/libsolidity/ASTJSON/ast_internal_function_id_export.sol b/test/libsolidity/ASTJSON/ast_internal_function_id_export.sol new file mode 100644 index 000000000000..100897b71f03 --- /dev/null +++ b/test/libsolidity/ASTJSON/ast_internal_function_id_export.sol @@ -0,0 +1,48 @@ +function free1() {} +function free2() {} +function free3() {} +library L { + function ext() external {} + function inr1() internal {} + function inr2() internal {} + function inr3() internal {} + function access() public { + free1; + inr1; + L.ext; + } + function expression() public { + (free2)(); + (inr2)(); + } +} +contract C { + function ext1() external {} + function ext2() external {} + function ext3() external {} + function inr1() internal {} + function inr2() internal {} + function inr3() internal {} + function access() public { + this.ext1; + inr1; + free1; + L.inr1; + L.ext; + } + function expression() public { + (this.ext2)(); + (inr2)(); + (free2)(); + (L.inr2)(); + (L.ext)(); + } +} +contract D is C { + constructor() { + access(); + expression(); + } +} + +// ---- diff --git a/test/libsolidity/ASTJSON/base_constructor_call.json b/test/libsolidity/ASTJSON/base_constructor_call.json index 774981fa9417..2c3c68c40d3a 100644 --- a/test/libsolidity/ASTJSON/base_constructor_call.json +++ b/test/libsolidity/ASTJSON/base_constructor_call.json @@ -102,7 +102,8 @@ ], "scope": 18, "src": "0:35:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -219,7 +220,8 @@ ], "scope": 18, "src": "36:41:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:78:1" diff --git a/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json b/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json index 8af0c0b2ca14..730a05178c62 100644 --- a/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json +++ b/test/libsolidity/ASTJSON/base_constructor_call_parseOnly.json @@ -73,7 +73,8 @@ } ], "src": "0:35:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -169,7 +170,8 @@ } ], "src": "36:41:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:78:1" diff --git a/test/libsolidity/ASTJSON/constructor.json b/test/libsolidity/ASTJSON/constructor.json index 9ac4ac9c887d..53e622b5ddab 100644 --- a/test/libsolidity/ASTJSON/constructor.json +++ b/test/libsolidity/ASTJSON/constructor.json @@ -66,7 +66,8 @@ ], "scope": 6, "src": "0:34:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:35:1" diff --git a/test/libsolidity/ASTJSON/constructor_parseOnly.json b/test/libsolidity/ASTJSON/constructor_parseOnly.json index 19d647058a03..9b1d4cfc4460 100644 --- a/test/libsolidity/ASTJSON/constructor_parseOnly.json +++ b/test/libsolidity/ASTJSON/constructor_parseOnly.json @@ -50,7 +50,8 @@ } ], "src": "0:34:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:35:1" diff --git a/test/libsolidity/ASTJSON/contract_dep_order.json b/test/libsolidity/ASTJSON/contract_dep_order.json index 83865d7d4ce0..67eff600b68f 100644 --- a/test/libsolidity/ASTJSON/contract_dep_order.json +++ b/test/libsolidity/ASTJSON/contract_dep_order.json @@ -45,7 +45,8 @@ "nodes": [], "scope": 14, "src": "0:14:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -85,7 +86,8 @@ "nodes": [], "scope": 14, "src": "15:19:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -126,7 +128,8 @@ "nodes": [], "scope": 14, "src": "35:19:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -168,7 +171,8 @@ "nodes": [], "scope": 14, "src": "55:19:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -211,7 +215,8 @@ "nodes": [], "scope": 14, "src": "75:19:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:95:1" diff --git a/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json b/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json index 2c8bdc7456a4..ba8c377cf7cd 100644 --- a/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json +++ b/test/libsolidity/ASTJSON/contract_dep_order_parseOnly.json @@ -15,7 +15,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "0:14:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -46,7 +47,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "15:19:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -77,7 +79,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "35:19:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -108,7 +111,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "55:19:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -139,7 +143,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "75:19:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:95:1" diff --git a/test/libsolidity/ASTJSON/documentation.json b/test/libsolidity/ASTJSON/documentation.json index f31382d3ad93..43224bc64d1d 100644 --- a/test/libsolidity/ASTJSON/documentation.json +++ b/test/libsolidity/ASTJSON/documentation.json @@ -37,7 +37,8 @@ "nodes": [], "scope": 3, "src": "28:13:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "28:14:1" @@ -80,7 +81,8 @@ "nodes": [], "scope": 6, "src": "62:13:2", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "62:14:2" @@ -259,7 +261,11 @@ ], "scope": 24, "src": "0:213:3", - "usedErrors": [] + "usedErrors": [], + "usedEvents": + [ + 12 + ] } ], "src": "0:214:3" diff --git a/test/libsolidity/ASTJSON/documentation_local_variable.json b/test/libsolidity/ASTJSON/documentation_local_variable.json index 24e38eb1a92a..edaa89c18a5d 100644 --- a/test/libsolidity/ASTJSON/documentation_local_variable.json +++ b/test/libsolidity/ASTJSON/documentation_local_variable.json @@ -484,7 +484,8 @@ ], "scope": 42, "src": "0:666:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:667:1" diff --git a/test/libsolidity/ASTJSON/documentation_local_variable_parseOnly.json b/test/libsolidity/ASTJSON/documentation_local_variable_parseOnly.json index 93fd1c9bd1f7..8725838394e8 100644 --- a/test/libsolidity/ASTJSON/documentation_local_variable_parseOnly.json +++ b/test/libsolidity/ASTJSON/documentation_local_variable_parseOnly.json @@ -350,7 +350,8 @@ } ], "src": "0:666:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:667:1" diff --git a/test/libsolidity/ASTJSON/documentation_on_statements.json b/test/libsolidity/ASTJSON/documentation_on_statements.json index bb3ee28d13a9..f7b424ea60d7 100644 --- a/test/libsolidity/ASTJSON/documentation_on_statements.json +++ b/test/libsolidity/ASTJSON/documentation_on_statements.json @@ -369,7 +369,8 @@ ], "scope": 28, "src": "0:330:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:331:1" diff --git a/test/libsolidity/ASTJSON/documentation_on_statements_parseOnly.json b/test/libsolidity/ASTJSON/documentation_on_statements_parseOnly.json index bb265a4cc4de..3872027cbb54 100644 --- a/test/libsolidity/ASTJSON/documentation_on_statements_parseOnly.json +++ b/test/libsolidity/ASTJSON/documentation_on_statements_parseOnly.json @@ -253,7 +253,8 @@ } ], "src": "0:330:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:331:1" diff --git a/test/libsolidity/ASTJSON/documentation_parseOnly.json b/test/libsolidity/ASTJSON/documentation_parseOnly.json index b3cda7e19a3d..7f446279b613 100644 --- a/test/libsolidity/ASTJSON/documentation_parseOnly.json +++ b/test/libsolidity/ASTJSON/documentation_parseOnly.json @@ -23,7 +23,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "28:13:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "28:14:1" @@ -52,7 +53,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "62:13:2", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "62:14:2" @@ -197,7 +199,8 @@ } ], "src": "0:213:3", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:214:3" diff --git a/test/libsolidity/ASTJSON/documentation_triple.json b/test/libsolidity/ASTJSON/documentation_triple.json index 9124e68b1294..bd6f483b5a15 100644 --- a/test/libsolidity/ASTJSON/documentation_triple.json +++ b/test/libsolidity/ASTJSON/documentation_triple.json @@ -379,7 +379,8 @@ ], "scope": 29, "src": "0:267:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:268:1" diff --git a/test/libsolidity/ASTJSON/documentation_triple_parseOnly.json b/test/libsolidity/ASTJSON/documentation_triple_parseOnly.json index bd6612acc868..5ccc2631ca99 100644 --- a/test/libsolidity/ASTJSON/documentation_triple_parseOnly.json +++ b/test/libsolidity/ASTJSON/documentation_triple_parseOnly.json @@ -256,7 +256,8 @@ } ], "src": "0:267:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:268:1" diff --git a/test/libsolidity/ASTJSON/enum_natspec.json b/test/libsolidity/ASTJSON/enum_natspec.json new file mode 100644 index 000000000000..f3cc7b8df8aa --- /dev/null +++ b/test/libsolidity/ASTJSON/enum_natspec.json @@ -0,0 +1,48 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "Color": + [ + 4 + ] + }, + "id": 5, + "nodeType": "SourceUnit", + "nodes": + [ + { + "canonicalName": "Color", + "documentation": + { + "id": 1, + "nodeType": "StructuredDocumentation", + "src": "0:112:1", + "text": "@title example of title\n @author example of author\n @notice example of notice\n @dev example of dev" + }, + "id": 4, + "members": + [ + { + "id": 2, + "name": "Red", + "nameLocation": "129:3:1", + "nodeType": "EnumValue", + "src": "129:3:1" + }, + { + "id": 3, + "name": "Green", + "nameLocation": "138:5:1", + "nodeType": "EnumValue", + "src": "138:5:1" + } + ], + "name": "Color", + "nameLocation": "117:5:1", + "nodeType": "EnumDefinition", + "src": "112:33:1" + } + ], + "src": "112:34:1" +} diff --git a/test/libsolidity/ASTJSON/enum_natspec.sol b/test/libsolidity/ASTJSON/enum_natspec.sol new file mode 100644 index 000000000000..b9663fa9e6d0 --- /dev/null +++ b/test/libsolidity/ASTJSON/enum_natspec.sol @@ -0,0 +1,10 @@ +/// @title example of title +/// @author example of author +/// @notice example of notice +/// @dev example of dev +enum Color { + Red, + Green +} + +// ---- diff --git a/test/libsolidity/ASTJSON/enum_natspec_parseOnly.json b/test/libsolidity/ASTJSON/enum_natspec_parseOnly.json new file mode 100644 index 000000000000..b5a38af6c449 --- /dev/null +++ b/test/libsolidity/ASTJSON/enum_natspec_parseOnly.json @@ -0,0 +1,40 @@ +{ + "absolutePath": "a", + "id": 5, + "nodeType": "SourceUnit", + "nodes": + [ + { + "documentation": + { + "id": 1, + "nodeType": "StructuredDocumentation", + "src": "0:112:1", + "text": "@title example of title\n @author example of author\n @notice example of notice\n @dev example of dev" + }, + "id": 4, + "members": + [ + { + "id": 2, + "name": "Red", + "nameLocation": "129:3:1", + "nodeType": "EnumValue", + "src": "129:3:1" + }, + { + "id": 3, + "name": "Green", + "nameLocation": "138:5:1", + "nodeType": "EnumValue", + "src": "138:5:1" + } + ], + "name": "Color", + "nameLocation": "117:5:1", + "nodeType": "EnumDefinition", + "src": "112:33:1" + } + ], + "src": "112:34:1" +} diff --git a/test/libsolidity/ASTJSON/enum_value.json b/test/libsolidity/ASTJSON/enum_value.json index 2cca00902aec..31615f657b6a 100644 --- a/test/libsolidity/ASTJSON/enum_value.json +++ b/test/libsolidity/ASTJSON/enum_value.json @@ -56,7 +56,8 @@ ], "scope": 5, "src": "0:30:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:31:1" diff --git a/test/libsolidity/ASTJSON/enum_value_parseOnly.json b/test/libsolidity/ASTJSON/enum_value_parseOnly.json index 93b3cffcdee4..006e2db36077 100644 --- a/test/libsolidity/ASTJSON/enum_value_parseOnly.json +++ b/test/libsolidity/ASTJSON/enum_value_parseOnly.json @@ -41,7 +41,8 @@ } ], "src": "0:30:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:31:1" diff --git a/test/libsolidity/ASTJSON/event_aggregated_contract.json b/test/libsolidity/ASTJSON/event_aggregated_contract.json new file mode 100644 index 000000000000..e312320c126a --- /dev/null +++ b/test/libsolidity/ASTJSON/event_aggregated_contract.json @@ -0,0 +1,398 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 10 + ], + "D": + [ + 30 + ] + }, + "id": 31, + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 10, + "linearizedBaseContracts": + [ + 10 + ], + "name": "C", + "nameLocation": "9:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "ffae15ba29768297c9b951e2e14bc33dc84599d1572acc234266fc70392babc8", + "id": 2, + "name": "e", + "nameLocation": "23:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "24:2:1" + }, + "src": "17:10:1" + }, + { + "body": + { + "id": 8, + "nodeType": "Block", + "src": "52:25:1", + "statements": + [ + { + "eventCall": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 5, + "name": "e", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2, + "src": "67:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_event_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 6, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "67:3:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 7, + "nodeType": "EmitStatement", + "src": "62:8:1" + } + ] + }, + "functionSelector": "26121ff0", + "id": 9, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "41:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "42:2:1" + }, + "returnParameters": + { + "id": 4, + "nodeType": "ParameterList", + "parameters": [], + "src": "52:0:1" + }, + "scope": 10, + "src": "32:45:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 31, + "src": "0:79:1", + "usedErrors": [], + "usedEvents": + [ + 2 + ] + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "D", + "contractDependencies": + [ + 10 + ], + "contractKind": "contract", + "fullyImplemented": true, + "id": 30, + "linearizedBaseContracts": + [ + 30 + ], + "name": "D", + "nameLocation": "89:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "constant": false, + "id": 13, + "mutability": "mutable", + "name": "c", + "nameLocation": "99:1:1", + "nodeType": "VariableDeclaration", + "scope": 30, + "src": "97:3:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + }, + "typeName": + { + "id": 12, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 11, + "name": "C", + "nameLocations": + [ + "97:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 10, + "src": "97:1:1" + }, + "referencedDeclaration": 10, + "src": "97:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "visibility": "internal" + }, + { + "body": + { + "id": 28, + "nodeType": "Block", + "src": "120:43:1", + "statements": + [ + { + "expression": + { + "id": 21, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": + { + "id": 16, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13, + "src": "130:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 19, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "134:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_C_$10_$", + "typeString": "function () returns (contract C)" + }, + "typeName": + { + "id": 18, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 17, + "name": "C", + "nameLocations": + [ + "138:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 10, + "src": "138:1:1" + }, + "referencedDeclaration": 10, + "src": "138:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + } + }, + "id": 20, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "134:7:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "src": "130:11:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "id": 22, + "nodeType": "ExpressionStatement", + "src": "130:11:1" + }, + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "expression": + { + "id": 23, + "name": "c", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 13, + "src": "151:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_contract$_C_$10", + "typeString": "contract C" + } + }, + "id": 25, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "153:1:1", + "memberName": "f", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "151:3:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", + "typeString": "function () external" + } + }, + "id": 26, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "151:5:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 27, + "nodeType": "ExpressionStatement", + "src": "151:5:1" + } + ] + }, + "id": 29, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": [], + "src": "117:2:1" + }, + "returnParameters": + { + "id": 15, + "nodeType": "ParameterList", + "parameters": [], + "src": "120:0:1" + }, + "scope": 30, + "src": "106:57:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 31, + "src": "80:85:1", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "0:166:1" +} diff --git a/test/libsolidity/ASTJSON/event_aggregated_contract.sol b/test/libsolidity/ASTJSON/event_aggregated_contract.sol new file mode 100644 index 000000000000..b8fe2b27610b --- /dev/null +++ b/test/libsolidity/ASTJSON/event_aggregated_contract.sol @@ -0,0 +1,15 @@ +contract C { + event e(); + function f() public { + emit e(); + } +} +contract D { + C c; + constructor() { + c = new C(); + c.f(); + } +} + +// ---- diff --git a/test/libsolidity/ASTJSON/event_definition.json b/test/libsolidity/ASTJSON/event_definition.json index 0bb614c221d0..b59164fcb049 100644 --- a/test/libsolidity/ASTJSON/event_definition.json +++ b/test/libsolidity/ASTJSON/event_definition.json @@ -47,7 +47,11 @@ ], "scope": 4, "src": "0:25:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": + [ + 2 + ] } ], "src": "0:26:1" diff --git a/test/libsolidity/ASTJSON/event_definition_parseOnly.json b/test/libsolidity/ASTJSON/event_definition_parseOnly.json index ee5773a3b184..9116b3d2da28 100644 --- a/test/libsolidity/ASTJSON/event_definition_parseOnly.json +++ b/test/libsolidity/ASTJSON/event_definition_parseOnly.json @@ -32,7 +32,8 @@ } ], "src": "0:25:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:26:1" diff --git a/test/libsolidity/ASTJSON/event_emited_in_base_contract.json b/test/libsolidity/ASTJSON/event_emited_in_base_contract.json new file mode 100644 index 000000000000..6b183b493111 --- /dev/null +++ b/test/libsolidity/ASTJSON/event_emited_in_base_contract.json @@ -0,0 +1,289 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "B": + [ + 16 + ], + "C": + [ + 19 + ], + "L": + [ + 5 + ] + }, + "id": 20, + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "canonicalName": "L", + "contractDependencies": [], + "contractKind": "library", + "fullyImplemented": true, + "id": 5, + "linearizedBaseContracts": + [ + 5 + ], + "name": "L", + "nameLocation": "10:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "870e3024466c178150e2490c7cfb455e33c0db877113af040f89189d07946664", + "id": 4, + "name": "E", + "nameLocation": "20:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 2, + "indexed": false, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 4, + "src": "22:5:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": + { + "id": 1, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "22:5:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + } + ], + "src": "21:7:1" + }, + "src": "14:15:1" + } + ], + "scope": 20, + "src": "0:31:1", + "usedErrors": [], + "usedEvents": + [ + 4 + ] + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "B", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 16, + "linearizedBaseContracts": + [ + 16 + ], + "name": "B", + "nameLocation": "41:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 14, + "nodeType": "Block", + "src": "63:28:1", + "statements": + [ + { + "eventCall": + { + "arguments": + [ + { + "hexValue": "30", + "id": 11, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "82:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": + { + "argumentTypes": + [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "expression": + { + "id": 8, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 5, + "src": "78:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$5_$", + "typeString": "type(library L)" + } + }, + "id": 10, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "80:1:1", + "memberName": "E", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "78:3:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_event_nonpayable$_t_uint8_$returns$__$", + "typeString": "function (uint8)" + } + }, + "id": 12, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "78:6:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 13, + "nodeType": "EmitStatement", + "src": "73:11:1" + } + ] + }, + "id": 15, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 6, + "nodeType": "ParameterList", + "parameters": [], + "src": "60:2:1" + }, + "returnParameters": + { + "id": 7, + "nodeType": "ParameterList", + "parameters": [], + "src": "63:0:1" + }, + "scope": 16, + "src": "49:42:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 20, + "src": "32:61:1", + "usedErrors": [], + "usedEvents": + [ + 4 + ] + }, + { + "abstract": false, + "baseContracts": + [ + { + "baseName": + { + "id": 17, + "name": "B", + "nameLocations": + [ + "108:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 16, + "src": "108:1:1" + }, + "id": 18, + "nodeType": "InheritanceSpecifier", + "src": "108:1:1" + } + ], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 19, + "linearizedBaseContracts": + [ + 19, + 16 + ], + "name": "C", + "nameLocation": "103:1:1", + "nodeType": "ContractDefinition", + "nodes": [], + "scope": 20, + "src": "94:18:1", + "usedErrors": [], + "usedEvents": + [ + 4 + ] + } + ], + "src": "0:113:1" +} diff --git a/test/libsolidity/ASTJSON/event_emited_in_base_contract.sol b/test/libsolidity/ASTJSON/event_emited_in_base_contract.sol new file mode 100644 index 000000000000..30380323323a --- /dev/null +++ b/test/libsolidity/ASTJSON/event_emited_in_base_contract.sol @@ -0,0 +1,9 @@ +library L { event E(uint8); } +contract B { + constructor() { + emit L.E(0); + } +} +contract C is B {} + +// ---- diff --git a/test/libsolidity/ASTJSON/event_inheritance.json b/test/libsolidity/ASTJSON/event_inheritance.json new file mode 100644 index 000000000000..afa79e916c3c --- /dev/null +++ b/test/libsolidity/ASTJSON/event_inheritance.json @@ -0,0 +1,194 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "B": + [ + 3 + ], + "C": + [ + 8 + ], + "D": + [ + 13 + ] + }, + "id": 14, + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "canonicalName": "B", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": true, + "id": 3, + "linearizedBaseContracts": + [ + 3 + ], + "name": "B", + "nameLocation": "10:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "dbec0351ad6bb0c1f07ea56e236e3e692fde2259f0165fd422f241da339b7e4f", + "id": 2, + "name": "EB", + "nameLocation": "24:2:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "26:2:1" + }, + "src": "18:11:1" + } + ], + "scope": 14, + "src": "0:31:1", + "usedErrors": [], + "usedEvents": + [ + 2 + ] + }, + { + "abstract": false, + "baseContracts": + [ + { + "baseName": + { + "id": 4, + "name": "B", + "nameLocations": + [ + "46:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 3, + "src": "46:1:1" + }, + "id": 5, + "nodeType": "InheritanceSpecifier", + "src": "46:1:1" + } + ], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 8, + "linearizedBaseContracts": + [ + 8, + 3 + ], + "name": "C", + "nameLocation": "41:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "a08b3367d3fa83ea27f8951ffb5d9d160cbfadbd80816b47f677e7699d76f5a0", + "id": 7, + "name": "EC", + "nameLocation": "60:2:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 6, + "nodeType": "ParameterList", + "parameters": [], + "src": "62:2:1" + }, + "src": "54:11:1" + } + ], + "scope": 14, + "src": "32:35:1", + "usedErrors": [], + "usedEvents": + [ + 2, + 7 + ] + }, + { + "abstract": false, + "baseContracts": + [ + { + "baseName": + { + "id": 9, + "name": "C", + "nameLocations": + [ + "82:1:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 8, + "src": "82:1:1" + }, + "id": 10, + "nodeType": "InheritanceSpecifier", + "src": "82:1:1" + } + ], + "canonicalName": "D", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 13, + "linearizedBaseContracts": + [ + 13, + 8, + 3 + ], + "name": "D", + "nameLocation": "77:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "caa54b91a2314ab89b39714b1cd283762e53a2f59cfb997d6770e2824c39db0d", + "id": 12, + "name": "ED", + "nameLocation": "96:2:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "98:2:1" + }, + "src": "90:11:1" + } + ], + "scope": 14, + "src": "68:35:1", + "usedErrors": [], + "usedEvents": + [ + 2, + 7, + 12 + ] + } + ], + "src": "0:104:1" +} diff --git a/test/libsolidity/ASTJSON/event_inheritance.sol b/test/libsolidity/ASTJSON/event_inheritance.sol new file mode 100644 index 000000000000..72687375337d --- /dev/null +++ b/test/libsolidity/ASTJSON/event_inheritance.sol @@ -0,0 +1,11 @@ +interface B { + event EB(); +} +contract C is B { + event EC(); +} +contract D is C { + event ED(); +} + +// ---- diff --git a/test/libsolidity/ASTJSON/event_with_variables_of_internal_types_parseOnly.json b/test/libsolidity/ASTJSON/event_with_variables_of_internal_types_parseOnly.json index 0c90ee840fab..3ff426cb2230 100644 --- a/test/libsolidity/ASTJSON/event_with_variables_of_internal_types_parseOnly.json +++ b/test/libsolidity/ASTJSON/event_with_variables_of_internal_types_parseOnly.json @@ -71,7 +71,8 @@ } ], "src": "0:48:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:49:1" diff --git a/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json b/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json index 5368d586247a..f1d958617427 100644 --- a/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json +++ b/test/libsolidity/ASTJSON/fail_after_parsing_parseOnly.json @@ -289,7 +289,8 @@ } ], "src": "21:154:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:176:1" diff --git a/test/libsolidity/ASTJSON/fallback.json b/test/libsolidity/ASTJSON/fallback.json index 25a9b8588e43..f68c72ce6600 100644 --- a/test/libsolidity/ASTJSON/fallback.json +++ b/test/libsolidity/ASTJSON/fallback.json @@ -66,7 +66,8 @@ ], "scope": 6, "src": "0:50:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:51:1" diff --git a/test/libsolidity/ASTJSON/fallback_and_reveice_ether.json b/test/libsolidity/ASTJSON/fallback_and_receive_ether.json similarity index 98% rename from test/libsolidity/ASTJSON/fallback_and_reveice_ether.json rename to test/libsolidity/ASTJSON/fallback_and_receive_ether.json index 26b4ada77ff6..f41559d2a640 100644 --- a/test/libsolidity/ASTJSON/fallback_and_reveice_ether.json +++ b/test/libsolidity/ASTJSON/fallback_and_receive_ether.json @@ -101,7 +101,8 @@ ], "scope": 10, "src": "0:85:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:86:1" diff --git a/test/libsolidity/ASTJSON/fallback_and_reveice_ether.sol b/test/libsolidity/ASTJSON/fallback_and_receive_ether.sol similarity index 100% rename from test/libsolidity/ASTJSON/fallback_and_reveice_ether.sol rename to test/libsolidity/ASTJSON/fallback_and_receive_ether.sol diff --git a/test/libsolidity/ASTJSON/fallback_and_reveice_ether_parseOnly.json b/test/libsolidity/ASTJSON/fallback_and_receive_ether_parseOnly.json similarity index 97% rename from test/libsolidity/ASTJSON/fallback_and_reveice_ether_parseOnly.json rename to test/libsolidity/ASTJSON/fallback_and_receive_ether_parseOnly.json index 55804a9f59e1..215bf3a83bd9 100644 --- a/test/libsolidity/ASTJSON/fallback_and_reveice_ether_parseOnly.json +++ b/test/libsolidity/ASTJSON/fallback_and_receive_ether_parseOnly.json @@ -85,7 +85,8 @@ } ], "src": "0:85:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:86:1" diff --git a/test/libsolidity/ASTJSON/fallback_parseOnly.json b/test/libsolidity/ASTJSON/fallback_parseOnly.json index 4d626dcbab8b..eb81fafbe930 100644 --- a/test/libsolidity/ASTJSON/fallback_parseOnly.json +++ b/test/libsolidity/ASTJSON/fallback_parseOnly.json @@ -51,7 +51,8 @@ } ], "src": "0:50:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:51:1" diff --git a/test/libsolidity/ASTJSON/fallback_payable.json b/test/libsolidity/ASTJSON/fallback_payable.json index 4331b5edf3e8..790351764550 100644 --- a/test/libsolidity/ASTJSON/fallback_payable.json +++ b/test/libsolidity/ASTJSON/fallback_payable.json @@ -66,7 +66,8 @@ ], "scope": 6, "src": "0:38:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:39:1" diff --git a/test/libsolidity/ASTJSON/fallback_payable_parseOnly.json b/test/libsolidity/ASTJSON/fallback_payable_parseOnly.json index 2d029e56a393..e1810828a39d 100644 --- a/test/libsolidity/ASTJSON/fallback_payable_parseOnly.json +++ b/test/libsolidity/ASTJSON/fallback_payable_parseOnly.json @@ -51,7 +51,8 @@ } ], "src": "0:38:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:39:1" diff --git a/test/libsolidity/ASTJSON/function_type.json b/test/libsolidity/ASTJSON/function_type.json index 924f9cdb9a63..e1a5156cf77d 100644 --- a/test/libsolidity/ASTJSON/function_type.json +++ b/test/libsolidity/ASTJSON/function_type.json @@ -225,7 +225,8 @@ ], "scope": 18, "src": "0:131:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:132:1" diff --git a/test/libsolidity/ASTJSON/function_type_parseOnly.json b/test/libsolidity/ASTJSON/function_type_parseOnly.json index fd1d7637b071..64b09d5d9d9b 100644 --- a/test/libsolidity/ASTJSON/function_type_parseOnly.json +++ b/test/libsolidity/ASTJSON/function_type_parseOnly.json @@ -173,7 +173,8 @@ } ], "src": "0:131:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:132:1" diff --git a/test/libsolidity/ASTJSON/indirect_event.json b/test/libsolidity/ASTJSON/indirect_event.json new file mode 100644 index 000000000000..fcbe81756275 --- /dev/null +++ b/test/libsolidity/ASTJSON/indirect_event.json @@ -0,0 +1,319 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 25 + ], + "L": + [ + 10 + ] + }, + "id": 26, + "license": "GPL-3.0", + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "canonicalName": "L", + "contractDependencies": [], + "contractKind": "library", + "fullyImplemented": true, + "id": 10, + "linearizedBaseContracts": + [ + 10 + ], + "name": "L", + "nameLocation": "44:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "92bbf6e823a631f3c8e09b1c8df90f378fb56f7fbc9701827e1ff8aad7f6a028", + "id": 2, + "name": "E", + "nameLocation": "58:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "59:2:1" + }, + "src": "52:10:1" + }, + { + "body": + { + "id": 8, + "nodeType": "Block", + "src": "89:13:1", + "statements": + [ + { + "eventCall": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 5, + "name": "E", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2, + "src": "96:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_event_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 6, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "96:3:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 7, + "nodeType": "EmitStatement", + "src": "91:8:1" + } + ] + }, + "id": 9, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "76:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "77:2:1" + }, + "returnParameters": + { + "id": 4, + "nodeType": "ParameterList", + "parameters": [], + "src": "89:0:1" + }, + "scope": 10, + "src": "67:35:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "scope": 26, + "src": "36:68:1", + "usedErrors": [], + "usedEvents": + [ + 2 + ] + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 25, + "linearizedBaseContracts": + [ + 25 + ], + "name": "C", + "nameLocation": "114:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "eventSelector": "70a5d861ef9816388422765f41d618eb3abdf490acb37354b539729e37b09f0e", + "id": 12, + "name": "H", + "nameLocation": "128:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "129:2:1" + }, + "src": "122:10:1" + }, + { + "body": + { + "id": 23, + "nodeType": "Block", + "src": "157:20:1", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "expression": + { + "id": 15, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 10, + "src": "159:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_type$_t_contract$_L_$10_$", + "typeString": "type(library L)" + } + }, + "id": 17, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "161:1:1", + "memberName": "f", + "nodeType": "MemberAccess", + "referencedDeclaration": 9, + "src": "159:3:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 18, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "159:5:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 19, + "nodeType": "ExpressionStatement", + "src": "159:5:1" + }, + { + "eventCall": + { + "arguments": [], + "expression": + { + "argumentTypes": [], + "id": 20, + "name": "H", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12, + "src": "171:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_function_event_nonpayable$__$returns$__$", + "typeString": "function ()" + } + }, + "id": 21, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "171:3:1", + "tryCall": false, + "typeDescriptions": + { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 22, + "nodeType": "EmitStatement", + "src": "166:8:1" + } + ] + }, + "functionSelector": "e2179b8e", + "id": 24, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "g", + "nameLocation": "146:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 13, + "nodeType": "ParameterList", + "parameters": [], + "src": "147:2:1" + }, + "returnParameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": [], + "src": "157:0:1" + }, + "scope": 25, + "src": "137:40:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 26, + "src": "105:74:1", + "usedErrors": [], + "usedEvents": + [ + 2, + 12 + ] + } + ], + "src": "36:144:1" +} diff --git a/test/libsolidity/ASTJSON/indirect_event.sol b/test/libsolidity/ASTJSON/indirect_event.sol new file mode 100644 index 000000000000..c4bba01c208c --- /dev/null +++ b/test/libsolidity/ASTJSON/indirect_event.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-3.0 +library L { + event E(); + function f() internal { emit E(); } +} +contract C { + event H(); + function g() public { L.f(); emit H(); } +} + +// ---- diff --git a/test/libsolidity/ASTJSON/indirect_event_parseOnly.json b/test/libsolidity/ASTJSON/indirect_event_parseOnly.json new file mode 100644 index 000000000000..17ca036d3259 --- /dev/null +++ b/test/libsolidity/ASTJSON/indirect_event_parseOnly.json @@ -0,0 +1,228 @@ +{ + "absolutePath": "a", + "id": 26, + "license": "GPL-3.0", + "nodeType": "SourceUnit", + "nodes": + [ + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "library", + "id": 10, + "name": "L", + "nameLocation": "44:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "id": 2, + "name": "E", + "nameLocation": "58:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 1, + "nodeType": "ParameterList", + "parameters": [], + "src": "59:2:1" + }, + "src": "52:10:1" + }, + { + "body": + { + "id": 8, + "nodeType": "Block", + "src": "89:13:1", + "statements": + [ + { + "eventCall": + { + "arguments": [], + "expression": + { + "id": 5, + "name": "E", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "96:1:1", + "typeDescriptions": {} + }, + "id": 6, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "96:3:1", + "tryCall": false, + "typeDescriptions": {} + }, + "id": 7, + "nodeType": "EmitStatement", + "src": "91:8:1" + } + ] + }, + "id": 9, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "76:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 3, + "nodeType": "ParameterList", + "parameters": [], + "src": "77:2:1" + }, + "returnParameters": + { + "id": 4, + "nodeType": "ParameterList", + "parameters": [], + "src": "89:0:1" + }, + "src": "67:35:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + } + ], + "src": "36:68:1", + "usedErrors": [], + "usedEvents": [] + }, + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "id": 25, + "name": "C", + "nameLocation": "114:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "anonymous": false, + "id": 12, + "name": "H", + "nameLocation": "128:1:1", + "nodeType": "EventDefinition", + "parameters": + { + "id": 11, + "nodeType": "ParameterList", + "parameters": [], + "src": "129:2:1" + }, + "src": "122:10:1" + }, + { + "body": + { + "id": 23, + "nodeType": "Block", + "src": "157:20:1", + "statements": + [ + { + "expression": + { + "arguments": [], + "expression": + { + "expression": + { + "id": 15, + "name": "L", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "159:1:1", + "typeDescriptions": {} + }, + "id": 17, + "memberLocation": "161:1:1", + "memberName": "f", + "nodeType": "MemberAccess", + "src": "159:3:1", + "typeDescriptions": {} + }, + "id": 18, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "159:5:1", + "tryCall": false, + "typeDescriptions": {} + }, + "id": 19, + "nodeType": "ExpressionStatement", + "src": "159:5:1" + }, + { + "eventCall": + { + "arguments": [], + "expression": + { + "id": 20, + "name": "H", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "src": "171:1:1", + "typeDescriptions": {} + }, + "id": 21, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "171:3:1", + "tryCall": false, + "typeDescriptions": {} + }, + "id": 22, + "nodeType": "EmitStatement", + "src": "166:8:1" + } + ] + }, + "id": 24, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "g", + "nameLocation": "146:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 13, + "nodeType": "ParameterList", + "parameters": [], + "src": "147:2:1" + }, + "returnParameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": [], + "src": "157:0:1" + }, + "src": "137:40:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "src": "105:74:1", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "36:144:1" +} diff --git a/test/libsolidity/ASTJSON/inheritance_specifier.json b/test/libsolidity/ASTJSON/inheritance_specifier.json index 8959d5b5d42c..ae210c949620 100644 --- a/test/libsolidity/ASTJSON/inheritance_specifier.json +++ b/test/libsolidity/ASTJSON/inheritance_specifier.json @@ -33,7 +33,8 @@ "nodes": [], "scope": 5, "src": "0:14:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -73,7 +74,8 @@ "nodes": [], "scope": 5, "src": "15:20:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:36:1" diff --git a/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json b/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json index 72da9ad2cc5c..171391b36d5e 100644 --- a/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json +++ b/test/libsolidity/ASTJSON/inheritance_specifier_parseOnly.json @@ -15,7 +15,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "0:14:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -46,7 +47,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "15:20:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:36:1" diff --git a/test/libsolidity/ASTJSON/license.json b/test/libsolidity/ASTJSON/license.json index 9f996e0517e3..4c0882637f2d 100644 --- a/test/libsolidity/ASTJSON/license.json +++ b/test/libsolidity/ASTJSON/license.json @@ -30,7 +30,8 @@ "nodes": [], "scope": 2, "src": "36:13:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "36:14:1" diff --git a/test/libsolidity/ASTJSON/license_parseOnly.json b/test/libsolidity/ASTJSON/license_parseOnly.json index 748b2548acde..f2958f15ffad 100644 --- a/test/libsolidity/ASTJSON/license_parseOnly.json +++ b/test/libsolidity/ASTJSON/license_parseOnly.json @@ -16,7 +16,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "36:13:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "36:14:1" diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation.json index 8340eaf40437..9bcd5e8fd9f2 100644 --- a/test/libsolidity/ASTJSON/long_type_name_binary_operation.json +++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation.json @@ -168,7 +168,8 @@ ], "scope": 12, "src": "0:54:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:55:1" diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation_parseOnly.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation_parseOnly.json index df2db39266e3..2cb372dd26ac 100644 --- a/test/libsolidity/ASTJSON/long_type_name_binary_operation_parseOnly.json +++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation_parseOnly.json @@ -115,7 +115,8 @@ } ], "src": "0:54:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:55:1" diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier.json b/test/libsolidity/ASTJSON/long_type_name_identifier.json index c810283d29ad..c22aeb40c28b 100644 --- a/test/libsolidity/ASTJSON/long_type_name_identifier.json +++ b/test/libsolidity/ASTJSON/long_type_name_identifier.json @@ -177,7 +177,8 @@ ], "scope": 16, "src": "0:70:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:71:1" diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier_parseOnly.json b/test/libsolidity/ASTJSON/long_type_name_identifier_parseOnly.json index ef76f30aa5b8..1bf50bed601c 100644 --- a/test/libsolidity/ASTJSON/long_type_name_identifier_parseOnly.json +++ b/test/libsolidity/ASTJSON/long_type_name_identifier_parseOnly.json @@ -130,7 +130,8 @@ } ], "src": "0:70:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:71:1" diff --git a/test/libsolidity/ASTJSON/mappings.json b/test/libsolidity/ASTJSON/mappings.json index 0bf816eb497b..81bf19db1a85 100644 --- a/test/libsolidity/ASTJSON/mappings.json +++ b/test/libsolidity/ASTJSON/mappings.json @@ -315,7 +315,8 @@ ], "scope": 24, "src": "0:173:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:174:1" diff --git a/test/libsolidity/ASTJSON/mappings_parseOnly.json b/test/libsolidity/ASTJSON/mappings_parseOnly.json index 9690f7c9efe0..84cfb4004a4d 100644 --- a/test/libsolidity/ASTJSON/mappings_parseOnly.json +++ b/test/libsolidity/ASTJSON/mappings_parseOnly.json @@ -228,7 +228,8 @@ } ], "src": "0:173:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:174:1" diff --git a/test/libsolidity/ASTJSON/modifier_definition.json b/test/libsolidity/ASTJSON/modifier_definition.json index aa448568c1ff..30ebcb7c20b2 100644 --- a/test/libsolidity/ASTJSON/modifier_definition.json +++ b/test/libsolidity/ASTJSON/modifier_definition.json @@ -169,7 +169,8 @@ ], "scope": 15, "src": "0:68:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:69:1" diff --git a/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json b/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json index 9344e419a17f..f8067952a28c 100644 --- a/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json +++ b/test/libsolidity/ASTJSON/modifier_definition_parseOnly.json @@ -134,7 +134,8 @@ } ], "src": "0:68:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:69:1" diff --git a/test/libsolidity/ASTJSON/modifier_invocation.json b/test/libsolidity/ASTJSON/modifier_invocation.json index aa448568c1ff..30ebcb7c20b2 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation.json +++ b/test/libsolidity/ASTJSON/modifier_invocation.json @@ -169,7 +169,8 @@ ], "scope": 15, "src": "0:68:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:69:1" diff --git a/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json b/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json index 9344e419a17f..f8067952a28c 100644 --- a/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json +++ b/test/libsolidity/ASTJSON/modifier_invocation_parseOnly.json @@ -134,7 +134,8 @@ } ], "src": "0:68:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:69:1" diff --git a/test/libsolidity/ASTJSON/mutability.json b/test/libsolidity/ASTJSON/mutability.json index 90bbf05d580c..b6318d84e5e9 100644 --- a/test/libsolidity/ASTJSON/mutability.json +++ b/test/libsolidity/ASTJSON/mutability.json @@ -178,7 +178,8 @@ ], "scope": 11, "src": "0:102:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:103:1" diff --git a/test/libsolidity/ASTJSON/mutability_parseOnly.json b/test/libsolidity/ASTJSON/mutability_parseOnly.json index 88d3968f2884..637f8e11416c 100644 --- a/test/libsolidity/ASTJSON/mutability_parseOnly.json +++ b/test/libsolidity/ASTJSON/mutability_parseOnly.json @@ -110,7 +110,8 @@ } ], "src": "0:102:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:103:1" diff --git a/test/libsolidity/ASTJSON/non_utf8.json b/test/libsolidity/ASTJSON/non_utf8.json index 926f858b5e94..0058e56eb322 100644 --- a/test/libsolidity/ASTJSON/non_utf8.json +++ b/test/libsolidity/ASTJSON/non_utf8.json @@ -230,7 +230,8 @@ ], "scope": 16, "src": "0:80:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:81:1" diff --git a/test/libsolidity/ASTJSON/non_utf8_parseOnly.json b/test/libsolidity/ASTJSON/non_utf8_parseOnly.json index ef265cbe4fdb..bbc350f96dfe 100644 --- a/test/libsolidity/ASTJSON/non_utf8_parseOnly.json +++ b/test/libsolidity/ASTJSON/non_utf8_parseOnly.json @@ -149,7 +149,8 @@ } ], "src": "0:80:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:81:1" diff --git a/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json b/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json index de14043f3415..ea08150fd372 100644 --- a/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json +++ b/test/libsolidity/ASTJSON/not_existing_import_parseOnly.json @@ -111,7 +111,8 @@ } ], "src": "41:90:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:132:1" diff --git a/test/libsolidity/ASTJSON/override.json b/test/libsolidity/ASTJSON/override.json index a7c43767f5d6..35d36eac4e9f 100644 --- a/test/libsolidity/ASTJSON/override.json +++ b/test/libsolidity/ASTJSON/override.json @@ -75,7 +75,8 @@ ], "scope": 30, "src": "0:48:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": true, @@ -193,7 +194,8 @@ ], "scope": 30, "src": "49:103:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -330,7 +332,8 @@ ], "scope": 30, "src": "153:91:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:245:1" diff --git a/test/libsolidity/ASTJSON/override_parseOnly.json b/test/libsolidity/ASTJSON/override_parseOnly.json index fe9d8a7c633c..3a927f5f2f12 100644 --- a/test/libsolidity/ASTJSON/override_parseOnly.json +++ b/test/libsolidity/ASTJSON/override_parseOnly.json @@ -51,7 +51,8 @@ } ], "src": "0:48:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": true, @@ -152,7 +153,8 @@ } ], "src": "49:103:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -267,7 +269,8 @@ } ], "src": "153:91:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:245:1" diff --git a/test/libsolidity/ASTJSON/placeholder_statement.json b/test/libsolidity/ASTJSON/placeholder_statement.json index 5a6d51b21821..96a46c1484c3 100644 --- a/test/libsolidity/ASTJSON/placeholder_statement.json +++ b/test/libsolidity/ASTJSON/placeholder_statement.json @@ -61,7 +61,8 @@ ], "scope": 6, "src": "0:32:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:33:1" diff --git a/test/libsolidity/ASTJSON/placeholder_statement_parseOnly.json b/test/libsolidity/ASTJSON/placeholder_statement_parseOnly.json index 8f73cde60253..8af17040246f 100644 --- a/test/libsolidity/ASTJSON/placeholder_statement_parseOnly.json +++ b/test/libsolidity/ASTJSON/placeholder_statement_parseOnly.json @@ -47,7 +47,8 @@ } ], "src": "0:32:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:33:1" diff --git a/test/libsolidity/ASTJSON/receive_ether.json b/test/libsolidity/ASTJSON/receive_ether.json index bfcb33f6cbd6..2790493993ee 100644 --- a/test/libsolidity/ASTJSON/receive_ether.json +++ b/test/libsolidity/ASTJSON/receive_ether.json @@ -66,7 +66,8 @@ ], "scope": 6, "src": "0:49:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:50:1" diff --git a/test/libsolidity/ASTJSON/receive_ether_parseOnly.json b/test/libsolidity/ASTJSON/receive_ether_parseOnly.json index 413c10564a3e..f9aede155ec7 100644 --- a/test/libsolidity/ASTJSON/receive_ether_parseOnly.json +++ b/test/libsolidity/ASTJSON/receive_ether_parseOnly.json @@ -51,7 +51,8 @@ } ], "src": "0:49:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:50:1" diff --git a/test/libsolidity/ASTJSON/short_type_name.json b/test/libsolidity/ASTJSON/short_type_name.json index b7409fbbcb32..1c1138cbafb3 100644 --- a/test/libsolidity/ASTJSON/short_type_name.json +++ b/test/libsolidity/ASTJSON/short_type_name.json @@ -122,7 +122,8 @@ ], "scope": 12, "src": "0:55:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:56:1" diff --git a/test/libsolidity/ASTJSON/short_type_name_parseOnly.json b/test/libsolidity/ASTJSON/short_type_name_parseOnly.json index 02590363a97c..3c4acfa775ed 100644 --- a/test/libsolidity/ASTJSON/short_type_name_parseOnly.json +++ b/test/libsolidity/ASTJSON/short_type_name_parseOnly.json @@ -93,7 +93,8 @@ } ], "src": "0:55:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:56:1" diff --git a/test/libsolidity/ASTJSON/short_type_name_ref.json b/test/libsolidity/ASTJSON/short_type_name_ref.json index 6a0f249f826e..447b1e5b7705 100644 --- a/test/libsolidity/ASTJSON/short_type_name_ref.json +++ b/test/libsolidity/ASTJSON/short_type_name_ref.json @@ -133,7 +133,8 @@ ], "scope": 13, "src": "0:60:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:61:1" diff --git a/test/libsolidity/ASTJSON/short_type_name_ref_parseOnly.json b/test/libsolidity/ASTJSON/short_type_name_ref_parseOnly.json index 00799a2124d8..07c782d47bb4 100644 --- a/test/libsolidity/ASTJSON/short_type_name_ref_parseOnly.json +++ b/test/libsolidity/ASTJSON/short_type_name_ref_parseOnly.json @@ -100,7 +100,8 @@ } ], "src": "0:60:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:61:1" diff --git a/test/libsolidity/ASTJSON/smoke.json b/test/libsolidity/ASTJSON/smoke.json index 4d4a02e2418a..d3b114bbcba4 100644 --- a/test/libsolidity/ASTJSON/smoke.json +++ b/test/libsolidity/ASTJSON/smoke.json @@ -29,7 +29,8 @@ "nodes": [], "scope": 2, "src": "0:13:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:14:1" diff --git a/test/libsolidity/ASTJSON/smoke_parseOnly.json b/test/libsolidity/ASTJSON/smoke_parseOnly.json index d03e9865422a..1160fea91e75 100644 --- a/test/libsolidity/ASTJSON/smoke_parseOnly.json +++ b/test/libsolidity/ASTJSON/smoke_parseOnly.json @@ -15,7 +15,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "0:13:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:14:1" diff --git a/test/libsolidity/ASTJSON/source_location.json b/test/libsolidity/ASTJSON/source_location.json index df51e49c6f6b..caeaf027ab3f 100644 --- a/test/libsolidity/ASTJSON/source_location.json +++ b/test/libsolidity/ASTJSON/source_location.json @@ -165,7 +165,8 @@ ], "scope": 13, "src": "0:55:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:56:1" diff --git a/test/libsolidity/ASTJSON/source_location_parseOnly.json b/test/libsolidity/ASTJSON/source_location_parseOnly.json index 88835788b85f..ec25111bd349 100644 --- a/test/libsolidity/ASTJSON/source_location_parseOnly.json +++ b/test/libsolidity/ASTJSON/source_location_parseOnly.json @@ -119,7 +119,8 @@ } ], "src": "0:55:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:56:1" diff --git a/test/libsolidity/ASTJSON/string.json b/test/libsolidity/ASTJSON/string.json index 438f760c4f7a..c7706e3bfc01 100644 --- a/test/libsolidity/ASTJSON/string.json +++ b/test/libsolidity/ASTJSON/string.json @@ -129,7 +129,8 @@ ], "scope": 10, "src": "0:71:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:72:1" diff --git a/test/libsolidity/ASTJSON/string_parseOnly.json b/test/libsolidity/ASTJSON/string_parseOnly.json index 444a1f7b2bfd..5f97eb1f917e 100644 --- a/test/libsolidity/ASTJSON/string_parseOnly.json +++ b/test/libsolidity/ASTJSON/string_parseOnly.json @@ -96,7 +96,8 @@ } ], "src": "0:71:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:72:1" diff --git a/test/libsolidity/ASTJSON/struct_natspec.json b/test/libsolidity/ASTJSON/struct_natspec.json new file mode 100644 index 000000000000..d8b38a8033d3 --- /dev/null +++ b/test/libsolidity/ASTJSON/struct_natspec.json @@ -0,0 +1,126 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "Example": + [ + 8 + ] + }, + "id": 9, + "nodeType": "SourceUnit", + "nodes": + [ + { + "canonicalName": "Example", + "documentation": + { + "id": 1, + "nodeType": "StructuredDocumentation", + "src": "0:112:1", + "text": "@title example of title\n @author example of author\n @notice example of notice\n @dev example of dev" + }, + "id": 8, + "members": + [ + { + "constant": false, + "id": 3, + "mutability": "mutable", + "name": "text", + "nameLocation": "140:4:1", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "133:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + }, + "typeName": + { + "id": 2, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "133:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5, + "mutability": "mutable", + "name": "valid", + "nameLocation": "155:5:1", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "150:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": + { + "id": 4, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "150:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7, + "mutability": "mutable", + "name": "value", + "nameLocation": "174:5:1", + "nodeType": "VariableDeclaration", + "scope": 8, + "src": "166:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": + { + "id": 6, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "166:7:1", + "typeDescriptions": + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "Example", + "nameLocation": "119:7:1", + "nodeType": "StructDefinition", + "scope": 9, + "src": "112:70:1", + "visibility": "public" + } + ], + "src": "112:71:1" +} diff --git a/test/libsolidity/ASTJSON/struct_natspec.sol b/test/libsolidity/ASTJSON/struct_natspec.sol new file mode 100644 index 000000000000..c9e279f6b867 --- /dev/null +++ b/test/libsolidity/ASTJSON/struct_natspec.sol @@ -0,0 +1,11 @@ +/// @title example of title +/// @author example of author +/// @notice example of notice +/// @dev example of dev +struct Example { + string text; + bool valid; + uint256 value; +} + +// ---- diff --git a/test/libsolidity/ASTJSON/struct_natspec_parseOnly.json b/test/libsolidity/ASTJSON/struct_natspec_parseOnly.json new file mode 100644 index 000000000000..b80aaf377cb8 --- /dev/null +++ b/test/libsolidity/ASTJSON/struct_natspec_parseOnly.json @@ -0,0 +1,90 @@ +{ + "absolutePath": "a", + "id": 9, + "nodeType": "SourceUnit", + "nodes": + [ + { + "documentation": + { + "id": 1, + "nodeType": "StructuredDocumentation", + "src": "0:112:1", + "text": "@title example of title\n @author example of author\n @notice example of notice\n @dev example of dev" + }, + "id": 8, + "members": + [ + { + "constant": false, + "id": 3, + "mutability": "mutable", + "name": "text", + "nameLocation": "140:4:1", + "nodeType": "VariableDeclaration", + "src": "133:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": {}, + "typeName": + { + "id": 2, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "133:6:1", + "typeDescriptions": {} + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 5, + "mutability": "mutable", + "name": "valid", + "nameLocation": "155:5:1", + "nodeType": "VariableDeclaration", + "src": "150:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": {}, + "typeName": + { + "id": 4, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "150:4:1", + "typeDescriptions": {} + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 7, + "mutability": "mutable", + "name": "value", + "nameLocation": "174:5:1", + "nodeType": "VariableDeclaration", + "src": "166:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": {}, + "typeName": + { + "id": 6, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "166:7:1", + "typeDescriptions": {} + }, + "visibility": "internal" + } + ], + "name": "Example", + "nameLocation": "119:7:1", + "nodeType": "StructDefinition", + "src": "112:70:1", + "visibility": "public" + } + ], + "src": "112:71:1" +} diff --git a/test/libsolidity/ASTJSON/two_base_functions.json b/test/libsolidity/ASTJSON/two_base_functions.json index 23bdf6efe0d9..0ed997a32fa3 100644 --- a/test/libsolidity/ASTJSON/two_base_functions.json +++ b/test/libsolidity/ASTJSON/two_base_functions.json @@ -75,7 +75,8 @@ ], "scope": 23, "src": "0:49:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -133,7 +134,8 @@ ], "scope": 23, "src": "50:49:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -265,7 +267,8 @@ ], "scope": 23, "src": "100:64:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:165:1" diff --git a/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json b/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json index 078dc5daaba6..e448be836bf8 100644 --- a/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json +++ b/test/libsolidity/ASTJSON/two_base_functions_parseOnly.json @@ -51,7 +51,8 @@ } ], "src": "0:49:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -100,7 +101,8 @@ } ], "src": "50:49:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "abstract": false, @@ -212,7 +214,8 @@ } ], "src": "100:64:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:165:1" diff --git a/test/libsolidity/ASTJSON/unicode.json b/test/libsolidity/ASTJSON/unicode.json index dcb267b3fbdd..0ff1426f17e2 100644 --- a/test/libsolidity/ASTJSON/unicode.json +++ b/test/libsolidity/ASTJSON/unicode.json @@ -129,7 +129,8 @@ ], "scope": 10, "src": "0:77:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:78:1" diff --git a/test/libsolidity/ASTJSON/unicode_parseOnly.json b/test/libsolidity/ASTJSON/unicode_parseOnly.json index a6f52aa4ae76..c8fb780c40cc 100644 --- a/test/libsolidity/ASTJSON/unicode_parseOnly.json +++ b/test/libsolidity/ASTJSON/unicode_parseOnly.json @@ -96,7 +96,8 @@ } ], "src": "0:77:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:78:1" diff --git a/test/libsolidity/ASTJSON/used_errors.json b/test/libsolidity/ASTJSON/used_errors.json index c59b4f530951..12a59f9cbf10 100644 --- a/test/libsolidity/ASTJSON/used_errors.json +++ b/test/libsolidity/ASTJSON/used_errors.json @@ -228,7 +228,8 @@ [ 2, 11 - ] + ], + "usedEvents": [] } ], "src": "0:108:1" diff --git a/test/libsolidity/ASTJSON/used_errors_parseOnly.json b/test/libsolidity/ASTJSON/used_errors_parseOnly.json index 7a4b24b3c691..115ea2aee567 100644 --- a/test/libsolidity/ASTJSON/used_errors_parseOnly.json +++ b/test/libsolidity/ASTJSON/used_errors_parseOnly.json @@ -167,7 +167,8 @@ } ], "src": "45:62:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:108:1" diff --git a/test/libsolidity/ASTJSON/userDefinedValueType.json b/test/libsolidity/ASTJSON/userDefinedValueType.json index eb44509466fb..adf1172f05a9 100644 --- a/test/libsolidity/ASTJSON/userDefinedValueType.json +++ b/test/libsolidity/ASTJSON/userDefinedValueType.json @@ -352,7 +352,8 @@ ], "scope": 28, "src": "96:113:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:210:1" diff --git a/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json b/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json index 0dc95e13f919..90e48a98276b 100644 --- a/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json +++ b/test/libsolidity/ASTJSON/userDefinedValueType_parseOnly.json @@ -261,7 +261,8 @@ } ], "src": "96:113:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:210:1" diff --git a/test/libsolidity/ASTJSON/user_defined_operator.json b/test/libsolidity/ASTJSON/user_defined_operator.json new file mode 100644 index 000000000000..ed72de49dd28 --- /dev/null +++ b/test/libsolidity/ASTJSON/user_defined_operator.json @@ -0,0 +1,664 @@ +{ + "absolutePath": "a", + "exportedSymbols": + { + "C": + [ + 49 + ], + "I8": + [ + 2 + ], + "sub": + [ + 20 + ], + "unsub": + [ + 30 + ] + }, + "id": 50, + "nodeType": "SourceUnit", + "nodes": + [ + { + "canonicalName": "I8", + "id": 2, + "name": "I8", + "nameLocation": "5:2:1", + "nodeType": "UserDefinedValueTypeDefinition", + "src": "0:16:1", + "underlyingType": + { + "id": 1, + "name": "int8", + "nodeType": "ElementaryTypeName", + "src": "11:4:1", + "typeDescriptions": + { + "typeIdentifier": "t_int8", + "typeString": "int8" + } + } + }, + { + "functionList": + [ + { + "definition": + { + "id": 3, + "name": "sub", + "nameLocations": + [ + "24:3:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 20, + "src": "24:3:1" + }, + "operator": "-" + }, + { + "definition": + { + "id": 4, + "name": "unsub", + "nameLocations": + [ + "34:5:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 30, + "src": "34:5:1" + }, + "operator": "-" + } + ], + "global": true, + "id": 7, + "nodeType": "UsingForDirective", + "src": "17:43:1", + "typeName": + { + "id": 6, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 5, + "name": "I8", + "nameLocations": + [ + "50:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "50:2:1" + }, + "referencedDeclaration": 2, + "src": "50:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + } + }, + { + "body": + { + "id": 19, + "nodeType": "Block", + "src": "100:2:1", + "statements": [] + }, + "id": 20, + "implemented": true, + "kind": "freeFunction", + "modifiers": [], + "name": "sub", + "nameLocation": "70:3:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 14, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 10, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 20, + "src": "74:2:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "typeName": + { + "id": 9, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 8, + "name": "I8", + "nameLocations": + [ + "74:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "74:2:1" + }, + "referencedDeclaration": 2, + "src": "74:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 13, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 20, + "src": "78:2:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "typeName": + { + "id": 12, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 11, + "name": "I8", + "nameLocations": + [ + "78:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "78:2:1" + }, + "referencedDeclaration": 2, + "src": "78:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "visibility": "internal" + } + ], + "src": "73:8:1" + }, + "returnParameters": + { + "id": 18, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 17, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 20, + "src": "96:2:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "typeName": + { + "id": 16, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 15, + "name": "I8", + "nameLocations": + [ + "96:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "96:2:1" + }, + "referencedDeclaration": 2, + "src": "96:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "visibility": "internal" + } + ], + "src": "95:4:1" + }, + "scope": 50, + "src": "61:41:1", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "body": + { + "id": 29, + "nodeType": "Block", + "src": "140:2:1", + "statements": [] + }, + "id": 30, + "implemented": true, + "kind": "freeFunction", + "modifiers": [], + "name": "unsub", + "nameLocation": "112:5:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 24, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 23, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 30, + "src": "118:2:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "typeName": + { + "id": 22, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 21, + "name": "I8", + "nameLocations": + [ + "118:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "118:2:1" + }, + "referencedDeclaration": 2, + "src": "118:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "visibility": "internal" + } + ], + "src": "117:4:1" + }, + "returnParameters": + { + "id": 28, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 27, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 30, + "src": "136:2:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "typeName": + { + "id": 26, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 25, + "name": "I8", + "nameLocations": + [ + "136:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "136:2:1" + }, + "referencedDeclaration": 2, + "src": "136:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "visibility": "internal" + } + ], + "src": "135:4:1" + }, + "scope": 50, + "src": "103:39:1", + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "C", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 49, + "linearizedBaseContracts": + [ + 49 + ], + "name": "C", + "nameLocation": "152:1:1", + "nodeType": "ContractDefinition", + "nodes": + [ + { + "body": + { + "id": 47, + "nodeType": "Block", + "src": "208:30:1", + "statements": + [ + { + "expression": + { + "commonType": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "function": 20, + "id": 45, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": + { + "function": 30, + "id": 43, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "-", + "prefix": true, + "src": "225:2:1", + "subExpression": + { + "id": 42, + "name": "a", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 33, + "src": "226:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": + { + "id": 44, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 36, + "src": "230:1:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "src": "225:6:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "functionReturnParameters": 41, + "id": 46, + "nodeType": "Return", + "src": "218:13:1" + } + ] + }, + "functionSelector": "ac9fe858", + "id": 48, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "f", + "nameLocation": "169:1:1", + "nodeType": "FunctionDefinition", + "parameters": + { + "id": 37, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 33, + "mutability": "mutable", + "name": "a", + "nameLocation": "174:1:1", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "171:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "typeName": + { + "id": 32, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 31, + "name": "I8", + "nameLocations": + [ + "171:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "171:2:1" + }, + "referencedDeclaration": 2, + "src": "171:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 36, + "mutability": "mutable", + "name": "b", + "nameLocation": "180:1:1", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "177:4:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "typeName": + { + "id": 35, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 34, + "name": "I8", + "nameLocations": + [ + "177:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "177:2:1" + }, + "referencedDeclaration": 2, + "src": "177:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "visibility": "internal" + } + ], + "src": "170:12:1" + }, + "returnParameters": + { + "id": 41, + "nodeType": "ParameterList", + "parameters": + [ + { + "constant": false, + "id": 40, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 48, + "src": "204:2:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + }, + "typeName": + { + "id": 39, + "nodeType": "UserDefinedTypeName", + "pathNode": + { + "id": 38, + "name": "I8", + "nameLocations": + [ + "204:2:1" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 2, + "src": "204:2:1" + }, + "referencedDeclaration": 2, + "src": "204:2:1", + "typeDescriptions": + { + "typeIdentifier": "t_userDefinedValueType$_I8_$2", + "typeString": "I8" + } + }, + "visibility": "internal" + } + ], + "src": "203:4:1" + }, + "scope": 49, + "src": "160:78:1", + "stateMutability": "pure", + "virtual": false, + "visibility": "public" + } + ], + "scope": 50, + "src": "143:97:1", + "usedErrors": [], + "usedEvents": [] + } + ], + "src": "0:241:1" +} diff --git a/test/libsolidity/ASTJSON/user_defined_operator.sol b/test/libsolidity/ASTJSON/user_defined_operator.sol new file mode 100644 index 000000000000..df5d0ed32609 --- /dev/null +++ b/test/libsolidity/ASTJSON/user_defined_operator.sol @@ -0,0 +1,11 @@ +type I8 is int8; +using {sub as -, unsub as -} for I8 global; +function sub(I8, I8) pure returns (I8) {} +function unsub(I8) pure returns (I8) {} +contract C { + function f(I8 a, I8 b) public pure returns (I8) { + return -a - b; + } +} + +// ---- diff --git a/test/libsolidity/ASTJSON/using_for_directive.json b/test/libsolidity/ASTJSON/using_for_directive.json index 57658134dd0f..f3094980ff12 100644 --- a/test/libsolidity/ASTJSON/using_for_directive.json +++ b/test/libsolidity/ASTJSON/using_for_directive.json @@ -72,7 +72,8 @@ "nodes": [], "scope": 14, "src": "20:12:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "body": @@ -179,7 +180,8 @@ ], "scope": 14, "src": "53:29:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:83:1" diff --git a/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json b/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json index 84de310c0056..9360227d435e 100644 --- a/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json +++ b/test/libsolidity/ASTJSON/using_for_directive_parseOnly.json @@ -45,7 +45,8 @@ "nodeType": "ContractDefinition", "nodes": [], "src": "20:12:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] }, { "body": @@ -134,7 +135,8 @@ } ], "src": "53:29:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:83:1" diff --git a/test/libsolidity/ASTJSON/yul_hex_literal.json b/test/libsolidity/ASTJSON/yul_hex_literal.json index fc1cc39db358..0b3fa41741b3 100644 --- a/test/libsolidity/ASTJSON/yul_hex_literal.json +++ b/test/libsolidity/ASTJSON/yul_hex_literal.json @@ -148,7 +148,8 @@ ], "scope": 7, "src": "0:216:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:217:1" diff --git a/test/libsolidity/ASTJSON/yul_hex_literal_parseOnly.json b/test/libsolidity/ASTJSON/yul_hex_literal_parseOnly.json index a6da7e778406..3551ac2d99a4 100644 --- a/test/libsolidity/ASTJSON/yul_hex_literal_parseOnly.json +++ b/test/libsolidity/ASTJSON/yul_hex_literal_parseOnly.json @@ -132,7 +132,8 @@ } ], "src": "0:216:1", - "usedErrors": [] + "usedErrors": [], + "usedEvents": [] } ], "src": "0:217:1" diff --git a/test/libsolidity/GasCosts.cpp b/test/libsolidity/GasCosts.cpp index 1d67281ccca5..0f280c9a0948 100644 --- a/test/libsolidity/GasCosts.cpp +++ b/test/libsolidity/GasCosts.cpp @@ -112,21 +112,29 @@ BOOST_AUTO_TEST_CASE(string_storage) // Costs with 0 are cases which cannot be triggered in tests. if (evmVersion < EVMVersion::istanbul()) CHECK_DEPLOY_GAS(0, 109241, evmVersion); - else + else if (evmVersion < EVMVersion::shanghai()) CHECK_DEPLOY_GAS(0, 97697, evmVersion); + // Shanghai is cheaper due to `push0` + else + CHECK_DEPLOY_GAS(0, 97071, evmVersion); } else { if (evmVersion < EVMVersion::istanbul()) CHECK_DEPLOY_GAS(139013, 123969, evmVersion); - else + else if (evmVersion < EVMVersion::shanghai()) CHECK_DEPLOY_GAS(123361, 110969, evmVersion); + // Shanghai is cheaper due to `push0` + else + CHECK_DEPLOY_GAS(121493, 110969, evmVersion); } } else if (evmVersion < EVMVersion::istanbul()) CHECK_DEPLOY_GAS(125829, 118559, evmVersion); - else + else if (evmVersion < EVMVersion::shanghai()) CHECK_DEPLOY_GAS(114077, 96461, evmVersion); + else + CHECK_DEPLOY_GAS(114077, 95835, evmVersion); if (evmVersion >= EVMVersion::byzantium()) { @@ -198,7 +206,11 @@ BOOST_AUTO_TEST_CASE(single_callvaluecheck) size_t bytecodeSizeNonpayable = m_compiler.object("Nonpayable").bytecode.size(); size_t bytecodeSizePayable = m_compiler.object("Payable").bytecode.size(); - BOOST_CHECK_EQUAL(bytecodeSizePayable - bytecodeSizeNonpayable, 26); + auto evmVersion = solidity::test::CommonOptions::get().evmVersion(); + if (evmVersion < EVMVersion::shanghai()) + BOOST_CHECK_EQUAL(bytecodeSizePayable - bytecodeSizeNonpayable, 26); + else + BOOST_CHECK_EQUAL(bytecodeSizePayable - bytecodeSizeNonpayable, 24); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/libsolidity/SMTCheckerTest.cpp b/test/libsolidity/SMTCheckerTest.cpp index e3e52491dd93..9495895278ab 100644 --- a/test/libsolidity/SMTCheckerTest.cpp +++ b/test/libsolidity/SMTCheckerTest.cpp @@ -33,6 +33,12 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E if (!contract.empty()) m_modelCheckerSettings.contracts.contracts[""] = {contract}; + auto extCallsMode = ModelCheckerExtCalls::fromString(m_reader.stringSetting("SMTExtCalls", "untrusted")); + if (extCallsMode) + m_modelCheckerSettings.externalCalls = *extCallsMode; + else + BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT external calls mode.")); + auto const& showUnproved = m_reader.stringSetting("SMTShowUnproved", "yes"); if (showUnproved == "no") m_modelCheckerSettings.showUnproved = false; @@ -41,6 +47,14 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E else BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT \"show unproved\" choice.")); + auto const& showUnsupported = m_reader.stringSetting("SMTShowUnsupported", "yes"); + if (showUnsupported == "no") + m_modelCheckerSettings.showUnsupported = false; + else if (showUnsupported == "yes") + m_modelCheckerSettings.showUnsupported = true; + else + BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT \"show unsupported\" choice.")); + m_modelCheckerSettings.solvers = smtutil::SMTSolverChoice::None(); auto const& choice = m_reader.stringSetting("SMTSolvers", "z3"); if (choice == "none") @@ -51,8 +65,13 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E m_modelCheckerSettings.solvers &= ModelChecker::availableSolvers(); /// Underflow and Overflow are not enabled by default for Solidity >=0.8.7, - /// so we explicitly enable all targets for the tests. - m_modelCheckerSettings.targets = ModelCheckerTargets::All(); + /// so we explicitly enable all targets for the tests, + /// if the targets were not explicitly set by the test. + auto targets = ModelCheckerTargets::fromString(m_reader.stringSetting("SMTTargets", "all")); + if (targets) + m_modelCheckerSettings.targets = *targets; + else + BOOST_THROW_EXCEPTION(runtime_error("Invalid SMT targets.")); auto engine = ModelCheckerEngine::fromString(m_reader.stringSetting("SMTEngine", "all")); if (engine) diff --git a/test/libsolidity/SolidityCompiler.cpp b/test/libsolidity/SolidityCompiler.cpp index 045ac167a905..cd99cbf53f34 100644 --- a/test/libsolidity/SolidityCompiler.cpp +++ b/test/libsolidity/SolidityCompiler.cpp @@ -47,7 +47,9 @@ BOOST_AUTO_TEST_CASE(does_not_include_creation_time_only_internal_functions) bytes const& runtimeBytecode = solidity::test::bytecodeSansMetadata(compiler().runtimeObject("C").bytecode); BOOST_CHECK(creationBytecode.size() >= 90); BOOST_CHECK(creationBytecode.size() <= 120); - BOOST_CHECK(runtimeBytecode.size() >= 10); + auto evmVersion = solidity::test::CommonOptions::get().evmVersion(); + unsigned threshold = evmVersion.hasPush0() ? 9 : 10; + BOOST_CHECK(runtimeBytecode.size() >= threshold); BOOST_CHECK(runtimeBytecode.size() <= 30); } diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp index 5a3f21e1cbac..0c92d495659f 100644 --- a/test/libsolidity/SolidityExpressionCompiler.cpp +++ b/test/libsolidity/SolidityExpressionCompiler.cpp @@ -210,7 +210,10 @@ BOOST_AUTO_TEST_CASE(literal_false) )"; bytes code = compileFirstExpression(sourceCode); - bytes expectation({uint8_t(Instruction::PUSH1), 0x0}); + bytes expectation = solidity::test::CommonOptions::get().evmVersion().hasPush0() ? + bytes{uint8_t(Instruction::PUSH0)} : + bytes{uint8_t(Instruction::PUSH1), 0x0}; + BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end()); } @@ -344,21 +347,27 @@ BOOST_AUTO_TEST_CASE(arithmetic) } )"; bytes code = compileFirstExpression(sourceCode, {}, {{"test", "f", "y"}}); - + bool hasPush0 = solidity::test::CommonOptions::get().evmVersion().hasPush0(); + bytes push0Bytes = hasPush0 ? + bytes{uint8_t(Instruction::PUSH0)} : + bytes{uint8_t(Instruction::PUSH1), 0x0}; + uint8_t size = hasPush0 ? 0x65: 0x67; bytes panic = bytes{ uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::PUSH32) } + util::fromHex("4E487B7100000000000000000000000000000000000000000000000000000000") + + push0Bytes + bytes{ - uint8_t(Instruction::PUSH1), 0x0, uint8_t(Instruction::MSTORE), uint8_t(Instruction::PUSH1), 0x12, uint8_t(Instruction::PUSH1), 0x4, uint8_t(Instruction::MSTORE), - uint8_t(Instruction::PUSH1), 0x24, - uint8_t(Instruction::PUSH1), 0x0, + uint8_t(Instruction::PUSH1), 0x24 + } + + push0Bytes + + bytes{ uint8_t(Instruction::REVERT), uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::JUMP), @@ -405,7 +414,7 @@ BOOST_AUTO_TEST_CASE(arithmetic) uint8_t(Instruction::DIV), uint8_t(Instruction::PUSH1), 0x1, uint8_t(Instruction::MUL), - uint8_t(Instruction::PUSH1), 0x67, + uint8_t(Instruction::PUSH1), size, uint8_t(Instruction::JUMP) } + panic; else @@ -447,7 +456,7 @@ BOOST_AUTO_TEST_CASE(arithmetic) uint8_t(Instruction::JUMPDEST), uint8_t(Instruction::DIV), uint8_t(Instruction::MUL), - uint8_t(Instruction::PUSH1), 0x67, + uint8_t(Instruction::PUSH1), size, uint8_t(Instruction::JUMP) } + panic; @@ -463,11 +472,17 @@ BOOST_AUTO_TEST_CASE(unary_operators) )"; bytes code = compileFirstExpression(sourceCode, {}, {{"test", "f", "y"}}); + bytes push0Bytes = solidity::test::CommonOptions::get().evmVersion().hasPush0() ? + bytes{uint8_t(Instruction::PUSH0)} : + bytes{uint8_t(Instruction::PUSH1), 0x0}; + bytes expectation; if (solidity::test::CommonOptions::get().optimize) - expectation = { + expectation = bytes{ uint8_t(Instruction::DUP1), - uint8_t(Instruction::PUSH1), 0x0, + } + + push0Bytes + + bytes{ uint8_t(Instruction::SUB), uint8_t(Instruction::NOT), uint8_t(Instruction::PUSH1), 0x2, @@ -475,10 +490,12 @@ BOOST_AUTO_TEST_CASE(unary_operators) uint8_t(Instruction::ISZERO) }; else - expectation = { + expectation = bytes{ uint8_t(Instruction::PUSH1), 0x2, uint8_t(Instruction::DUP2), - uint8_t(Instruction::PUSH1), 0x0, + } + + push0Bytes + + bytes{ uint8_t(Instruction::SUB), uint8_t(Instruction::NOT), uint8_t(Instruction::EQ), diff --git a/test/libsolidity/SolidityNatspecJSON.cpp b/test/libsolidity/SolidityNatspecJSON.cpp index 1a2c3af1ff83..a54460eb624b 100644 --- a/test/libsolidity/SolidityNatspecJSON.cpp +++ b/test/libsolidity/SolidityNatspecJSON.cpp @@ -485,6 +485,411 @@ BOOST_AUTO_TEST_CASE(event) checkNatspec(sourceCode, "ERC20", userDoc, true); } +BOOST_AUTO_TEST_CASE(emit_same_signature_event_library_contract) +{ + char const* sourceCode = R"( + library L { + /// @notice This event is defined in Library L + /// @dev This should not appear in Contract C dev doc + event SameSignatureEvent(uint16); + /// @notice This event is defined in Library L + /// @dev This should appear in Contract C dev doc + event LibraryEvent(uint32); + } + contract C { + /// @notice This event is defined in Contract C + /// @dev This should appear in Contract C dev doc + event SameSignatureEvent(uint16); + /// @notice This event is defined in Contract C + /// @dev This should appear in contract C dev doc + event ContractEvent(uint32); + function f() public { + emit L.SameSignatureEvent(0); + emit SameSignatureEvent(1); + emit L.LibraryEvent(2); + emit ContractEvent(3); + } + } + )"; + + char const* devDoc = R"ABCDEF( + { + "events": + { + "ContractEvent(uint32)": + { + "details": "This should appear in contract C dev doc" + }, + "LibraryEvent(uint32)": + { + "details": "This should appear in Contract C dev doc" + }, + "SameSignatureEvent(uint16)": + { + "details": "This should appear in Contract C dev doc" + } + }, + "kind": "dev", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "events": + { + "ContractEvent(uint32)": + { + "notice": "This event is defined in Contract C" + }, + "LibraryEvent(uint32)": + { + "notice": "This event is defined in Library L" + }, + "SameSignatureEvent(uint16)": + { + "notice": "This event is defined in Contract C" + } + }, + "kind": "user", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", userDoc, true); +} + +BOOST_AUTO_TEST_CASE(emit_same_signature_event_different_libraries) +{ + char const* sourceCode = R"( + library L1 { + /// @notice This event is defined in Library L1 + /// @dev This should not appear in Contract C dev doc + event SameSignatureEvent(uint16); + } + library L2 { + /// @notice This event is defined in Library L2 + /// @dev This should not appear in Contract C dev doc + event SameSignatureEvent(uint16); + } + library L3 { + /// @notice This event is defined in Library L3 + /// @dev This should not appear in Contract C dev doc + event SameSignatureEvent(uint16); + } + contract C { + function f() public { + emit L1.SameSignatureEvent(0); + emit L2.SameSignatureEvent(1); + emit L3.SameSignatureEvent(2); + } + } + )"; + + char const* devDoc = R"ABCDEF( + { + "kind": "dev", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "kind": "user", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", userDoc, true); + + char const* libraryDevDoc = R"ABCDEF( + { + "events": + { + "SameSignatureEvent(uint16)": + { + "details": "This should not appear in Contract C dev doc" + } + }, + "kind": "user", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "L1", libraryDevDoc, false); + + char const* libraryUserDoc = R"ABCDEF( + { + "events": + { + "SameSignatureEvent(uint16)": + { + "notice": "This event is defined in Library L1" + } + }, + "kind": "user", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "L1", libraryUserDoc, true); +} + +BOOST_AUTO_TEST_CASE(emit_same_signature_event_library_inherited) +{ + char const* sourceCode = R"( + contract D { + /// @notice This event is defined in contract D + /// @dev This should appear in Contract C dev doc + event SameSignatureEvent(uint16); + } + library L { + /// @notice This event is defined in Library L + /// @dev This should not appear in Contract C + event SameSignatureEvent(uint16); + } + contract C is D { + function f() public { + emit L.SameSignatureEvent(0); + emit D.SameSignatureEvent(1); + } + } + )"; + + char const* devDoc = R"ABCDEF( + { + "events": + { + "SameSignatureEvent(uint16)": + { + "details": "This should appear in Contract C dev doc" + } + }, + "kind": "dev", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "events": + { + "SameSignatureEvent(uint16)": + { + "notice": "This event is defined in contract D" + } + }, + "kind": "user", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", userDoc, true); +} + +BOOST_AUTO_TEST_CASE(emit_same_signature_event_library_contract_missing_natspec) +{ + char const* sourceCode = R"( + library L { + /// @notice This event is defined in library L + /// @dev This should not appear in contract C devdoc + event SameSignatureEvent(uint16); + /// @notice This event is defined in library L + /// @dev This should appear in contract C devdoc + event LibraryEvent(uint32); + } + contract C { + event SameSignatureEvent(uint16); + /// @notice This event is defined in contract C + event ContractEvent(uint32); + function f() public { + emit L.SameSignatureEvent(0); + emit SameSignatureEvent(1); + emit L.LibraryEvent(2); + emit ContractEvent(3); + } + } + )"; + + char const* devDoc = R"ABCDEF( + { + "events": + { + "LibraryEvent(uint32)": + { + "details": "This should appear in contract C devdoc" + } + }, + "kind": "dev", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "events": + { + "ContractEvent(uint32)": + { + "notice": "This event is defined in contract C" + }, + "LibraryEvent(uint32)": + { + "notice": "This event is defined in library L" + } + }, + "kind": "user", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", userDoc, true); +} + +BOOST_AUTO_TEST_CASE(emit_same_signature_event_different_libraries_missing_natspec) +{ + char const* sourceCode = R"( + library L1 { + event SameSignatureEvent(uint16); + } + library L2 { + /// @notice This event is defined in library L2 + /// @dev This should not appear in Contract C devdoc + event SameSignatureEvent(uint16); + } + library L3 { + event SameSignatureEvent(uint16); + } + contract C { + function f() public { + emit L1.SameSignatureEvent(0); + emit L2.SameSignatureEvent(1); + emit L3.SameSignatureEvent(2); + } + } + )"; + + char const* devDoc = R"ABCDEF( + { + "kind": "dev", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "kind": "user", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", userDoc, true); +} + +BOOST_AUTO_TEST_CASE(emit_same_signature_event_library_inherited_missing_natspec) +{ + char const* sourceCode = R"( + contract D { + event SameSignatureEvent(uint16); + } + library L { + /// @notice This event is defined in library L + /// @dev This should not appear in contract C devdoc + event SameSignatureEvent(uint16); + } + contract C is D { + function f() public { + emit L.SameSignatureEvent(0); + emit D.SameSignatureEvent(1); + } + } + )"; + + char const* devDoc = R"ABCDEF( + { + "kind": "dev", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "kind": "user", + "methods": {}, + "version": 1 + } + )ABCDEF"; + checkNatspec(sourceCode, "C", userDoc, true); +} + +BOOST_AUTO_TEST_CASE(event_inheritance_interface) +{ + char const* sourceCode = R"( + interface ERC20 { + /// @notice This event is emitted when a transfer occurs. + /// @param from The source account. + /// @param to The destination account. + /// @param amount The amount. + /// @dev A test case! + event Transfer(address indexed from, address indexed to, uint amount); + } + contract A is ERC20 { + } + contract B is A { + } + )"; + + char const* devDoc = R"ABCDEF( + { + "events": + { + "Transfer(address,address,uint256)": + { + "details": "A test case!", + "params": + { + "amount": "The amount.", + "from": "The source account.", + "to": "The destination account." + } + } + }, + "methods": {} + } + )ABCDEF"; + checkNatspec(sourceCode, "ERC20", devDoc, false); + checkNatspec(sourceCode, "A", devDoc, false); + checkNatspec(sourceCode, "B", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "events": + { + "Transfer(address,address,uint256)": + { + "notice": "This event is emitted when a transfer occurs." + } + }, + "methods": {} + } + )ABCDEF"; + checkNatspec(sourceCode, "ERC20", userDoc, true); + checkNatspec(sourceCode, "A", userDoc, true); + checkNatspec(sourceCode, "B", userDoc, true); +} + BOOST_AUTO_TEST_CASE(event_inheritance) { char const* sourceCode = R"( @@ -496,10 +901,8 @@ BOOST_AUTO_TEST_CASE(event_inheritance) /// @dev A test case! event Transfer(address indexed from, address indexed to, uint amount); } - contract A is ERC20 { } - contract B is A { } )"; @@ -1076,6 +1479,75 @@ BOOST_AUTO_TEST_CASE(dev_author_at_function) expectNatspecError(sourceCode); } +BOOST_AUTO_TEST_CASE(struct_no_docs) +{ + char const* sourceCode = R"( + contract C { + /// @title example of title + /// @author example of author + /// @notice example of notice + /// @dev example of dev + struct Example { + string text; + bool valid; + uint256 value; + } + } + )"; + + char const* devDoc = R"ABCDEF( + { + "kind": "dev", + "methods": {}, + "version": 1 + })ABCDEF"; + + checkNatspec(sourceCode, "C", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "kind": "user", + "methods": {}, + "version": 1 + })ABCDEF"; + + checkNatspec(sourceCode, "C", userDoc, true); +} + +BOOST_AUTO_TEST_CASE(enum_no_docs) +{ + char const* sourceCode = R"( + contract C { + /// @title example of title + /// @author example of author + /// @notice example of notice + /// @dev example of dev + enum Color { + Red, + Green + } + } + )"; + + char const* devDoc = R"ABCDEF( + { + "kind": "dev", + "methods": {}, + "version": 1 + })ABCDEF"; + + checkNatspec(sourceCode, "C", devDoc, false); + + char const* userDoc = R"ABCDEF( + { + "kind": "user", + "methods": {}, + "version": 1 + })ABCDEF"; + + checkNatspec(sourceCode, "C", userDoc, true); +} + BOOST_AUTO_TEST_CASE(natspec_notice_without_tag) { char const* sourceCode = R"( diff --git a/test/libsolidity/SolidityTypes.cpp b/test/libsolidity/SolidityTypes.cpp index 63b943e979ec..48a0441b44de 100644 --- a/test/libsolidity/SolidityTypes.cpp +++ b/test/libsolidity/SolidityTypes.cpp @@ -187,11 +187,11 @@ BOOST_AUTO_TEST_CASE(type_identifiers) BOOST_CHECK_EQUAL(c.type()->identifier(), "t_type$_t_contract$_MyContract$$$_$2_$"); BOOST_CHECK_EQUAL(ContractType(c, true).identifier(), "t_super$_MyContract$$$_$2"); - StructDefinition s(++id, {}, make_shared("Struct"), {}, {}); + StructDefinition s(++id, {}, make_shared("Struct"), {}, {}, {}); s.annotation().recursive = false; BOOST_CHECK_EQUAL(s.type()->identifier(), "t_type$_t_struct$_Struct_$3_storage_ptr_$"); - EnumDefinition e(++id, {}, make_shared("Enum"), {}, {}); + EnumDefinition e(++id, {}, make_shared("Enum"), {}, {}, {}); BOOST_CHECK_EQUAL(e.type()->identifier(), "t_type$_t_enum$_Enum_$4_$"); TupleType t({e.type(), s.type(), stringArray, nullptr}); diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp index d2eeedd910d6..785f14284249 100644 --- a/test/libsolidity/StandardCompiler.cpp +++ b/test/libsolidity/StandardCompiler.cpp @@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(invalid_language) } )"; Json::Value result = compile(input); - BOOST_CHECK(containsError(result, "JSONError", "Only \"Solidity\" or \"Yul\" is supported as a language.")); + BOOST_CHECK(containsError(result, "JSONError", "Only \"Solidity\", \"Yul\" or \"SolidityAST\" is supported as a language.")); } BOOST_AUTO_TEST_CASE(valid_language) @@ -420,9 +420,9 @@ BOOST_AUTO_TEST_CASE(basic_compilation) BOOST_CHECK(contract["evm"]["bytecode"]["object"].isString()); BOOST_CHECK_EQUAL( solidity::test::bytecodeSansMetadata(contract["evm"]["bytecode"]["object"].asString()), - string("6080604052348015600f57600080fd5b5060") + - (VersionIsRelease ? "3f" : util::toHex(bytes{uint8_t(61 + VersionStringStrict.size())})) + - "80601d6000396000f3fe6080604052600080fdfe" + string("6080604052348015600e575f80fd5b5060") + + (VersionIsRelease ? "3e" : util::toHex(bytes{uint8_t(60 + VersionStringStrict.size())})) + + "80601a5f395ff3fe60806040525f80fdfe" ); BOOST_CHECK(contract["evm"]["assembly"].isString()); BOOST_CHECK(contract["evm"]["assembly"].asString().find( @@ -485,9 +485,10 @@ BOOST_AUTO_TEST_CASE(basic_compilation) BOOST_CHECK_EQUAL( util::jsonCompactPrint(result["sources"]["fileA"]["ast"]), "{\"absolutePath\":\"fileA\",\"exportedSymbols\":{\"A\":[1]},\"id\":2,\"nodeType\":\"SourceUnit\",\"nodes\":[{\"abstract\":false," - "\"baseContracts\":[],\"canonicalName\":\"A\",\"contractDependencies\":[],\"contractKind\":\"contract\",\"fullyImplemented\":true,\"id\":1," + "\"baseContracts\":[],\"canonicalName\":\"A\",\"contractDependencies\":[]," + "\"contractKind\":\"contract\",\"fullyImplemented\":true,\"id\":1," "\"linearizedBaseContracts\":[1],\"name\":\"A\",\"nameLocation\":\"9:1:0\",\"nodeType\":\"ContractDefinition\",\"nodes\":[],\"scope\":2," - "\"src\":\"0:14:0\",\"usedErrors\":[]}],\"src\":\"0:14:0\"}" + "\"src\":\"0:14:0\",\"usedErrors\":[],\"usedEvents\":[]}],\"src\":\"0:14:0\"}" ); } @@ -1084,9 +1085,11 @@ BOOST_AUTO_TEST_CASE(evm_version) BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"london\"") != string::npos); result = compile(inputForVersion("\"evmVersion\": \"paris\",")); BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"paris\"") != string::npos); + result = compile(inputForVersion("\"evmVersion\": \"shanghai\",")); + BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"shanghai\"") != string::npos); // test default result = compile(inputForVersion("")); - BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"paris\"") != string::npos); + BOOST_CHECK(result["contracts"]["fileA"]["A"]["metadata"].asString().find("\"evmVersion\":\"shanghai\"") != string::npos); // test invalid result = compile(inputForVersion("\"evmVersion\": \"invalid\",")); BOOST_CHECK(result["errors"][0]["message"].asString() == "Invalid EVM version requested."); diff --git a/test/libsolidity/analysis/FunctionCallGraph.cpp b/test/libsolidity/analysis/FunctionCallGraph.cpp index fcc8d1423953..da17fc433214 100644 --- a/test/libsolidity/analysis/FunctionCallGraph.cpp +++ b/test/libsolidity/analysis/FunctionCallGraph.cpp @@ -1702,6 +1702,72 @@ BOOST_AUTO_TEST_CASE(using_for) checkCallGraphExpectations(get<1>(graphs), expectedDeployedEdges); } +BOOST_AUTO_TEST_CASE(user_defined_binary_operator) +{ + unique_ptr compilerStack = parseAndAnalyzeContracts(R"( + type Int is int128; + using {add as +} for Int global; + + function add(Int, Int) pure returns (Int) { + return Int.wrap(0); + } + + contract C { + function pub() public { + Int.wrap(0) + Int.wrap(1); + } + } + )"s); + tuple graphs = collectGraphs(*compilerStack); + + map expectedCreationEdges = { + {"C", {}}, + }; + + map expectedDeployedEdges = { + {"C", { + {"Entry", "function C.pub()"}, + {"function C.pub()", "function add(Int,Int)"}, + }}, + }; + + checkCallGraphExpectations(get<0>(graphs), expectedCreationEdges); + checkCallGraphExpectations(get<1>(graphs), expectedDeployedEdges); +} + +BOOST_AUTO_TEST_CASE(user_defined_unary_operator) +{ + unique_ptr compilerStack = parseAndAnalyzeContracts(R"( + type Int is int128; + using {sub as -} for Int global; + + function sub(Int) pure returns (Int) { + return Int.wrap(0); + } + + contract C { + function pub() public { + -Int.wrap(1); + } + } + )"s); + tuple graphs = collectGraphs(*compilerStack); + + map expectedCreationEdges = { + {"C", {}}, + }; + + map expectedDeployedEdges = { + {"C", { + {"Entry", "function C.pub()"}, + {"function C.pub()", "function sub(Int)"}, + }}, + }; + + checkCallGraphExpectations(get<0>(graphs), expectedCreationEdges); + checkCallGraphExpectations(get<1>(graphs), expectedDeployedEdges); +} + BOOST_AUTO_TEST_CASE(getters) { unique_ptr compilerStack = parseAndAnalyzeContracts(R"( diff --git a/test/libsolidity/gasTests/abiv2.sol b/test/libsolidity/gasTests/abiv2.sol index da433a9e5218..aacb333bfeca 100644 --- a/test/libsolidity/gasTests/abiv2.sol +++ b/test/libsolidity/gasTests/abiv2.sol @@ -14,11 +14,11 @@ contract C { } // ---- // creation: -// codeDepositCost: 1241200 -// executionCost: 1288 -// totalCost: 1242488 +// codeDepositCost: 1213200 +// executionCost: 1259 +// totalCost: 1214459 // external: -// a(): 2430 +// a(): 2425 // b(uint256): infinite // f1(uint256): infinite // f2(uint256[],string[],uint16,address): infinite diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol index 26e2104f25bc..2d4100df48b8 100644 --- a/test/libsolidity/gasTests/abiv2_optimised.sol +++ b/test/libsolidity/gasTests/abiv2_optimised.sol @@ -17,13 +17,13 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 659000 -// executionCost: 689 -// totalCost: 659689 +// codeDepositCost: 640600 +// executionCost: 674 +// totalCost: 641274 // external: -// a(): 2285 -// b(uint256): 4652 -// f1(uint256): 307 +// a(): 2283 +// b(uint256): 4649 +// f1(uint256): 304 // f2(uint256[],string[],uint16,address): infinite // f3(uint16[],string[],uint16,address): infinite // f4(uint32[],string[12],bytes[2][],address): infinite diff --git a/test/libsolidity/gasTests/data_storage.sol b/test/libsolidity/gasTests/data_storage.sol index fa0db135d5ad..0d24ef505273 100644 --- a/test/libsolidity/gasTests/data_storage.sol +++ b/test/libsolidity/gasTests/data_storage.sol @@ -13,8 +13,8 @@ contract C { } // ---- // creation: -// codeDepositCost: 387600 -// executionCost: 424 -// totalCost: 388024 +// codeDepositCost: 377800 +// executionCost: 416 +// totalCost: 378216 // external: -// f(): 428 +// f(): 421 diff --git a/test/libsolidity/gasTests/dispatch_large.sol b/test/libsolidity/gasTests/dispatch_large.sol index 21369e6f71c6..e1cce4acd764 100644 --- a/test/libsolidity/gasTests/dispatch_large.sol +++ b/test/libsolidity/gasTests/dispatch_large.sol @@ -24,11 +24,11 @@ contract Large { } // ---- // creation: -// codeDepositCost: 640200 -// executionCost: 676 -// totalCost: 640876 +// codeDepositCost: 618400 +// executionCost: 649 +// totalCost: 619049 // external: -// a(): 2475 +// a(): 2470 // b(uint256): infinite // f0(uint256): infinite // f1(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_large_optimised.sol b/test/libsolidity/gasTests/dispatch_large_optimised.sol index ae38258f09d7..83e55c1a9c1e 100644 --- a/test/libsolidity/gasTests/dispatch_large_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_large_optimised.sol @@ -27,29 +27,29 @@ contract Large { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 232800 -// executionCost: 275 -// totalCost: 233075 +// codeDepositCost: 224600 +// executionCost: 267 +// totalCost: 224867 // external: -// a(): 2283 -// b(uint256): 4937 -// f0(uint256): 366 -// f1(uint256): 47006 -// f2(uint256): 24972 -// f3(uint256): 25060 -// f4(uint256): 25038 -// f5(uint256): 25016 -// f6(uint256): 24928 -// f7(uint256): 24708 -// f8(uint256): 24840 -// f9(uint256): 24862 -// g0(uint256): 606 -// g1(uint256): 46718 -// g2(uint256): 24706 -// g3(uint256): 24794 -// g4(uint256): 24772 -// g5(uint256): 24860 -// g6(uint256): 24640 -// g7(uint256): 24750 -// g8(uint256): 24728 -// g9(uint256): 24574 +// a(): 2281 +// b(uint256): 4934 +// f0(uint256): 363 +// f1(uint256): 47002 +// f2(uint256): 24967 +// f3(uint256): 25055 +// f4(uint256): 25033 +// f5(uint256): 25011 +// f6(uint256): 24923 +// f7(uint256): 24703 +// f8(uint256): 24835 +// f9(uint256): 24857 +// g0(uint256): 603 +// g1(uint256): 46714 +// g2(uint256): 24701 +// g3(uint256): 24789 +// g4(uint256): 24767 +// g5(uint256): 24855 +// g6(uint256): 24635 +// g7(uint256): 24745 +// g8(uint256): 24723 +// g9(uint256): 24569 diff --git a/test/libsolidity/gasTests/dispatch_medium.sol b/test/libsolidity/gasTests/dispatch_medium.sol index c76fc852e577..6bf8f89394fa 100644 --- a/test/libsolidity/gasTests/dispatch_medium.sol +++ b/test/libsolidity/gasTests/dispatch_medium.sol @@ -11,11 +11,11 @@ contract Medium { } // ---- // creation: -// codeDepositCost: 269600 -// executionCost: 312 -// totalCost: 269912 +// codeDepositCost: 259600 +// executionCost: 298 +// totalCost: 259898 // external: -// a(): 2452 +// a(): 2447 // b(uint256): infinite // f1(uint256): infinite // f2(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_medium_optimised.sol b/test/libsolidity/gasTests/dispatch_medium_optimised.sol index fca8d2695764..e921fcf125ba 100644 --- a/test/libsolidity/gasTests/dispatch_medium_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_medium_optimised.sol @@ -14,16 +14,16 @@ contract Medium { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 131600 -// executionCost: 177 -// totalCost: 131777 +// codeDepositCost: 126000 +// executionCost: 169 +// totalCost: 126169 // external: -// a(): 2283 -// b(uint256): 4695 -// f1(uint256): 46786 -// f2(uint256): 24730 -// f3(uint256): 24774 -// g0(uint256): 364 -// g7(uint256): 24640 -// g8(uint256): 24618 -// g9(uint256): 24574 +// a(): 2281 +// b(uint256): 4692 +// f1(uint256): 46782 +// f2(uint256): 24725 +// f3(uint256): 24769 +// g0(uint256): 361 +// g7(uint256): 24635 +// g8(uint256): 24613 +// g9(uint256): 24569 diff --git a/test/libsolidity/gasTests/dispatch_small.sol b/test/libsolidity/gasTests/dispatch_small.sol index bf66fe18268c..d2c391582ed5 100644 --- a/test/libsolidity/gasTests/dispatch_small.sol +++ b/test/libsolidity/gasTests/dispatch_small.sol @@ -6,11 +6,11 @@ contract Small { } // ---- // creation: -// codeDepositCost: 108800 -// executionCost: 153 -// totalCost: 108953 +// codeDepositCost: 103800 +// executionCost: 151 +// totalCost: 103951 // external: -// fallback: 129 -// a(): 2407 +// fallback: 128 +// a(): 2402 // b(uint256): infinite // f1(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_small_optimised.sol b/test/libsolidity/gasTests/dispatch_small_optimised.sol index 28ddf2af069c..e20e1d982427 100644 --- a/test/libsolidity/gasTests/dispatch_small_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_small_optimised.sol @@ -9,11 +9,11 @@ contract Small { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 60800 -// executionCost: 111 -// totalCost: 60911 +// codeDepositCost: 58200 +// executionCost: 109 +// totalCost: 58309 // external: -// fallback: 118 -// a(): 2261 -// b(uint256): 4585 -// f1(uint256): 46720 +// fallback: 117 +// a(): 2259 +// b(uint256): 4582 +// f1(uint256): 46716 diff --git a/test/libsolidity/gasTests/exp.sol b/test/libsolidity/gasTests/exp.sol index 8dc59b09449b..6ad4dd3bee43 100644 --- a/test/libsolidity/gasTests/exp.sol +++ b/test/libsolidity/gasTests/exp.sol @@ -19,11 +19,11 @@ contract C { // optimize-yul: false // ---- // creation: -// codeDepositCost: 110800 -// executionCost: 159 -// totalCost: 110959 +// codeDepositCost: 107000 +// executionCost: 151 +// totalCost: 107151 // external: -// exp_neg_one(uint256): 2259 +// exp_neg_one(uint256): 2250 // exp_one(uint256): infinite // exp_two(uint256): infinite // exp_zero(uint256): infinite diff --git a/test/libsolidity/gasTests/exp_optimized.sol b/test/libsolidity/gasTests/exp_optimized.sol index c934c710e213..982fcd28feb9 100644 --- a/test/libsolidity/gasTests/exp_optimized.sol +++ b/test/libsolidity/gasTests/exp_optimized.sol @@ -19,11 +19,11 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 37200 -// executionCost: 87 -// totalCost: 37287 +// codeDepositCost: 35800 +// executionCost: 85 +// totalCost: 35885 // external: -// exp_neg_one(uint256): 1917 -// exp_one(uint256): 1870 -// exp_two(uint256): 1848 -// exp_zero(uint256): 1892 +// exp_neg_one(uint256): 1914 +// exp_one(uint256): 1868 +// exp_two(uint256): 1846 +// exp_zero(uint256): 1889 diff --git a/test/libsolidity/gasTests/storage_costs.sol b/test/libsolidity/gasTests/storage_costs.sol index 1e4995833f63..afb442ed7f97 100644 --- a/test/libsolidity/gasTests/storage_costs.sol +++ b/test/libsolidity/gasTests/storage_costs.sol @@ -15,10 +15,10 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 27200 -// executionCost: 81 -// totalCost: 27281 +// codeDepositCost: 25600 +// executionCost: 73 +// totalCost: 25673 // external: -// readX(): 2290 -// resetX(): 5116 -// setX(uint256): 22312 +// readX(): 2288 +// resetX(): 5114 +// setX(uint256): 22309 diff --git a/test/libsolidity/lsp/hover/hover.sol b/test/libsolidity/lsp/hover/hover.sol index 9a1ee034cf17..154d2326e134 100644 --- a/test/libsolidity/lsp/hover/hover.sol +++ b/test/libsolidity/lsp/hover/hover.sol @@ -48,9 +48,18 @@ contract User // <- { // "contents": { // "kind": "markdown", -// "value": "```solidity\ntype(enum User.SomeEnum)\n```\n\n" +// "value": "```solidity\ntype(enum User.SomeEnum)\n```\n\nSome enum value.\n\n" // }, -// "range": @Cursor1Range +// "range": { +// "end": { +// "character": 12, +// "line": 17 +// }, +// "start": { +// "character": 4, +// "line": 17 +// } +// } // } // -> textDocument/hover { // "position": @Cursor2 @@ -58,9 +67,18 @@ contract User // <- { // "contents": { // "kind": "markdown", -// "value": "```solidity\ntype(enum User.SomeEnum)\n```\n\n" +// "value": "```solidity\ntype(enum User.SomeEnum)\n```\n\nSome enum value.\n\n" // }, -// "range": @Cursor2Range +// "range": { +// "end": { +// "character": 32, +// "line": 22 +// }, +// "start": { +// "character": 24, +// "line": 22 +// } +// } // } // -> textDocument/hover { // "position": @Cursor3 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol index fd7bc2083809..61360868be69 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_decode_v2_storage.sol @@ -22,6 +22,6 @@ contract C { // ---- // f() -> 0x20, 0x8, 0x40, 0x3, 0x9, 0xa, 0xb -// gas irOptimized: 203172 -// gas legacy: 206343 -// gas legacyOptimized: 203162 +// gas irOptimized: 203166 +// gas legacy: 206263 +// gas legacyOptimized: 203151 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol index 328de20a5e64..e043853e09e1 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_calldata_slice.sol @@ -59,10 +59,10 @@ contract C { // EVMVersion: >homestead // ---- // test_bytes() -> -// gas irOptimized: 362400 -// gas legacy: 414569 -// gas legacyOptimized: 319271 +// gas irOptimized: 361321 +// gas legacy: 411269 +// gas legacyOptimized: 317754 // test_uint256() -> -// gas irOptimized: 511451 -// gas legacy: 581876 -// gas legacyOptimized: 442757 +// gas irOptimized: 509988 +// gas legacy: 577469 +// gas legacyOptimized: 440931 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol b/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol index fa62b4f777ce..575b759074d6 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/struct/struct_storage_ptr.sol @@ -24,6 +24,6 @@ contract C { // ---- // library: L // f() -> 8, 7, 1, 2, 7, 12 -// gas irOptimized: 166513 -// gas legacy: 169347 -// gas legacyOptimized: 167269 +// gas irOptimized: 166506 +// gas legacy: 169283 +// gas legacyOptimized: 167248 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol index 2eef62d1779c..8d98179d91e9 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_calldata_slice.sol @@ -60,10 +60,10 @@ contract C { // EVMVersion: >homestead // ---- // test_bytes() -> -// gas irOptimized: 362400 -// gas legacy: 414569 -// gas legacyOptimized: 319271 +// gas irOptimized: 361321 +// gas legacy: 411269 +// gas legacyOptimized: 317754 // test_uint256() -> -// gas irOptimized: 511451 -// gas legacy: 581876 -// gas legacyOptimized: 442757 +// gas irOptimized: 509988 +// gas legacy: 577469 +// gas legacyOptimized: 440931 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol index 58b38a9c38fc..a0b732caed24 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2.sol @@ -51,6 +51,6 @@ contract C { // f2() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc" // f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc" // f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3 -// gas irOptimized: 112646 -// gas legacy: 114866 -// gas legacyOptimized: 112586 +// gas irOptimized: 112641 +// gas legacy: 114794 +// gas legacyOptimized: 112572 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol index e0ab2c97f691..add5458967ff 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_function_inherited_in_v1_contract.sol @@ -30,6 +30,6 @@ contract C is B { } // ---- // test() -> 77 -// gas irOptimized: 120170 -// gas legacy: 155093 -// gas legacyOptimized: 111550 +// gas irOptimized: 119177 +// gas legacy: 151866 +// gas legacyOptimized: 110359 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_modifier_used_in_v1_contract.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_modifier_used_in_v1_contract.sol index a45d8d599771..7de26301205c 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_modifier_used_in_v1_contract.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_v2_in_modifier_used_in_v1_contract.sol @@ -39,4 +39,4 @@ contract C is B { // ---- // test() -> 5, 10 // gas irOptimized: 87337 -// gas legacy: 104481 +// gas legacy: 102651 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol index 689bb9810129..915514754a97 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol @@ -20,6 +20,6 @@ contract C { // f(uint256[][1]): 32, 32, 0 -> true // f(uint256[][1]): 32, 32, 1, 42 -> true // f(uint256[][1]): 32, 32, 8, 421, 422, 423, 424, 425, 426, 427, 428 -> true -// gas irOptimized: 127347 -// gas legacy: 140553 -// gas legacyOptimized: 119450 +// gas irOptimized: 127012 +// gas legacy: 139800 +// gas legacyOptimized: 119092 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_overlapped_dynamic_arrays.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_overlapped_dynamic_arrays.sol index 1ec1ca4c5621..1b1f360f48d0 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/calldata_overlapped_dynamic_arrays.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/calldata_overlapped_dynamic_arrays.sol @@ -34,8 +34,8 @@ contract C { // f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1, 5, 6 -> 0x20, 0x40, 5, 2 // f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1 -> FAILURE // f_storage(uint256[],uint256[2]): 0x20, 1, 2 -> 0x20, 0x60, 0x20, 1, 2 -// gas irOptimized: 111653 -// gas legacy: 112979 -// gas legacyOptimized: 112104 +// gas irOptimized: 111650 +// gas legacy: 112944 +// gas legacyOptimized: 112092 // f_storage(uint256[],uint256[2]): 0x40, 1, 2, 5, 6 -> 0x20, 0x80, 0x20, 2, 5, 6 // f_storage(uint256[],uint256[2]): 0x40, 1, 2, 5 -> FAILURE diff --git a/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol b/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol index 16f365bd4390..c72ac0075079 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol @@ -18,10 +18,10 @@ contract C { // EVMVersion: >homestead // ---- // h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324 -// gas irOptimized: 180829 -// gas legacy: 184921 -// gas legacyOptimized: 181506 +// gas irOptimized: 180823 +// gas legacy: 184830 +// gas legacyOptimized: 181493 // i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224 -// gas irOptimized: 112464 -// gas legacy: 115460 -// gas legacyOptimized: 112990 +// gas irOptimized: 112459 +// gas legacy: 115398 +// gas legacyOptimized: 112982 diff --git a/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol b/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol index 15ba6f7de3f9..93fe74c99168 100644 --- a/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol +++ b/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol @@ -9,6 +9,6 @@ contract C { // ---- // f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg" -// gas irOptimized: 135699 -// gas legacy: 137325 -// gas legacyOptimized: 136059 +// gas irOptimized: 135693 +// gas legacy: 137278 +// gas legacyOptimized: 136043 diff --git a/test/libsolidity/semanticTests/arithmetics/check_var_init.sol b/test/libsolidity/semanticTests/arithmetics/check_var_init.sol index 29fa81ffed35..6cc02bd97580 100644 --- a/test/libsolidity/semanticTests/arithmetics/check_var_init.sol +++ b/test/libsolidity/semanticTests/arithmetics/check_var_init.sol @@ -16,4 +16,4 @@ contract D { // ---- // f() -> FAILURE, hex"4e487b71", 0x11 // g(), 100 wei -> 1 -// gas legacy: 101790 +// gas legacy: 100388 diff --git a/test/libsolidity/semanticTests/array/array_memory_index_access.sol b/test/libsolidity/semanticTests/array/array_memory_index_access.sol index d8cad3e8da84..116582415fc1 100644 --- a/test/libsolidity/semanticTests/array/array_memory_index_access.sol +++ b/test/libsolidity/semanticTests/array/array_memory_index_access.sol @@ -26,9 +26,9 @@ contract C { // index(uint256): 10 -> true // index(uint256): 20 -> true // index(uint256): 0xFF -> true -// gas irOptimized: 135584 -// gas legacy: 244264 -// gas legacyOptimized: 152128 +// gas irOptimized: 135073 +// gas legacy: 241703 +// gas legacyOptimized: 151613 // accessIndex(uint256,int256): 10, 1 -> 2 // accessIndex(uint256,int256): 10, 0 -> 1 // accessIndex(uint256,int256): 10, 11 -> FAILURE, hex"4e487b71", 0x32 diff --git a/test/libsolidity/semanticTests/array/array_storage_index_access.sol b/test/libsolidity/semanticTests/array/array_storage_index_access.sol index 676e3759e321..1b6e461a364b 100644 --- a/test/libsolidity/semanticTests/array/array_storage_index_access.sol +++ b/test/libsolidity/semanticTests/array/array_storage_index_access.sol @@ -16,38 +16,38 @@ contract C { // ---- // test_indices(uint256): 1 -> // test_indices(uint256): 129 -> -// gas irOptimized: 3020710 -// gas legacy: 3071683 -// gas legacyOptimized: 3014415 +// gas irOptimized: 3019936 +// gas legacy: 3069098 +// gas legacyOptimized: 3013250 // test_indices(uint256): 5 -> -// gas irOptimized: 578008 -// gas legacy: 575321 -// gas legacyOptimized: 572912 +// gas irOptimized: 577789 +// gas legacy: 574754 +// gas legacyOptimized: 572383 // test_indices(uint256): 10 -> -// gas irOptimized: 158347 -// gas legacy: 162657 -// gas legacyOptimized: 158422 +// gas irOptimized: 158291 +// gas legacy: 162468 +// gas legacyOptimized: 158336 // test_indices(uint256): 15 -> -// gas irOptimized: 173377 -// gas legacy: 179782 -// gas legacyOptimized: 173727 +// gas irOptimized: 173296 +// gas legacy: 179513 +// gas legacyOptimized: 173606 // test_indices(uint256): 0xFF -> -// gas irOptimized: 5680122 -// gas legacy: 5780977 -// gas legacyOptimized: 5668997 +// gas irOptimized: 5678606 +// gas legacy: 5775928 +// gas legacyOptimized: 5666726 // test_indices(uint256): 1000 -> -// gas irOptimized: 18202919 -// gas legacy: 18602799 -// gas legacyOptimized: 18179744 +// gas irOptimized: 18197173 +// gas legacy: 18583810 +// gas legacyOptimized: 18171248 // test_indices(uint256): 129 -> -// gas irOptimized: 4158223 -// gas legacy: 4169611 -// gas legacyOptimized: 4126312 +// gas irOptimized: 4156312 +// gas legacy: 4164468 +// gas legacyOptimized: 4122100 // test_indices(uint256): 128 -> -// gas irOptimized: 411932 -// gas legacy: 465768 -// gas legacyOptimized: 418968 +// gas irOptimized: 411289 +// gas legacy: 463706 +// gas legacyOptimized: 418061 // test_indices(uint256): 1 -> -// gas irOptimized: 581570 -// gas legacy: 577432 -// gas legacyOptimized: 576168 +// gas irOptimized: 581362 +// gas legacy: 576904 +// gas legacyOptimized: 575649 diff --git a/test/libsolidity/semanticTests/array/array_storage_index_boundary_test.sol b/test/libsolidity/semanticTests/array/array_storage_index_boundary_test.sol index daa78f0b4062..ffe98ee43002 100644 --- a/test/libsolidity/semanticTests/array/array_storage_index_boundary_test.sol +++ b/test/libsolidity/semanticTests/array/array_storage_index_boundary_test.sol @@ -16,12 +16,12 @@ contract C { // test_boundary_check(uint256,uint256): 1, 1 -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 10, 10 -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 256, 256 -> FAILURE, hex"4e487b71", 0x32 -// gas irOptimized: 140631 -// gas legacy: 134630 -// gas legacyOptimized: 114854 +// gas irOptimized: 140383 +// gas legacy: 133633 +// gas legacyOptimized: 114354 // test_boundary_check(uint256,uint256): 256, 255 -> 0 -// gas irOptimized: 142763 -// gas legacy: 136949 -// gas legacyOptimized: 117033 +// gas irOptimized: 142515 +// gas legacy: 135949 +// gas legacyOptimized: 116533 // test_boundary_check(uint256,uint256): 256, 0xFFFF -> FAILURE, hex"4e487b71", 0x32 // test_boundary_check(uint256,uint256): 256, 2 -> 0 diff --git a/test/libsolidity/semanticTests/array/array_storage_index_zeroed_test.sol b/test/libsolidity/semanticTests/array/array_storage_index_zeroed_test.sol index 1d9d427aee52..6b3f4643cb5f 100644 --- a/test/libsolidity/semanticTests/array/array_storage_index_zeroed_test.sol +++ b/test/libsolidity/semanticTests/array/array_storage_index_zeroed_test.sol @@ -52,18 +52,18 @@ contract C { // ---- // test_zeroed_indicies(uint256): 1 -> // test_zeroed_indicies(uint256): 5 -> -// gas irOptimized: 131998 -// gas legacy: 132961 -// gas legacyOptimized: 130752 +// gas irOptimized: 131925 +// gas legacy: 132804 +// gas legacyOptimized: 130649 // test_zeroed_indicies(uint256): 10 -> -// gas irOptimized: 226012 -// gas legacy: 228071 -// gas legacyOptimized: 224010 +// gas irOptimized: 225874 +// gas legacy: 227786 +// gas legacyOptimized: 223830 // test_zeroed_indicies(uint256): 15 -> -// gas irOptimized: 324140 -// gas legacy: 327311 -// gas legacyOptimized: 321462 +// gas irOptimized: 323938 +// gas legacy: 326902 +// gas legacyOptimized: 321206 // test_zeroed_indicies(uint256): 0xFF -> -// gas irOptimized: 5120200 -// gas legacy: 5172987 -// gas legacyOptimized: 5066462 +// gas irOptimized: 5116738 +// gas legacy: 5165874 +// gas legacyOptimized: 5062182 diff --git a/test/libsolidity/semanticTests/array/array_storage_length_access.sol b/test/libsolidity/semanticTests/array/array_storage_length_access.sol index c8083b6c3f85..6a611cc17115 100644 --- a/test/libsolidity/semanticTests/array/array_storage_length_access.sol +++ b/test/libsolidity/semanticTests/array/array_storage_length_access.sol @@ -13,10 +13,10 @@ contract C { // set_get_length(uint256): 20 -> 20 // set_get_length(uint256): 0xFF -> 0xFF // gas irOptimized: 96690 -// gas legacy: 129522 -// gas legacyOptimized: 110618 +// gas legacy: 128571 +// gas legacyOptimized: 110143 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 1220648 -// gas legacy: 1704919 -// gas legacyOptimized: 1401220 +// gas irOptimized: 1220647 +// gas legacy: 1689548 +// gas legacyOptimized: 1393535 // set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas # diff --git a/test/libsolidity/semanticTests/array/array_storage_push_empty.sol b/test/libsolidity/semanticTests/array/array_storage_push_empty.sol index 6772deab0bcc..b59afd039163 100644 --- a/test/libsolidity/semanticTests/array/array_storage_push_empty.sol +++ b/test/libsolidity/semanticTests/array/array_storage_push_empty.sol @@ -12,13 +12,13 @@ contract C { // EVMVersion: >=petersburg // ---- // pushEmpty(uint256): 128 -// gas irOptimized: 406798 -// gas legacy: 416903 -// gas legacyOptimized: 398280 +// gas irOptimized: 406413 +// gas legacy: 415744 +// gas legacyOptimized: 397380 // pushEmpty(uint256): 256 -// gas irOptimized: 693826 -// gas legacy: 717115 -// gas legacyOptimized: 690172 +// gas irOptimized: 693185 +// gas legacy: 715316 +// gas legacyOptimized: 688632 // pushEmpty(uint256): 38869 -> FAILURE # out-of-gas # // gas irOptimized: 100000000 // gas legacy: 100000000 diff --git a/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol b/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol index e1de31f42cf3..9c3a426fe9cf 100644 --- a/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol +++ b/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol @@ -21,13 +21,13 @@ contract C { // gas legacy: 77730 // gas legacyOptimized: 77162 // set_get_length(uint256): 0xFF -> 0xFF -// gas irOptimized: 161696 -// gas legacy: 698137 -// gas legacyOptimized: 135004 +// gas irOptimized: 161440 +// gas legacy: 696850 +// gas legacyOptimized: 134488 // set_get_length(uint256): 0xFFF -> 0xFFF -// gas irOptimized: 1804463 -// gas legacy: 9876574 -// gas legacyOptimized: 1401346 +// gas irOptimized: 1800622 +// gas legacy: 9857362 +// gas legacyOptimized: 1393660 // set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas # // gas irOptimized: 100000000 // gas legacyOptimized: 100000000 diff --git a/test/libsolidity/semanticTests/array/array_storage_push_pop.sol b/test/libsolidity/semanticTests/array/array_storage_push_pop.sol index 97f7a1269b49..91948540f919 100644 --- a/test/libsolidity/semanticTests/array/array_storage_push_pop.sol +++ b/test/libsolidity/semanticTests/array/array_storage_push_pop.sol @@ -17,11 +17,11 @@ contract C { // gas legacy: 105722 // gas legacyOptimized: 103508 // set_get_length(uint256): 0xFF -> 0 -// gas irOptimized: 821872 -// gas legacy: 810327 -// gas legacyOptimized: 786258 +// gas irOptimized: 821106 +// gas legacy: 808020 +// gas legacyOptimized: 784467 // set_get_length(uint256): 0xFFF -> 0 -// gas irOptimized: 12841084 -// gas legacy: 12649059 -// gas legacyOptimized: 12267870 +// gas irOptimized: 12828798 +// gas legacy: 12612192 +// gas legacyOptimized: 12239199 // set_get_length(uint256): 0xFFFF -> FAILURE # Out-of-gas # diff --git a/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol b/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol index ed54d0279f60..05a663c0beef 100644 --- a/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol +++ b/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol @@ -12,9 +12,9 @@ contract Test { } // ---- // set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06 -// gas irOptimized: 186550 -// gas legacy: 211149 -// gas legacyOptimized: 206054 +// gas irOptimized: 186537 +// gas legacy: 211054 +// gas legacyOptimized: 206042 // data(uint256,uint256): 0x02, 0x02 -> 0x09 // data(uint256,uint256): 0x05, 0x01 -> 0x11 // data(uint256,uint256): 0x06, 0x00 -> FAILURE diff --git a/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol b/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol index bb1e904f0ffd..e5fd0a2d709e 100644 --- a/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol +++ b/test/libsolidity/semanticTests/array/byte_array_storage_layout.sol @@ -46,8 +46,8 @@ contract c { // storageEmpty -> 0 // test_long() -> 67 // gas irOptimized: 89148 -// gas legacy: 105839 -// gas legacyOptimized: 103293 +// gas legacy: 105693 +// gas legacyOptimized: 103216 // storageEmpty -> 0 // test_pop() -> 1780731860627700044960722568376592200742329637303199754547598369979433020 // gas legacy: 61930 diff --git a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol index 2165483ec432..554f4361a133 100644 --- a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol +++ b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 0 -// gas irOptimized: 125751 -// gas legacy: 150861 -// gas legacyOptimized: 146667 +// gas irOptimized: 125584 +// gas legacy: 150372 +// gas legacyOptimized: 146391 diff --git a/test/libsolidity/semanticTests/array/bytes_length_member.sol b/test/libsolidity/semanticTests/array/bytes_length_member.sol index 387ef09302af..04dcf2d34084 100644 --- a/test/libsolidity/semanticTests/array/bytes_length_member.sol +++ b/test/libsolidity/semanticTests/array/bytes_length_member.sol @@ -13,7 +13,7 @@ contract c { // ---- // getLength() -> 0 // set(): 1, 2 -> true -// gas irOptimized: 110402 -// gas legacy: 110968 -// gas legacyOptimized: 110585 +// gas irOptimized: 110400 +// gas legacy: 110952 +// gas legacyOptimized: 110580 // getLength() -> 68 diff --git a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol index fc51f4e3038e..ffd4b54033e7 100644 --- a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol +++ b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol @@ -9,9 +9,9 @@ contract C { // ---- // constructor(): 1, 2, 3 -> -// gas irOptimized: 141581 -// gas legacy: 183490 -// gas legacyOptimized: 151938 +// gas irOptimized: 140952 +// gas legacy: 180517 +// gas legacyOptimized: 150462 // a(uint256): 0 -> 1 // a(uint256): 1 -> 2 // a(uint256): 2 -> 3 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol b/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol index 6afd8f88f40d..3be5ba29f4d8 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_calldata_storage.sol @@ -20,7 +20,7 @@ contract c { } // ---- // store(uint256[9],uint8[3][]): 21, 22, 23, 24, 25, 26, 27, 28, 29, 0x140, 4, 1, 2, 3, 11, 12, 13, 21, 22, 23, 31, 32, 33 -> 32 -// gas irOptimized: 648324 -// gas legacy: 694515 -// gas legacyOptimized: 694013 +// gas irOptimized: 648323 +// gas legacy: 694356 +// gas legacyOptimized: 693864 // retrieve() -> 9, 28, 9, 28, 4, 3, 32 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol index 88506585e703..d88aaebcdac4 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol @@ -46,6 +46,6 @@ contract C { } // ---- // f() -> true -// gas irOptimized: 117405 -// gas legacy: 124769 -// gas legacyOptimized: 122871 +// gas irOptimized: 117369 +// gas legacy: 124660 +// gas legacyOptimized: 122801 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol index 27f687360733..ebc6dadbe76f 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage.sol @@ -13,6 +13,6 @@ contract C { } // ---- // f() -> 0 -// gas irOptimized: 107492 -// gas legacy: 108251 -// gas legacyOptimized: 107639 +// gas irOptimized: 107488 +// gas legacy: 108218 +// gas legacyOptimized: 107625 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol index 86da315c3f58..55e20f91729f 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol @@ -19,6 +19,6 @@ contract c { // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x05000000000000000000000000000000000000000000000000 -// gas irOptimized: 208149 -// gas legacy: 221856 -// gas legacyOptimized: 220680 +// gas irOptimized: 208122 +// gas legacy: 221769 +// gas legacyOptimized: 220611 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol b/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol index 1599f0d3523c..80364f02578d 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_including_array.sol @@ -35,12 +35,12 @@ contract c { } // ---- // test() -> 0x02000202 -// gas irOptimized: 4550335 -// gas legacy: 4478946 -// gas legacyOptimized: 4448809 +// gas irOptimized: 4548245 +// gas legacy: 4476222 +// gas legacyOptimized: 4448113 // storageEmpty -> 1 // clear() -> 0, 0 -// gas irOptimized: 4477223 -// gas legacy: 4410748 -// gas legacyOptimized: 4382489 +// gas irOptimized: 4475224 +// gas legacy: 4408014 +// gas legacyOptimized: 4381784 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol b/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol index a85765cd9853..03f58e11900f 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_nested_array.sol @@ -13,6 +13,6 @@ contract c { // ---- // test(uint256[2][]): 32, 3, 7, 8, 9, 10, 11, 12 -> 10 -// gas irOptimized: 689759 -// gas legacy: 686268 -// gas legacyOptimized: 685688 +// gas irOptimized: 689714 +// gas legacy: 686178 +// gas legacyOptimized: 685628 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol index ed8e2746eb4c..d17e45a2f3ed 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 5, 4 -// gas irOptimized: 205073 -// gas legacy: 213901 -// gas legacyOptimized: 212916 +// gas irOptimized: 205062 +// gas legacy: 213863 +// gas legacyOptimized: 212902 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol index 960343916d57..113269ea2ba3 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol @@ -23,6 +23,6 @@ contract c { // compileToEwasm: also // ---- // test() -> 3, 4 -// gas irOptimized: 169616 -// gas legacy: 175453 -// gas legacyOptimized: 172541 +// gas irOptimized: 169602 +// gas legacy: 175424 +// gas legacyOptimized: 172535 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol index 5e12fa657d17..29c845f13065 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol @@ -15,9 +15,9 @@ contract c { // ---- // setData1(uint256,uint256,uint256): 10, 5, 4 -> // copyStorageStorage() -> -// gas irOptimized: 111368 -// gas legacy: 109278 -// gas legacyOptimized: 109268 +// gas irOptimized: 111366 +// gas legacy: 109272 +// gas legacyOptimized: 109262 // getData2(uint256): 5 -> 10, 4 // setData1(uint256,uint256,uint256): 0, 0, 0 -> // copyStorageStorage() -> diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol index 749b70417aa9..1582b711837c 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dynamic_dynamic.sol @@ -18,6 +18,6 @@ contract c { // ---- // test() -> 5, 4 -// gas irOptimized: 252993 -// gas legacy: 250934 -// gas legacyOptimized: 250060 +// gas irOptimized: 252986 +// gas legacy: 250892 +// gas legacyOptimized: 250046 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_dynamic.sol index 99e6b06f0dca..8b750efa7ad3 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_dynamic.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_dynamic.sol @@ -12,6 +12,6 @@ contract c { // ---- // test() -> 9, 4 -// gas irOptimized: 123143 -// gas legacy: 123579 -// gas legacyOptimized: 123208 +// gas irOptimized: 123142 +// gas legacy: 123567 +// gas legacyOptimized: 123202 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_static.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_static.sol index 3f74616c25a6..f7f0560653b4 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_static.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_static.sol @@ -17,6 +17,6 @@ contract c { // compileToEwasm: also // ---- // test() -> 8, 0 -// gas irOptimized: 196279 -// gas legacy: 194895 -// gas legacyOptimized: 194303 +// gas irOptimized: 196278 +// gas legacy: 194843 +// gas legacyOptimized: 194281 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol index c42b6799880a..4339c89b5506 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol @@ -17,7 +17,7 @@ contract c { } // ---- // test() -> 4, 5 -// gas irOptimized: 190899 -// gas legacy: 190989 -// gas legacyOptimized: 189728 +// gas irOptimized: 190870 +// gas legacy: 190852 +// gas legacyOptimized: 189658 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol index 27f1a6aa0741..c9c6e32284b9 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_to_memory_nested.sol @@ -15,6 +15,6 @@ contract C { } // ---- // f() -> 0x20, 2, 0x40, 0xa0, 2, 0, 1, 2, 2, 3 -// gas irOptimized: 161735 -// gas legacy: 162278 -// gas legacyOptimized: 159955 +// gas irOptimized: 161715 +// gas legacy: 162203 +// gas legacyOptimized: 159941 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol index fa73987bf908..a3f800b0834f 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol @@ -19,6 +19,6 @@ contract c { // compileToEwasm: also // ---- // test() -> 0xffffffff, 0x0000000000000000000000000a00090008000700060005000400030002000100, 0x0000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 104740 -// gas legacy: 167514 -// gas legacyOptimized: 145759 +// gas irOptimized: 104665 +// gas legacy: 166874 +// gas legacyOptimized: 145474 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol index fb0e49b47847..160697c6b157 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol @@ -21,6 +21,6 @@ contract c { // compileToEwasm: also // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x0 -// gas irOptimized: 273586 -// gas legacy: 283726 -// gas legacyOptimized: 282045 +// gas irOptimized: 273576 +// gas legacy: 283666 +// gas legacyOptimized: 282023 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol index c4ffe543f8d7..c2ab09c6432e 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol @@ -21,6 +21,6 @@ contract c { // compileToEwasm: also // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x00 -// gas irOptimized: 233293 -// gas legacy: 236560 -// gas legacyOptimized: 235611 +// gas irOptimized: 233285 +// gas legacy: 236523 +// gas legacyOptimized: 235592 diff --git a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol index 4ee91191c672..e139e200ffe3 100644 --- a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol @@ -53,9 +53,9 @@ contract C { // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 150098 -// gas legacy: 150830 -// gas legacyOptimized: 148728 +// gas irOptimized: 150061 +// gas legacy: 150745 +// gas legacyOptimized: 148685 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_calldata(uint8[][]): 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol index 02872f8dde9f..8cc849ecdc7b 100644 --- a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol @@ -38,10 +38,10 @@ contract c { // compileViaYul: true // ---- // test1(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 180769 +// gas irOptimized: 180759 // test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 157567 +// gas irOptimized: 157562 // test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 -// gas irOptimized: 134644 +// gas irOptimized: 134637 // test4(uint256[2][2]): 23, 42, 23, 42 -> 65 -// gas irOptimized: 111271 +// gas irOptimized: 111270 diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol index d86eb748d950..08e427eea53f 100644 --- a/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_nested_memory_to_storage.sol @@ -38,12 +38,12 @@ contract Test { } // ---- // test() -> 24 -// gas irOptimized: 226700 -// gas legacy: 227121 -// gas legacyOptimized: 226557 +// gas irOptimized: 226687 +// gas legacy: 227084 +// gas legacyOptimized: 226529 // test1() -> 3 // test2() -> 6 // test3() -> 24 -// gas irOptimized: 141260 -// gas legacy: 142283 -// gas legacyOptimized: 141393 +// gas irOptimized: 141244 +// gas legacy: 142238 +// gas legacyOptimized: 141365 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol index 3b150f4f78a6..9a2ab14cbbd2 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol @@ -45,7 +45,7 @@ contract C { } // ---- // copyExternalStorageArrayOfFunctionType() -> true -// gas irOptimized: 104615 -// gas legacy: 108722 -// gas legacyOptimized: 102438 +// gas irOptimized: 104606 +// gas legacy: 108554 +// gas legacyOptimized: 102413 // copyInternalArrayOfFunctionType() -> true diff --git a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol index 6576149eb9be..dc30e44b6fde 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol @@ -48,8 +48,8 @@ contract C { } // ---- // copyExternalStorageArraysOfFunctionType() -> true -// gas irOptimized: 104288 -// gas legacy: 108459 -// gas legacyOptimized: 102171 +// gas irOptimized: 104279 +// gas legacy: 108295 +// gas legacyOptimized: 102146 // copyInternalArrayOfFunctionType() -> true // gas legacy: 104178 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol index a7487a64fe25..ec193d693ae5 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol @@ -17,4 +17,4 @@ contract C { // compileViaYul: true // ---- // f((uint128,uint64,uint128)[]): 0x20, 3, 0, 0, 12, 0, 11, 0, 10, 0, 0 -> 10, 11, 12 -// gas irOptimized: 119737 +// gas irOptimized: 119736 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol index 09653d5369d1..3024f44adcd1 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol @@ -19,4 +19,4 @@ contract C { // compileViaYul: true // ---- // f() -> 10, 11, 12 -// gas irOptimized: 118394 +// gas irOptimized: 118393 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol index 49d307fe2dbe..b60a7c3c2a5a 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol @@ -23,4 +23,4 @@ contract C { // compileViaYul: true // ---- // f((uint256[])[]): 0x20, 3, 0x60, 0x60, 0x60, 0x20, 3, 1, 2, 3 -> 3, 1 -// gas irOptimized: 327798 +// gas irOptimized: 327759 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol index 03146105639e..e175dd87c75b 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol @@ -26,4 +26,4 @@ contract C { // compileViaYul: true // ---- // f() -> 3, 3, 3, 1 -// gas irOptimized: 181997 +// gas irOptimized: 181950 diff --git a/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol b/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol index fbb7244c5267..cbb87a2788ca 100644 --- a/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol +++ b/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol @@ -14,6 +14,6 @@ contract C { // compileToEwasm: also // ---- // f() -> 1, 2, 3 -// gas irOptimized: 131933 -// gas legacy: 134619 -// gas legacyOptimized: 131940 +// gas irOptimized: 131932 +// gas legacy: 134606 +// gas legacyOptimized: 131938 diff --git a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol index bd9444638015..5c36ed3f3a0e 100644 --- a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol @@ -38,8 +38,8 @@ contract C { // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 147913 -// gas legacy: 148965 -// gas legacyOptimized: 146935 +// gas irOptimized: 147892 +// gas legacy: 148896 +// gas legacyOptimized: 146908 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 diff --git a/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol b/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol index d13381d804c8..0deb396d3d66 100644 --- a/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol @@ -11,8 +11,8 @@ contract Test { // ---- // set(uint24[]): 0x20, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 -> 18 // gas irOptimized: 99616 -// gas legacy: 103563 -// gas legacyOptimized: 101397 +// gas legacy: 103509 +// gas legacyOptimized: 101390 // data(uint256): 7 -> 8 // data(uint256): 15 -> 16 // data(uint256): 18 -> FAILURE diff --git a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol index 99ee19d7a387..523a0ebebb9e 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol @@ -5,13 +5,13 @@ contract c { } // ---- // set(uint256): 1, 2 -> true -// gas irOptimized: 110576 -// gas legacy: 111333 -// gas legacyOptimized: 110750 +// gas irOptimized: 110574 +// gas legacy: 111312 +// gas legacyOptimized: 110744 // set(uint256): 2, 2, 3, 4, 5 -> true -// gas irOptimized: 177527 -// gas legacy: 178335 -// gas legacyOptimized: 177725 +// gas irOptimized: 177525 +// gas legacy: 178314 +// gas legacyOptimized: 177719 // storageEmpty -> 0 // copy(uint256,uint256): 1, 2 -> true // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol index f0f0b3fbdfe3..9448970b7845 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol @@ -17,25 +17,25 @@ contract c { // ---- // f(uint256): 0 -> 0x20, 0x00 // f(uint256): 31 -> 0x20, 0x1f, 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e00 -// gas irOptimized: 109413 -// gas legacy: 124296 -// gas legacyOptimized: 119119 +// gas irOptimized: 109255 +// gas legacy: 123948 +// gas legacyOptimized: 118948 // f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671 -// gas irOptimized: 124165 -// gas legacy: 140851 -// gas legacyOptimized: 135691 +// gas irOptimized: 123936 +// gas legacy: 140362 +// gas legacyOptimized: 135386 // f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 130784 -// gas legacy: 148435 -// gas legacyOptimized: 142608 +// gas irOptimized: 130543 +// gas legacy: 147916 +// gas legacyOptimized: 142290 // f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992 -// gas irOptimized: 139784 -// gas legacy: 172075 -// gas legacyOptimized: 162138 +// gas irOptimized: 139333 +// gas legacy: 171136 +// gas legacyOptimized: 161550 // f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000 // gas legacy: 59345 // gas legacyOptimized: 57279 // f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968 -// gas irOptimized: 442899 -// gas legacy: 506874 -// gas legacyOptimized: 488177 +// gas irOptimized: 441985 +// gas legacy: 505021 +// gas legacyOptimized: 486997 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol index 0905266d82e1..3f629686f78a 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol @@ -9,6 +9,6 @@ contract C { } // ---- // f(uint256[]): 0x20, 0x03, 0x1, 0x2, 0x3 -> 0x1 -// gas irOptimized: 110971 -// gas legacy: 111565 -// gas legacyOptimized: 111347 +// gas irOptimized: 110970 +// gas legacy: 111551 +// gas legacyOptimized: 111339 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol index 0573760eb4e9..90b5b85d6afe 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol @@ -15,4 +15,4 @@ contract C { // compileViaYul: true // ---- // from_calldata(uint8[][]): 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 139927 +// gas irOptimized: 139905 diff --git a/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol b/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol index c2dda730d614..9a111e2bcde3 100644 --- a/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol +++ b/test/libsolidity/semanticTests/array/copying/cleanup_during_multi_element_per_slot_copy.sol @@ -16,7 +16,7 @@ contract C { } // ---- // constructor() -// gas irOptimized: 236265 -// gas legacy: 221315 -// gas legacyOptimized: 185247 +// gas irOptimized: 234419 +// gas legacy: 215757 +// gas legacyOptimized: 181760 // f() -> 0 diff --git a/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol index ef7ff3232c74..edb657ad975b 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol @@ -35,12 +35,12 @@ contract C { } // ---- // f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000 -// gas irOptimized: 179766 -// gas legacy: 181047 -// gas legacyOptimized: 180029 +// gas irOptimized: 179752 +// gas legacy: 181001 +// gas legacyOptimized: 180014 // g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000 -// gas irOptimized: 106697 -// gas legacy: 109801 -// gas legacyOptimized: 106953 +// gas irOptimized: 106682 +// gas legacy: 109720 +// gas legacyOptimized: 106937 // h() -> 0x40, 0x60, 0x00, 0x00 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/copy_byte_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_byte_array_to_storage.sol index a4c5566221fe..61d5ccf869dc 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_byte_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_byte_array_to_storage.sol @@ -46,6 +46,6 @@ contract C { } // ---- // f() -> 0xff -// gas irOptimized: 143428 -// gas legacy: 153580 -// gas legacyOptimized: 146765 +// gas irOptimized: 143426 +// gas legacy: 153395 +// gas legacyOptimized: 146722 diff --git a/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol b/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol index e938b03d6199..d4d535950181 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol @@ -16,6 +16,6 @@ contract C { // ---- // test() -> 7 -// gas irOptimized: 122483 -// gas legacy: 205196 -// gas legacyOptimized: 204987 +// gas irOptimized: 122477 +// gas legacy: 205176 +// gas legacyOptimized: 204971 diff --git a/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol index b13d15e17574..20b894082ca1 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol @@ -21,6 +21,6 @@ contract C { // compileToEwasm: also // ---- // one() -> 3 -// gas legacy: 140260 -// gas legacyOptimized: 140097 +// gas legacy: 140253 +// gas legacyOptimized: 140093 // two() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol index 1c72666111bd..58fc1c13dacf 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_removes_bytes_data.sol @@ -7,9 +7,9 @@ contract c { } // ---- // set(): 1, 2, 3, 4, 5 -> true -// gas irOptimized: 177386 -// gas legacy: 177970 -// gas legacyOptimized: 177559 +// gas irOptimized: 177383 +// gas legacy: 177954 +// gas legacyOptimized: 177554 // storageEmpty -> 0 // reset() -> true // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol index cc61509d4437..ca6362b5c01d 100644 --- a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol +++ b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol @@ -20,9 +20,9 @@ contract sender { // compileToEwasm: false // ---- // (): 7 -> -// gas irOptimized: 110826 -// gas legacy: 111408 -// gas legacyOptimized: 111078 +// gas irOptimized: 110820 +// gas legacy: 111388 +// gas legacyOptimized: 111071 // val() -> 0 // forward(bool): true -> true // val() -> 0x80 diff --git a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol index fe87b79ee21f..f435d9136367 100644 --- a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol @@ -33,8 +33,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][][]): 0x20, 1, 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 327878 +// gas irOptimized: 327821 // test2((uint8[],uint8[2])[][1][]): 0x20, 2, 0x40, 0x0160, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13, 0x20, 1, 0x20, 0x60, 31, 37, 2, 23, 29 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 140894 +// gas irOptimized: 140867 // test3((uint8[],uint8[2])[1][][2]): 0x20, 0x40, 0x60, 0, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 188509 +// gas irOptimized: 188473 diff --git a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol index 8bd1eb18a06f..3a52e0a58488 100644 --- a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol @@ -33,8 +33,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][][]): 0x20, 1, 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 332586 +// gas irOptimized: 332527 // test2((uint8[],uint8[2])[][1][]): 0x20, 2, 0x40, 0x0160, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13, 0x20, 1, 0x20, 0x60, 31, 37, 2, 23, 29 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 145182 +// gas irOptimized: 145155 // test3((uint8[],uint8[2])[1][][2]): 0x20, 0x40, 0x60, 0, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 192512 +// gas irOptimized: 192476 diff --git a/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol index 1e8760250a37..68db47519436 100644 --- a/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol @@ -46,11 +46,11 @@ contract C { } // ---- // test() -> 0x20, 0x14, "[a called][b called]" -// gas irOptimized: 116673 -// gas legacy: 119030 -// gas legacyOptimized: 117021 +// gas irOptimized: 116638 +// gas legacy: 118936 +// gas legacyOptimized: 116975 // test2() -> 0x20, 0x14, "[b called][a called]" // test3() -> 0x20, 0x14, "[b called][a called]" -// gas irOptimized: 103256 -// gas legacy: 102814 -// gas legacyOptimized: 101706 +// gas irOptimized: 103241 +// gas legacy: 102745 +// gas legacyOptimized: 101669 diff --git a/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol b/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol index 16d10a36d20b..074ca934ff13 100644 --- a/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> 3 -// gas irOptimized: 128172 -// gas legacy: 130757 -// gas legacyOptimized: 129144 +// gas irOptimized: 128116 +// gas legacy: 130584 +// gas legacyOptimized: 129031 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol index 0da09064cdd9..c402c14b2099 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_element_storage_to_storage.sol @@ -71,15 +71,15 @@ contract C { // ---- // test1() -> -// gas irOptimized: 150570 -// gas legacy: 151017 -// gas legacyOptimized: 150970 +// gas irOptimized: 150508 +// gas legacy: 150949 +// gas legacyOptimized: 150906 // test2() -> FAILURE -// gas irOptimized: 150408 -// gas legacy: 150700 -// gas legacyOptimized: 150601 +// gas irOptimized: 150385 +// gas legacy: 150673 +// gas legacyOptimized: 150576 // test3() -> -// gas irOptimized: 123810 -// gas legacy: 125381 -// gas legacyOptimized: 125160 +// gas irOptimized: 123776 +// gas legacy: 125333 +// gas legacyOptimized: 125127 // test4() -> FAILURE diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol index 1f9011abde3c..60d65cb59bd6 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol @@ -31,8 +31,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][]): 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 304768 +// gas irOptimized: 304714 // test2((uint8[],uint8[2])[][1]): 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 116476 +// gas irOptimized: 116454 // test3((uint8[],uint8[2])[1][]): 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 187998 +// gas irOptimized: 187962 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol index 218e8f1c7cbe..13b350262162 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol @@ -31,8 +31,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][]): 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 309123 +// gas irOptimized: 309068 // test2((uint8[],uint8[2])[][1]): 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 118188 +// gas irOptimized: 118167 // test3((uint8[],uint8[2])[1][]): 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 190997 +// gas irOptimized: 190961 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_storage_to_storage.sol index b4ab1cc61e41..64c7f06a57c1 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_storage_to_storage.sol @@ -64,7 +64,7 @@ contract C { // compileViaYul: true // ---- // test1() -// gas irOptimized: 123279 +// gas irOptimized: 123237 // test2() -// gas irOptimized: 123073 +// gas irOptimized: 123043 // test3() diff --git a/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol index c519d11ce933..5b7205553026 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol @@ -31,7 +31,7 @@ contract C { // compileViaYul: true // ---- // test(uint8[][][]): 0x20, 2, 0x40, 0x60, 0, 2, 0x40, 0x80, 1, 7, 2, 8, 9 -// gas irOptimized: 138083 +// gas irOptimized: 138054 // test2(uint8[][]): 0x20, 2, 0x40, 0x80, 1, 7, 2, 8, 9 -// gas irOptimized: 164290 +// gas irOptimized: 164232 // gas legacyOptimized: 120228 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol index ddcae981f22c..f7a863b46953 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol @@ -17,6 +17,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 205985 -// gas legacy: 212313 -// gas legacyOptimized: 211462 +// gas irOptimized: 205974 +// gas legacy: 212237 +// gas legacyOptimized: 211425 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol index 550e74a6fad9..2a786301585f 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_bytes.sol @@ -11,6 +11,6 @@ contract C { } // ---- // f() -> 0x20, 0x02, 0x40, 0x80, 3, 0x6162630000000000000000000000000000000000000000000000000000000000, 0x99, 44048183304486788312148433451363384677562265908331949128489393215789685032262, 32241931068525137014058842823026578386641954854143559838526554899205067598957, 49951309422467613961193228765530489307475214998374779756599339590522149884499, 0x54555658595a6162636465666768696a6b6c6d6e6f707172737475767778797a, 0x4142434445464748494a4b4c4d4e4f5051525354555658595a00000000000000 -// gas irOptimized: 202808 -// gas legacy: 204860 -// gas legacyOptimized: 203385 +// gas irOptimized: 202805 +// gas legacy: 204798 +// gas legacyOptimized: 203368 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol index eabcb1666cf3..0f3f7783d478 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 205985 -// gas legacy: 212318 -// gas legacyOptimized: 211467 +// gas irOptimized: 205974 +// gas legacy: 212242 +// gas legacyOptimized: 211430 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol index 46eae913df2e..b40bfacedc7a 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol @@ -24,6 +24,6 @@ contract C { } // ---- // f() -> 11, 0x0c, 1, 0x15, 22, 4 -// gas irOptimized: 291168 -// gas legacy: 293516 -// gas legacyOptimized: 290263 +// gas irOptimized: 291155 +// gas legacy: 293407 +// gas legacyOptimized: 290218 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol index 8fed11241a67..341a4c9d9029 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_packed_dyn.sol @@ -13,6 +13,6 @@ contract C { } // ---- // f() -> 2, 3, 4 -// gas irOptimized: 109838 -// gas legacy: 126350 -// gas legacyOptimized: 120704 +// gas irOptimized: 109804 +// gas legacy: 126129 +// gas legacyOptimized: 120622 diff --git a/test/libsolidity/semanticTests/array/create_memory_array.sol b/test/libsolidity/semanticTests/array/create_memory_array.sol index fbef4ccfaa2a..0d099815bf34 100644 --- a/test/libsolidity/semanticTests/array/create_memory_array.sol +++ b/test/libsolidity/semanticTests/array/create_memory_array.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> "A", 8, 4, "B" -// gas irOptimized: 125828 -// gas legacy: 121398 -// gas legacyOptimized: 115494 +// gas irOptimized: 125827 +// gas legacy: 121382 +// gas legacyOptimized: 115488 diff --git a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol index 9aadf0db048b..a653db837f08 100644 --- a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol +++ b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol @@ -16,6 +16,6 @@ contract c { } // ---- // test1() -> true -// gas irOptimized: 206428 -// gas legacy: 254905 -// gas legacyOptimized: 247415 +// gas irOptimized: 206322 +// gas legacy: 254056 +// gas legacyOptimized: 246887 diff --git a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol index 9d1b02b22d15..13d510f80b2a 100644 --- a/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/dynamic_array_cleanup.sol @@ -14,9 +14,9 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> -// gas irOptimized: 519361 -// gas legacy: 521584 -// gas legacyOptimized: 517027 +// gas irOptimized: 519276 +// gas legacy: 521414 +// gas legacyOptimized: 516983 // storageEmpty -> 0 // halfClear() -> // gas irOptimized: 113961 diff --git a/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol b/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol index 8ff67048c382..d6e7160be9fc 100644 --- a/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol +++ b/test/libsolidity/semanticTests/array/dynamic_arrays_in_storage.sol @@ -42,9 +42,9 @@ contract c { // ---- // getLengths() -> 0, 0 // setLengths(uint256,uint256): 48, 49 -> -// gas irOptimized: 111448 -// gas legacy: 108571 -// gas legacyOptimized: 100417 +// gas irOptimized: 111301 +// gas legacy: 108273 +// gas legacyOptimized: 100269 // getLengths() -> 48, 49 // setIDStatic(uint256): 11 -> // getID(uint256): 2 -> 11 diff --git a/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol b/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol index 90957b0ddc2d..4c5f646951b9 100644 --- a/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/dynamic_multi_array_cleanup.sol @@ -16,9 +16,9 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> 8 -// gas irOptimized: 123012 -// gas legacy: 121756 -// gas legacyOptimized: 120687 +// gas irOptimized: 122916 +// gas legacy: 121602 +// gas legacyOptimized: 120589 // storageEmpty -> 0 // clear() -> // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol index cb4a14c05171..51f93db7a29b 100644 --- a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol @@ -12,9 +12,9 @@ contract c { // ---- // storageEmpty -> 1 // fill() -> -// gas irOptimized: 465345 -// gas legacy: 471280 -// gas legacyOptimized: 467500 +// gas irOptimized: 465324 +// gas legacy: 471178 +// gas legacyOptimized: 467478 // storageEmpty -> 0 // clear() -> // gas irOptimized: 122148 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol index 4416635b62cb..519a11131c85 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol @@ -19,6 +19,6 @@ contract B { // ---- // f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004 -// gas irOptimized: 116813 -// gas legacy: 234719 -// gas legacyOptimized: 132639 +// gas irOptimized: 115828 +// gas legacy: 230001 +// gas legacyOptimized: 130637 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol index 2749f0102590..71fec7bda0d1 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol @@ -9,8 +9,8 @@ contract Creator { } // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 128288 -// gas legacy: 176789 -// gas legacyOptimized: 129585 +// gas irOptimized: 127659 +// gas legacy: 174186 +// gas legacyOptimized: 128709 // r() -> 4 // ch() -> 3 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index 71bd36b9003e..8bb4545b2b94 100644 --- a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol +++ b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol @@ -43,6 +43,6 @@ contract C { // ---- // test() -> 5, 6, 7 -// gas irOptimized: 262057 -// gas legacy: 452136 -// gas legacyOptimized: 284945 +// gas irOptimized: 260895 +// gas legacy: 441556 +// gas legacyOptimized: 279321 diff --git a/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol b/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol index 0ff2ea5f8910..815c1768c2db 100644 --- a/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol +++ b/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol @@ -40,9 +40,9 @@ contract C { // copyFromStorageShort() // x() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000 // copyFromStorageLong() -// gas irOptimized: 121130 -// gas legacy: 121930 -// gas legacyOptimized: 121408 +// gas irOptimized: 121123 +// gas legacy: 121904 +// gas legacyOptimized: 121400 // x() -> 0x20, 0x25, 0x3132333435363738393031323334353637383930313233343536373839303132, 0x3334353637000000000000000000000000000000000000000000000000000000 // copyToStorage() // x() -> 0x20, 0x25, 0x3132333435363738393031323334353637383930313233343536373839303132, 0x3334353637000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol b/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol index 5292182b9528..7f80f1bd0770 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_array_transition.sol @@ -23,7 +23,7 @@ contract c { } // ---- // test() -> 1, 2, 3 -// gas irOptimized: 1828598 -// gas legacy: 1823228 -// gas legacyOptimized: 1813956 +// gas irOptimized: 1828169 +// gas legacy: 1822466 +// gas legacyOptimized: 1813404 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol b/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol index 2ef781a703d5..6a657032bb48 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_uint16_transition.sol @@ -18,7 +18,7 @@ contract c { } // ---- // test() -> 38, 28, 18 -// gas irOptimized: 148520 -// gas legacy: 151594 -// gas legacyOptimized: 142655 +// gas irOptimized: 148168 +// gas legacy: 151184 +// gas legacyOptimized: 142418 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol b/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol index a56aef2cd602..1a74ea972295 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_uint24_transition.sol @@ -18,7 +18,7 @@ contract c { } // ---- // test() -> 20, 10 -// gas irOptimized: 126056 -// gas legacy: 127424 -// gas legacyOptimized: 122350 +// gas irOptimized: 125933 +// gas legacy: 127216 +// gas legacyOptimized: 122224 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_copy_long.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_copy_long.sol index cb917cef0977..3528e4c8180a 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_copy_long.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_copy_long.sol @@ -11,5 +11,5 @@ contract c { // ---- // test() -> 0x20, 29, 0x0303030303030303030303030303030303030303030303030303030303000000 // gas irOptimized: 109310 -// gas legacy: 101362 +// gas legacy: 101220 // gas legacyOptimized: 123422 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol index 0c03436544a5..95a2b012c713 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol @@ -16,7 +16,7 @@ contract c { } // ---- // test() -> true -// gas irOptimized: 140496 -// gas legacy: 179275 -// gas legacyOptimized: 164122 +// gas irOptimized: 140325 +// gas legacy: 178397 +// gas legacyOptimized: 163832 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol index 7ce41ffffd9b..f6eb8e1270c2 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty_garbage_ref.sol @@ -15,7 +15,7 @@ contract c { } // ---- // test() -> -// gas irOptimized: 113892 -// gas legacy: 131544 -// gas legacyOptimized: 126811 +// gas irOptimized: 113826 +// gas legacy: 131245 +// gas legacyOptimized: 126668 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol index 095109a186cd..6416afb2da74 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_masking_long.sol @@ -10,6 +10,6 @@ contract c { // ---- // test() -> 0x20, 33, 0x303030303030303030303030303030303030303030303030303030303030303, 0x0300000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 108097 -// gas legacy: 125584 -// gas legacyOptimized: 122560 +// gas irOptimized: 108053 +// gas legacy: 125420 +// gas legacyOptimized: 122472 diff --git a/test/libsolidity/semanticTests/array/push/array_push.sol b/test/libsolidity/semanticTests/array/push/array_push.sol index 18f20c021afd..0dbd7c11bfaf 100644 --- a/test/libsolidity/semanticTests/array/push/array_push.sol +++ b/test/libsolidity/semanticTests/array/push/array_push.sol @@ -16,6 +16,6 @@ contract c { } // ---- // test() -> 5, 4, 3, 3 -// gas irOptimized: 111406 -// gas legacy: 111838 -// gas legacyOptimized: 111128 +// gas irOptimized: 111401 +// gas legacy: 111807 +// gas legacyOptimized: 111122 diff --git a/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol b/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol index 63f974498a9d..87616f1f5fc3 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol @@ -12,6 +12,6 @@ contract C { } // ---- // f(uint120[]): 0x20, 3, 1, 2, 3 -> 1 -// gas irOptimized: 112832 -// gas legacy: 113686 -// gas legacyOptimized: 113499 +// gas irOptimized: 112825 +// gas legacy: 113659 +// gas legacyOptimized: 113482 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct.sol b/test/libsolidity/semanticTests/array/push/array_push_struct.sol index 04f94b3dbb0d..f7918bbb488f 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct.sol @@ -20,6 +20,6 @@ contract c { } // ---- // test() -> 2, 3, 4, 5 -// gas irOptimized: 135204 -// gas legacy: 147484 -// gas legacyOptimized: 146456 +// gas irOptimized: 135199 +// gas legacy: 147443 +// gas legacyOptimized: 146434 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol b/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol index 9718f303c3d7..91a6a0b372cc 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol @@ -16,6 +16,6 @@ contract c { } // ---- // test((uint16,uint16,uint16[3],uint16[])): 0x20, 2, 3, 0, 0, 4, 0xC0, 4, 0, 0, 5, 0, 0 -> 2, 3, 4, 5 -// gas irOptimized: 137092 -// gas legacy: 142537 -// gas legacyOptimized: 138023 +// gas irOptimized: 137087 +// gas legacy: 142423 +// gas legacyOptimized: 137993 diff --git a/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol b/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol index 119e4ca2890b..08cfe58a3f60 100644 --- a/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol +++ b/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol @@ -15,6 +15,6 @@ contract c { } // ---- // test() -> 0 -// gas irOptimized: 173456 -// gas legacy: 216790 -// gas legacyOptimized: 204003 +// gas irOptimized: 173252 +// gas legacy: 215891 +// gas legacyOptimized: 203615 diff --git a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol index 71a21820d24a..b2fbbc977bfd 100644 --- a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol +++ b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol @@ -13,6 +13,6 @@ contract C { } // ---- // f() -> -// gas irOptimized: 179170 -// gas legacy: 181066 -// gas legacyOptimized: 180435 +// gas irOptimized: 179165 +// gas legacy: 181014 +// gas legacyOptimized: 180413 diff --git a/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol b/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol index 4938e6e45525..4b5a2b89d730 100644 --- a/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol +++ b/test/libsolidity/semanticTests/array/push/push_no_args_2d.sol @@ -27,15 +27,15 @@ contract C { // ---- // l() -> 0 // f(uint256,uint256): 42, 64 -> -// gas irOptimized: 112470 -// gas legacy: 108105 -// gas legacyOptimized: 101987 +// gas irOptimized: 112290 +// gas legacy: 107920 +// gas legacyOptimized: 101897 // l() -> 1 // ll(uint256): 0 -> 43 // a(uint256,uint256): 0, 42 -> 64 // f(uint256,uint256): 84, 128 -> -// gas irOptimized: 119058 -// gas legacy: 110325 +// gas irOptimized: 118710 +// gas legacy: 109972 // gas legacyOptimized: 96331 // l() -> 2 // ll(uint256): 1 -> 85 diff --git a/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol b/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol index dae522e57953..8ba57af0208f 100644 --- a/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol +++ b/test/libsolidity/semanticTests/array/push/push_no_args_bytes.sol @@ -21,9 +21,9 @@ contract C { // ---- // l() -> 0 // g(uint256): 70 -> -// gas irOptimized: 182534 -// gas legacy: 183811 -// gas legacyOptimized: 179218 +// gas irOptimized: 182362 +// gas legacy: 183445 +// gas legacyOptimized: 178995 // l() -> 70 // a(uint256): 69 -> left(69) // f() -> diff --git a/test/libsolidity/semanticTests/array/reusing_memory.sol b/test/libsolidity/semanticTests/array/reusing_memory.sol index d4dafdb73b04..b690fad1de4c 100644 --- a/test/libsolidity/semanticTests/array/reusing_memory.sol +++ b/test/libsolidity/semanticTests/array/reusing_memory.sol @@ -24,6 +24,6 @@ contract Main { } // ---- // f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1 -// gas irOptimized: 112757 -// gas legacy: 126596 -// gas legacyOptimized: 113823 +// gas irOptimized: 112161 +// gas legacy: 125162 +// gas legacyOptimized: 113012 diff --git a/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol b/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol index e2d0ba7ac8a2..d76260c9ab0b 100644 --- a/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol +++ b/test/libsolidity/semanticTests/byte_array_to_storage_cleanup.sol @@ -28,9 +28,9 @@ contract C { // compileViaYul: also // ---- // constructor() -> -// gas irOptimized: 449704 -// gas legacy: 729908 -// gas legacyOptimized: 493347 +// gas irOptimized: 442746 +// gas legacy: 711299 +// gas legacyOptimized: 481080 // h() -> 0x20, 0x40, 0x00, 0 // ~ emit ev(uint256[],uint256): 0x40, 0x21, 0x02, 0x00, 0x00 // g() -> 0x20, 0x40, 0, 0x00 diff --git a/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol b/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol index 9fc432e8c3aa..8df274158469 100644 --- a/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/calldata/copy_from_calldata_removes_bytes_data.sol @@ -10,9 +10,9 @@ contract c { // compileToEwasm: false // ---- // (): 1, 2, 3, 4, 5 -> -// gas irOptimized: 155158 -// gas legacy: 155483 -// gas legacyOptimized: 155303 +// gas irOptimized: 155155 +// gas legacy: 155473 +// gas legacyOptimized: 155299 // checkIfDataIsEmpty() -> false // sendMessage() -> true, 0x40, 0 // checkIfDataIsEmpty() -> true diff --git a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol index 1d311be806ac..24c33facb62d 100644 --- a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol @@ -24,6 +24,6 @@ contract Creator { } // ---- // f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8 -// gas irOptimized: 429680 -// gas legacy: 590683 -// gas legacyOptimized: 448326 +// gas irOptimized: 429160 +// gas legacy: 581443 +// gas legacyOptimized: 444588 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol index 4e3f92c81c77..3df201222e3f 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol @@ -24,6 +24,6 @@ contract Creator { } // ---- // f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h" -// gas irOptimized: 279069 -// gas legacy: 427192 -// gas legacyOptimized: 296504 +// gas irOptimized: 278528 +// gas legacy: 418462 +// gas legacyOptimized: 291755 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol index 905114aba7c6..99260d2efd81 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol @@ -8,8 +8,8 @@ contract Test { } // ---- // constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> -// gas irOptimized: 270118 -// gas legacy: 315616 -// gas legacyOptimized: 260686 +// gas irOptimized: 269441 +// gas legacy: 311324 +// gas legacyOptimized: 258351 // m_x() -> 7 // m_s() -> 0x20, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" diff --git a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol index 3f12c4e27b24..4f8ebefeaa20 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol @@ -17,8 +17,8 @@ contract Main { } // ---- // constructor(): "abc", true -// gas irOptimized: 106546 -// gas legacy: 145838 -// gas legacyOptimized: 104017 +// gas irOptimized: 105906 +// gas legacy: 143300 +// gas legacyOptimized: 102961 // getFlag() -> true // getName() -> "abc" diff --git a/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol b/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol index 220db16d56fc..4117b84b64f9 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_function_complex.sol @@ -17,4 +17,4 @@ contract C { } // ---- // f() -> 16 -// gas legacy: 103488 +// gas legacy: 102082 diff --git a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol index 7daf503d4c47..b6242379e75b 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol @@ -10,9 +10,9 @@ contract C { // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 172948 -// gas legacy: 221377 -// gas legacyOptimized: 177671 +// gas irOptimized: 172314 +// gas legacy: 218378 +// gas legacyOptimized: 176195 // a() -> 1 // b(uint256): 0 -> 2 // b(uint256): 1 -> 3 diff --git a/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol b/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol index bad890226723..9319d592a549 100644 --- a/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol +++ b/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol @@ -17,6 +17,6 @@ contract C { } // ---- // f(), 2000 ether -> true -// gas irOptimized: 120052 -// gas legacy: 123226 -// gas legacyOptimized: 123092 +// gas irOptimized: 119457 +// gas legacy: 122621 +// gas legacyOptimized: 122490 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol index 4f9984503b2e..6b1b6704afa3 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol @@ -15,5 +15,5 @@ contract B is A { // compileViaYul: true // ---- // constructor() -> -// gas irOptimized: 121557 +// gas irOptimized: 120936 // y() -> 42 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol index 1f10b6277825..b60564665ded 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol @@ -11,7 +11,7 @@ contract B is A { // compileToEwasm: also // ---- // constructor() -> -// gas irOptimized: 121557 -// gas legacy: 135046 -// gas legacyOptimized: 116176 +// gas irOptimized: 120936 +// gas legacy: 133594 +// gas legacyOptimized: 115341 // y() -> 42 diff --git a/test/libsolidity/semanticTests/constructor_with_params.sol b/test/libsolidity/semanticTests/constructor_with_params.sol index 5304a9b1bd9d..13bdb625bf56 100644 --- a/test/libsolidity/semanticTests/constructor_with_params.sol +++ b/test/libsolidity/semanticTests/constructor_with_params.sol @@ -9,7 +9,7 @@ contract C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 103531 -// gas legacy: 117158 +// gas irOptimized: 102902 +// gas legacy: 115678 // i() -> 2 // k() -> 0 diff --git a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol index 8580d2150624..fc2dd8f7153c 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol @@ -21,9 +21,9 @@ contract D is B, C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 154331 -// gas legacy: 170115 -// gas legacyOptimized: 145429 +// gas irOptimized: 153694 +// gas legacy: 168623 +// gas legacyOptimized: 144577 // i() -> 2 // j() -> 2 // k() -> 1 diff --git a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol index d34fb896c644..a0b4c772d66e 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol @@ -12,8 +12,8 @@ contract D is C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 123966 -// gas legacy: 138700 -// gas legacyOptimized: 119400 +// gas irOptimized: 123317 +// gas legacy: 137193 +// gas legacyOptimized: 118548 // i() -> 2 // k() -> 1 diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/bound_function.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/bound_function.sol new file mode 100644 index 000000000000..64b80422c352 --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/bound_function.sol @@ -0,0 +1,40 @@ +function longdata(S memory) pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/library_function.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/library_function.sol new file mode 100644 index 000000000000..931109199649 --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/library_function.sol @@ -0,0 +1,34 @@ +library L { + function longdata() pure internal returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/library_function_deployed.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/library_function_deployed.sol new file mode 100644 index 000000000000..30f403af7f3d --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/library_function_deployed.sol @@ -0,0 +1,31 @@ +library L { + function longdata() pure internal returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/module_function.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/module_function.sol new file mode 100644 index 000000000000..018d410557b0 --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/module_function.sol @@ -0,0 +1,36 @@ +==== Source: mod.sol ==== +function longdata() pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/module_function_deployed.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/module_function_deployed.sol new file mode 100644 index 000000000000..f29355e07482 --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/module_function_deployed.sol @@ -0,0 +1,32 @@ +==== Source: mod.sol ==== +function longdata() pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/static_base_function.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/static_base_function.sol new file mode 100644 index 000000000000..0f9b023b08d9 --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/static_base_function.sol @@ -0,0 +1,35 @@ +abstract contract S { + function longdata() internal pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/static_base_function_deployed.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/static_base_function_deployed.sol new file mode 100644 index 000000000000..a7c8d6cfeb82 --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/static_base_function_deployed.sol @@ -0,0 +1,31 @@ +abstract contract S { + function longdata() internal pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/subassembly_deduplication.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/subassembly_deduplication.sol new file mode 100644 index 000000000000..2b2d694bd17a --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/subassembly_deduplication.sol @@ -0,0 +1,42 @@ +contract A { + function longdata() pure external returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/super_function.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/super_function.sol new file mode 100644 index 000000000000..9accc54a2b05 --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/super_function.sol @@ -0,0 +1,35 @@ +abstract contract S { + function longdata() internal pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/super_function_deployed.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/super_function_deployed.sol new file mode 100644 index 000000000000..9588007b360b --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/super_function_deployed.sol @@ -0,0 +1,31 @@ +abstract contract S { + function longdata() internal pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/virtual_function.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/virtual_function.sol new file mode 100644 index 000000000000..866fe9dfc452 --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/virtual_function.sol @@ -0,0 +1,39 @@ +abstract contract S { + function longdata() internal virtual pure returns (bytes memory); +} + +abstract contract X is S { + function longdata() internal override pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/deployedCodeExclusion/virtual_function_deployed.sol b/test/libsolidity/semanticTests/deployedCodeExclusion/virtual_function_deployed.sol new file mode 100644 index 000000000000..bcc95b9f418d --- /dev/null +++ b/test/libsolidity/semanticTests/deployedCodeExclusion/virtual_function_deployed.sol @@ -0,0 +1,35 @@ +abstract contract S { + function longdata() internal virtual pure returns (bytes memory); +} + +abstract contract X is S { + function longdata() internal override pure returns (bytes memory) { + return + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID" + "M,SEYBDXCNTKIMNJGO;DUIAQBQUEHAKMPGIDSAJCOUKANJBCUEBKNA.GIAKMV.TI" + "AJMO true diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol index f9f06134feed..057496c6dd00 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_array_storage.sol @@ -13,6 +13,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c -// gas irOptimized: 113511 -// gas legacy: 116381 -// gas legacyOptimized: 114425 +// gas irOptimized: 113510 +// gas legacy: 116314 +// gas legacyOptimized: 114407 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol b/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol index a2862d6897c9..5c5138742a6d 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_array_storage_v2.sol @@ -14,6 +14,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c -// gas irOptimized: 113511 -// gas legacy: 116381 -// gas legacyOptimized: 114425 +// gas irOptimized: 113510 +// gas legacy: 116314 +// gas legacyOptimized: 114407 diff --git a/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol b/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol index 442a5299ad9e..7b9a9400be40 100644 --- a/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol +++ b/test/libsolidity/semanticTests/events/event_dynamic_nested_array_storage_v2.sol @@ -15,6 +15,6 @@ contract C { // ---- // createEvent(uint256): 42 -> // ~ emit E(uint256[][]): 0x20, 0x02, 0x40, 0xa0, 0x02, 0x2a, 0x2b, 0x02, 0x2c, 0x2d -// gas irOptimized: 185118 -// gas legacy: 187603 -// gas legacyOptimized: 184566 +// gas irOptimized: 185095 +// gas legacy: 187495 +// gas legacyOptimized: 184534 diff --git a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol index aa5074fa2aa2..5b8827ce7e85 100644 --- a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol +++ b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol @@ -15,8 +15,8 @@ contract C { } // ---- // constructor() -> -// gas irOptimized: 166854 -// gas legacy: 250376 -// gas legacyOptimized: 174522 +// gas irOptimized: 165398 +// gas legacy: 244800 +// gas legacyOptimized: 171615 // deposit(bytes32), 18 wei: 0x1234 -> // ~ emit Deposit(address,bytes32,uint256) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: #0xc06afe3a8444fc0004668591e8306bfb9968e79e, #0x1234, 0x00 diff --git a/test/libsolidity/semanticTests/events/event_indexed_string.sol b/test/libsolidity/semanticTests/events/event_indexed_string.sol index aeaf20c75b2f..a6283f274ea1 100644 --- a/test/libsolidity/semanticTests/events/event_indexed_string.sol +++ b/test/libsolidity/semanticTests/events/event_indexed_string.sol @@ -17,6 +17,6 @@ contract C { // ---- // deposit() -> // ~ emit E(string,uint256[4]): #0xa7fb06bb999a5eb9aff9e0779953f4e1e4ce58044936c2f51c7fb879b85c08bd, #0xe755d8cc1a8cde16a2a31160dcd8017ac32d7e2f13215b29a23cdae40a78aa81 -// gas irOptimized: 332396 -// gas legacy: 388679 -// gas legacyOptimized: 374441 +// gas irOptimized: 332157 +// gas legacy: 387608 +// gas legacyOptimized: 373772 diff --git a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol index d281d6f273ac..f2ee4894f167 100644 --- a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol +++ b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol @@ -74,9 +74,9 @@ contract FixedFeeRegistrar is Registrar { } // ---- // constructor() -// gas irOptimized: 415761 -// gas legacy: 933867 -// gas legacyOptimized: 487352 +// gas irOptimized: 413501 +// gas legacy: 913421 +// gas legacyOptimized: 476928 // reserve(string), 69 ether: 0x20, 3, "abc" -> // ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 // gas irOptimized: 45967 diff --git a/test/libsolidity/semanticTests/externalContracts/base64.sol b/test/libsolidity/semanticTests/externalContracts/base64.sol index 37be5e14d022..328b55ec9961 100644 --- a/test/libsolidity/semanticTests/externalContracts/base64.sol +++ b/test/libsolidity/semanticTests/externalContracts/base64.sol @@ -33,9 +33,9 @@ contract test { // EVMVersion: >=constantinople // ---- // constructor() -// gas irOptimized: 414909 -// gas legacy: 750723 -// gas legacyOptimized: 536620 +// gas irOptimized: 409367 +// gas legacy: 737652 +// gas legacyOptimized: 526820 // encode_inline_asm(bytes): 0x20, 0 -> 0x20, 0 // encode_inline_asm(bytes): 0x20, 1, "f" -> 0x20, 4, "Zg==" // encode_inline_asm(bytes): 0x20, 2, "fo" -> 0x20, 4, "Zm8=" @@ -51,10 +51,10 @@ contract test { // encode_no_asm(bytes): 0x20, 5, "fooba" -> 0x20, 8, "Zm9vYmE=" // encode_no_asm(bytes): 0x20, 6, "foobar" -> 0x20, 8, "Zm9vYmFy" // encode_inline_asm_large() -// gas irOptimized: 1374039 -// gas legacy: 1688033 -// gas legacyOptimized: 1205033 +// gas irOptimized: 1373038 +// gas legacy: 1672031 +// gas legacyOptimized: 1199031 // encode_no_asm_large() -// gas irOptimized: 3291100 -// gas legacy: 4765077 -// gas legacyOptimized: 2908077 +// gas irOptimized: 3276098 +// gas legacy: 4705075 +// gas legacyOptimized: 2890075 diff --git a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol index 389661fd7a06..38bb477593fe 100644 --- a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol +++ b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol @@ -176,35 +176,35 @@ contract DepositContract is IDepositContract, ERC165 { } // ---- // constructor() -// gas irOptimized: 1430741 -// gas legacy: 2427905 -// gas legacyOptimized: 1773081 +// gas irOptimized: 1415659 +// gas legacy: 2391952 +// gas legacyOptimized: 1752320 // supportsInterface(bytes4): 0x0 -> 0 // supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 # // supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id # // supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 117398 -// gas legacy: 152660 -// gas legacyOptimized: 124659 +// gas irOptimized: 117264 +// gas legacy: 151981 +// gas legacyOptimized: 124447 // get_deposit_count() -> 0x20, 8, 0 # TODO: check balance and logs after each deposit # // deposit(bytes,bytes,bytes,bytes32), 32 ether: 0 -> FAILURE # Empty input # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 117398 -// gas legacy: 152660 -// gas legacyOptimized: 124659 +// gas irOptimized: 117264 +// gas legacy: 151981 +// gas legacyOptimized: 124447 // get_deposit_count() -> 0x20, 8, 0 // deposit(bytes,bytes,bytes,bytes32), 1 ether: 0x80, 0xe0, 0x120, 0xaa4a8d0b7d9077248630f1a4701ae9764e42271d7f22b7838778411857fd349e, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0x00f50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8 -> # txhash: 0x7085c586686d666e8bb6e9477a0f0b09565b2060a11f1c4209d3a52295033832 # // ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0xf50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x08, 0xca9a3b00000000000000000000000000000000000000000000000000000000, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8, 0x08, 0x00 // get_deposit_root() -> 0x2089653123d9c721215120b6db6738ba273bbc5228ac093b1f983badcdc8a438 -// gas irOptimized: 117383 -// gas legacy: 152670 -// gas legacyOptimized: 124672 +// gas irOptimized: 117249 +// gas legacy: 151990 +// gas legacyOptimized: 124459 // get_deposit_count() -> 0x20, 8, 0x0100000000000000000000000000000000000000000000000000000000000000 // deposit(bytes,bytes,bytes,bytes32), 32 ether: 0x80, 0xe0, 0x120, 0xdbd986dc85ceb382708cf90a3500f500f0a393c5ece76963ac3ed72eccd2c301, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x00344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d -> # txhash: 0x404d8e109822ce448e68f45216c12cb051b784d068fbe98317ab8e50c58304ac # // ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x08, 0x40597307000000000000000000000000000000000000000000000000000000, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d, 0x08, 0x0100000000000000000000000000000000000000000000000000000000000000 // get_deposit_root() -> 0x40255975859377d912c53aa853245ebd939bdd2b33a28e084babdcc1ed8238ee -// gas irOptimized: 117383 -// gas legacy: 152670 -// gas legacyOptimized: 124672 +// gas irOptimized: 117249 +// gas legacy: 151990 +// gas legacyOptimized: 124459 // get_deposit_count() -> 0x20, 8, 0x0200000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol index bf257815affd..7860560f6256 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol @@ -48,9 +48,9 @@ contract test { } // ---- // constructor() -// gas irOptimized: 1876171 -// gas legacy: 2471603 -// gas legacyOptimized: 1876669 +// gas irOptimized: 1870040 +// gas legacy: 2430726 +// gas legacyOptimized: 1854979 // div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 // gas irOptimized: 22137 // gas legacy: 22767 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol index 5cea75abec2d..6cda4f1e9831 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol @@ -48,9 +48,9 @@ contract test { } // ---- // constructor() -// gas irOptimized: 1735588 -// gas legacy: 2241243 -// gas legacyOptimized: 1748028 +// gas irOptimized: 1731900 +// gas legacy: 2210160 +// gas legacyOptimized: 1734152 // div(uint256,uint256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 // gas irOptimized: 22004 // gas legacy: 22497 diff --git a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol index b4b7054a4fe2..b3ba4496446f 100644 --- a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol +++ b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol @@ -33,10 +33,10 @@ contract test { } // ---- // constructor() -// gas irOptimized: 430305 -// gas legacy: 649335 -// gas legacyOptimized: 473132 +// gas irOptimized: 424583 +// gas legacy: 631753 +// gas legacyOptimized: 459425 // prb_pi() -> 3141592656369545286 // gas irOptimized: 57478 -// gas legacy: 103112 +// gas legacy: 101655 // gas legacyOptimized: 75735 diff --git a/test/libsolidity/semanticTests/externalContracts/snark.sol b/test/libsolidity/semanticTests/externalContracts/snark.sol index bb76542111e6..254befe0142a 100644 --- a/test/libsolidity/semanticTests/externalContracts/snark.sol +++ b/test/libsolidity/semanticTests/externalContracts/snark.sol @@ -294,11 +294,11 @@ contract Test { // f() -> true // g() -> true // pair() -> true -// gas irOptimized: 269938 -// gas legacy: 275952 -// gas legacyOptimized: 267239 +// gas irOptimized: 269918 +// gas legacy: 275678 +// gas legacyOptimized: 267193 // verifyTx() -> true // ~ emit Verified(string): 0x20, 0x16, "Successfully verified." -// gas irOptimized: 783501 -// gas legacy: 805423 -// gas legacyOptimized: 772571 +// gas irOptimized: 783371 +// gas legacy: 804346 +// gas legacyOptimized: 772349 diff --git a/test/libsolidity/semanticTests/externalContracts/strings.sol b/test/libsolidity/semanticTests/externalContracts/strings.sol index a134fe86ab9b..c2ad61557d52 100644 --- a/test/libsolidity/semanticTests/externalContracts/strings.sol +++ b/test/libsolidity/semanticTests/externalContracts/strings.sol @@ -49,9 +49,9 @@ contract test { } // ---- // constructor() -// gas irOptimized: 642624 -// gas legacy: 1096108 -// gas legacyOptimized: 741962 +// gas irOptimized: 636074 +// gas legacy: 1065857 +// gas legacyOptimized: 725207 // toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0 // gas irOptimized: 22660 // gas legacy: 23190 @@ -69,6 +69,6 @@ contract test { // gas legacy: 31621 // gas legacyOptimized: 27914 // benchmark(string,bytes32): 0x40, 0x0842021, 8, "solidity" -> 0x2020 -// gas irOptimized: 1989966 -// gas legacy: 4294552 -// gas legacyOptimized: 2327981 +// gas irOptimized: 1981693 +// gas legacy: 4235651 +// gas legacyOptimized: 2319622 diff --git a/test/libsolidity/semanticTests/freeFunctions/new_operator.sol b/test/libsolidity/semanticTests/freeFunctions/new_operator.sol index 6daaa5407ed6..dd44a1b5950c 100644 --- a/test/libsolidity/semanticTests/freeFunctions/new_operator.sol +++ b/test/libsolidity/semanticTests/freeFunctions/new_operator.sol @@ -13,4 +13,4 @@ contract D { } // ---- // f() -> 2 -// gas legacy: 101626 +// gas legacy: 100211 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_no_args.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_no_args.sol index b6c33fd07dd8..b6a33fb7e835 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_no_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_no_args.sol @@ -11,4 +11,4 @@ contract D { } // ---- // f() -> 2 -// gas legacy: 101599 +// gas legacy: 100185 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol index c6a556a19f0c..0fd2efeb9fb8 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol @@ -15,7 +15,7 @@ contract D { } // ---- // constructor(): 2 -> -// gas irOptimized: 195258 -// gas legacy: 245842 -// gas legacyOptimized: 195676 +// gas irOptimized: 193999 +// gas legacy: 241234 +// gas legacyOptimized: 192961 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol index 0c81a0bae80b..5952a88e0690 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol @@ -17,7 +17,7 @@ contract D { // EVMVersion: >=constantinople // ---- // constructor(): 2 -> -// gas irOptimized: 195421 -// gas legacy: 246202 -// gas legacyOptimized: 195914 +// gas irOptimized: 194162 +// gas legacy: 241606 +// gas legacyOptimized: 193193 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol index d0c3c4d80575..e8efe09fad0d 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol @@ -23,9 +23,9 @@ contract C { // ---- // constructor(), 1 ether -> -// gas irOptimized: 266135 -// gas legacy: 454729 -// gas legacyOptimized: 301679 +// gas irOptimized: 265110 +// gas legacy: 441442 +// gas legacyOptimized: 292862 // f(uint256): 0 -> FAILURE // f(uint256): 1 -> FAILURE // f(uint256): 2 -> FAILURE diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol index f004d94723af..8fe807e638fe 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol @@ -26,9 +26,9 @@ contract C { // revertStrings: debug // ---- // constructor(), 1 ether -> -// gas irOptimized: 391081 -// gas legacy: 823681 -// gas legacyOptimized: 505900 +// gas irOptimized: 390464 +// gas legacy: 809985 +// gas legacyOptimized: 498331 // f(uint256): 0 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" // f(uint256): 1 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" // f(uint256): 2 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" diff --git a/test/libsolidity/semanticTests/functionCall/failed_create.sol b/test/libsolidity/semanticTests/functionCall/failed_create.sol index cf865ff19d31..ffe7a7f3777b 100644 --- a/test/libsolidity/semanticTests/functionCall/failed_create.sol +++ b/test/libsolidity/semanticTests/functionCall/failed_create.sol @@ -17,17 +17,17 @@ contract C { // EVMVersion: >=byzantium // ---- // constructor(), 20 wei -// gas irOptimized: 184005 -// gas legacy: 294335 -// gas legacyOptimized: 173427 +// gas irOptimized: 177446 +// gas legacy: 285547 +// gas legacyOptimized: 168515 // f(uint256): 20 -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a // x() -> 1 // f(uint256): 20 -> FAILURE // x() -> 1 // stack(uint256): 1023 -> FAILURE -// gas irOptimized: 260987 -// gas legacy: 483942 -// gas legacyOptimized: 302349 +// gas irOptimized: 259624 +// gas legacy: 477722 +// gas legacyOptimized: 299567 // x() -> 1 // stack(uint256): 10 -> 0x87948bd7ebbe13a00bfd930c93e4828ab18e3908 // x() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol index 977f1a56a4a6..abff2c9e7ec6 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol @@ -39,9 +39,9 @@ contract test { // ---- // constructor(), 20 wei -> -// gas irOptimized: 261698 -// gas legacy: 402654 -// gas legacyOptimized: 274470 +// gas irOptimized: 260052 +// gas legacy: 391588 +// gas legacyOptimized: 268089 // sendAmount(uint256): 5 -> 5 // outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway # // checkState() -> false, 15 diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol index 48365a61aca2..dd7487cdfdef 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol @@ -38,9 +38,9 @@ contract test { // ---- // constructor(), 20 wei -> -// gas irOptimized: 261698 -// gas legacy: 402654 -// gas legacyOptimized: 274470 +// gas irOptimized: 260052 +// gas legacy: 391588 +// gas legacyOptimized: 268089 // sendAmount(uint256): 5 -> 5 // outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway # // checkState() -> false, 15 diff --git a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol index 99ca5e3f7e6c..bb2221f2c3a1 100644 --- a/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol +++ b/test/libsolidity/semanticTests/functionCall/mapping_array_internal_argument.sol @@ -18,9 +18,9 @@ contract test { } // ---- // set(uint8,uint8,uint8,uint8,uint8): 1, 21, 22, 42, 43 -> 0, 0, 0, 0 -// gas irOptimized: 111669 -// gas legacy: 113806 -// gas legacyOptimized: 111781 +// gas irOptimized: 111668 +// gas legacy: 113748 +// gas legacyOptimized: 111772 // get(uint8): 1 -> 21, 22, 42, 43 // set(uint8,uint8,uint8,uint8,uint8): 1, 10, 30, 11, 31 -> 21, 22, 42, 43 // get(uint8): 1 -> 10, 30, 11, 31 diff --git a/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol b/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol index 1a120bebadf3..b78951c41abe 100644 --- a/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol +++ b/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol @@ -19,6 +19,6 @@ contract Main { // ---- // constructor(), 20 wei -> // gas irOptimized: 100264 -// gas legacy: 116691 +// gas legacy: 113411 // gas legacyOptimized: 100361 // s() -> true diff --git a/test/libsolidity/semanticTests/functionTypes/store_function.sol b/test/libsolidity/semanticTests/functionTypes/store_function.sol index ba8b65bbc726..b1d0fc0c3bca 100644 --- a/test/libsolidity/semanticTests/functionTypes/store_function.sol +++ b/test/libsolidity/semanticTests/functionTypes/store_function.sol @@ -27,5 +27,5 @@ contract C { // ---- // t() -> 9 // gas irOptimized: 99064 -// gas legacy: 152137 -// gas legacyOptimized: 107793 +// gas legacy: 149095 +// gas legacyOptimized: 106188 diff --git a/test/libsolidity/semanticTests/immutable/multi_creation.sol b/test/libsolidity/semanticTests/immutable/multi_creation.sol index 88f3ed5eb74b..8aaf961aa254 100644 --- a/test/libsolidity/semanticTests/immutable/multi_creation.sol +++ b/test/libsolidity/semanticTests/immutable/multi_creation.sol @@ -27,8 +27,8 @@ contract C { } // ---- // f() -> 3, 7, 5 -// gas irOptimized: 126044 -// gas legacy: 151334 -// gas legacyOptimized: 125166 +// gas irOptimized: 124849 +// gas legacy: 148528 +// gas legacyOptimized: 123971 // x() -> 7 // y() -> 5 diff --git a/test/libsolidity/semanticTests/immutable/use_scratch.sol b/test/libsolidity/semanticTests/immutable/use_scratch.sol index 364ac525e347..ff10c13aa2b5 100644 --- a/test/libsolidity/semanticTests/immutable/use_scratch.sol +++ b/test/libsolidity/semanticTests/immutable/use_scratch.sol @@ -15,8 +15,8 @@ contract C { } // ---- // constructor(): 3 -> -// gas irOptimized: 125477 -// gas legacy: 202011 -// gas legacyOptimized: 139552 +// gas irOptimized: 124838 +// gas legacy: 197645 +// gas legacyOptimized: 137678 // f() -> 84, 23 // m(uint256): 3 -> 7 diff --git a/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol b/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol index fac3a61ad2c6..aa9dc4b9924e 100644 --- a/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol +++ b/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol @@ -22,7 +22,7 @@ contract D { // ---- // f() -> 1 // gas irOptimized: 77051 -// gas legacy: 114884 +// gas legacy: 112280 // g() -> 5 // gas irOptimized: 77106 -// gas legacy: 115430 +// gas legacy: 112816 diff --git a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol index cfa124c25773..0663ddf4cc24 100644 --- a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol +++ b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol @@ -24,4 +24,4 @@ contract B { // ---- // g() -> 42 // gas irOptimized: 80813 -// gas legacy: 125481 +// gas legacy: 122471 diff --git a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol index 388a4de42e5b..e9339e66414c 100644 --- a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol +++ b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol @@ -23,6 +23,6 @@ contract B { // ---- // g() -> 42 -// gas irOptimized: 100874 -// gas legacy: 185053 -// gas legacyOptimized: 114598 +// gas irOptimized: 100282 +// gas legacy: 180440 +// gas legacyOptimized: 112596 diff --git a/test/libsolidity/semanticTests/inheritance/member_notation_ctor.sol b/test/libsolidity/semanticTests/inheritance/member_notation_ctor.sol index 44cbb1e141c3..c0eef13c4b9b 100644 --- a/test/libsolidity/semanticTests/inheritance/member_notation_ctor.sol +++ b/test/libsolidity/semanticTests/inheritance/member_notation_ctor.sol @@ -20,6 +20,6 @@ contract A { // ---- // g(int256): -1 -> -1 -// gas legacy: 103494 +// gas legacy: 102086 // g(int256): 10 -> 10 -// gas legacy: 103122 +// gas legacy: 101714 diff --git a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol index 8917ad68e044..dce48fa28cd3 100644 --- a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol +++ b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol @@ -40,9 +40,9 @@ contract Main { // ---- // constructor(), 22 wei -> -// gas irOptimized: 268544 -// gas legacy: 402045 -// gas legacyOptimized: 266772 +// gas irOptimized: 266886 +// gas legacy: 392786 +// gas legacyOptimized: 261633 // getFlag() -> true // getName() -> "abc" // getBalances() -> 12, 10 diff --git a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol index 5013ef4ced0e..39f3c2d0faab 100644 --- a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol +++ b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol @@ -16,9 +16,9 @@ contract ClientReceipt { } // ---- // constructor(), 2000 wei -> -// gas irOptimized: 173106 -// gas legacy: 235195 -// gas legacyOptimized: 176766 +// gas irOptimized: 171865 +// gas legacy: 230038 +// gas legacyOptimized: 173883 // balance -> 1500 // gas irOptimized: 191881 // gas legacy: 235167 diff --git a/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol b/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol index 9caaa89b985e..7b4e05b72e02 100644 --- a/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol +++ b/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol @@ -24,6 +24,6 @@ contract Test { // ---- // library: Lib // f() -> 4, 0x11 -// gas irOptimized: 112281 -// gas legacy: 135820 -// gas legacyOptimized: 119448 +// gas irOptimized: 112209 +// gas legacy: 135413 +// gas legacyOptimized: 119325 diff --git a/test/libsolidity/semanticTests/libraries/library_references_preserve.sol b/test/libsolidity/semanticTests/libraries/library_references_preserve.sol new file mode 100644 index 000000000000..ce41e54e98cb --- /dev/null +++ b/test/libsolidity/semanticTests/libraries/library_references_preserve.sol @@ -0,0 +1,48 @@ +library L1 { + function add(uint256 a, uint256 b) external pure returns (uint256) { + return a + b + 1; + } +} + +library L2 { + function add(uint256 a, uint256 b) external pure returns (uint256) { + return a + b + 2; + } +} + +contract A { + uint256 sum; + constructor() { + sum = L1.add(1, 2); + } + function getSum() external view returns(uint256) { + return sum; + } +} + +contract B { + uint256 sum; + constructor() { + sum = L2.add(1, 2); + } + function getSum() external view returns(uint256) { + return sum; + } +} + +contract C { + A a = new A(); + B b = new B(); + function aSum() external view returns(uint256) { + return a.getSum(); + } + function bSum() external view returns(uint256) { + return b.getSum(); + } +} + +// ---- +// library: L1 +// library: L2 +// aSum() -> 4 +// bSum() -> 5 diff --git a/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol b/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol index f4f9405b6cb5..41c700976c7c 100644 --- a/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol +++ b/test/libsolidity/semanticTests/libraries/using_library_mappings_public.sol @@ -21,6 +21,6 @@ contract Test { // ---- // library: Lib // f() -> 1, 0, 0x2a, 0x17, 0, 0x63 -// gas irOptimized: 119659 -// gas legacy: 124793 -// gas legacyOptimized: 119694 +// gas irOptimized: 119654 +// gas legacy: 124674 +// gas legacyOptimized: 119669 diff --git a/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol b/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol index 80e831a4cb19..3ac843eedaae 100644 --- a/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol +++ b/test/libsolidity/semanticTests/libraries/using_library_mappings_return.sol @@ -19,6 +19,6 @@ contract Test { // ---- // library: Lib // f() -> 1, 0, 0x2a, 0x17, 0, 0x63 -// gas irOptimized: 120270 -// gas legacy: 125245 -// gas legacyOptimized: 120153 +// gas irOptimized: 120265 +// gas legacy: 125109 +// gas legacyOptimized: 120128 diff --git a/test/libsolidity/semanticTests/libraries/using_library_structs.sol b/test/libsolidity/semanticTests/libraries/using_library_structs.sol index 888c9c0486b6..465dcebb1757 100644 --- a/test/libsolidity/semanticTests/libraries/using_library_structs.sol +++ b/test/libsolidity/semanticTests/libraries/using_library_structs.sol @@ -23,4 +23,4 @@ contract Test { // library: Lib // f() -> 7, 8 // gas irOptimized: 101818 -// gas legacy: 101504 +// gas legacy: 101429 diff --git a/test/libsolidity/semanticTests/literals/denominations_in_array_sizes.sol b/test/libsolidity/semanticTests/literals/denominations_in_array_sizes.sol new file mode 100644 index 000000000000..43a09af050e7 --- /dev/null +++ b/test/libsolidity/semanticTests/literals/denominations_in_array_sizes.sol @@ -0,0 +1,25 @@ +contract C { + uint[2 wei] a; + uint[2 gwei] b; + uint[2 ether] c; + uint[2 seconds] d; + uint[2 minutes] e; + uint[2 hours] f; + uint[2 days] g; + uint[2 weeks] h; + + function lengths() public returns (uint, uint, uint, uint, uint, uint, uint, uint) { + return ( + a.length, + b.length, + c.length, + d.length, + e.length, + f.length, + g.length, + h.length + ); + } +} +// ---- +// lengths() -> 2, 2000000000, 2000000000000000000, 2, 120, 7200, 172800, 1209600 diff --git a/test/libsolidity/semanticTests/literals/fractional_denominations.sol b/test/libsolidity/semanticTests/literals/fractional_denominations.sol new file mode 100644 index 000000000000..6bc448f09018 --- /dev/null +++ b/test/libsolidity/semanticTests/literals/fractional_denominations.sol @@ -0,0 +1,15 @@ +contract C { + uint public g = 1.5 gwei; + uint public e = 1.5 ether; + uint public m = 1.5 minutes; + uint public h = 1.5 hours; + uint public d = 1.5 days; + uint public w = 1.5 weeks; +} +// ---- +// g() -> 1500000000 +// e() -> 1500000000000000000 +// m() -> 90 +// h() -> 5400 +// d() -> 129600 +// w() -> 907200 diff --git a/test/libsolidity/semanticTests/operators/userDefined/all_possible_operators.sol b/test/libsolidity/semanticTests/operators/userDefined/all_possible_operators.sol new file mode 100644 index 000000000000..315356b6c34c --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/all_possible_operators.sol @@ -0,0 +1,92 @@ +type Int is int8; +using { + bitor as |, bitand as &, bitxor as ^, bitnot as ~, + add as +, sub as -, unsub as -, mul as *, div as /, mod as %, + eq as ==, noteq as !=, lt as <, gt as >, leq as <=, geq as >= +} for Int global; + +function bitor(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) | Int.unwrap(y)); } +function bitand(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) & Int.unwrap(y)); } +function bitxor(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) ^ Int.unwrap(y)); } +function bitnot(Int x) pure returns (Int) { return Int.wrap(~Int.unwrap(x)); } + +function add(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) + Int.unwrap(y)); } +function sub(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) - Int.unwrap(y)); } +function unsub(Int x) pure returns (Int) { return Int.wrap(-Int.unwrap(x)); } +function mul(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) * Int.unwrap(y)); } +function div(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) / Int.unwrap(y)); } +function mod(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) % Int.unwrap(y)); } + +function eq(Int x, Int y) pure returns (bool) { return Int.unwrap(x) == Int.unwrap(y); } +function noteq(Int x, Int y) pure returns (bool) { return Int.unwrap(x) != Int.unwrap(y); } +function lt(Int x, Int y) pure returns (bool) { return Int.unwrap(x) < Int.unwrap(y); } +function gt(Int x, Int y) pure returns (bool) { return Int.unwrap(x) > Int.unwrap(y); } +function leq(Int x, Int y) pure returns (bool) { return Int.unwrap(x) <= Int.unwrap(y); } +function geq(Int x, Int y) pure returns (bool) { return Int.unwrap(x) >= Int.unwrap(y); } + +contract C { + Int constant ZERO = Int.wrap(0); + Int constant ONE = Int.wrap(1); + Int constant TWO = Int.wrap(2); + Int constant THREE = Int.wrap(3); + Int constant SIX = Int.wrap(6); + + function testBitwise() public pure { + assert(Int.unwrap(ONE | TWO) == 3); + assert(Int.unwrap(ONE | ZERO) == 1); + + assert(Int.unwrap(ONE & THREE) == 1); + assert(Int.unwrap(ONE & ONE) == 1); + + assert(Int.unwrap(TWO ^ TWO) == 0); + assert(Int.unwrap(TWO ^ ONE) == 3); + + assert(Int.unwrap(~ZERO) == -1); + assert(Int.unwrap(~ONE) == -2); + assert(Int.unwrap(~TWO) == -3); + } + + function testArithmetic() public pure { + assert(Int.unwrap(ONE + TWO) == 3); + assert(Int.unwrap(ONE + ZERO) == 1); + + assert(Int.unwrap(TWO - ONE) == 1); + assert(Int.unwrap(THREE - THREE) == 0); + + assert(Int.unwrap(-TWO) == -2); + assert(Int.unwrap(-ZERO) == 0); + + assert(Int.unwrap(ONE * ONE) == 1); + assert(Int.unwrap(THREE * TWO) == 6); + + assert(Int.unwrap(SIX / TWO) == 3); + assert(Int.unwrap(THREE / TWO) == 1); + + assert(Int.unwrap(SIX % TWO) == 0); + assert(Int.unwrap(THREE % TWO) == 1); + } + + function testComparison() public pure { + assert((ONE == ONE) == true); + assert((ONE == TWO) == false); + + assert((ONE != ONE) == false); + assert((ONE != TWO) == true); + + assert((ONE < TWO) == true); + assert((TWO < ONE) == false); + + assert((ONE <= TWO) == true); + assert((TWO <= ONE) == false); + + assert((ONE > TWO) == false); + assert((TWO > ONE) == true); + + assert((ONE >= TWO) == false); + assert((TWO >= ONE) == true); + } +} +// ---- +// testBitwise() -> +// testArithmetic() -> +// testComparison() -> diff --git a/test/libsolidity/semanticTests/operators/userDefined/all_possible_user_defined_value_types_with_operators.sol b/test/libsolidity/semanticTests/operators/userDefined/all_possible_user_defined_value_types_with_operators.sol new file mode 100644 index 000000000000..868a5396761a --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/all_possible_user_defined_value_types_with_operators.sol @@ -0,0 +1,670 @@ +type Int8 is int8; +type Int16 is int16; +type Int24 is int24; +type Int32 is int32; +type Int40 is int40; +type Int48 is int48; +type Int56 is int56; +type Int64 is int64; +type Int72 is int72; +type Int80 is int80; +type Int88 is int88; +type Int96 is int96; +type Int104 is int104; +type Int112 is int112; +type Int120 is int120; +type Int128 is int128; +type Int136 is int136; +type Int144 is int144; +type Int152 is int152; +type Int160 is int160; +type Int168 is int168; +type Int176 is int176; +type Int184 is int184; +type Int192 is int192; +type Int200 is int200; +type Int208 is int208; +type Int216 is int216; +type Int224 is int224; +type Int232 is int232; +type Int240 is int240; +type Int248 is int248; +type Int256 is int256; +type Int is int; + +type Uint8 is uint8; +type Uint16 is uint16; +type Uint24 is uint24; +type Uint32 is uint32; +type Uint40 is uint40; +type Uint48 is uint48; +type Uint56 is uint56; +type Uint64 is uint64; +type Uint72 is uint72; +type Uint80 is uint80; +type Uint88 is uint88; +type Uint96 is uint96; +type Uint104 is uint104; +type Uint112 is uint112; +type Uint120 is uint120; +type Uint128 is uint128; +type Uint136 is uint136; +type Uint144 is uint144; +type Uint152 is uint152; +type Uint160 is uint160; +type Uint168 is uint168; +type Uint176 is uint176; +type Uint184 is uint184; +type Uint192 is uint192; +type Uint200 is uint200; +type Uint208 is uint208; +type Uint216 is uint216; +type Uint224 is uint224; +type Uint232 is uint232; +type Uint240 is uint240; +type Uint248 is uint248; +type Uint256 is uint256; +type Uint is uint; + +type Bytes1 is bytes1; +type Bytes2 is bytes2; +type Bytes3 is bytes3; +type Bytes4 is bytes4; +type Bytes5 is bytes5; +type Bytes6 is bytes6; +type Bytes7 is bytes7; +type Bytes8 is bytes8; +type Bytes9 is bytes9; +type Bytes10 is bytes10; +type Bytes11 is bytes11; +type Bytes12 is bytes12; +type Bytes13 is bytes13; +type Bytes14 is bytes14; +type Bytes15 is bytes15; +type Bytes16 is bytes16; +type Bytes17 is bytes17; +type Bytes18 is bytes18; +type Bytes19 is bytes19; +type Bytes20 is bytes20; +type Bytes21 is bytes21; +type Bytes22 is bytes22; +type Bytes23 is bytes23; +type Bytes24 is bytes24; +type Bytes25 is bytes25; +type Bytes26 is bytes26; +type Bytes27 is bytes27; +type Bytes28 is bytes28; +type Bytes29 is bytes29; +type Bytes30 is bytes30; +type Bytes31 is bytes31; +type Bytes32 is bytes32; + +type Address is address; +type AddressPayable is address payable; + +type Bool is bool; + +using {bitorInt8 as |, unsubInt8 as -} for Int8 global; +using {bitorInt16 as |, unsubInt16 as -} for Int16 global; +using {bitorInt24 as |, unsubInt24 as -} for Int24 global; +using {bitorInt32 as |, unsubInt32 as -} for Int32 global; +using {bitorInt40 as |, unsubInt40 as -} for Int40 global; +using {bitorInt48 as |, unsubInt48 as -} for Int48 global; +using {bitorInt56 as |, unsubInt56 as -} for Int56 global; +using {bitorInt64 as |, unsubInt64 as -} for Int64 global; +using {bitorInt72 as |, unsubInt72 as -} for Int72 global; +using {bitorInt80 as |, unsubInt80 as -} for Int80 global; +using {bitorInt88 as |, unsubInt88 as -} for Int88 global; +using {bitorInt96 as |, unsubInt96 as -} for Int96 global; +using {bitorInt104 as |, unsubInt104 as -} for Int104 global; +using {bitorInt112 as |, unsubInt112 as -} for Int112 global; +using {bitorInt120 as |, unsubInt120 as -} for Int120 global; +using {bitorInt128 as |, unsubInt128 as -} for Int128 global; +using {bitorInt136 as |, unsubInt136 as -} for Int136 global; +using {bitorInt144 as |, unsubInt144 as -} for Int144 global; +using {bitorInt152 as |, unsubInt152 as -} for Int152 global; +using {bitorInt160 as |, unsubInt160 as -} for Int160 global; +using {bitorInt168 as |, unsubInt168 as -} for Int168 global; +using {bitorInt176 as |, unsubInt176 as -} for Int176 global; +using {bitorInt184 as |, unsubInt184 as -} for Int184 global; +using {bitorInt192 as |, unsubInt192 as -} for Int192 global; +using {bitorInt200 as |, unsubInt200 as -} for Int200 global; +using {bitorInt208 as |, unsubInt208 as -} for Int208 global; +using {bitorInt216 as |, unsubInt216 as -} for Int216 global; +using {bitorInt224 as |, unsubInt224 as -} for Int224 global; +using {bitorInt232 as |, unsubInt232 as -} for Int232 global; +using {bitorInt240 as |, unsubInt240 as -} for Int240 global; +using {bitorInt248 as |, unsubInt248 as -} for Int248 global; +using {bitorInt256 as |, unsubInt256 as -} for Int256 global; +using {bitorInt as |, unsubInt as -} for Int global; + +using {bitorUint8 as |, bitnotUint8 as ~} for Uint8 global; +using {bitorUint16 as |, bitnotUint16 as ~} for Uint16 global; +using {bitorUint24 as |, bitnotUint24 as ~} for Uint24 global; +using {bitorUint32 as |, bitnotUint32 as ~} for Uint32 global; +using {bitorUint40 as |, bitnotUint40 as ~} for Uint40 global; +using {bitorUint48 as |, bitnotUint48 as ~} for Uint48 global; +using {bitorUint56 as |, bitnotUint56 as ~} for Uint56 global; +using {bitorUint64 as |, bitnotUint64 as ~} for Uint64 global; +using {bitorUint72 as |, bitnotUint72 as ~} for Uint72 global; +using {bitorUint80 as |, bitnotUint80 as ~} for Uint80 global; +using {bitorUint88 as |, bitnotUint88 as ~} for Uint88 global; +using {bitorUint96 as |, bitnotUint96 as ~} for Uint96 global; +using {bitorUint104 as |, bitnotUint104 as ~} for Uint104 global; +using {bitorUint112 as |, bitnotUint112 as ~} for Uint112 global; +using {bitorUint120 as |, bitnotUint120 as ~} for Uint120 global; +using {bitorUint128 as |, bitnotUint128 as ~} for Uint128 global; +using {bitorUint136 as |, bitnotUint136 as ~} for Uint136 global; +using {bitorUint144 as |, bitnotUint144 as ~} for Uint144 global; +using {bitorUint152 as |, bitnotUint152 as ~} for Uint152 global; +using {bitorUint160 as |, bitnotUint160 as ~} for Uint160 global; +using {bitorUint168 as |, bitnotUint168 as ~} for Uint168 global; +using {bitorUint176 as |, bitnotUint176 as ~} for Uint176 global; +using {bitorUint184 as |, bitnotUint184 as ~} for Uint184 global; +using {bitorUint192 as |, bitnotUint192 as ~} for Uint192 global; +using {bitorUint200 as |, bitnotUint200 as ~} for Uint200 global; +using {bitorUint208 as |, bitnotUint208 as ~} for Uint208 global; +using {bitorUint216 as |, bitnotUint216 as ~} for Uint216 global; +using {bitorUint224 as |, bitnotUint224 as ~} for Uint224 global; +using {bitorUint232 as |, bitnotUint232 as ~} for Uint232 global; +using {bitorUint240 as |, bitnotUint240 as ~} for Uint240 global; +using {bitorUint248 as |, bitnotUint248 as ~} for Uint248 global; +using {bitorUint256 as |, bitnotUint256 as ~} for Uint256 global; +using {bitorUint as |, bitnotUint as ~} for Uint global; + +using {bitorBytes1 as |, bitnotBytes1 as ~} for Bytes1 global; +using {bitorBytes2 as |, bitnotBytes2 as ~} for Bytes2 global; +using {bitorBytes3 as |, bitnotBytes3 as ~} for Bytes3 global; +using {bitorBytes4 as |, bitnotBytes4 as ~} for Bytes4 global; +using {bitorBytes5 as |, bitnotBytes5 as ~} for Bytes5 global; +using {bitorBytes6 as |, bitnotBytes6 as ~} for Bytes6 global; +using {bitorBytes7 as |, bitnotBytes7 as ~} for Bytes7 global; +using {bitorBytes8 as |, bitnotBytes8 as ~} for Bytes8 global; +using {bitorBytes9 as |, bitnotBytes9 as ~} for Bytes9 global; +using {bitorBytes10 as |, bitnotBytes10 as ~} for Bytes10 global; +using {bitorBytes11 as |, bitnotBytes11 as ~} for Bytes11 global; +using {bitorBytes12 as |, bitnotBytes12 as ~} for Bytes12 global; +using {bitorBytes13 as |, bitnotBytes13 as ~} for Bytes13 global; +using {bitorBytes14 as |, bitnotBytes14 as ~} for Bytes14 global; +using {bitorBytes15 as |, bitnotBytes15 as ~} for Bytes15 global; +using {bitorBytes16 as |, bitnotBytes16 as ~} for Bytes16 global; +using {bitorBytes17 as |, bitnotBytes17 as ~} for Bytes17 global; +using {bitorBytes18 as |, bitnotBytes18 as ~} for Bytes18 global; +using {bitorBytes19 as |, bitnotBytes19 as ~} for Bytes19 global; +using {bitorBytes20 as |, bitnotBytes20 as ~} for Bytes20 global; +using {bitorBytes21 as |, bitnotBytes21 as ~} for Bytes21 global; +using {bitorBytes22 as |, bitnotBytes22 as ~} for Bytes22 global; +using {bitorBytes23 as |, bitnotBytes23 as ~} for Bytes23 global; +using {bitorBytes24 as |, bitnotBytes24 as ~} for Bytes24 global; +using {bitorBytes25 as |, bitnotBytes25 as ~} for Bytes25 global; +using {bitorBytes26 as |, bitnotBytes26 as ~} for Bytes26 global; +using {bitorBytes27 as |, bitnotBytes27 as ~} for Bytes27 global; +using {bitorBytes28 as |, bitnotBytes28 as ~} for Bytes28 global; +using {bitorBytes29 as |, bitnotBytes29 as ~} for Bytes29 global; +using {bitorBytes30 as |, bitnotBytes30 as ~} for Bytes30 global; +using {bitorBytes31 as |, bitnotBytes31 as ~} for Bytes31 global; +using {bitorBytes32 as |, bitnotBytes32 as ~} for Bytes32 global; + +function bitorInt8(Int8 x, Int8 y) pure returns (Int8) { return Int8.wrap(Int8.unwrap(x) | Int8.unwrap(y)); } +function bitorInt16(Int16 x, Int16 y) pure returns (Int16) { return Int16.wrap(Int16.unwrap(x) | Int16.unwrap(y)); } +function bitorInt24(Int24 x, Int24 y) pure returns (Int24) { return Int24.wrap(Int24.unwrap(x) | Int24.unwrap(y)); } +function bitorInt32(Int32 x, Int32 y) pure returns (Int32) { return Int32.wrap(Int32.unwrap(x) | Int32.unwrap(y)); } +function bitorInt40(Int40 x, Int40 y) pure returns (Int40) { return Int40.wrap(Int40.unwrap(x) | Int40.unwrap(y)); } +function bitorInt48(Int48 x, Int48 y) pure returns (Int48) { return Int48.wrap(Int48.unwrap(x) | Int48.unwrap(y)); } +function bitorInt56(Int56 x, Int56 y) pure returns (Int56) { return Int56.wrap(Int56.unwrap(x) | Int56.unwrap(y)); } +function bitorInt64(Int64 x, Int64 y) pure returns (Int64) { return Int64.wrap(Int64.unwrap(x) | Int64.unwrap(y)); } +function bitorInt72(Int72 x, Int72 y) pure returns (Int72) { return Int72.wrap(Int72.unwrap(x) | Int72.unwrap(y)); } +function bitorInt80(Int80 x, Int80 y) pure returns (Int80) { return Int80.wrap(Int80.unwrap(x) | Int80.unwrap(y)); } +function bitorInt88(Int88 x, Int88 y) pure returns (Int88) { return Int88.wrap(Int88.unwrap(x) | Int88.unwrap(y)); } +function bitorInt96(Int96 x, Int96 y) pure returns (Int96) { return Int96.wrap(Int96.unwrap(x) | Int96.unwrap(y)); } +function bitorInt104(Int104 x, Int104 y) pure returns (Int104) { return Int104.wrap(Int104.unwrap(x) | Int104.unwrap(y)); } +function bitorInt112(Int112 x, Int112 y) pure returns (Int112) { return Int112.wrap(Int112.unwrap(x) | Int112.unwrap(y)); } +function bitorInt120(Int120 x, Int120 y) pure returns (Int120) { return Int120.wrap(Int120.unwrap(x) | Int120.unwrap(y)); } +function bitorInt128(Int128 x, Int128 y) pure returns (Int128) { return Int128.wrap(Int128.unwrap(x) | Int128.unwrap(y)); } +function bitorInt136(Int136 x, Int136 y) pure returns (Int136) { return Int136.wrap(Int136.unwrap(x) | Int136.unwrap(y)); } +function bitorInt144(Int144 x, Int144 y) pure returns (Int144) { return Int144.wrap(Int144.unwrap(x) | Int144.unwrap(y)); } +function bitorInt152(Int152 x, Int152 y) pure returns (Int152) { return Int152.wrap(Int152.unwrap(x) | Int152.unwrap(y)); } +function bitorInt160(Int160 x, Int160 y) pure returns (Int160) { return Int160.wrap(Int160.unwrap(x) | Int160.unwrap(y)); } +function bitorInt168(Int168 x, Int168 y) pure returns (Int168) { return Int168.wrap(Int168.unwrap(x) | Int168.unwrap(y)); } +function bitorInt176(Int176 x, Int176 y) pure returns (Int176) { return Int176.wrap(Int176.unwrap(x) | Int176.unwrap(y)); } +function bitorInt184(Int184 x, Int184 y) pure returns (Int184) { return Int184.wrap(Int184.unwrap(x) | Int184.unwrap(y)); } +function bitorInt192(Int192 x, Int192 y) pure returns (Int192) { return Int192.wrap(Int192.unwrap(x) | Int192.unwrap(y)); } +function bitorInt200(Int200 x, Int200 y) pure returns (Int200) { return Int200.wrap(Int200.unwrap(x) | Int200.unwrap(y)); } +function bitorInt208(Int208 x, Int208 y) pure returns (Int208) { return Int208.wrap(Int208.unwrap(x) | Int208.unwrap(y)); } +function bitorInt216(Int216 x, Int216 y) pure returns (Int216) { return Int216.wrap(Int216.unwrap(x) | Int216.unwrap(y)); } +function bitorInt224(Int224 x, Int224 y) pure returns (Int224) { return Int224.wrap(Int224.unwrap(x) | Int224.unwrap(y)); } +function bitorInt232(Int232 x, Int232 y) pure returns (Int232) { return Int232.wrap(Int232.unwrap(x) | Int232.unwrap(y)); } +function bitorInt240(Int240 x, Int240 y) pure returns (Int240) { return Int240.wrap(Int240.unwrap(x) | Int240.unwrap(y)); } +function bitorInt248(Int248 x, Int248 y) pure returns (Int248) { return Int248.wrap(Int248.unwrap(x) | Int248.unwrap(y)); } +function bitorInt256(Int256 x, Int256 y) pure returns (Int256) { return Int256.wrap(Int256.unwrap(x) | Int256.unwrap(y)); } +function bitorInt(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) | Int.unwrap(y)); } + +function unsubInt8(Int8 x) pure returns (Int8) { return Int8.wrap(-Int8.unwrap(x)); } +function unsubInt16(Int16 x) pure returns (Int16) { return Int16.wrap(-Int16.unwrap(x)); } +function unsubInt24(Int24 x) pure returns (Int24) { return Int24.wrap(-Int24.unwrap(x)); } +function unsubInt32(Int32 x) pure returns (Int32) { return Int32.wrap(-Int32.unwrap(x)); } +function unsubInt40(Int40 x) pure returns (Int40) { return Int40.wrap(-Int40.unwrap(x)); } +function unsubInt48(Int48 x) pure returns (Int48) { return Int48.wrap(-Int48.unwrap(x)); } +function unsubInt56(Int56 x) pure returns (Int56) { return Int56.wrap(-Int56.unwrap(x)); } +function unsubInt64(Int64 x) pure returns (Int64) { return Int64.wrap(-Int64.unwrap(x)); } +function unsubInt72(Int72 x) pure returns (Int72) { return Int72.wrap(-Int72.unwrap(x)); } +function unsubInt80(Int80 x) pure returns (Int80) { return Int80.wrap(-Int80.unwrap(x)); } +function unsubInt88(Int88 x) pure returns (Int88) { return Int88.wrap(-Int88.unwrap(x)); } +function unsubInt96(Int96 x) pure returns (Int96) { return Int96.wrap(-Int96.unwrap(x)); } +function unsubInt104(Int104 x) pure returns (Int104) { return Int104.wrap(-Int104.unwrap(x)); } +function unsubInt112(Int112 x) pure returns (Int112) { return Int112.wrap(-Int112.unwrap(x)); } +function unsubInt120(Int120 x) pure returns (Int120) { return Int120.wrap(-Int120.unwrap(x)); } +function unsubInt128(Int128 x) pure returns (Int128) { return Int128.wrap(-Int128.unwrap(x)); } +function unsubInt136(Int136 x) pure returns (Int136) { return Int136.wrap(-Int136.unwrap(x)); } +function unsubInt144(Int144 x) pure returns (Int144) { return Int144.wrap(-Int144.unwrap(x)); } +function unsubInt152(Int152 x) pure returns (Int152) { return Int152.wrap(-Int152.unwrap(x)); } +function unsubInt160(Int160 x) pure returns (Int160) { return Int160.wrap(-Int160.unwrap(x)); } +function unsubInt168(Int168 x) pure returns (Int168) { return Int168.wrap(-Int168.unwrap(x)); } +function unsubInt176(Int176 x) pure returns (Int176) { return Int176.wrap(-Int176.unwrap(x)); } +function unsubInt184(Int184 x) pure returns (Int184) { return Int184.wrap(-Int184.unwrap(x)); } +function unsubInt192(Int192 x) pure returns (Int192) { return Int192.wrap(-Int192.unwrap(x)); } +function unsubInt200(Int200 x) pure returns (Int200) { return Int200.wrap(-Int200.unwrap(x)); } +function unsubInt208(Int208 x) pure returns (Int208) { return Int208.wrap(-Int208.unwrap(x)); } +function unsubInt216(Int216 x) pure returns (Int216) { return Int216.wrap(-Int216.unwrap(x)); } +function unsubInt224(Int224 x) pure returns (Int224) { return Int224.wrap(-Int224.unwrap(x)); } +function unsubInt232(Int232 x) pure returns (Int232) { return Int232.wrap(-Int232.unwrap(x)); } +function unsubInt240(Int240 x) pure returns (Int240) { return Int240.wrap(-Int240.unwrap(x)); } +function unsubInt248(Int248 x) pure returns (Int248) { return Int248.wrap(-Int248.unwrap(x)); } +function unsubInt256(Int256 x) pure returns (Int256) { return Int256.wrap(-Int256.unwrap(x)); } +function unsubInt(Int x) pure returns (Int) { return Int.wrap(-Int.unwrap(x)); } + +function bitorUint8(Uint8 x, Uint8 y) pure returns (Uint8) { return Uint8.wrap(Uint8.unwrap(x) | Uint8.unwrap(y)); } +function bitorUint16(Uint16 x, Uint16 y) pure returns (Uint16) { return Uint16.wrap(Uint16.unwrap(x) | Uint16.unwrap(y)); } +function bitorUint24(Uint24 x, Uint24 y) pure returns (Uint24) { return Uint24.wrap(Uint24.unwrap(x) | Uint24.unwrap(y)); } +function bitorUint32(Uint32 x, Uint32 y) pure returns (Uint32) { return Uint32.wrap(Uint32.unwrap(x) | Uint32.unwrap(y)); } +function bitorUint40(Uint40 x, Uint40 y) pure returns (Uint40) { return Uint40.wrap(Uint40.unwrap(x) | Uint40.unwrap(y)); } +function bitorUint48(Uint48 x, Uint48 y) pure returns (Uint48) { return Uint48.wrap(Uint48.unwrap(x) | Uint48.unwrap(y)); } +function bitorUint56(Uint56 x, Uint56 y) pure returns (Uint56) { return Uint56.wrap(Uint56.unwrap(x) | Uint56.unwrap(y)); } +function bitorUint64(Uint64 x, Uint64 y) pure returns (Uint64) { return Uint64.wrap(Uint64.unwrap(x) | Uint64.unwrap(y)); } +function bitorUint72(Uint72 x, Uint72 y) pure returns (Uint72) { return Uint72.wrap(Uint72.unwrap(x) | Uint72.unwrap(y)); } +function bitorUint80(Uint80 x, Uint80 y) pure returns (Uint80) { return Uint80.wrap(Uint80.unwrap(x) | Uint80.unwrap(y)); } +function bitorUint88(Uint88 x, Uint88 y) pure returns (Uint88) { return Uint88.wrap(Uint88.unwrap(x) | Uint88.unwrap(y)); } +function bitorUint96(Uint96 x, Uint96 y) pure returns (Uint96) { return Uint96.wrap(Uint96.unwrap(x) | Uint96.unwrap(y)); } +function bitorUint104(Uint104 x, Uint104 y) pure returns (Uint104) { return Uint104.wrap(Uint104.unwrap(x) | Uint104.unwrap(y)); } +function bitorUint112(Uint112 x, Uint112 y) pure returns (Uint112) { return Uint112.wrap(Uint112.unwrap(x) | Uint112.unwrap(y)); } +function bitorUint120(Uint120 x, Uint120 y) pure returns (Uint120) { return Uint120.wrap(Uint120.unwrap(x) | Uint120.unwrap(y)); } +function bitorUint128(Uint128 x, Uint128 y) pure returns (Uint128) { return Uint128.wrap(Uint128.unwrap(x) | Uint128.unwrap(y)); } +function bitorUint136(Uint136 x, Uint136 y) pure returns (Uint136) { return Uint136.wrap(Uint136.unwrap(x) | Uint136.unwrap(y)); } +function bitorUint144(Uint144 x, Uint144 y) pure returns (Uint144) { return Uint144.wrap(Uint144.unwrap(x) | Uint144.unwrap(y)); } +function bitorUint152(Uint152 x, Uint152 y) pure returns (Uint152) { return Uint152.wrap(Uint152.unwrap(x) | Uint152.unwrap(y)); } +function bitorUint160(Uint160 x, Uint160 y) pure returns (Uint160) { return Uint160.wrap(Uint160.unwrap(x) | Uint160.unwrap(y)); } +function bitorUint168(Uint168 x, Uint168 y) pure returns (Uint168) { return Uint168.wrap(Uint168.unwrap(x) | Uint168.unwrap(y)); } +function bitorUint176(Uint176 x, Uint176 y) pure returns (Uint176) { return Uint176.wrap(Uint176.unwrap(x) | Uint176.unwrap(y)); } +function bitorUint184(Uint184 x, Uint184 y) pure returns (Uint184) { return Uint184.wrap(Uint184.unwrap(x) | Uint184.unwrap(y)); } +function bitorUint192(Uint192 x, Uint192 y) pure returns (Uint192) { return Uint192.wrap(Uint192.unwrap(x) | Uint192.unwrap(y)); } +function bitorUint200(Uint200 x, Uint200 y) pure returns (Uint200) { return Uint200.wrap(Uint200.unwrap(x) | Uint200.unwrap(y)); } +function bitorUint208(Uint208 x, Uint208 y) pure returns (Uint208) { return Uint208.wrap(Uint208.unwrap(x) | Uint208.unwrap(y)); } +function bitorUint216(Uint216 x, Uint216 y) pure returns (Uint216) { return Uint216.wrap(Uint216.unwrap(x) | Uint216.unwrap(y)); } +function bitorUint224(Uint224 x, Uint224 y) pure returns (Uint224) { return Uint224.wrap(Uint224.unwrap(x) | Uint224.unwrap(y)); } +function bitorUint232(Uint232 x, Uint232 y) pure returns (Uint232) { return Uint232.wrap(Uint232.unwrap(x) | Uint232.unwrap(y)); } +function bitorUint240(Uint240 x, Uint240 y) pure returns (Uint240) { return Uint240.wrap(Uint240.unwrap(x) | Uint240.unwrap(y)); } +function bitorUint248(Uint248 x, Uint248 y) pure returns (Uint248) { return Uint248.wrap(Uint248.unwrap(x) | Uint248.unwrap(y)); } +function bitorUint256(Uint256 x, Uint256 y) pure returns (Uint256) { return Uint256.wrap(Uint256.unwrap(x) | Uint256.unwrap(y)); } +function bitorUint(Uint x, Uint y) pure returns (Uint) { return Uint.wrap(Uint.unwrap(x) | Uint.unwrap(y)); } + +function bitnotUint8(Uint8 x) pure returns (Uint8) { return Uint8.wrap(~Uint8.unwrap(x)); } +function bitnotUint16(Uint16 x) pure returns (Uint16) { return Uint16.wrap(~Uint16.unwrap(x)); } +function bitnotUint24(Uint24 x) pure returns (Uint24) { return Uint24.wrap(~Uint24.unwrap(x)); } +function bitnotUint32(Uint32 x) pure returns (Uint32) { return Uint32.wrap(~Uint32.unwrap(x)); } +function bitnotUint40(Uint40 x) pure returns (Uint40) { return Uint40.wrap(~Uint40.unwrap(x)); } +function bitnotUint48(Uint48 x) pure returns (Uint48) { return Uint48.wrap(~Uint48.unwrap(x)); } +function bitnotUint56(Uint56 x) pure returns (Uint56) { return Uint56.wrap(~Uint56.unwrap(x)); } +function bitnotUint64(Uint64 x) pure returns (Uint64) { return Uint64.wrap(~Uint64.unwrap(x)); } +function bitnotUint72(Uint72 x) pure returns (Uint72) { return Uint72.wrap(~Uint72.unwrap(x)); } +function bitnotUint80(Uint80 x) pure returns (Uint80) { return Uint80.wrap(~Uint80.unwrap(x)); } +function bitnotUint88(Uint88 x) pure returns (Uint88) { return Uint88.wrap(~Uint88.unwrap(x)); } +function bitnotUint96(Uint96 x) pure returns (Uint96) { return Uint96.wrap(~Uint96.unwrap(x)); } +function bitnotUint104(Uint104 x) pure returns (Uint104) { return Uint104.wrap(~Uint104.unwrap(x)); } +function bitnotUint112(Uint112 x) pure returns (Uint112) { return Uint112.wrap(~Uint112.unwrap(x)); } +function bitnotUint120(Uint120 x) pure returns (Uint120) { return Uint120.wrap(~Uint120.unwrap(x)); } +function bitnotUint128(Uint128 x) pure returns (Uint128) { return Uint128.wrap(~Uint128.unwrap(x)); } +function bitnotUint136(Uint136 x) pure returns (Uint136) { return Uint136.wrap(~Uint136.unwrap(x)); } +function bitnotUint144(Uint144 x) pure returns (Uint144) { return Uint144.wrap(~Uint144.unwrap(x)); } +function bitnotUint152(Uint152 x) pure returns (Uint152) { return Uint152.wrap(~Uint152.unwrap(x)); } +function bitnotUint160(Uint160 x) pure returns (Uint160) { return Uint160.wrap(~Uint160.unwrap(x)); } +function bitnotUint168(Uint168 x) pure returns (Uint168) { return Uint168.wrap(~Uint168.unwrap(x)); } +function bitnotUint176(Uint176 x) pure returns (Uint176) { return Uint176.wrap(~Uint176.unwrap(x)); } +function bitnotUint184(Uint184 x) pure returns (Uint184) { return Uint184.wrap(~Uint184.unwrap(x)); } +function bitnotUint192(Uint192 x) pure returns (Uint192) { return Uint192.wrap(~Uint192.unwrap(x)); } +function bitnotUint200(Uint200 x) pure returns (Uint200) { return Uint200.wrap(~Uint200.unwrap(x)); } +function bitnotUint208(Uint208 x) pure returns (Uint208) { return Uint208.wrap(~Uint208.unwrap(x)); } +function bitnotUint216(Uint216 x) pure returns (Uint216) { return Uint216.wrap(~Uint216.unwrap(x)); } +function bitnotUint224(Uint224 x) pure returns (Uint224) { return Uint224.wrap(~Uint224.unwrap(x)); } +function bitnotUint232(Uint232 x) pure returns (Uint232) { return Uint232.wrap(~Uint232.unwrap(x)); } +function bitnotUint240(Uint240 x) pure returns (Uint240) { return Uint240.wrap(~Uint240.unwrap(x)); } +function bitnotUint248(Uint248 x) pure returns (Uint248) { return Uint248.wrap(~Uint248.unwrap(x)); } +function bitnotUint256(Uint256 x) pure returns (Uint256) { return Uint256.wrap(~Uint256.unwrap(x)); } +function bitnotUint(Uint x) pure returns (Uint) { return Uint.wrap(~Uint.unwrap(x)); } + +function bitorBytes1(Bytes1 x, Bytes1 y) pure returns (Bytes1) { return Bytes1.wrap(Bytes1.unwrap(x) | Bytes1.unwrap(y)); } +function bitorBytes2(Bytes2 x, Bytes2 y) pure returns (Bytes2) { return Bytes2.wrap(Bytes2.unwrap(x) | Bytes2.unwrap(y)); } +function bitorBytes3(Bytes3 x, Bytes3 y) pure returns (Bytes3) { return Bytes3.wrap(Bytes3.unwrap(x) | Bytes3.unwrap(y)); } +function bitorBytes4(Bytes4 x, Bytes4 y) pure returns (Bytes4) { return Bytes4.wrap(Bytes4.unwrap(x) | Bytes4.unwrap(y)); } +function bitorBytes5(Bytes5 x, Bytes5 y) pure returns (Bytes5) { return Bytes5.wrap(Bytes5.unwrap(x) | Bytes5.unwrap(y)); } +function bitorBytes6(Bytes6 x, Bytes6 y) pure returns (Bytes6) { return Bytes6.wrap(Bytes6.unwrap(x) | Bytes6.unwrap(y)); } +function bitorBytes7(Bytes7 x, Bytes7 y) pure returns (Bytes7) { return Bytes7.wrap(Bytes7.unwrap(x) | Bytes7.unwrap(y)); } +function bitorBytes8(Bytes8 x, Bytes8 y) pure returns (Bytes8) { return Bytes8.wrap(Bytes8.unwrap(x) | Bytes8.unwrap(y)); } +function bitorBytes9(Bytes9 x, Bytes9 y) pure returns (Bytes9) { return Bytes9.wrap(Bytes9.unwrap(x) | Bytes9.unwrap(y)); } +function bitorBytes10(Bytes10 x, Bytes10 y) pure returns (Bytes10) { return Bytes10.wrap(Bytes10.unwrap(x) | Bytes10.unwrap(y)); } +function bitorBytes11(Bytes11 x, Bytes11 y) pure returns (Bytes11) { return Bytes11.wrap(Bytes11.unwrap(x) | Bytes11.unwrap(y)); } +function bitorBytes12(Bytes12 x, Bytes12 y) pure returns (Bytes12) { return Bytes12.wrap(Bytes12.unwrap(x) | Bytes12.unwrap(y)); } +function bitorBytes13(Bytes13 x, Bytes13 y) pure returns (Bytes13) { return Bytes13.wrap(Bytes13.unwrap(x) | Bytes13.unwrap(y)); } +function bitorBytes14(Bytes14 x, Bytes14 y) pure returns (Bytes14) { return Bytes14.wrap(Bytes14.unwrap(x) | Bytes14.unwrap(y)); } +function bitorBytes15(Bytes15 x, Bytes15 y) pure returns (Bytes15) { return Bytes15.wrap(Bytes15.unwrap(x) | Bytes15.unwrap(y)); } +function bitorBytes16(Bytes16 x, Bytes16 y) pure returns (Bytes16) { return Bytes16.wrap(Bytes16.unwrap(x) | Bytes16.unwrap(y)); } +function bitorBytes17(Bytes17 x, Bytes17 y) pure returns (Bytes17) { return Bytes17.wrap(Bytes17.unwrap(x) | Bytes17.unwrap(y)); } +function bitorBytes18(Bytes18 x, Bytes18 y) pure returns (Bytes18) { return Bytes18.wrap(Bytes18.unwrap(x) | Bytes18.unwrap(y)); } +function bitorBytes19(Bytes19 x, Bytes19 y) pure returns (Bytes19) { return Bytes19.wrap(Bytes19.unwrap(x) | Bytes19.unwrap(y)); } +function bitorBytes20(Bytes20 x, Bytes20 y) pure returns (Bytes20) { return Bytes20.wrap(Bytes20.unwrap(x) | Bytes20.unwrap(y)); } +function bitorBytes21(Bytes21 x, Bytes21 y) pure returns (Bytes21) { return Bytes21.wrap(Bytes21.unwrap(x) | Bytes21.unwrap(y)); } +function bitorBytes22(Bytes22 x, Bytes22 y) pure returns (Bytes22) { return Bytes22.wrap(Bytes22.unwrap(x) | Bytes22.unwrap(y)); } +function bitorBytes23(Bytes23 x, Bytes23 y) pure returns (Bytes23) { return Bytes23.wrap(Bytes23.unwrap(x) | Bytes23.unwrap(y)); } +function bitorBytes24(Bytes24 x, Bytes24 y) pure returns (Bytes24) { return Bytes24.wrap(Bytes24.unwrap(x) | Bytes24.unwrap(y)); } +function bitorBytes25(Bytes25 x, Bytes25 y) pure returns (Bytes25) { return Bytes25.wrap(Bytes25.unwrap(x) | Bytes25.unwrap(y)); } +function bitorBytes26(Bytes26 x, Bytes26 y) pure returns (Bytes26) { return Bytes26.wrap(Bytes26.unwrap(x) | Bytes26.unwrap(y)); } +function bitorBytes27(Bytes27 x, Bytes27 y) pure returns (Bytes27) { return Bytes27.wrap(Bytes27.unwrap(x) | Bytes27.unwrap(y)); } +function bitorBytes28(Bytes28 x, Bytes28 y) pure returns (Bytes28) { return Bytes28.wrap(Bytes28.unwrap(x) | Bytes28.unwrap(y)); } +function bitorBytes29(Bytes29 x, Bytes29 y) pure returns (Bytes29) { return Bytes29.wrap(Bytes29.unwrap(x) | Bytes29.unwrap(y)); } +function bitorBytes30(Bytes30 x, Bytes30 y) pure returns (Bytes30) { return Bytes30.wrap(Bytes30.unwrap(x) | Bytes30.unwrap(y)); } +function bitorBytes31(Bytes31 x, Bytes31 y) pure returns (Bytes31) { return Bytes31.wrap(Bytes31.unwrap(x) | Bytes31.unwrap(y)); } +function bitorBytes32(Bytes32 x, Bytes32 y) pure returns (Bytes32) { return Bytes32.wrap(Bytes32.unwrap(x) | Bytes32.unwrap(y)); } + +function bitnotBytes1(Bytes1 x) pure returns (Bytes1) { return Bytes1.wrap(~Bytes1.unwrap(x)); } +function bitnotBytes2(Bytes2 x) pure returns (Bytes2) { return Bytes2.wrap(~Bytes2.unwrap(x)); } +function bitnotBytes3(Bytes3 x) pure returns (Bytes3) { return Bytes3.wrap(~Bytes3.unwrap(x)); } +function bitnotBytes4(Bytes4 x) pure returns (Bytes4) { return Bytes4.wrap(~Bytes4.unwrap(x)); } +function bitnotBytes5(Bytes5 x) pure returns (Bytes5) { return Bytes5.wrap(~Bytes5.unwrap(x)); } +function bitnotBytes6(Bytes6 x) pure returns (Bytes6) { return Bytes6.wrap(~Bytes6.unwrap(x)); } +function bitnotBytes7(Bytes7 x) pure returns (Bytes7) { return Bytes7.wrap(~Bytes7.unwrap(x)); } +function bitnotBytes8(Bytes8 x) pure returns (Bytes8) { return Bytes8.wrap(~Bytes8.unwrap(x)); } +function bitnotBytes9(Bytes9 x) pure returns (Bytes9) { return Bytes9.wrap(~Bytes9.unwrap(x)); } +function bitnotBytes10(Bytes10 x) pure returns (Bytes10) { return Bytes10.wrap(~Bytes10.unwrap(x)); } +function bitnotBytes11(Bytes11 x) pure returns (Bytes11) { return Bytes11.wrap(~Bytes11.unwrap(x)); } +function bitnotBytes12(Bytes12 x) pure returns (Bytes12) { return Bytes12.wrap(~Bytes12.unwrap(x)); } +function bitnotBytes13(Bytes13 x) pure returns (Bytes13) { return Bytes13.wrap(~Bytes13.unwrap(x)); } +function bitnotBytes14(Bytes14 x) pure returns (Bytes14) { return Bytes14.wrap(~Bytes14.unwrap(x)); } +function bitnotBytes15(Bytes15 x) pure returns (Bytes15) { return Bytes15.wrap(~Bytes15.unwrap(x)); } +function bitnotBytes16(Bytes16 x) pure returns (Bytes16) { return Bytes16.wrap(~Bytes16.unwrap(x)); } +function bitnotBytes17(Bytes17 x) pure returns (Bytes17) { return Bytes17.wrap(~Bytes17.unwrap(x)); } +function bitnotBytes18(Bytes18 x) pure returns (Bytes18) { return Bytes18.wrap(~Bytes18.unwrap(x)); } +function bitnotBytes19(Bytes19 x) pure returns (Bytes19) { return Bytes19.wrap(~Bytes19.unwrap(x)); } +function bitnotBytes20(Bytes20 x) pure returns (Bytes20) { return Bytes20.wrap(~Bytes20.unwrap(x)); } +function bitnotBytes21(Bytes21 x) pure returns (Bytes21) { return Bytes21.wrap(~Bytes21.unwrap(x)); } +function bitnotBytes22(Bytes22 x) pure returns (Bytes22) { return Bytes22.wrap(~Bytes22.unwrap(x)); } +function bitnotBytes23(Bytes23 x) pure returns (Bytes23) { return Bytes23.wrap(~Bytes23.unwrap(x)); } +function bitnotBytes24(Bytes24 x) pure returns (Bytes24) { return Bytes24.wrap(~Bytes24.unwrap(x)); } +function bitnotBytes25(Bytes25 x) pure returns (Bytes25) { return Bytes25.wrap(~Bytes25.unwrap(x)); } +function bitnotBytes26(Bytes26 x) pure returns (Bytes26) { return Bytes26.wrap(~Bytes26.unwrap(x)); } +function bitnotBytes27(Bytes27 x) pure returns (Bytes27) { return Bytes27.wrap(~Bytes27.unwrap(x)); } +function bitnotBytes28(Bytes28 x) pure returns (Bytes28) { return Bytes28.wrap(~Bytes28.unwrap(x)); } +function bitnotBytes29(Bytes29 x) pure returns (Bytes29) { return Bytes29.wrap(~Bytes29.unwrap(x)); } +function bitnotBytes30(Bytes30 x) pure returns (Bytes30) { return Bytes30.wrap(~Bytes30.unwrap(x)); } +function bitnotBytes31(Bytes31 x) pure returns (Bytes31) { return Bytes31.wrap(~Bytes31.unwrap(x)); } +function bitnotBytes32(Bytes32 x) pure returns (Bytes32) { return Bytes32.wrap(~Bytes32.unwrap(x)); } + +using {bitorAddress as |, bitnotAddress as ~} for Address global; +using {bitorAddressPayable as |, bitnotAddressPayable as ~} for AddressPayable global; +using {bitorBool as |, bitnotBool as ~} for Bool global; + +function bitorAddress(Address x, Address y) pure returns (Address) { + return Address.wrap(address(bytes20(Address.unwrap(x)) | bytes20(Address.unwrap(y)))); +} +function bitnotAddress(Address x) pure returns (Address) { + return Address.wrap(address(~bytes20(Address.unwrap(x)))); +} + +function bitorAddressPayable(AddressPayable x, AddressPayable y) pure returns (AddressPayable) { + return AddressPayable.wrap(payable(address(bytes20(address(AddressPayable.unwrap(x))) | bytes20(address(AddressPayable.unwrap(y)))))); +} +function bitnotAddressPayable(AddressPayable x) pure returns (AddressPayable) { + return AddressPayable.wrap(payable(address(~bytes20(address(AddressPayable.unwrap(x)))))); +} + +function bitorBool(Bool x, Bool y) pure returns (Bool) { + return Bool.wrap(Bool.unwrap(x) || Bool.unwrap(y)); +} +function bitnotBool(Bool x) pure returns (Bool) { + return Bool.wrap(!Bool.unwrap(x)); +} + +contract C { + function testIntBinary() public pure { + assert(Int8.unwrap(Int8.wrap(1) | Int8.wrap(2)) == 3); + assert(Int16.unwrap(Int16.wrap(1) | Int16.wrap(2)) == 3); + assert(Int24.unwrap(Int24.wrap(1) | Int24.wrap(2)) == 3); + assert(Int32.unwrap(Int32.wrap(1) | Int32.wrap(2)) == 3); + assert(Int40.unwrap(Int40.wrap(1) | Int40.wrap(2)) == 3); + assert(Int48.unwrap(Int48.wrap(1) | Int48.wrap(2)) == 3); + assert(Int56.unwrap(Int56.wrap(1) | Int56.wrap(2)) == 3); + assert(Int64.unwrap(Int64.wrap(1) | Int64.wrap(2)) == 3); + assert(Int72.unwrap(Int72.wrap(1) | Int72.wrap(2)) == 3); + assert(Int80.unwrap(Int80.wrap(1) | Int80.wrap(2)) == 3); + assert(Int88.unwrap(Int88.wrap(1) | Int88.wrap(2)) == 3); + assert(Int96.unwrap(Int96.wrap(1) | Int96.wrap(2)) == 3); + assert(Int104.unwrap(Int104.wrap(1) | Int104.wrap(2)) == 3); + assert(Int112.unwrap(Int112.wrap(1) | Int112.wrap(2)) == 3); + assert(Int120.unwrap(Int120.wrap(1) | Int120.wrap(2)) == 3); + assert(Int128.unwrap(Int128.wrap(1) | Int128.wrap(2)) == 3); + assert(Int136.unwrap(Int136.wrap(1) | Int136.wrap(2)) == 3); + assert(Int144.unwrap(Int144.wrap(1) | Int144.wrap(2)) == 3); + assert(Int152.unwrap(Int152.wrap(1) | Int152.wrap(2)) == 3); + assert(Int160.unwrap(Int160.wrap(1) | Int160.wrap(2)) == 3); + assert(Int168.unwrap(Int168.wrap(1) | Int168.wrap(2)) == 3); + assert(Int176.unwrap(Int176.wrap(1) | Int176.wrap(2)) == 3); + assert(Int184.unwrap(Int184.wrap(1) | Int184.wrap(2)) == 3); + assert(Int192.unwrap(Int192.wrap(1) | Int192.wrap(2)) == 3); + assert(Int200.unwrap(Int200.wrap(1) | Int200.wrap(2)) == 3); + assert(Int208.unwrap(Int208.wrap(1) | Int208.wrap(2)) == 3); + assert(Int216.unwrap(Int216.wrap(1) | Int216.wrap(2)) == 3); + assert(Int224.unwrap(Int224.wrap(1) | Int224.wrap(2)) == 3); + assert(Int232.unwrap(Int232.wrap(1) | Int232.wrap(2)) == 3); + assert(Int240.unwrap(Int240.wrap(1) | Int240.wrap(2)) == 3); + assert(Int248.unwrap(Int248.wrap(1) | Int248.wrap(2)) == 3); + assert(Int256.unwrap(Int256.wrap(1) | Int256.wrap(2)) == 3); + assert(Int.unwrap(Int.wrap(1) | Int.wrap(2)) == 3); + } + + function testIntUnary() public pure { + assert(Int8.unwrap(-Int8.wrap(1)) == -1); + assert(Int16.unwrap(-Int16.wrap(1)) == -1); + assert(Int24.unwrap(-Int24.wrap(1)) == -1); + assert(Int32.unwrap(-Int32.wrap(1)) == -1); + assert(Int40.unwrap(-Int40.wrap(1)) == -1); + assert(Int48.unwrap(-Int48.wrap(1)) == -1); + assert(Int56.unwrap(-Int56.wrap(1)) == -1); + assert(Int64.unwrap(-Int64.wrap(1)) == -1); + assert(Int72.unwrap(-Int72.wrap(1)) == -1); + assert(Int80.unwrap(-Int80.wrap(1)) == -1); + assert(Int88.unwrap(-Int88.wrap(1)) == -1); + assert(Int96.unwrap(-Int96.wrap(1)) == -1); + assert(Int104.unwrap(-Int104.wrap(1)) == -1); + assert(Int112.unwrap(-Int112.wrap(1)) == -1); + assert(Int120.unwrap(-Int120.wrap(1)) == -1); + assert(Int128.unwrap(-Int128.wrap(1)) == -1); + assert(Int136.unwrap(-Int136.wrap(1)) == -1); + assert(Int144.unwrap(-Int144.wrap(1)) == -1); + assert(Int152.unwrap(-Int152.wrap(1)) == -1); + assert(Int160.unwrap(-Int160.wrap(1)) == -1); + assert(Int168.unwrap(-Int168.wrap(1)) == -1); + assert(Int176.unwrap(-Int176.wrap(1)) == -1); + assert(Int184.unwrap(-Int184.wrap(1)) == -1); + assert(Int192.unwrap(-Int192.wrap(1)) == -1); + assert(Int200.unwrap(-Int200.wrap(1)) == -1); + assert(Int208.unwrap(-Int208.wrap(1)) == -1); + assert(Int216.unwrap(-Int216.wrap(1)) == -1); + assert(Int224.unwrap(-Int224.wrap(1)) == -1); + assert(Int232.unwrap(-Int232.wrap(1)) == -1); + assert(Int240.unwrap(-Int240.wrap(1)) == -1); + assert(Int248.unwrap(-Int248.wrap(1)) == -1); + assert(Int256.unwrap(-Int256.wrap(1)) == -1); + assert(Int.unwrap(-Int.wrap(1)) == -1); + } + + function testUintBinary() public pure { + assert(Uint8.unwrap(Uint8.wrap(1) | Uint8.wrap(2)) == 3); + assert(Uint16.unwrap(Uint16.wrap(1) | Uint16.wrap(2)) == 3); + assert(Uint24.unwrap(Uint24.wrap(1) | Uint24.wrap(2)) == 3); + assert(Uint32.unwrap(Uint32.wrap(1) | Uint32.wrap(2)) == 3); + assert(Uint40.unwrap(Uint40.wrap(1) | Uint40.wrap(2)) == 3); + assert(Uint48.unwrap(Uint48.wrap(1) | Uint48.wrap(2)) == 3); + assert(Uint56.unwrap(Uint56.wrap(1) | Uint56.wrap(2)) == 3); + assert(Uint64.unwrap(Uint64.wrap(1) | Uint64.wrap(2)) == 3); + assert(Uint72.unwrap(Uint72.wrap(1) | Uint72.wrap(2)) == 3); + assert(Uint80.unwrap(Uint80.wrap(1) | Uint80.wrap(2)) == 3); + assert(Uint88.unwrap(Uint88.wrap(1) | Uint88.wrap(2)) == 3); + assert(Uint96.unwrap(Uint96.wrap(1) | Uint96.wrap(2)) == 3); + assert(Uint104.unwrap(Uint104.wrap(1) | Uint104.wrap(2)) == 3); + assert(Uint112.unwrap(Uint112.wrap(1) | Uint112.wrap(2)) == 3); + assert(Uint120.unwrap(Uint120.wrap(1) | Uint120.wrap(2)) == 3); + assert(Uint128.unwrap(Uint128.wrap(1) | Uint128.wrap(2)) == 3); + assert(Uint136.unwrap(Uint136.wrap(1) | Uint136.wrap(2)) == 3); + assert(Uint144.unwrap(Uint144.wrap(1) | Uint144.wrap(2)) == 3); + assert(Uint152.unwrap(Uint152.wrap(1) | Uint152.wrap(2)) == 3); + assert(Uint160.unwrap(Uint160.wrap(1) | Uint160.wrap(2)) == 3); + assert(Uint168.unwrap(Uint168.wrap(1) | Uint168.wrap(2)) == 3); + assert(Uint176.unwrap(Uint176.wrap(1) | Uint176.wrap(2)) == 3); + assert(Uint184.unwrap(Uint184.wrap(1) | Uint184.wrap(2)) == 3); + assert(Uint192.unwrap(Uint192.wrap(1) | Uint192.wrap(2)) == 3); + assert(Uint200.unwrap(Uint200.wrap(1) | Uint200.wrap(2)) == 3); + assert(Uint208.unwrap(Uint208.wrap(1) | Uint208.wrap(2)) == 3); + assert(Uint216.unwrap(Uint216.wrap(1) | Uint216.wrap(2)) == 3); + assert(Uint224.unwrap(Uint224.wrap(1) | Uint224.wrap(2)) == 3); + assert(Uint232.unwrap(Uint232.wrap(1) | Uint232.wrap(2)) == 3); + assert(Uint240.unwrap(Uint240.wrap(1) | Uint240.wrap(2)) == 3); + assert(Uint248.unwrap(Uint248.wrap(1) | Uint248.wrap(2)) == 3); + assert(Uint256.unwrap(Uint256.wrap(1) | Uint256.wrap(2)) == 3); + assert(Uint.unwrap(Uint.wrap(1) | Uint.wrap(2)) == 3); + } + + function testUintUnary() public pure { + assert(Uint8.unwrap(~Uint8.wrap(1)) == ~uint8(1)); + assert(Uint16.unwrap(~Uint16.wrap(1)) == ~uint16(1)); + assert(Uint24.unwrap(~Uint24.wrap(1)) == ~uint24(1)); + assert(Uint32.unwrap(~Uint32.wrap(1)) == ~uint32(1)); + assert(Uint40.unwrap(~Uint40.wrap(1)) == ~uint40(1)); + assert(Uint48.unwrap(~Uint48.wrap(1)) == ~uint48(1)); + assert(Uint56.unwrap(~Uint56.wrap(1)) == ~uint56(1)); + assert(Uint64.unwrap(~Uint64.wrap(1)) == ~uint64(1)); + assert(Uint72.unwrap(~Uint72.wrap(1)) == ~uint72(1)); + assert(Uint80.unwrap(~Uint80.wrap(1)) == ~uint80(1)); + assert(Uint88.unwrap(~Uint88.wrap(1)) == ~uint88(1)); + assert(Uint96.unwrap(~Uint96.wrap(1)) == ~uint96(1)); + assert(Uint104.unwrap(~Uint104.wrap(1)) == ~uint104(1)); + assert(Uint112.unwrap(~Uint112.wrap(1)) == ~uint112(1)); + assert(Uint120.unwrap(~Uint120.wrap(1)) == ~uint120(1)); + assert(Uint128.unwrap(~Uint128.wrap(1)) == ~uint128(1)); + assert(Uint136.unwrap(~Uint136.wrap(1)) == ~uint136(1)); + assert(Uint144.unwrap(~Uint144.wrap(1)) == ~uint144(1)); + assert(Uint152.unwrap(~Uint152.wrap(1)) == ~uint152(1)); + assert(Uint160.unwrap(~Uint160.wrap(1)) == ~uint160(1)); + assert(Uint168.unwrap(~Uint168.wrap(1)) == ~uint168(1)); + assert(Uint176.unwrap(~Uint176.wrap(1)) == ~uint176(1)); + assert(Uint184.unwrap(~Uint184.wrap(1)) == ~uint184(1)); + assert(Uint192.unwrap(~Uint192.wrap(1)) == ~uint192(1)); + assert(Uint200.unwrap(~Uint200.wrap(1)) == ~uint200(1)); + assert(Uint208.unwrap(~Uint208.wrap(1)) == ~uint208(1)); + assert(Uint216.unwrap(~Uint216.wrap(1)) == ~uint216(1)); + assert(Uint224.unwrap(~Uint224.wrap(1)) == ~uint224(1)); + assert(Uint232.unwrap(~Uint232.wrap(1)) == ~uint232(1)); + assert(Uint240.unwrap(~Uint240.wrap(1)) == ~uint240(1)); + assert(Uint248.unwrap(~Uint248.wrap(1)) == ~uint248(1)); + assert(Uint256.unwrap(~Uint256.wrap(1)) == ~uint256(1)); + assert(Uint.unwrap(~Uint.wrap(1)) == ~uint(1)); + } + + function testBytesBinary() public pure { + assert(Bytes1.unwrap(Bytes1.wrap(0x01) | Bytes1.wrap(0x02)) == bytes1(0x03)); + assert(Bytes2.unwrap(Bytes2.wrap(bytes2(bytes1(0x01))) | Bytes2.wrap(bytes2(bytes1(0x02)))) == bytes2(bytes1(0x03))); + assert(Bytes3.unwrap(Bytes3.wrap(bytes3(bytes1(0x01))) | Bytes3.wrap(bytes3(bytes1(0x02)))) == bytes3(bytes1(0x03))); + assert(Bytes4.unwrap(Bytes4.wrap(bytes4(bytes1(0x01))) | Bytes4.wrap(bytes4(bytes1(0x02)))) == bytes4(bytes1(0x03))); + assert(Bytes5.unwrap(Bytes5.wrap(bytes5(bytes1(0x01))) | Bytes5.wrap(bytes5(bytes1(0x02)))) == bytes5(bytes1(0x03))); + assert(Bytes6.unwrap(Bytes6.wrap(bytes6(bytes1(0x01))) | Bytes6.wrap(bytes6(bytes1(0x02)))) == bytes6(bytes1(0x03))); + assert(Bytes7.unwrap(Bytes7.wrap(bytes7(bytes1(0x01))) | Bytes7.wrap(bytes7(bytes1(0x02)))) == bytes7(bytes1(0x03))); + assert(Bytes8.unwrap(Bytes8.wrap(bytes8(bytes1(0x01))) | Bytes8.wrap(bytes8(bytes1(0x02)))) == bytes8(bytes1(0x03))); + assert(Bytes9.unwrap(Bytes9.wrap(bytes9(bytes1(0x01))) | Bytes9.wrap(bytes9(bytes1(0x02)))) == bytes9(bytes1(0x03))); + assert(Bytes10.unwrap(Bytes10.wrap(bytes10(bytes1(0x01))) | Bytes10.wrap(bytes10(bytes1(0x02)))) == bytes10(bytes1(0x03))); + assert(Bytes11.unwrap(Bytes11.wrap(bytes11(bytes1(0x01))) | Bytes11.wrap(bytes11(bytes1(0x02)))) == bytes11(bytes1(0x03))); + assert(Bytes12.unwrap(Bytes12.wrap(bytes12(bytes1(0x01))) | Bytes12.wrap(bytes12(bytes1(0x02)))) == bytes12(bytes1(0x03))); + assert(Bytes13.unwrap(Bytes13.wrap(bytes13(bytes1(0x01))) | Bytes13.wrap(bytes13(bytes1(0x02)))) == bytes13(bytes1(0x03))); + assert(Bytes14.unwrap(Bytes14.wrap(bytes14(bytes1(0x01))) | Bytes14.wrap(bytes14(bytes1(0x02)))) == bytes14(bytes1(0x03))); + assert(Bytes15.unwrap(Bytes15.wrap(bytes15(bytes1(0x01))) | Bytes15.wrap(bytes15(bytes1(0x02)))) == bytes15(bytes1(0x03))); + assert(Bytes16.unwrap(Bytes16.wrap(bytes16(bytes1(0x01))) | Bytes16.wrap(bytes16(bytes1(0x02)))) == bytes16(bytes1(0x03))); + assert(Bytes17.unwrap(Bytes17.wrap(bytes17(bytes1(0x01))) | Bytes17.wrap(bytes17(bytes1(0x02)))) == bytes17(bytes1(0x03))); + assert(Bytes18.unwrap(Bytes18.wrap(bytes18(bytes1(0x01))) | Bytes18.wrap(bytes18(bytes1(0x02)))) == bytes18(bytes1(0x03))); + assert(Bytes19.unwrap(Bytes19.wrap(bytes19(bytes1(0x01))) | Bytes19.wrap(bytes19(bytes1(0x02)))) == bytes19(bytes1(0x03))); + assert(Bytes20.unwrap(Bytes20.wrap(bytes20(bytes1(0x01))) | Bytes20.wrap(bytes20(bytes1(0x02)))) == bytes20(bytes1(0x03))); + assert(Bytes21.unwrap(Bytes21.wrap(bytes21(bytes1(0x01))) | Bytes21.wrap(bytes21(bytes1(0x02)))) == bytes21(bytes1(0x03))); + assert(Bytes22.unwrap(Bytes22.wrap(bytes22(bytes1(0x01))) | Bytes22.wrap(bytes22(bytes1(0x02)))) == bytes22(bytes1(0x03))); + assert(Bytes23.unwrap(Bytes23.wrap(bytes23(bytes1(0x01))) | Bytes23.wrap(bytes23(bytes1(0x02)))) == bytes23(bytes1(0x03))); + assert(Bytes24.unwrap(Bytes24.wrap(bytes24(bytes1(0x01))) | Bytes24.wrap(bytes24(bytes1(0x02)))) == bytes24(bytes1(0x03))); + assert(Bytes25.unwrap(Bytes25.wrap(bytes25(bytes1(0x01))) | Bytes25.wrap(bytes25(bytes1(0x02)))) == bytes25(bytes1(0x03))); + assert(Bytes26.unwrap(Bytes26.wrap(bytes26(bytes1(0x01))) | Bytes26.wrap(bytes26(bytes1(0x02)))) == bytes26(bytes1(0x03))); + assert(Bytes27.unwrap(Bytes27.wrap(bytes27(bytes1(0x01))) | Bytes27.wrap(bytes27(bytes1(0x02)))) == bytes27(bytes1(0x03))); + assert(Bytes28.unwrap(Bytes28.wrap(bytes28(bytes1(0x01))) | Bytes28.wrap(bytes28(bytes1(0x02)))) == bytes28(bytes1(0x03))); + assert(Bytes29.unwrap(Bytes29.wrap(bytes29(bytes1(0x01))) | Bytes29.wrap(bytes29(bytes1(0x02)))) == bytes29(bytes1(0x03))); + assert(Bytes30.unwrap(Bytes30.wrap(bytes30(bytes1(0x01))) | Bytes30.wrap(bytes30(bytes1(0x02)))) == bytes30(bytes1(0x03))); + assert(Bytes31.unwrap(Bytes31.wrap(bytes31(bytes1(0x01))) | Bytes31.wrap(bytes31(bytes1(0x02)))) == bytes31(bytes1(0x03))); + assert(Bytes32.unwrap(Bytes32.wrap(bytes32(bytes1(0x01))) | Bytes32.wrap(bytes32(bytes1(0x02)))) == bytes32(bytes1(0x03))); + } + + function testBytesUnary() public pure { + assert(Bytes1.unwrap(~Bytes1.wrap(bytes1(0x01))) == ~bytes1(0x01)); + assert(Bytes2.unwrap(~Bytes2.wrap(bytes2(bytes1(0x01)))) == ~bytes2(bytes1(0x01))); + assert(Bytes3.unwrap(~Bytes3.wrap(bytes3(bytes1(0x01)))) == ~bytes3(bytes1(0x01))); + assert(Bytes4.unwrap(~Bytes4.wrap(bytes4(bytes1(0x01)))) == ~bytes4(bytes1(0x01))); + assert(Bytes5.unwrap(~Bytes5.wrap(bytes5(bytes1(0x01)))) == ~bytes5(bytes1(0x01))); + assert(Bytes6.unwrap(~Bytes6.wrap(bytes6(bytes1(0x01)))) == ~bytes6(bytes1(0x01))); + assert(Bytes7.unwrap(~Bytes7.wrap(bytes7(bytes1(0x01)))) == ~bytes7(bytes1(0x01))); + assert(Bytes8.unwrap(~Bytes8.wrap(bytes8(bytes1(0x01)))) == ~bytes8(bytes1(0x01))); + assert(Bytes9.unwrap(~Bytes9.wrap(bytes9(bytes1(0x01)))) == ~bytes9(bytes1(0x01))); + assert(Bytes10.unwrap(~Bytes10.wrap(bytes10(bytes1(0x01)))) == ~bytes10(bytes1(0x01))); + assert(Bytes11.unwrap(~Bytes11.wrap(bytes11(bytes1(0x01)))) == ~bytes11(bytes1(0x01))); + assert(Bytes12.unwrap(~Bytes12.wrap(bytes12(bytes1(0x01)))) == ~bytes12(bytes1(0x01))); + assert(Bytes13.unwrap(~Bytes13.wrap(bytes13(bytes1(0x01)))) == ~bytes13(bytes1(0x01))); + assert(Bytes14.unwrap(~Bytes14.wrap(bytes14(bytes1(0x01)))) == ~bytes14(bytes1(0x01))); + assert(Bytes15.unwrap(~Bytes15.wrap(bytes15(bytes1(0x01)))) == ~bytes15(bytes1(0x01))); + assert(Bytes16.unwrap(~Bytes16.wrap(bytes16(bytes1(0x01)))) == ~bytes16(bytes1(0x01))); + assert(Bytes17.unwrap(~Bytes17.wrap(bytes17(bytes1(0x01)))) == ~bytes17(bytes1(0x01))); + assert(Bytes18.unwrap(~Bytes18.wrap(bytes18(bytes1(0x01)))) == ~bytes18(bytes1(0x01))); + assert(Bytes19.unwrap(~Bytes19.wrap(bytes19(bytes1(0x01)))) == ~bytes19(bytes1(0x01))); + assert(Bytes20.unwrap(~Bytes20.wrap(bytes20(bytes1(0x01)))) == ~bytes20(bytes1(0x01))); + assert(Bytes21.unwrap(~Bytes21.wrap(bytes21(bytes1(0x01)))) == ~bytes21(bytes1(0x01))); + assert(Bytes22.unwrap(~Bytes22.wrap(bytes22(bytes1(0x01)))) == ~bytes22(bytes1(0x01))); + assert(Bytes23.unwrap(~Bytes23.wrap(bytes23(bytes1(0x01)))) == ~bytes23(bytes1(0x01))); + assert(Bytes24.unwrap(~Bytes24.wrap(bytes24(bytes1(0x01)))) == ~bytes24(bytes1(0x01))); + assert(Bytes25.unwrap(~Bytes25.wrap(bytes25(bytes1(0x01)))) == ~bytes25(bytes1(0x01))); + assert(Bytes26.unwrap(~Bytes26.wrap(bytes26(bytes1(0x01)))) == ~bytes26(bytes1(0x01))); + assert(Bytes27.unwrap(~Bytes27.wrap(bytes27(bytes1(0x01)))) == ~bytes27(bytes1(0x01))); + assert(Bytes28.unwrap(~Bytes28.wrap(bytes28(bytes1(0x01)))) == ~bytes28(bytes1(0x01))); + assert(Bytes29.unwrap(~Bytes29.wrap(bytes29(bytes1(0x01)))) == ~bytes29(bytes1(0x01))); + assert(Bytes30.unwrap(~Bytes30.wrap(bytes30(bytes1(0x01)))) == ~bytes30(bytes1(0x01))); + assert(Bytes31.unwrap(~Bytes31.wrap(bytes31(bytes1(0x01)))) == ~bytes31(bytes1(0x01))); + assert(Bytes32.unwrap(~Bytes32.wrap(bytes32(bytes1(0x01)))) == ~bytes32(bytes1(0x01))); + } + + function testOtherBinary() public pure { + assert(Address.unwrap(Address.wrap(address(0x01)) | Address.wrap(address(0x02))) == address(0x03)); + assert(AddressPayable.unwrap(AddressPayable.wrap(payable(address(0x01))) | AddressPayable.wrap(payable(address(0x02)))) == payable(address(0x03))); + assert(Bool.unwrap(~Bool.wrap(true)) == false); + } + + function testOtherUnary() public pure { + assert(Address.unwrap(~Address.wrap(address(0))) == address(~bytes20(0))); + assert(AddressPayable.unwrap(~AddressPayable.wrap(payable(address(0)))) == payable(address(~bytes20(0)))); + assert(Bool.unwrap(~Bool.wrap(true)) == false); + } +} +// ---- +// testIntBinary() -> +// testIntUnary() -> +// testUintBinary() -> +// testUintUnary() -> +// testBytesBinary() -> +// testBytesUnary() -> +// testOtherBinary() -> +// testOtherUnary() -> diff --git a/test/libsolidity/semanticTests/operators/userDefined/attaching_and_defining_operator_with_same_function.sol b/test/libsolidity/semanticTests/operators/userDefined/attaching_and_defining_operator_with_same_function.sol new file mode 100644 index 000000000000..6f0323869061 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/attaching_and_defining_operator_with_same_function.sol @@ -0,0 +1,20 @@ +type Int is int16; + +using {add as +, add} for Int global; + +function add(Int _a, Int _b) pure returns (Int) { + return Int.wrap(Int.unwrap(_a) + Int.unwrap(_b)); +} + +contract C { + function f() pure public returns (Int) { + return Int.wrap(5) + Int.wrap(5); + } + + function g() pure public returns (Int) { + return Int.wrap(7).add(Int.wrap(6)); + } +} +// ---- +// f() -> 10 +// g() -> 13 diff --git a/test/libsolidity/semanticTests/operators/userDefined/checked_operators.sol b/test/libsolidity/semanticTests/operators/userDefined/checked_operators.sol new file mode 100644 index 000000000000..599e894b2e4f --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/checked_operators.sol @@ -0,0 +1,22 @@ +type U8 is uint8; + +function checkedAdd(U8 x, U8 y) pure returns (U8) { + return U8.wrap(U8.unwrap(x) + U8.unwrap(y)); +} + +using {checkedAdd as +} for U8 global; + +contract C { + function testCheckedOperator() public pure returns (U8) { + return U8.wrap(250) + U8.wrap(10); + } + + function testCheckedOperatorInUncheckedBlock() public pure returns (U8) { + unchecked { + return U8.wrap(250) + U8.wrap(10); + } + } +} +// ---- +// testCheckedOperator() -> FAILURE, hex"4e487b71", 0x11 +// testCheckedOperatorInUncheckedBlock() -> FAILURE, hex"4e487b71", 0x11 diff --git a/test/libsolidity/semanticTests/operators/userDefined/consecutive_operator_invocations.sol b/test/libsolidity/semanticTests/operators/userDefined/consecutive_operator_invocations.sol new file mode 100644 index 000000000000..ef36294a6ac5 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/consecutive_operator_invocations.sol @@ -0,0 +1,18 @@ +type A is address; + +using {add as +} for A global; + +function add(A a, A b) pure returns (A) { + return A.wrap(address(uint160(A.unwrap(a)) + uint160(A.unwrap(b)))); +} + +contract C { + function g() public pure returns (A) { + A a = A.wrap(0x3333333333333333333333333333333333333333); + A b = A.wrap(0x1111111111111111111111111111111111111111); + A c = A.wrap(0x5555555555555555555555555555555555555555); + return a + b + c; + } +} +// ---- +// g() -> 0x9999999999999999999999999999999999999999 diff --git a/test/libsolidity/semanticTests/operators/userDefined/fixed_point_udvt_with_operators.sol b/test/libsolidity/semanticTests/operators/userDefined/fixed_point_udvt_with_operators.sol new file mode 100644 index 000000000000..6f17b16eb38d --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/fixed_point_udvt_with_operators.sol @@ -0,0 +1,22 @@ +type Fixed is int128; +using {add as +, mul as *} for Fixed global; + +int constant MULTIPLIER = 10**18; + +function add(Fixed a, Fixed b) pure returns (Fixed) { + return Fixed.wrap(Fixed.unwrap(a) + Fixed.unwrap(b)); +} + +function mul(Fixed a, Fixed b) pure returns (Fixed) { + int intermediate = (int(Fixed.unwrap(a)) * int(Fixed.unwrap(b))) / MULTIPLIER; + if (int128(intermediate) != intermediate) { revert("Overflow"); } + return Fixed.wrap(int128(intermediate)); +} + +contract C { + function applyInterest(Fixed value, Fixed percentage) public pure returns (Fixed result) { + return value + value * percentage; + } +} +// ---- +// applyInterest(int128,int128): 500000000000000000000, 100000000000000000 -> 550000000000000000000 diff --git a/test/libsolidity/semanticTests/operators/userDefined/multiple_operator_definitions_different_types_different_functions_separate_directives.sol b/test/libsolidity/semanticTests/operators/userDefined/multiple_operator_definitions_different_types_different_functions_separate_directives.sol new file mode 100644 index 000000000000..0b2d740a6da5 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/multiple_operator_definitions_different_types_different_functions_separate_directives.sol @@ -0,0 +1,26 @@ +type SmallInt is int; +type BigInt is int; + +using {addSmall as +} for SmallInt global; +using {addBig as +} for BigInt global; + +function addSmall(SmallInt a, SmallInt b) pure returns (SmallInt) { + return SmallInt.wrap(SmallInt.unwrap(a) + SmallInt.unwrap(b)); +} + +function addBig(BigInt a, BigInt b) pure returns (BigInt) { + return BigInt.wrap(10 * (BigInt.unwrap(a) + BigInt.unwrap(b))); +} + +contract C { + function small() public pure returns (SmallInt) { + return SmallInt.wrap(1) + SmallInt.wrap(2); + } + + function big() public pure returns (BigInt) { + return BigInt.wrap(3) + BigInt.wrap(4); + } +} +// ---- +// small() -> 3 +// big() -> 70 diff --git a/test/libsolidity/semanticTests/operators/userDefined/multiple_operator_definitions_same_type_same_function_same_directive.sol b/test/libsolidity/semanticTests/operators/userDefined/multiple_operator_definitions_same_type_same_function_same_directive.sol new file mode 100644 index 000000000000..3085d8e89304 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/multiple_operator_definitions_same_type_same_function_same_directive.sol @@ -0,0 +1,20 @@ +type Int is int32; + +using {foo as +, foo as -} for Int global; + +function foo(Int a, Int b) pure returns(Int) { + return Int.wrap(Int.unwrap(a) + Int.unwrap(b)); +} + +contract C { + function f() pure public returns (Int) { + return Int.wrap(2) + Int.wrap(3); + } + + function g() pure public returns (Int) { + return Int.wrap(6) - Int.wrap(1); + } +} +// ---- +// f() -> 5 +// g() -> 7 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_definition_shadowing_builtin_keccak256.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_definition_shadowing_builtin_keccak256.sol new file mode 100644 index 000000000000..a26a750cde97 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_definition_shadowing_builtin_keccak256.sol @@ -0,0 +1,15 @@ +type Int is int16; + +using {keccak256 as +} for Int global; + +function keccak256(Int a, Int b) pure returns (Int) { + return Int.wrap(Int.unwrap(a) + Int.unwrap(b)); +} + +contract C { + function test() public returns (Int) { + return Int.wrap(3) + Int.wrap(4); + } +} +// ---- +// test() -> 7 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_evaluation_order.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_evaluation_order.sol new file mode 100644 index 000000000000..781f21d167d3 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_evaluation_order.sol @@ -0,0 +1,83 @@ +type Bool is bool; +using {add as +, mul as *, unsub as -} for Bool global; + +function add(Bool x, Bool y) pure returns (Bool) { + return Bool.wrap(Bool.unwrap(x) || Bool.unwrap(y)); +} + +function mul(Bool x, Bool y) pure returns (Bool) { + return Bool.wrap(Bool.unwrap(x) && Bool.unwrap(y)); +} + +function unsub(Bool x) pure returns (Bool) { + return Bool.wrap(!Bool.unwrap(x)); +} + +contract C { + event Wrapped(uint); + event Probe(Bool); + + function toBool(uint x) public returns (Bool) { + emit Wrapped(x); + return Bool.wrap(x > 0); + } + + function probe(Bool x) public returns (Bool) { + emit Probe(x); + return x; + } + + function testSingleOperator() public { + toBool(0) + + (toBool(1) + toBool(2)) + + toBool(3); + } + + function testTwoBinaryOperators() public { + toBool(0) * toBool(1) + + (toBool(2) * toBool(3)) + + toBool(4) * toBool(5); + } + + function testBinaryAndUnaryOperators() public { + -toBool(0) * -toBool(1) + + (-toBool(2) * -toBool(3)) + + -toBool(4) * -toBool(5); + } + + function testOperatorsNestedInCalls() public { + -probe(toBool(0) * -toBool(1)) + + (-probe(toBool(2) * -toBool(3))) + + -probe(toBool(4) * -toBool(5)); + } +} +// ---- +// testSingleOperator() -> +// ~ emit Wrapped(uint256): 0x00 +// ~ emit Wrapped(uint256): 0x01 +// ~ emit Wrapped(uint256): 0x02 +// ~ emit Wrapped(uint256): 0x03 +// testTwoBinaryOperators() -> +// ~ emit Wrapped(uint256): 0x00 +// ~ emit Wrapped(uint256): 0x01 +// ~ emit Wrapped(uint256): 0x02 +// ~ emit Wrapped(uint256): 0x03 +// ~ emit Wrapped(uint256): 0x04 +// ~ emit Wrapped(uint256): 0x05 +// testBinaryAndUnaryOperators() -> +// ~ emit Wrapped(uint256): 0x00 +// ~ emit Wrapped(uint256): 0x01 +// ~ emit Wrapped(uint256): 0x02 +// ~ emit Wrapped(uint256): 0x03 +// ~ emit Wrapped(uint256): 0x04 +// ~ emit Wrapped(uint256): 0x05 +// testOperatorsNestedInCalls() -> +// ~ emit Wrapped(uint256): 0x00 +// ~ emit Wrapped(uint256): 0x01 +// ~ emit Probe(bool): 0x00 +// ~ emit Wrapped(uint256): 0x02 +// ~ emit Wrapped(uint256): 0x03 +// ~ emit Probe(bool): 0x00 +// ~ emit Wrapped(uint256): 0x04 +// ~ emit Wrapped(uint256): 0x05 +// ~ emit Probe(bool): 0x00 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol new file mode 100644 index 000000000000..ce6a0f48db09 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol @@ -0,0 +1,61 @@ +type Int32 is int32; +using {add as +, unsub as -} for Int32 global; + +function add(Int32 x, Int32 y) pure returns (Int32) { + return loadAdder().mul(x, y); +} + +function unsub(Int32 x) pure returns (Int32) { + return loadAdder().inc(x); +} + +interface IAdder { + function mul(Int32, Int32) external pure returns (Int32); + function inc(Int32) external pure returns (Int32); +} + +contract Adder is IAdder { + function mul(Int32 x, Int32 y) external pure override returns (Int32) { + return Int32.wrap(Int32.unwrap(x) * Int32.unwrap(y)); + } + + function inc(Int32 x) external pure override returns (Int32) { + return Int32.wrap(Int32.unwrap(x) + 1); + } +} + +function storeAdder(IAdder adder) pure { + assembly { + // This test would also work without assembly if we could hard-code an address here. + mstore(0, adder) + } +} + +function loadAdder() pure returns (IAdder adder) { + assembly { + adder := mload(0) + } +} + +contract C { + function testMul(Int32 x, Int32 y) public returns (Int32) { + storeAdder(new Adder()); + + return x + y; + } + + function testInc(Int32 x) public returns (Int32) { + storeAdder(new Adder()); + + return -x; + } +} +// ---- +// testMul(int32,int32): 42, 10 -> 420 +// gas irOptimized: 102563 +// gas legacy: 183981 +// gas legacyOptimized: 123563 +// testInc(int32): 42 -> 43 +// gas irOptimized: 102386 +// gas legacy: 183239 +// gas legacyOptimized: 123251 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol new file mode 100644 index 000000000000..f3f8ebdc63db --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol @@ -0,0 +1,67 @@ +type Int32 is int32; +using {add as +, unsub as -} for Int32 global; + +function add(Int32 x, Int32 y) pure returns (Int32) { + return loadAdder().mul(x, y); +} + +function unsub(Int32 x) pure returns (Int32) { + return loadAdder().inc(x); +} + +interface IAdderPure { + function mul(Int32, Int32) external pure returns (Int32); + function inc(Int32) external pure returns (Int32); +} + +interface IAdderView { + function mul(Int32, Int32) external view returns (Int32); + function inc(Int32) external view returns (Int32); +} + +contract Adder is IAdderView { + function mul(Int32 x, Int32 y) external view override returns (Int32) { + return Int32.wrap(Int32.unwrap(x) * Int32.unwrap(y)); + } + + function inc(Int32 x) external view override returns (Int32) { + return Int32.wrap(Int32.unwrap(x) + 1); + } +} + +function storeAdder(IAdderView adder) pure { + assembly { + // This test would also work without assembly if we could hard-code an address here. + mstore(0, adder) + } +} + +function loadAdder() pure returns (IAdderPure adder) { + assembly { + // The adder we stored is view but we cheat by using a modified version with pure functions + adder := mload(0) + } +} + +contract C { + function testMul(Int32 x, Int32 y) public returns (Int32) { + storeAdder(new Adder()); + + return x + y; + } + + function testInc(Int32 x) public returns (Int32) { + storeAdder(new Adder()); + + return -x; + } +} +// ---- +// testMul(int32,int32): 42, 10 -> 420 +// gas irOptimized: 102563 +// gas legacy: 183981 +// gas legacyOptimized: 123563 +// testInc(int32): 42 -> 43 +// gas irOptimized: 102386 +// gas legacy: 183239 +// gas legacyOptimized: 123251 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_parameter_and_return_cleanup_between_calls.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_parameter_and_return_cleanup_between_calls.sol new file mode 100644 index 000000000000..b51ad8dad5c5 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_parameter_and_return_cleanup_between_calls.sol @@ -0,0 +1,22 @@ +type U8 is uint8; +using {yoloAdd as +, yoloDiv as /} for U8 global; + +function yoloAdd(U8 x, U8 y) pure returns (U8 z) { + assembly { + z := add(x, y) // Wrong! No cleanup. + } +} + +function yoloDiv(U8 x, U8 y) pure returns (U8 z) { + assembly { + z := div(x, y) // Wrong! No cleanup. + } +} + +contract C { + function divAddNoOverflow(U8 a, U8 b, U8 c) external pure returns (U8) { + return a / (b + c); + } +} +// ---- +// divAddNoOverflow(uint8,uint8,uint8): 4, 0xff, 3 -> 0 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_parameter_cleanup.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_parameter_cleanup.sol new file mode 100644 index 000000000000..fe37a0e12cc2 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_parameter_cleanup.sol @@ -0,0 +1,40 @@ +type U8 is uint8; +using {f as ~, add as +} for U8 global; + +function f(U8 x) pure returns (U8 z) { + assembly { + // NOTE: Not using shr so that the test works pre-constantinople too + z := div(x, 256) + } +} + +function add(U8 x, U8 y) pure returns (U8 z) { + assembly { + z := add(div(x, 256), div(x, 256)) + } +} + +contract C { + function testUnary() external pure returns (U8, U8) { + U8 a; + assembly { + a := 0x4200 + } + // If the result is not 0, no cleanup was performed. + return (~a, f(a)); + } + + function testBinary() external pure returns (U8, U8) { + U8 a; + U8 b; + assembly { + a := 0x4200 + b := 0x4200 + } + // If the result is not 0, no cleanup was performed. + return (a + b, add(a, b)); + } +} +// ---- +// testUnary() -> 0x42, 0x42 +// testBinary() -> 0x84, 0x84 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_precendence.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_precendence.sol new file mode 100644 index 000000000000..961e031695b6 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_precendence.sol @@ -0,0 +1,71 @@ +type Int is int64; +using { + bitor as |, bitand as &, bitxor as ^, bitnot as ~, + add as +, sub as -, unsub as -, mul as *, div as /, mod as % +} for Int global; + +function bitor(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) | Int.unwrap(y)); } +function bitand(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) & Int.unwrap(y)); } +function bitxor(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) ^ Int.unwrap(y)); } +function bitnot(Int x) pure returns (Int) { return Int.wrap(~Int.unwrap(x)); } + +function add(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) + Int.unwrap(y)); } +function sub(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) - Int.unwrap(y)); } +function unsub(Int x) pure returns (Int) { return Int.wrap(-Int.unwrap(x)); } +function mul(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) * Int.unwrap(y)); } +function div(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) / Int.unwrap(y)); } +function mod(Int x, Int y) pure returns (Int) { return Int.wrap(Int.unwrap(x) % Int.unwrap(y)); } + +contract C { + Int constant I0 = Int.wrap(0); + Int constant I1 = Int.wrap(1); + Int constant I2 = Int.wrap(2); + Int constant I3 = Int.wrap(3); + Int constant I4 = Int.wrap(4); + Int constant I5 = Int.wrap(5); + Int constant I6 = Int.wrap(6); + Int constant I7 = Int.wrap(7); + Int constant I8 = Int.wrap(8); + Int constant I10 = Int.wrap(10); + Int constant I13 = Int.wrap(13); + Int constant I15 = Int.wrap(15); + Int constant I20 = Int.wrap(20); + Int constant I128 = Int.wrap(128); + + function testBitwise() public pure { + assert(Int.unwrap(I0 & I0 | I1) == (0 & 0 | 1)); + assert(Int.unwrap(I0 & I0 | I1) == ((0 & 0) | 1)); + } + + function testBitwise_arithmetic() public pure { + assert(Int.unwrap(I2 + I2 & ~I1 | I6 * I6 - I4 & ~I3) == (2 + 2 & ~1 | 6 * 6 - 4 & ~3)); + assert(Int.unwrap(I2 + I2 & ~I1 | I6 * I6 - I4 & ~I3) == (((2 + 2) & (~1)) | (((6 * 6) - 4) & (~3)))); + } + + function testArithmetic() public pure { + assert(Int.unwrap(I1 + I8 / I4 - I5 % I6 * I7) == (1 + 8 / 4 - 5 % 6 * 7)); + assert(Int.unwrap(I1 + I8 / I4 - I5 % I6 * I7) == ((1 + (8 / 4)) - ((5 % 6) * 7))); + } + + function testAll() public pure { + assert( + Int.unwrap(I128 + I1 - I10 + I4 & ~I1 ^ ~I1 * I2 | -I15 % -I10 * I20 / I2 + I13 & ~I3) == + (128 + 1 - 10 + 4 & ~1 ^ ~1 * 2 | -15 % -10 * 20 / 2 + 13 & ~3) + ); + assert( + Int.unwrap(I128 + I1 - I10 + I4 & ~I1 ^ ~I1 * I2 | -I15 % -I10 * I20 / I2 + I13 & ~I3) == + ( + ( + ((((128 + 1) - 10) + 4) & (~1)) ^ + ((~1) * 2) + ) | + ((((((-15) % (-10)) * 20) / 2) + 13) & (~3)) + ) + ); + } +} +// ---- +// testBitwise() -> +// testBitwise_arithmetic() -> +// testArithmetic() -> +// testAll() -> diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_return_parameter_cleanup.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_return_parameter_cleanup.sol new file mode 100644 index 000000000000..3798a0036238 --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_return_parameter_cleanup.sol @@ -0,0 +1,58 @@ +type U8 is uint8; +using {f as ~, g as +} for U8 global; + +function f(U8) pure returns (U8 z) { + assembly { + // Return a value with dirty bytes outside of uint8 + z := 0xffff + } +} + +function g(U8, U8) pure returns (U8 z) { + assembly { + // Return a value with dirty bytes outside of uint8 + z := 0xffff + } +} + +contract C { + function testUnary() external pure returns (uint, uint) { + U8 a; // Value does not matter + + U8 opResult = ~a; + U8 fResult = f(a); + + // Get the slot, including bytes outside of uint8 + uint opResultFull; + uint fResultFull; + assembly { + opResultFull := opResult + fResultFull := fResult + } + + // If the result is not 0xff, no cleanup was performed. + return (opResultFull, fResultFull); + } + + function testBinary() external pure returns (uint, uint) { + U8 a; // Value does not matter + U8 b; // Value does not matter + + U8 opResult = a + b; + U8 fResult = g(a, b); + + // Get the slot, including bytes outside of uint8 + uint opResultFull; + uint fResultFull; + assembly { + opResultFull := opResult + fResultFull := fResult + } + + // If the result is not 0xff, no cleanup was performed. + return (opResultFull, fResultFull); + } +} +// ---- +// testUnary() -> 0xffff, 0xffff +// testBinary() -> 0xffff, 0xffff diff --git a/test/libsolidity/semanticTests/operators/userDefined/recursive_operator.sol b/test/libsolidity/semanticTests/operators/userDefined/recursive_operator.sol new file mode 100644 index 000000000000..3ce080c34dff --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/recursive_operator.sol @@ -0,0 +1,41 @@ +type Uint is uint; +using {unaryCountdown as ~, binaryCountdown as ^, eq as ==} for Uint global; + +function unaryCountdown(Uint x) pure returns (Uint) { + if (x == Uint.wrap(0)) + return Uint.wrap(0); + + return ~Uint.wrap(Uint.unwrap(x) - 1); +} + +function binaryCountdown(Uint x, Uint y) pure returns (Uint) { + if (x == Uint.wrap(0) && y == Uint.wrap(0)) + return Uint.wrap(0); + if (x == Uint.wrap(0)) + return y ^ x; + + return Uint.wrap(Uint.unwrap(x) - 1) ^ y; +} + +function eq(Uint x, Uint y) pure returns (bool) { + return Uint.unwrap(x) == Uint.unwrap(y); +} + +contract C { + function testUnary(Uint x) public pure returns (Uint) { + return ~x; + } + + function testBinary(Uint x, Uint y) public pure returns (Uint) { + return x ^ y; + } +} +// ---- +// testUnary(uint256): 0 -> 0 +// testUnary(uint256): 1 -> 0 +// testUnary(uint256): 99999999999 -> FAILURE +// testBinary(uint256,uint256): 0, 0 -> 0 +// testBinary(uint256,uint256): 1, 0 -> 0 +// testBinary(uint256,uint256): 0, 1 -> 0 +// testBinary(uint256,uint256): 1, 1 -> 0 +// testBinary(uint256,uint256): 99999999999, 99999999999 -> FAILURE diff --git a/test/libsolidity/semanticTests/operators/userDefined/unchecked_operators.sol b/test/libsolidity/semanticTests/operators/userDefined/unchecked_operators.sol new file mode 100644 index 000000000000..684ea1b433ad --- /dev/null +++ b/test/libsolidity/semanticTests/operators/userDefined/unchecked_operators.sol @@ -0,0 +1,25 @@ +type U8 is uint8; + +function uncheckedAdd(U8 x, U8 y) pure returns (U8) { + unchecked { + return U8.wrap(U8.unwrap(x) + U8.unwrap(y)); + } +} + +using {uncheckedAdd as +} for U8 global; + +contract D { + function testUncheckedOperator() public pure returns (U8) { + return U8.wrap(250) + U8.wrap(10); + } + + function testUncheckedOperatorInUncheckedBlock() public pure returns (U8) { + unchecked { + return U8.wrap(250) + U8.wrap(10); + } + } +} + +// ---- +// testUncheckedOperator() -> 4 +// testUncheckedOperatorInUncheckedBlock() -> 4 diff --git a/test/libsolidity/semanticTests/salted_create/prediction_example.sol b/test/libsolidity/semanticTests/salted_create/prediction_example.sol index 1b138bdbb359..1c5ce63ad456 100644 --- a/test/libsolidity/semanticTests/salted_create/prediction_example.sol +++ b/test/libsolidity/semanticTests/salted_create/prediction_example.sol @@ -26,4 +26,4 @@ contract C { // compileViaYul: also // ---- // createDSalted(bytes32,uint256): 42, 64 -> -// gas legacy: 104365 +// gas legacy: 102943 diff --git a/test/libsolidity/semanticTests/salted_create/salted_create.sol b/test/libsolidity/semanticTests/salted_create/salted_create.sol index 80869b5aace2..11b74168d993 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create.sol @@ -21,6 +21,6 @@ contract A { // ---- // different_salt() -> true // same_salt() -> true -// gas irOptimized: 98438900 -// gas legacy: 98439116 -// gas legacyOptimized: 98438970 +// gas irOptimized: 98438897 +// gas legacy: 98439109 +// gas legacyOptimized: 98438967 diff --git a/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol b/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol index d51b99b59a73..025c8259db56 100644 --- a/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol +++ b/test/libsolidity/semanticTests/salted_create/salted_create_with_value.sol @@ -21,6 +21,6 @@ contract A { // EVMVersion: >=constantinople // ---- // f(), 10 ether -> 3007, 3008, 3009 -// gas irOptimized: 255997 -// gas legacy: 387712 -// gas legacyOptimized: 283266 +// gas irOptimized: 254238 +// gas legacy: 381063 +// gas legacyOptimized: 279694 diff --git a/test/libsolidity/semanticTests/shanghai/evmone_support.sol b/test/libsolidity/semanticTests/shanghai/evmone_support.sol new file mode 100644 index 000000000000..359dc516ffcd --- /dev/null +++ b/test/libsolidity/semanticTests/shanghai/evmone_support.sol @@ -0,0 +1,31 @@ +contract ShortReturn { + constructor() { + assembly { + // return(0, 32) + // PUSH1 0x20 PUSH0 RETURN + mstore(0, hex"60205ff3") + return(0, 4) + } + } +} + +interface DoesItReturnZero { + function foo() external pure returns (uint256); +} + +contract Test { + ShortReturn immutable shortReturn = new ShortReturn(); + function bytecode() external view returns(bytes memory) { + return address(shortReturn).code; + } + function isPush0Supported() external view returns (bool) { + assert(DoesItReturnZero(address(shortReturn)).foo() == 0); + return true; + } +} +// ==== +// compileViaYul: also +// EVMVersion: >=shanghai +// ---- +// bytecode() -> 0x20, 4, 0x60205ff300000000000000000000000000000000000000000000000000000000 +// isPush0Supported() -> true diff --git a/test/libsolidity/semanticTests/shanghai/push0.sol b/test/libsolidity/semanticTests/shanghai/push0.sol new file mode 100644 index 000000000000..e1acaaae6af1 --- /dev/null +++ b/test/libsolidity/semanticTests/shanghai/push0.sol @@ -0,0 +1,11 @@ +contract C { + function zero() external returns (uint) { + return 0; + } + +} +// ==== +// compileViaYul: also +// EVMVersion: >=shanghai +// ---- +// zero() -> 0 diff --git a/test/libsolidity/semanticTests/smoke/alignment.sol b/test/libsolidity/semanticTests/smoke/alignment.sol index bdf2ed446fb0..3e8016f988f8 100644 --- a/test/libsolidity/semanticTests/smoke/alignment.sol +++ b/test/libsolidity/semanticTests/smoke/alignment.sol @@ -25,5 +25,5 @@ contract D { // stateDecimal() -> right(42) // stateBytes() -> left(0x4200ef) // internalStateDecimal() -> 0x20 -// gas legacy: 101679 +// gas legacy: 100265 // update(bool,uint256,bytes32): false, -23, left(0x2300ef) -> false, -23, left(0x2300ef) diff --git a/test/libsolidity/semanticTests/smoke/constructor.sol b/test/libsolidity/semanticTests/smoke/constructor.sol index b834f8018a30..eb1d73a448ed 100644 --- a/test/libsolidity/semanticTests/smoke/constructor.sol +++ b/test/libsolidity/semanticTests/smoke/constructor.sol @@ -12,9 +12,9 @@ contract C { } // ---- // constructor(), 2 wei: 3 -> -// gas irOptimized: 107003 -// gas legacy: 151416 -// gas legacyOptimized: 108388 +// gas irOptimized: 106374 +// gas legacy: 148308 +// gas legacyOptimized: 106727 // state() -> 3 // balance() -> 2 // balance -> 2 diff --git a/test/libsolidity/semanticTests/state/blockhash_basic.sol b/test/libsolidity/semanticTests/state/blockhash_basic.sol index f6830a202f56..62138a9b2863 100644 --- a/test/libsolidity/semanticTests/state/blockhash_basic.sol +++ b/test/libsolidity/semanticTests/state/blockhash_basic.sol @@ -12,9 +12,9 @@ contract C { } // ---- // constructor() -// gas irOptimized: 110504 -// gas legacy: 155081 -// gas legacyOptimized: 107997 +// gas irOptimized: 109878 +// gas legacy: 152179 +// gas legacyOptimized: 106750 // genesisHash() -> 0x3737373737373737373737373737373737373737373737373737373737373737 // currentHash() -> 0 // f(uint256): 0 -> 0x3737373737373737373737373737373737373737373737373737373737373737 diff --git a/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol b/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol index 7341b85c6b0c..20755a0694c7 100644 --- a/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol +++ b/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol @@ -22,9 +22,9 @@ contract Test { // set(bytes): 0x20, 0 // storageEmpty -> 1 // set(bytes): 0x20, 66, "12345678901234567890123456789012", "12345678901234567890123456789012", "12" -// gas irOptimized: 111897 -// gas legacy: 112756 -// gas legacyOptimized: 112116 +// gas irOptimized: 111895 +// gas legacy: 112734 +// gas legacyOptimized: 112110 // storageEmpty -> 0 // set(bytes): 0x20, 3, "abc" // storageEmpty -> 0 diff --git a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol index a2f7ba1d8d8e..a3131d564f2a 100644 --- a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol +++ b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol @@ -45,6 +45,6 @@ contract C { // compileToEwasm: also // ---- // test() -> true -// gas irOptimized: 132506 -// gas legacy: 136036 -// gas legacyOptimized: 133480 +// gas irOptimized: 132505 +// gas legacy: 136009 +// gas legacyOptimized: 133478 diff --git a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_nested_array_to_storage.sol b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_nested_array_to_storage.sol index 1f698719926f..0bcc74b6ba54 100644 --- a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_nested_array_to_storage.sol +++ b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_nested_array_to_storage.sol @@ -16,6 +16,6 @@ contract C { } // ---- // f(uint32,(uint128,uint256[][2],uint32)): 55, 0x40, 77, 0x60, 88, 0x40, 0x40, 2, 1, 2 -> 55, 77, 1, 2, 88 -// gas irOptimized: 202838 -// gas legacy: 207487 -// gas legacyOptimized: 203611 +// gas irOptimized: 202829 +// gas legacy: 207384 +// gas legacyOptimized: 203584 diff --git a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol index 3d062fc95aae..52ad00649bec 100644 --- a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol +++ b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol @@ -23,6 +23,6 @@ contract CopyTest { } // ---- // run() -> 2, 23, 42 -// gas irOptimized: 193756 -// gas legacy: 186016 -// gas legacyOptimized: 184668 +// gas irOptimized: 193687 +// gas legacy: 185731 +// gas legacyOptimized: 184458 diff --git a/test/libsolidity/semanticTests/structs/copy_from_mapping.sol b/test/libsolidity/semanticTests/structs/copy_from_mapping.sol index 5057b0efab73..9aa41a34255b 100644 --- a/test/libsolidity/semanticTests/structs/copy_from_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_from_mapping.sol @@ -37,8 +37,8 @@ contract C { // ---- // to_state() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121513 -// gas legacy: 123120 -// gas legacyOptimized: 121776 +// gas irOptimized: 121497 +// gas legacy: 123069 +// gas legacyOptimized: 121758 // to_storage() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 // to_memory() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 diff --git a/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol b/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol index ba890a4ae09b..aed54f98b6ac 100644 --- a/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol +++ b/test/libsolidity/semanticTests/structs/copy_struct_array_from_storage.sol @@ -87,9 +87,9 @@ contract Test { // EVMVersion: >homestead // ---- // test1() -> true -// gas irOptimized: 152963 -// gas legacy: 153066 -// gas legacyOptimized: 152675 +// gas irOptimized: 152954 +// gas legacy: 153012 +// gas legacyOptimized: 152637 // test2() -> true // test3() -> true // test4() -> true diff --git a/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol b/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol index e91fa839e772..29618bb044b6 100644 --- a/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol @@ -45,8 +45,8 @@ contract C { // ---- // to_state() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121616 -// gas legacy: 123263 -// gas legacyOptimized: 121785 +// gas irOptimized: 121598 +// gas legacy: 123208 +// gas legacyOptimized: 121765 // to_storage() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 // to_memory() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 diff --git a/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol b/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol index aecde10dce6e..ec989b508ef6 100644 --- a/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol @@ -53,14 +53,14 @@ contract C { // ---- // from_memory() -> 0x20, 0x60, 0xa0, 0x15, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 123041 -// gas legacy: 130289 -// gas legacyOptimized: 128785 +// gas irOptimized: 123029 +// gas legacy: 130227 +// gas legacyOptimized: 128762 // from_state() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121737 -// gas legacy: 123341 -// gas legacyOptimized: 121892 +// gas irOptimized: 121721 +// gas legacy: 123282 +// gas legacyOptimized: 121870 // from_calldata((bytes,uint16[],uint16)): 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -> 0x20, 0x60, 0xa0, 0x15, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 115127 -// gas legacy: 122579 -// gas legacyOptimized: 120829 +// gas irOptimized: 115116 +// gas legacy: 122516 +// gas legacyOptimized: 120806 diff --git a/test/libsolidity/semanticTests/structs/copy_to_mapping.sol b/test/libsolidity/semanticTests/structs/copy_to_mapping.sol index e575fb8f13f8..e5c02001fe13 100644 --- a/test/libsolidity/semanticTests/structs/copy_to_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_to_mapping.sol @@ -46,18 +46,18 @@ contract C { // ---- // from_state() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121709 -// gas legacy: 123198 -// gas legacyOptimized: 121830 +// gas irOptimized: 121693 +// gas legacy: 123144 +// gas legacyOptimized: 121811 // from_storage() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121753 -// gas legacy: 123247 -// gas legacyOptimized: 121882 +// gas irOptimized: 121737 +// gas legacy: 123193 +// gas legacyOptimized: 121863 // from_memory() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 122954 -// gas legacy: 130146 -// gas legacyOptimized: 128779 +// gas irOptimized: 122942 +// gas legacy: 130088 +// gas legacyOptimized: 128757 // from_calldata((bytes,uint16[],uint16)): 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -> 0x20, 0x60, 0xa0, 21, 3, 0x666f6f0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 115067 -// gas legacy: 118383 -// gas legacyOptimized: 115458 +// gas irOptimized: 115056 +// gas legacy: 118301 +// gas legacyOptimized: 115435 diff --git a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol index 9d157d70eb24..12b514a23c6a 100644 --- a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol +++ b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol @@ -68,7 +68,7 @@ contract Test { // compileToEwasm: also // ---- // load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 -// gas irOptimized: 110327 -// gas legacy: 112999 -// gas legacyOptimized: 110881 +// gas irOptimized: 110326 +// gas legacy: 112964 +// gas legacyOptimized: 110876 // store() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 diff --git a/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol b/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol index 48a4f08e0167..4a64f08136b6 100644 --- a/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol +++ b/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol @@ -23,17 +23,17 @@ contract c { // ---- // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133599 -// gas legacy: 134654 -// gas legacyOptimized: 133882 +// gas irOptimized: 133596 +// gas legacy: 134628 +// gas legacyOptimized: 133875 // test(uint256): 32 -> "3" // storageEmpty -> 0 // copy() -> true // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133599 -// gas legacy: 134654 -// gas legacyOptimized: 133882 +// gas irOptimized: 133596 +// gas legacy: 134628 +// gas legacyOptimized: 133875 // storageEmpty -> 0 // del() -> true // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/structs/struct_copy.sol b/test/libsolidity/semanticTests/structs/struct_copy.sol index e5960ce1ed02..956416a967e6 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy.sol @@ -36,14 +36,14 @@ contract c { // ---- // set(uint256): 7 -> true -// gas irOptimized: 109897 -// gas legacy: 110616 -// gas legacyOptimized: 110006 +// gas irOptimized: 109896 +// gas legacy: 110597 +// gas legacyOptimized: 110003 // retrieve(uint256): 7 -> 1, 3, 4, 2 // copy(uint256,uint256): 7, 8 -> true -// gas irOptimized: 118594 -// gas legacy: 119166 -// gas legacyOptimized: 118622 +// gas irOptimized: 118593 +// gas legacy: 119147 +// gas legacyOptimized: 118619 // retrieve(uint256): 7 -> 1, 3, 4, 2 // retrieve(uint256): 8 -> 1, 3, 4, 2 // copy(uint256,uint256): 0, 7 -> true diff --git a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol index d33b8fd02f8d..53d1ca93a9d7 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol @@ -20,6 +20,6 @@ contract c { // compileToEwasm: also // ---- // test() -> true -// gas irOptimized: 109714 -// gas legacy: 110627 -// gas legacyOptimized: 109706 +// gas irOptimized: 109713 +// gas legacy: 110615 +// gas legacyOptimized: 109705 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol index d2300d4937bf..7ec85c929d65 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol @@ -42,10 +42,10 @@ contract C { } // ---- // f() -> -// gas irOptimized: 113246 -// gas legacy: 113626 -// gas legacyOptimized: 113120 +// gas irOptimized: 113232 +// gas legacy: 113591 +// gas legacyOptimized: 113103 // g() -> -// gas irOptimized: 118618 -// gas legacy: 118806 -// gas legacyOptimized: 118192 +// gas irOptimized: 118604 +// gas legacy: 118764 +// gas legacyOptimized: 118172 diff --git a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol index e2821a5a6b03..46094d3766d6 100644 --- a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol +++ b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol @@ -31,6 +31,6 @@ contract C { // compileToEwasm: also // ---- // f() -> 42, 23, 34, 42, 42 -// gas irOptimized: 110389 -// gas legacy: 112021 -// gas legacyOptimized: 110548 +// gas irOptimized: 110388 +// gas legacy: 111993 +// gas legacyOptimized: 110546 diff --git a/test/libsolidity/semanticTests/structs/structs.sol b/test/libsolidity/semanticTests/structs/structs.sol index ada5534ca5af..61456cd7e30a 100644 --- a/test/libsolidity/semanticTests/structs/structs.sol +++ b/test/libsolidity/semanticTests/structs/structs.sol @@ -30,7 +30,7 @@ contract test { // ---- // check() -> false // set() -> -// gas irOptimized: 134436 -// gas legacy: 135277 -// gas legacyOptimized: 134064 +// gas irOptimized: 134435 +// gas legacy: 135246 +// gas legacyOptimized: 134062 // check() -> true diff --git a/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol b/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol index 4315095ac835..daf5d000c864 100644 --- a/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol +++ b/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol @@ -30,6 +30,6 @@ contract C { // ---- // f() -> 0x20, 7, 8, 9, 0xa0, 13, 2, 0x40, 0xa0, 2, 3, 4, 2, 3, 4 -// gas irOptimized: 197113 -// gas legacy: 199986 -// gas legacyOptimized: 196847 +// gas irOptimized: 197082 +// gas legacy: 199891 +// gas legacyOptimized: 196817 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol index b2acbb01f647..1e58c9b037cf 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol @@ -49,13 +49,13 @@ contract C { } // ---- // test_f() -> true -// gas irOptimized: 122510 -// gas legacy: 126150 -// gas legacyOptimized: 123163 +// gas irOptimized: 122489 +// gas legacy: 126030 +// gas legacyOptimized: 123120 // test_g() -> true -// gas irOptimized: 106903 -// gas legacy: 112481 -// gas legacyOptimized: 107706 +// gas irOptimized: 106871 +// gas legacy: 112300 +// gas legacyOptimized: 107649 // addresses(uint256): 0 -> 0x18 // addresses(uint256): 1 -> 0x19 // addresses(uint256): 3 -> 0x1b diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index 167521bffabc..31e754a9b7b1 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -113,9 +113,9 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 362054 -// gas legacy: 852973 -// gas legacyOptimized: 419237 +// gas irOptimized: 360201 +// gas legacy: 834932 +// gas legacyOptimized: 412648 // totalSupply() -> 20 // gas irOptimized: 23415 // gas legacy: 23653 diff --git a/test/libsolidity/semanticTests/using/library_functions_inside_contract.sol b/test/libsolidity/semanticTests/using/library_functions_inside_contract.sol new file mode 100644 index 000000000000..170bc7853680 --- /dev/null +++ b/test/libsolidity/semanticTests/using/library_functions_inside_contract.sol @@ -0,0 +1,31 @@ +library L { + function externalFunction(uint a) external pure returns (uint) { return a * 1; } + function publicFunction(uint b) public pure returns (uint) { return b * 2; } + function internalFunction(uint c) internal pure returns (uint) { return c * 3; } +} + +contract C { + using {L.externalFunction} for uint; + using {L.publicFunction} for uint; + using {L.internalFunction} for uint; + + function f() public pure returns (uint) { + uint x = 1; + return x.externalFunction(); + } + + function g() public pure returns (uint) { + uint x = 1; + return x.publicFunction(); + } + + function h() public pure returns (uint) { + uint x = 1; + return x.internalFunction(); + } +} +// ---- +// library: L +// f() -> 1 +// g() -> 2 +// h() -> 3 diff --git a/test/libsolidity/semanticTests/using/using_global_invisible.sol b/test/libsolidity/semanticTests/using/using_global_invisible.sol index 8db7a9a05d00..3e767a185d90 100644 --- a/test/libsolidity/semanticTests/using/using_global_invisible.sol +++ b/test/libsolidity/semanticTests/using/using_global_invisible.sol @@ -40,4 +40,4 @@ contract D { // ---- // library: "A":L // test() -> 3 -// gas legacy: 123521 +// gas legacy: 120881 diff --git a/test/libsolidity/semanticTests/various/address_code.sol b/test/libsolidity/semanticTests/various/address_code.sol index 8dcdd13e7c13..b944100b96f1 100644 --- a/test/libsolidity/semanticTests/various/address_code.sol +++ b/test/libsolidity/semanticTests/various/address_code.sol @@ -16,9 +16,9 @@ contract C { // compileToEwasm: also // ---- // constructor() -> -// gas irOptimized: 175791 -// gas legacy: 247263 -// gas legacyOptimized: 155977 +// gas irOptimized: 175145 +// gas legacy: 241796 +// gas legacyOptimized: 153411 // initCode() -> 0x20, 0 // f() -> true // g() -> 0 diff --git a/test/libsolidity/semanticTests/various/code_access_content.sol b/test/libsolidity/semanticTests/various/code_access_content.sol index 5ed7db5a376f..92d31d621433 100644 --- a/test/libsolidity/semanticTests/various/code_access_content.sol +++ b/test/libsolidity/semanticTests/various/code_access_content.sol @@ -38,6 +38,6 @@ contract C { } // ---- // testRuntime() -> true -// gas legacy: 101579 +// gas legacy: 100177 // testCreation() -> true -// gas legacy: 102009 +// gas legacy: 100600 diff --git a/test/libsolidity/semanticTests/various/code_access_create.sol b/test/libsolidity/semanticTests/various/code_access_create.sol index ae3825651983..839608aaf5ac 100644 --- a/test/libsolidity/semanticTests/various/code_access_create.sol +++ b/test/libsolidity/semanticTests/various/code_access_create.sol @@ -24,4 +24,4 @@ contract C { // ---- // test() -> 7 -// gas legacy: 102264 +// gas legacy: 100849 diff --git a/test/libsolidity/semanticTests/various/code_access_runtime.sol b/test/libsolidity/semanticTests/various/code_access_runtime.sol index 588ed3ac520c..d22d3e43cb35 100644 --- a/test/libsolidity/semanticTests/various/code_access_runtime.sol +++ b/test/libsolidity/semanticTests/various/code_access_runtime.sol @@ -24,4 +24,4 @@ contract C { // EVMVersion: >=constantinople // ---- // test() -> 42 -// gas legacy: 101638 +// gas legacy: 100235 diff --git a/test/libsolidity/semanticTests/various/code_length.sol b/test/libsolidity/semanticTests/various/code_length.sol index 0e17ae2a29b4..84fd393bd721 100644 --- a/test/libsolidity/semanticTests/various/code_length.sol +++ b/test/libsolidity/semanticTests/various/code_length.sol @@ -61,5 +61,5 @@ contract C { // compileToEwasm: also // ---- // constructor() -// gas legacy: 126455 +// gas legacy: 124168 // f(): true, true -> true, true diff --git a/test/libsolidity/semanticTests/various/create_calldata.sol b/test/libsolidity/semanticTests/various/create_calldata.sol new file mode 100644 index 000000000000..fc4e885ff12a --- /dev/null +++ b/test/libsolidity/semanticTests/various/create_calldata.sol @@ -0,0 +1,14 @@ +contract C { + bytes public s; + constructor(uint256 x) { + // Due to a bug in EVMHost, msg.data used to contain initcode and constructor arguments. + s = msg.data; + assert(msg.data.length == 0); + } +} +// ---- +// constructor(): 42 -> +// gas irOptimized: 146699 +// gas legacy: 173845 +// gas legacyOptimized: 137736 +// s() -> 0x20, 0 diff --git a/test/libsolidity/semanticTests/various/destructuring_assignment.sol b/test/libsolidity/semanticTests/various/destructuring_assignment.sol index 59b468fce2b1..e2c8c52638b7 100644 --- a/test/libsolidity/semanticTests/various/destructuring_assignment.sol +++ b/test/libsolidity/semanticTests/various/destructuring_assignment.sol @@ -34,6 +34,6 @@ contract C { // ---- // f(bytes): 0x20, 0x5, "abcde" -> 0 -// gas irOptimized: 241872 -// gas legacy: 243341 -// gas legacyOptimized: 242454 +// gas irOptimized: 241853 +// gas legacy: 243284 +// gas legacyOptimized: 242421 diff --git a/test/libsolidity/semanticTests/various/erc20.sol b/test/libsolidity/semanticTests/various/erc20.sol index 236ebbce5663..47f4005e3880 100644 --- a/test/libsolidity/semanticTests/various/erc20.sol +++ b/test/libsolidity/semanticTests/various/erc20.sol @@ -96,9 +96,9 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 357746 -// gas legacy: 824737 -// gas legacyOptimized: 414462 +// gas irOptimized: 355485 +// gas legacy: 807683 +// gas legacyOptimized: 408718 // totalSupply() -> 20 // gas irOptimized: 23415 // gas legacy: 23524 diff --git a/test/libsolidity/semanticTests/various/external_types_in_calls.sol b/test/libsolidity/semanticTests/various/external_types_in_calls.sol index 55c201513c56..6b28f542c731 100644 --- a/test/libsolidity/semanticTests/various/external_types_in_calls.sol +++ b/test/libsolidity/semanticTests/various/external_types_in_calls.sol @@ -25,5 +25,5 @@ contract C { // ---- // test() -> 9, 7 -// gas legacy: 129760 +// gas legacy: 127514 // t2() -> 9 diff --git a/test/libsolidity/semanticTests/various/negative_stack_height.sol b/test/libsolidity/semanticTests/various/negative_stack_height.sol index 52fce16f5170..92b6b5650cbb 100644 --- a/test/libsolidity/semanticTests/various/negative_stack_height.sol +++ b/test/libsolidity/semanticTests/various/negative_stack_height.sol @@ -65,5 +65,5 @@ contract C { // compileViaYul: false // ---- // constructor() -> -// gas legacy: 588138 -// gas legacyOptimized: 349636 +// gas legacy: 575272 +// gas legacyOptimized: 346970 diff --git a/test/libsolidity/semanticTests/various/selfdestruct.sol b/test/libsolidity/semanticTests/various/selfdestruct.sol index b823bd14db13..366bac41dec6 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct.sol @@ -30,9 +30,9 @@ contract D { } // ---- // constructor(), 1 ether -> -// gas irOptimized: 188203 -// gas legacy: 261114 -// gas legacyOptimized: 181602 +// gas irOptimized: 186970 +// gas legacy: 255973 +// gas legacyOptimized: 178919 // c() -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a // balance: 0x137aa4dfc0911524504fcd4d98501f179bc13b4a -> 1000000000000000000 // balance -> 0 diff --git a/test/libsolidity/semanticTests/various/senders_balance.sol b/test/libsolidity/semanticTests/various/senders_balance.sol index 8241ec554d55..9f391e2a17ea 100644 --- a/test/libsolidity/semanticTests/various/senders_balance.sol +++ b/test/libsolidity/semanticTests/various/senders_balance.sol @@ -17,7 +17,7 @@ contract D { // ---- // constructor(), 27 wei -> -// gas irOptimized: 170627 -// gas legacy: 222977 -// gas legacyOptimized: 169779 +// gas irOptimized: 169377 +// gas legacy: 218459 +// gas legacyOptimized: 167292 // f() -> 27 diff --git a/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol b/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol index cd34a419ddcc..ec94f73a1f18 100644 --- a/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol +++ b/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol @@ -20,6 +20,6 @@ contract C { // ---- // g() -> 2, 6 -// gas irOptimized: 178549 -// gas legacy: 180893 -// gas legacyOptimized: 179394 +// gas irOptimized: 178542 +// gas legacy: 180839 +// gas legacyOptimized: 179375 diff --git a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol index 413e129ef77c..d95a2cd7ca8f 100644 --- a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol +++ b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol @@ -35,12 +35,12 @@ contract D { // EVMVersion: >=byzantium // ---- // f() -> 0x1 # This should work, next should throw # -// gas legacy: 103716 +// gas legacy: 102095 // fview() -> FAILURE -// gas irOptimized: 98438605 -// gas legacy: 98438801 -// gas legacyOptimized: 98438594 +// gas irOptimized: 98438596 +// gas legacy: 98438774 +// gas legacyOptimized: 98438580 // fpure() -> FAILURE -// gas irOptimized: 98438605 -// gas legacy: 98438801 -// gas legacyOptimized: 98438595 +// gas irOptimized: 98438596 +// gas legacy: 98438774 +// gas legacyOptimized: 98438580 diff --git a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol index 129a78931fd1..a21065bf7219 100644 --- a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol +++ b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol @@ -29,9 +29,9 @@ contract c { // x() -> 0, 0 // y() -> 0, 0 // set() -> -// gas irOptimized: 109691 -// gas legacy: 109732 -// gas legacyOptimized: 109682 +// gas irOptimized: 109690 +// gas legacy: 109728 +// gas legacyOptimized: 109680 // x() -> 1, 2 // y() -> 3, 4 // swap() -> diff --git a/test/libsolidity/semanticTests/various/value_complex.sol b/test/libsolidity/semanticTests/various/value_complex.sol index 6f57e9e322c5..a799b7d9bf2c 100644 --- a/test/libsolidity/semanticTests/various/value_complex.sol +++ b/test/libsolidity/semanticTests/various/value_complex.sol @@ -20,7 +20,7 @@ contract test { // ---- // constructor(), 20 wei -> -// gas irOptimized: 176003 -// gas legacy: 257656 -// gas legacyOptimized: 183070 +// gas irOptimized: 174351 +// gas legacy: 252296 +// gas legacyOptimized: 180352 // sendAmount(uint256): 5 -> 8 diff --git a/test/libsolidity/semanticTests/various/value_insane.sol b/test/libsolidity/semanticTests/various/value_insane.sol index 8aba90d96497..8718bd42249f 100644 --- a/test/libsolidity/semanticTests/various/value_insane.sol +++ b/test/libsolidity/semanticTests/various/value_insane.sol @@ -19,7 +19,7 @@ contract test { // ---- // constructor(), 20 wei -> -// gas irOptimized: 176867 -// gas legacy: 259378 -// gas legacyOptimized: 183682 +// gas irOptimized: 175215 +// gas legacy: 253820 +// gas legacyOptimized: 180784 // sendAmount(uint256): 5 -> 8 diff --git a/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol b/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol index 502e4bde17bf..4b8f599a8f98 100644 --- a/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol +++ b/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol @@ -21,6 +21,6 @@ contract C { } // ---- // f() -> -// gas irOptimized: 113019 -// gas legacy: 112931 -// gas legacyOptimized: 112602 +// gas irOptimized: 113010 +// gas legacy: 112890 +// gas legacyOptimized: 112580 diff --git a/test/libsolidity/semanticTests/virtualFunctions/virtual_override_changing_mutability_internal.sol b/test/libsolidity/semanticTests/virtualFunctions/virtual_override_changing_mutability_internal.sol new file mode 100644 index 000000000000..cee1bcdde55d --- /dev/null +++ b/test/libsolidity/semanticTests/virtualFunctions/virtual_override_changing_mutability_internal.sol @@ -0,0 +1,23 @@ +contract A { + function f() internal virtual { + mutableWithViewOverride(); + mutableWithPureOverride(); + viewWithPureOverride(); + } + + function mutableWithViewOverride() internal virtual {} + function mutableWithPureOverride() internal virtual {} + function viewWithPureOverride() internal view virtual {} +} + +contract C is A { + function run() public { + f(); + } + + function mutableWithViewOverride() internal view override {} + function mutableWithPureOverride() internal pure override {} + function viewWithPureOverride() internal pure override {} +} +// ---- +// run() -> diff --git a/test/libsolidity/semanticTests/virtualFunctions/virtual_override_changing_mutability_public.sol b/test/libsolidity/semanticTests/virtualFunctions/virtual_override_changing_mutability_public.sol new file mode 100644 index 000000000000..c3d9e60a0519 --- /dev/null +++ b/test/libsolidity/semanticTests/virtualFunctions/virtual_override_changing_mutability_public.sol @@ -0,0 +1,23 @@ +contract A { + function f() internal virtual { + mutableWithViewOverride(); + mutableWithPureOverride(); + viewWithPureOverride(); + } + + function mutableWithViewOverride() public virtual {} + function mutableWithPureOverride() public virtual {} + function viewWithPureOverride() public view virtual {} +} + +contract C is A { + function run() public { + f(); + } + + function mutableWithViewOverride() public view override {} + function mutableWithPureOverride() public pure override {} + function viewWithPureOverride() public pure override {} +} +// ---- +// run() -> diff --git a/test/libsolidity/smtCheckerTests/abi/abi_decode_array.sol b/test/libsolidity/smtCheckerTests/abi/abi_decode_array.sol index e2c089493440..da30d302fedf 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_decode_array.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_decode_array.sol @@ -42,3 +42,4 @@ contract C { // Warning 6328: (1009-1037): CHC: Assertion violation happens here. // Warning 6328: (1056-1084): CHC: Assertion violation happens here. // Warning 6328: (1103-1131): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_decode_simple.sol b/test/libsolidity/smtCheckerTests/abi/abi_decode_simple.sol index 2020ce7aeeb7..76c2ec2e9fe1 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_decode_simple.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_decode_simple.sol @@ -28,3 +28,4 @@ contract C { // Warning 6328: (425-434): CHC: Assertion violation happens here. // Warning 6328: (505-519): CHC: Assertion violation happens here. // Warning 6328: (538-552): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_1.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_1.sol index be0bc4769ffb..db29d51113b2 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_1.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_1.sol @@ -20,3 +20,4 @@ contract C { // Warning 6368: (354-359): CHC: Out of bounds access happens here. // Warning 6368: (363-368): CHC: Out of bounds access happens here. // Warning 6328: (451-481): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_2.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_2.sol index c6044a8cdc22..2ce3d625adda 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_2.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_2.sol @@ -19,3 +19,4 @@ contract C { // Warning 6368: (329-334): CHC: Out of bounds access happens here. // Warning 6368: (338-343): CHC: Out of bounds access happens here. // Warning 6328: (426-456): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_3.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_3.sol index a3b20f7f75bc..691493b565a3 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_3.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_3.sol @@ -19,3 +19,4 @@ contract C { // Warning 6368: (323-328): CHC: Out of bounds access happens here. // Warning 6368: (332-337): CHC: Out of bounds access happens here. // Warning 6328: (417-447): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_4.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_4.sol index 6f0128f8ab0f..358f4955c6b3 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_4.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_4.sol @@ -23,3 +23,4 @@ contract C { // Warning 6368: (377-382): CHC: Out of bounds access happens here. // Warning 6368: (386-391): CHC: Out of bounds access happens here. // Warning 6328: (462-492): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_5.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_5.sol index 98e42ad9f61f..21173a707dec 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_5.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_call_simple_5.sol @@ -23,3 +23,4 @@ contract C { // Warning 6368: (382-387): CHC: Out of bounds access happens here. // Warning 6368: (391-396): CHC: Out of bounds access happens here. // Warning 6328: (467-497): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_hash.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_hash.sol index 2f099fba1212..6260ebde9c7a 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_hash.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_hash.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_no_arguments.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_no_arguments.sol index 336696d397d5..2d4c8119903e 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_no_arguments.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_no_arguments.sol @@ -20,3 +20,4 @@ contract C { // Warning 6328: (231-253): CHC: Assertion violation happens here. // Warning 6328: (307-330): CHC: Assertion violation happens here. // Warning 6328: (423-446): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_packed_hash.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_packed_hash.sol index 1cde510697e6..dc886246b817 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_packed_hash.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_packed_hash.sol @@ -13,4 +13,5 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (281-319): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\nb = 0\n\nTransaction trace:\nC.constructor()\nC.abiencodePackedHash(0, 0) +// Warning 6328: (281-319): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_packed_simple.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_packed_simple.sol index cc8723ff2587..50d474a873f7 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_packed_simple.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_packed_simple.sol @@ -23,7 +23,8 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (322-352): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\nb4 = []\nb5 = []\n\nTransaction trace:\nC.constructor()\nC.abiencodePackedSimple(false, 0, 0, 0, a, b) -// Warning 6328: (419-449): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\nb5 = []\n\nTransaction trace:\nC.constructor()\nC.abiencodePackedSimple(false, 0, 0, 0, a, b) -// Warning 6328: (528-558): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\n\nTransaction trace:\nC.constructor()\nC.abiencodePackedSimple(false, 0, 0, 0, a, b) -// Warning 6328: (577-607): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\n\nTransaction trace:\nC.constructor()\nC.abiencodePackedSimple(false, 0, 0, 0, a, b) +// Warning 6328: (322-352): CHC: Assertion violation happens here. +// Warning 6328: (419-449): CHC: Assertion violation happens here. +// Warning 6328: (528-558): CHC: Assertion violation happens here. +// Warning 6328: (577-607): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_simple.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_simple.sol index 2b79850d7856..bf3bd61bece7 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_simple.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_simple.sol @@ -21,6 +21,7 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (298-328): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\nb4 = []\nb5 = []\n\nTransaction trace:\nC.constructor()\nC.abiEncodeSimple(false, 0, 0, 0, a, b) -// Warning 6328: (389-419): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\nb5 = []\n\nTransaction trace:\nC.constructor()\nC.abiEncodeSimple(false, 0, 0, 0, a, b) -// Warning 6328: (492-522): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\nb1 = []\nb2 = []\nb5 = []\n\nTransaction trace:\nC.constructor()\nC.abiEncodeSimple(false, 0, 0, 0, a, b) +// Warning 6328: (298-328): CHC: Assertion violation happens here. +// Warning 6328: (389-419): CHC: Assertion violation happens here. +// Warning 6328: (492-522): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_array_slice.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_array_slice.sol index c6f523b37d14..67c8b92e6203 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_array_slice.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_array_slice.sol @@ -29,4 +29,5 @@ contract C { // Warning 6328: (325-355): CHC: Assertion violation happens here. // Warning 6328: (578-608): CHC: Assertion violation happens here. // Warning 6328: (1079-1109): CHC: Assertion violation might happen here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 4661: (1079-1109): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_array_slice_2.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_array_slice_2.sol index 2c2b975611fc..69a3482b199d 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_array_slice_2.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_array_slice_2.sol @@ -29,4 +29,5 @@ contract C { // Warning 6328: (326-356): CHC: Assertion violation happens here. // Warning 6328: (579-609): CHC: Assertion violation happens here. // Warning 6328: (1080-1110): CHC: Assertion violation might happen here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 4661: (1080-1110): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_string_literal_2.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_string_literal_2.sol index 6fd25fee5cc3..6737700b5ba8 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_string_literal_2.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_selector_string_literal_2.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_array_slice.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_array_slice.sol index bbb5a58bddb9..fad7437448f3 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_array_slice.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_array_slice.sol @@ -29,4 +29,5 @@ contract C { // Warning 6328: (334-364): CHC: Assertion violation happens here. // Warning 6328: (588-618): CHC: Assertion violation happens here. // Warning 6328: (1086-1116): CHC: Assertion violation might happen here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 4661: (1086-1116): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_array_slice_2.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_array_slice_2.sol index 6451a932b5df..41e71ee5bf0e 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_array_slice_2.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_array_slice_2.sol @@ -29,4 +29,5 @@ contract C { // Warning 6328: (335-365): CHC: Assertion violation happens here. // Warning 6328: (589-619): CHC: Assertion violation happens here. // Warning 6328: (1087-1117): CHC: Assertion violation might happen here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 4661: (1087-1117): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_hash.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_hash.sol index 73575690d1c0..fbcaa1607cef 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_hash.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_hash.sol @@ -14,5 +14,6 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (337-375): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\nb = 0\nb1 = [0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d]\nb2 = [0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d]\n\nTransaction trace:\nC.constructor()\nC.abiEncodeHash(sig, 0, 0) -// Warning 6328: (394-432): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\nb = 0\n\nTransaction trace:\nC.constructor()\nC.abiEncodeHash(sig, 0, 0) +// Warning 6328: (337-375): CHC: Assertion violation happens here. +// Warning 6328: (394-432): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_simple.sol b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_simple.sol index b88a9697308c..bd0f8a331a44 100644 --- a/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_simple.sol +++ b/test/libsolidity/smtCheckerTests/abi/abi_encode_with_sig_simple.sol @@ -25,7 +25,8 @@ contract C { // SMTIgnoreOS: macos // ---- // Warning 5667: (107-122): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (543-573): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\nb5 = []\nb6 = []\n\nTransaction trace:\nC.constructor()\nC.abiEncodeSimple(sig, false, 0, 0, 0, a, b) -// Warning 6328: (664-694): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\nb6 = []\n\nTransaction trace:\nC.constructor()\nC.abiEncodeSimple(sig, false, 0, 0, 0, a, b) -// Warning 6328: (713-743): CHC: Assertion violation happens here.\nCounterexample:\n\nt = false\nx = 0\ny = 0\nz = 0\nb6 = []\n\nTransaction trace:\nC.constructor()\nC.abiEncodeSimple(sig, false, 0, 0, 0, a, b) +// Warning 6328: (543-573): CHC: Assertion violation happens here. +// Warning 6328: (664-694): CHC: Assertion violation happens here. +// Warning 6328: (713-743): CHC: Assertion violation happens here. // Warning 6328: (824-854): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/array_pop_length_7.sol b/test/libsolidity/smtCheckerTests/array_members/array_pop_length_7.sol index a655a5debe8e..5ba845e7497b 100644 --- a/test/libsolidity/smtCheckerTests/array_members/array_pop_length_7.sol +++ b/test/libsolidity/smtCheckerTests/array_members/array_pop_length_7.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/array_pop_length_8.sol b/test/libsolidity/smtCheckerTests/array_members/array_pop_length_8.sol index 6de94c8ecf3a..f3546acf1bce 100644 --- a/test/libsolidity/smtCheckerTests/array_members/array_pop_length_8.sol +++ b/test/libsolidity/smtCheckerTests/array_members/array_pop_length_8.sol @@ -13,4 +13,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 2529: (49-56): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.f() +// Warning 2529: (49-56): CHC: Empty array "pop" happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/array_push_string_literal.sol b/test/libsolidity/smtCheckerTests/array_members/array_push_string_literal.sol index 5ed512278b80..cbded7cad7df 100644 --- a/test/libsolidity/smtCheckerTests/array_members/array_push_string_literal.sol +++ b/test/libsolidity/smtCheckerTests/array_members/array_push_string_literal.sol @@ -15,5 +15,6 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (139-161): CHC: Assertion violation happens here.\nCounterexample:\ndata = [0x62]\n\nTransaction trace:\nC.constructor()\nState: data = []\nC.g() -// Warning 6328: (263-290): CHC: Assertion violation happens here.\nCounterexample:\ndata = [0x01]\n\nTransaction trace:\nC.constructor()\nState: data = []\nC.g() +// Warning 6328: (139-161): CHC: Assertion violation happens here. +// Warning 6328: (263-290): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_assignment_2d_memory_to_memory.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_assignment_2d_memory_to_memory.sol index 5eab212587d2..3d68cef67e66 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_assignment_2d_memory_to_memory.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_assignment_2d_memory_to_memory.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_assignment_2d_storage_to_storage.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_assignment_2d_storage_to_storage.sol index 294038399157..a20d20e0e503 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_assignment_2d_storage_to_storage.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_assignment_2d_storage_to_storage.sol @@ -18,4 +18,4 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Info 1180: Contract invariant(s) for :C:\n!(arr.length <= 0)\n!(arr2.length <= 0)\n(((arr.length + ((- 1) * arr2.length)) <= 0) && ((arr2.length + ((- 1) * arr.length)) <= 0))\n(((arr2[0].length + ((- 1) * arr[0].length)) >= 0) && ((arr2[0].length + ((- 1) * arr[0].length)) <= 0))\n +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_copy_2d_memory_to_storage.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_copy_2d_memory_to_storage.sol index 7d4656e8f9fb..cc5845733bee 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_copy_2d_memory_to_storage.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_copy_2d_memory_to_storage.sol @@ -12,3 +12,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_copy_2d_storage_to_memory.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_copy_2d_storage_to_memory.sol index 468f34257a94..8c952aa75b68 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_copy_2d_storage_to_memory.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_copy_2d_storage_to_memory.sol @@ -17,4 +17,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(arr.length <= 1)\n +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_1.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_1.sol index 48e0f73bf228..233c95560f72 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_1.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_1.sol @@ -7,4 +7,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(true && (map[1].length <= 0))\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_2.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_2.sol index b62a905d0928..245d4b8d4ece 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_2.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_2.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_2d_1.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_2d_1.sol index 7d253ac3064e..d6efabebfd32 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_2d_1.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_mapping_array_2d_1.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_struct_array_1.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_struct_array_1.sol index 833caa24f8d4..f12f2bd92d5e 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_struct_array_1.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_struct_array_1.sol @@ -11,4 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(((s1.arr.length + ((- 1) * s2.arr.length)) >= 0) && ((s1.arr.length + ((- 1) * s2.arr.length)) <= 0))\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_1d_struct_array_2d_1.sol b/test/libsolidity/smtCheckerTests/array_members/length_1d_struct_array_2d_1.sol index ddda215df8d0..ab3bf9a7c573 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_1d_struct_array_2d_1.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_1d_struct_array_2d_1.sol @@ -22,4 +22,4 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Info 1180: Contract invariant(s) for :C:\n!(s1.arr.length <= 0)\n!(s2.arr.length <= 0)\n(((s2.arr[0].length + ((- 1) * s1.arr[0].length)) <= 0) && ((s1.arr[0].length + ((- 1) * s2.arr[0].length)) <= 0))\n +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_assignment_2d_memory_to_memory.sol b/test/libsolidity/smtCheckerTests/array_members/length_assignment_2d_memory_to_memory.sol index 7a81d6f15c8a..9a6a00b8fd2a 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_assignment_2d_memory_to_memory.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_assignment_2d_memory_to_memory.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_assignment_memory_to_memory.sol b/test/libsolidity/smtCheckerTests/array_members/length_assignment_memory_to_memory.sol index 6bbab32b7b61..72aca44e0b29 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_assignment_memory_to_memory.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_assignment_memory_to_memory.sol @@ -7,3 +7,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_assignment_storage_to_storage.sol b/test/libsolidity/smtCheckerTests/array_members/length_assignment_storage_to_storage.sol index 58a48bd7fd0a..f198c962645d 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_assignment_storage_to_storage.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_assignment_storage_to_storage.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_basic.sol b/test/libsolidity/smtCheckerTests/array_members/length_basic.sol index 205c7746d59e..981311a8b7d3 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_basic.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_basic.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (120-143): CHC: Assertion violation happens here.\nCounterexample:\narr = []\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nState: arr = []\nC.f() +// Warning 6328: (120-143): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_copy_memory_to_storage.sol b/test/libsolidity/smtCheckerTests/array_members/length_copy_memory_to_storage.sol index 4e4295a0b507..07b0bbb467eb 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_copy_memory_to_storage.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_copy_memory_to_storage.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_copy_storage_to_memory.sol b/test/libsolidity/smtCheckerTests/array_members/length_copy_storage_to_memory.sol index 580465f4df3f..a750ba59ad42 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_copy_storage_to_memory.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_copy_storage_to_memory.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_function_call.sol b/test/libsolidity/smtCheckerTests/array_members/length_function_call.sol index c96d53047c69..4b30e2a6a808 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_function_call.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_function_call.sol @@ -9,4 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(arr.length <= 0)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment.sol b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment.sol index 4f1cf701b4bc..aa1a06132fb4 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment.sol @@ -15,4 +15,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(arr.length <= 2)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_2.sol b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_2.sol index 66dad84128c3..783ad207ec54 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_2.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_2.sol @@ -23,4 +23,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(arr.length <= 2)\n!(arr.length <= 3)\n!(arr[2].length <= 3)\n +// Info 1391: CHC: 13 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_2_fail.sol b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_2_fail.sol index 0023906fefc4..40effc4cb9ef 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_2_fail.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_2_fail.sol @@ -27,4 +27,4 @@ contract C { // Warning 6328: (291-317): CHC: Assertion violation happens here. // Warning 6328: (321-347): CHC: Assertion violation happens here. // Warning 6328: (351-374): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n!(arr.length <= 2)\n!(arr.length <= 3)\n!(arr[2].length <= 3)\n +// Info 1391: CHC: 10 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_3.sol b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_3.sol index caafcbd397e8..8ba2cd75de80 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_3.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_3.sol @@ -28,4 +28,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(arr.length <= 7)\n!(arr.length <= 8)\n((arr[5].length <= 0) && (arr[8].length <= 0))\n +// Info 1391: CHC: 12 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_3_fail.sol b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_3_fail.sol index 7a7db383b267..d346692db7df 100644 --- a/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_3_fail.sol +++ b/test/libsolidity/smtCheckerTests/array_members/length_same_after_assignment_3_fail.sol @@ -27,8 +27,8 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (319-345): CHC: Assertion violation happens here.\nCounterexample:\narr = [[], [], [], [], [], [], [], [], []]\nx = 0\ny = 0\nz = 9\nt = 0\n\nTransaction trace:\nC.constructor()\nState: arr = [[], [], [], [], [], [], [], [], []]\nC.f() -// Warning 6328: (349-375): CHC: Assertion violation happens here.\nCounterexample:\narr = [[], [], [], [], [], [], [], [], []]\nx = 0\ny = 0\nz = 9\nt = 0\n\nTransaction trace:\nC.constructor()\nState: arr = [[], [], [], [], [], [], [], [], []]\nC.f() -// Warning 6328: (379-402): CHC: Assertion violation happens here.\nCounterexample:\narr = [[], [], [], [], [], [], [], [], []]\nx = 0\ny = 0\nz = 9\nt = 0\n\nTransaction trace:\nC.constructor()\nState: arr = [[], [], [], [], [], [], [], [], []]\nC.f() -// Warning 6328: (406-432): CHC: Assertion violation happens here.\nCounterexample:\narr = [[], [], [], [], [], [], [], [], []]\nx = 0\ny = 0\nz = 9\nt = 0\n\nTransaction trace:\nC.constructor()\nState: arr = [[], [], [], [], [], [], [], [], []]\nC.f() -// Info 1180: Contract invariant(s) for :C:\n!(arr.length <= 7)\n!(arr.length <= 8)\n +// Warning 6328: (319-345): CHC: Assertion violation happens here. +// Warning 6328: (349-375): CHC: Assertion violation happens here. +// Warning 6328: (379-402): CHC: Assertion violation happens here. +// Warning 6328: (406-432): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/pop_1_safe.sol b/test/libsolidity/smtCheckerTests/array_members/pop_1_safe.sol index a655a5debe8e..5ba845e7497b 100644 --- a/test/libsolidity/smtCheckerTests/array_members/pop_1_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/pop_1_safe.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/pop_2d_safe.sol b/test/libsolidity/smtCheckerTests/array_members/pop_2d_safe.sol index f95eae7f3f6d..e915d4df4fa9 100644 --- a/test/libsolidity/smtCheckerTests/array_members/pop_2d_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/pop_2d_safe.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/pop_2d_unsafe.sol b/test/libsolidity/smtCheckerTests/array_members/pop_2d_unsafe.sol index f74381ce9c64..ea9f6a251bcd 100644 --- a/test/libsolidity/smtCheckerTests/array_members/pop_2d_unsafe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/pop_2d_unsafe.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 2529: (90-100): CHC: Empty array "pop" happens here.\nCounterexample:\na = [[0], []]\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.f() +// Warning 2529: (90-100): CHC: Empty array "pop" happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/pop_constructor_safe.sol b/test/libsolidity/smtCheckerTests/array_members/pop_constructor_safe.sol index 4ee5e0b97276..06be68f9bc64 100644 --- a/test/libsolidity/smtCheckerTests/array_members/pop_constructor_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/pop_constructor_safe.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/pop_loop_safe.sol b/test/libsolidity/smtCheckerTests/array_members/pop_loop_safe.sol index 2bf382e5d93d..5bd322cd598e 100644 --- a/test/libsolidity/smtCheckerTests/array_members/pop_loop_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/pop_loop_safe.sol @@ -10,3 +10,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/pop_loop_unsafe.sol b/test/libsolidity/smtCheckerTests/array_members/pop_loop_unsafe.sol index 0b0ba37e3c2b..0bb7b4f16e19 100644 --- a/test/libsolidity/smtCheckerTests/array_members/pop_loop_unsafe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/pop_loop_unsafe.sol @@ -11,4 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 2529: (117-124): CHC: Empty array "pop" happens here.\nCounterexample:\na = []\nl = 0\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.f(0) +// Warning 2529: (117-124): CHC: Empty array "pop" happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_2d_arg_1_safe.sol b/test/libsolidity/smtCheckerTests/array_members/push_2d_arg_1_safe.sol index 403a759982a3..665fb13c8f41 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_2d_arg_1_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_2d_arg_1_safe.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_2d_arg_1_unsafe.sol b/test/libsolidity/smtCheckerTests/array_members/push_2d_arg_1_unsafe.sol index 235c585bd47f..c60e983c2e14 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_2d_arg_1_unsafe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_2d_arg_1_unsafe.sol @@ -13,3 +13,4 @@ contract C { // ---- // Warning 3944: (129-144): CHC: Underflow (resulting value less than 0) happens here. // Warning 6328: (117-151): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_arg_1.sol b/test/libsolidity/smtCheckerTests/array_members/push_arg_1.sol index d1a61b04fb12..002d9246fc99 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_arg_1.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_arg_1.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_1d.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_1d.sol index 0d16306b72bf..42dd2e4947cf 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_1d.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_1d.sol @@ -17,6 +17,8 @@ contract C { } // ==== // SMTEngine: all +// SMTIgnoreCex: yes // SMTIgnoreOS: macos // ---- -// Warning 6328: (199-229): CHC: Assertion violation happens here.\nCounterexample:\nb = [1]\n\nTransaction trace:\nC.constructor()\nState: b = []\nC.g() +// Warning 6328: (199-229): CHC: Assertion violation happens here. +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_2d.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_2d.sol index bbd5589a48ba..71997ecdd357 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_2d.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_2d.sol @@ -20,5 +20,7 @@ contract C { } // ==== // SMTEngine: all +// SMTIgnoreCex: yes // ---- // Warning 6328: (362-420): CHC: Assertion violation happens here. +// Info 1391: CHC: 23 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_2d_2.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_2d_2.sol index 4afa7df1d1b3..180e70cbe7e3 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_2d_2.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_2d_2.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_3d.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_3d.sol index dcb8c3aac4f0..380dd892d3fb 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_3d.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_3d.sol @@ -28,3 +28,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (537-592): CHC: Assertion violation happens here. +// Info 1391: CHC: 32 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_1d.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_1d.sol index 66776ed49f40..d52b657d52f0 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_1d.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_1d.sol @@ -15,3 +15,4 @@ contract C { // SMTIgnoreOS: macos // ---- // Warning 6328: (204-230): CHC: Assertion violation happens here. +// Info 1391: CHC: 11 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_2d_1.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_2d_1.sol index b79bc3e3b808..efc775ed7962 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_2d_1.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_2d_1.sol @@ -16,4 +16,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (284-310): CHC: Assertion violation happens here.\nCounterexample:\nb = [[0], [0]]\n\nTransaction trace:\nC.constructor()\nState: b = []\nC.f() +// Warning 6328: (284-310): CHC: Assertion violation happens here. +// Info 1391: CHC: 20 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_2d_2.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_2d_2.sol index ae1251aac164..ccfc54401522 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_2d_2.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_2d_2.sol @@ -14,3 +14,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 12 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_bytes.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_bytes.sol index 56bc859eb1d7..b29bdde3f4fb 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_bytes.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_and_rhs_bytes.sol @@ -15,3 +15,4 @@ contract C { // SMTIgnoreOS: macos // ---- // Warning 6328: (203-244): CHC: Assertion violation happens here. +// Info 1391: CHC: 11 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes.sol index 31eca9e92532..ce8fa06572ce 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes.sol @@ -21,3 +21,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (265-310): CHC: Assertion violation happens here. +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes_2d.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes_2d.sol index fcceeebfd50e..4dc7a7c3d10e 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes_2d.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_bytes_2d.sol @@ -25,3 +25,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (435-508): CHC: Assertion violation happens here. +// Info 1391: CHC: 23 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_compound_assignment.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_compound_assignment.sol index f13c4f452a29..4d20c8ae9b68 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_compound_assignment.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_compound_assignment.sol @@ -12,4 +12,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (128-145): CHC: Assertion violation happens here.\nCounterexample:\nu = [(- 1)]\n\nTransaction trace:\nC.constructor()\nState: u = []\nC.t() +// Warning 6328: (128-145): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_struct.sol b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_struct.sol index 3ea238014558..a92b69f7b1aa 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_struct.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_as_lhs_struct.sol @@ -15,3 +15,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_overflow_1_safe.sol b/test/libsolidity/smtCheckerTests/array_members/push_overflow_1_safe.sol index 930736ce8dd7..0d92364200d2 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_overflow_1_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_overflow_1_safe.sol @@ -10,3 +10,4 @@ contract C { // SMTEngine: all // SMTIgnoreInv: yes // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_overflow_1_safe_no_overflow_assumption.sol b/test/libsolidity/smtCheckerTests/array_members/push_overflow_1_safe_no_overflow_assumption.sol index 9cc3f2e375ee..66cd21111ab6 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_overflow_1_safe_no_overflow_assumption.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_overflow_1_safe_no_overflow_assumption.sol @@ -9,4 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(!((x[x.length] := 23)[0] >= 43) && !((x[x.length] := 23)[0] <= 41))\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_overflow_2_safe.sol b/test/libsolidity/smtCheckerTests/array_members/push_overflow_2_safe.sol index c15d5da15987..5c0466ace414 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_overflow_2_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_overflow_2_safe.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_overflow_2_safe_no_overflow_assumption.sol b/test/libsolidity/smtCheckerTests/array_members/push_overflow_2_safe_no_overflow_assumption.sol index 046cf59a133e..cbd65e041701 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_overflow_2_safe_no_overflow_assumption.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_overflow_2_safe_no_overflow_assumption.sol @@ -13,3 +13,4 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_1.sol b/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_1.sol index 02cdbe68a4b5..5d3f01fe3032 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_1.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_1.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_1_fail.sol b/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_1_fail.sol index 9e998a1f0041..2d54d3ae1de4 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_1_fail.sol @@ -9,5 +9,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (81-107): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[0]]\n\nTransaction trace:\nC.constructor()\nState: array2d = []\nC.l() -// Warning 6328: (111-157): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[0]]\n\nTransaction trace:\nC.constructor()\nState: array2d = []\nC.l() +// Warning 6328: (81-107): CHC: Assertion violation happens here. +// Warning 6328: (111-157): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_2.sol b/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_2.sol index 37c416b220c8..f78f917e48ce 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_2.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_2.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_2_fail.sol b/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_2_fail.sol index 42313dee9358..5ff371cd70e7 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_2_fail.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_push_no_args_2_fail.sol @@ -12,6 +12,7 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (90-116): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[[0]]]\nlast = 0\n\nTransaction trace:\nC.constructor()\nState: array2d = []\nC.l() -// Warning 6328: (170-186): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[[0]]]\nlast = 1\n\nTransaction trace:\nC.constructor()\nState: array2d = []\nC.l() -// Warning 6328: (190-246): CHC: Assertion violation happens here.\nCounterexample:\narray2d = [[[0]]]\nlast = 1\n\nTransaction trace:\nC.constructor()\nState: array2d = []\nC.l() +// Warning 6328: (90-116): CHC: Assertion violation happens here. +// Warning 6328: (170-186): CHC: Assertion violation happens here. +// Warning 6328: (190-246): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_safe_aliasing.sol b/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_safe_aliasing.sol index 7a120f4284af..e43d83c61fa1 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_safe_aliasing.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_safe_aliasing.sol @@ -17,3 +17,4 @@ contract C { // Warning 6368: (184-188): CHC: Out of bounds access happens here. // Warning 3944: (184-199): CHC: Underflow (resulting value less than 0) happens here. // Warning 6328: (172-206): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_unsafe_aliasing.sol b/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_unsafe_aliasing.sol index a8669fb6016f..502274fb2a1e 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_unsafe_aliasing.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_unsafe_aliasing.sol @@ -12,9 +12,10 @@ contract C { } // ==== // SMTEngine: all -// SMTIgnoreOS: macos // SMTIgnoreCex: yes +// SMTIgnoreOS: macos // ---- // Warning 6368: (188-192): CHC: Out of bounds access happens here. // Warning 6368: (188-195): CHC: Out of bounds access happens here. // Warning 6328: (181-202): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_unsafe_length.sol b/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_unsafe_length.sol index 4ddb195a1ebd..ebabc9706f42 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_unsafe_length.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_storage_ref_unsafe_length.sol @@ -28,8 +28,8 @@ contract C { // SMTIgnoreOS: macos // ---- // Warning 6368: (238-242): CHC: Out of bounds access happens here. -// Warning 6368: (238-245): CHC: Out of bounds access might happen here. -// Warning 6368: (238-248): CHC: Out of bounds access might happen here. +// Warning 6368: (238-245): CHC: Out of bounds access happens here. +// Warning 6368: (238-248): CHC: Out of bounds access happens here. // Warning 6368: (311-315): CHC: Out of bounds access happens here. // Warning 6368: (343-347): CHC: Out of bounds access happens here. // Warning 6328: (336-360): CHC: Assertion violation happens here. @@ -37,3 +37,4 @@ contract C { // Warning 6368: (513-520): CHC: Out of bounds access happens here. // Warning 6368: (513-523): CHC: Out of bounds access happens here. // Warning 6328: (506-530): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_struct_member_2.sol b/test/libsolidity/smtCheckerTests/array_members/push_struct_member_2.sol index f763dd55c701..091ec74af698 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_struct_member_2.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_struct_member_2.sol @@ -17,3 +17,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_zero_2d_safe.sol b/test/libsolidity/smtCheckerTests/array_members/push_zero_2d_safe.sol index 0f3aca5a0e6b..73fb53865482 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_zero_2d_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_zero_2d_safe.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_zero_2d_unsafe.sol b/test/libsolidity/smtCheckerTests/array_members/push_zero_2d_unsafe.sol index ec33dc041939..dde8a83705b3 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_zero_2d_unsafe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_zero_2d_unsafe.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (89-122): CHC: Assertion violation happens here.\nCounterexample:\na = [[0]]\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.f() +// Warning 6328: (89-122): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_zero_safe.sol b/test/libsolidity/smtCheckerTests/array_members/push_zero_safe.sol index f2a860572916..3c33fbda6756 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_zero_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_zero_safe.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/push_zero_unsafe.sol b/test/libsolidity/smtCheckerTests/array_members/push_zero_unsafe.sol index 6647e8d41d5e..aab7b5b78cfb 100644 --- a/test/libsolidity/smtCheckerTests/array_members/push_zero_unsafe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/push_zero_unsafe.sol @@ -8,4 +8,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (61-91): CHC: Assertion violation happens here.\nCounterexample:\na = [0]\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.f() +// Warning 6328: (61-91): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1.sol b/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1.sol index bbbc3a68fbc4..cbe2d6593d5c 100644 --- a/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1.sol +++ b/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1.sol @@ -19,3 +19,4 @@ contract C { // ---- // Warning 6368: (159-169): CHC: Out of bounds access happens here. // Warning 6328: (152-181): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1_safe.sol b/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1_safe.sol index 01868e7e5d42..74906c3d95d6 100644 --- a/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1_safe.sol +++ b/test/libsolidity/smtCheckerTests/array_members/storage_pointer_push_1_safe.sol @@ -15,3 +15,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_non_zero_2.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_non_zero_2.sol index f88eab0bf4f8..e5c913c6a818 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_non_zero_2.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_non_zero_2.sol @@ -10,5 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (153-188): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor(){ msg.value: 101 }\nC.f() -// Info 1180: Contract invariant(s) for :C:\n!((:var 0).balances[address(this)] <= 100)\n +// Warning 6328: (153-188): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive.sol index fc4719cefd20..796144733244 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive.sol @@ -16,4 +16,4 @@ contract C { // ---- // Warning 6328: (132-188): CHC: Assertion violation happens here. // Warning 6328: (269-324): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n((prevBalance + ((- 1) * (:var 1).balances[address(this)])) <= 0)\n +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_2.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_2.sol index b611bc95f17b..f1c423bc8718 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_2.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_2.sol @@ -18,4 +18,4 @@ contract C { // ---- // Warning 4984: (266-272): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (235-273): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\nonce\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_4.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_4.sol index cd6e1ef9baed..dfa571c33822 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_4.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_4.sol @@ -18,6 +18,7 @@ contract C { // Warning 4984: (154-160): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. // Warning 4984: (212-218): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. // Warning 6328: (180-219): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 2661: (82-85): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 2661: (154-160): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 2661: (212-218): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_5.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_5.sol index 1885a60c81b8..26009b3b8f8e 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_5.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_5.sol @@ -11,5 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (122-158): CHC: Assertion violation happens here.\nCounterexample:\nsum = 0\n\nTransaction trace:\nC.constructor()\nState: sum = 0\nC.inv() -// Info 1180: Contract invariant(s) for :C:\n((sum + ((- 1) * (:var 1).balances[address(this)])) <= 0)\n +// Warning 6328: (122-158): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_calls.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_calls.sol index 263a90b08d65..7379b1999931 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_calls.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_calls.sol @@ -22,7 +22,7 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (173-208): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ msg.value: 10 } -// Warning 6328: (321-356): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ msg.value: 10 }\n C.g() -- internal call -// Warning 6328: (469-504): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ msg.value: 10 }\n C.g() -- internal call\n C.h() -- internal call -// Info 1180: Contract invariant(s) for :C:\n((:var 1).balances[address(this)] >= 0)\nonce\n +// Warning 6328: (173-208): CHC: Assertion violation happens here. +// Warning 6328: (321-356): CHC: Assertion violation happens here. +// Warning 6328: (469-504): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls.sol index 43b620ffc08f..7f22d1d0efb3 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls.sol @@ -14,4 +14,5 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (131-165): CHC: Assertion violation happens here.\nCounterexample:\n\n_i = 0\nx = 282\n\nTransaction trace:\nC.constructor()\nC.f(0)\n _i.ext() -- untrusted external call, synthesized as:\n C.f(0) -- reentrant call\n _i.ext() -- untrusted external call +// Warning 6328: (131-165): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls_2.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls_2.sol index a1eb278bc707..0a3066888f50 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls_2.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls_2.sol @@ -13,3 +13,4 @@ contract C { // ---- // Warning 9302: (82-93): Return value of low-level calls not used. // Warning 6328: (97-131): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls_mutex.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls_mutex.sol index 76443dfd055b..b74f34c3bec5 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls_mutex.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_ext_calls_mutex.sol @@ -22,4 +22,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (277-310): CHC: Assertion violation happens here. -// Info 1180: Reentrancy property(ies) for :C:\n((lock' || !lock) && !( = 1) && (!lock || (((:var 3).balances[address(this)] + ((- 1) * (:var 1).balances[address(this)])) >= 0)) && (!lock || (((:var 3).balances[address(this)] + ((- 1) * (:var 1).balances[address(this)])) <= 0)))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(address(this).balance == x)\n = 2 -> Assertion failed at assert(address(this).balance < x)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/balance_spend.sol b/test/libsolidity/smtCheckerTests/blockchain_state/balance_spend.sol index bd30b77d1ff6..387e45bb9f46 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/balance_spend.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/balance_spend.sol @@ -19,5 +19,5 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (280-314): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n((!(c <= 1) || !((:var 1).balances[address(this)] <= 90)) && !((:var 1).balances[address(this)] <= 81) && (!(c <= 0) || !((:var 1).balances[address(this)] <= 100)))\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 1236: (175-190): BMC: Insufficient funds happens here. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/decreasing_balance.sol b/test/libsolidity/smtCheckerTests/blockchain_state/decreasing_balance.sol index 7bbbf9ddbc04..76455060d8d5 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/decreasing_balance.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/decreasing_balance.sol @@ -18,3 +18,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/free_function_1.sol b/test/libsolidity/smtCheckerTests/blockchain_state/free_function_1.sol index 260d3c942bd3..e7e7d924206b 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/free_function_1.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/free_function_1.sol @@ -14,4 +14,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/free_function_2.sol b/test/libsolidity/smtCheckerTests/blockchain_state/free_function_2.sol index 50081bc5aa61..e2e187038ca1 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/free_function_2.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/free_function_2.sol @@ -20,5 +20,5 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (258-274): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 1236: (33-46): BMC: Insufficient funds happens here. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/library_internal_1.sol b/test/libsolidity/smtCheckerTests/blockchain_state/library_internal_1.sol index 9df3aa27a011..4314db11b091 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/library_internal_1.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/library_internal_1.sol @@ -17,4 +17,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/library_internal_2.sol b/test/libsolidity/smtCheckerTests/blockchain_state/library_internal_2.sol index f32652da971e..f16a57acf68f 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/library_internal_2.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/library_internal_2.sol @@ -23,5 +23,5 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (315-331): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 1236: (87-100): BMC: Insufficient funds happens here. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change.sol b/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change.sol index 0b66b2791934..a51f73ddd73d 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change.sol @@ -11,4 +11,4 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Info 1180: Contract invariant(s) for :C:\n(((address(this) + ((- 1) * t)) <= 0) && ((address(this) + ((- 1) * t)) >= 0))\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change_external_call.sol b/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change_external_call.sol index 49d2eb33b418..2c9e58e7b39d 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change_external_call.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change_external_call.sol @@ -16,5 +16,7 @@ contract C { } // ==== // SMTEngine: all -// SMTIgnoreOS: macos // SMTIgnoreInv: yes +// SMTIgnoreOS: macos +// ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change_internal_call.sol b/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change_internal_call.sol index 0ffe4346934d..1b1adc9d7546 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change_internal_call.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/this_does_not_change_internal_call.sol @@ -14,4 +14,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(((t + ((- 1) * address(this))) >= 0) && ((t + ((- 1) * address(this))) <= 0))\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/blockchain_state/transfer.sol b/test/libsolidity/smtCheckerTests/blockchain_state/transfer.sol index 4192d8aba927..c099ffb2e5c9 100644 --- a/test/libsolidity/smtCheckerTests/blockchain_state/transfer.sol +++ b/test/libsolidity/smtCheckerTests/blockchain_state/transfer.sol @@ -12,3 +12,5 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (166-201): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/assert_in_constructor.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/assert_in_constructor.sol index f6f2f3a5b2f5..65f079649edb 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/assert_in_constructor.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/assert_in_constructor.sol @@ -17,3 +17,4 @@ contract D is C { // ==== // SMTEngine: bmc // ---- +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/branches_in_modifiers.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/branches_in_modifiers.sol index 297d732ee5e4..422f57c09e05 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/branches_in_modifiers.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/branches_in_modifiers.sol @@ -24,3 +24,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 4661: (70-84): BMC: Assertion violation happens here. +// Info 6002: BMC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/branches_in_modifiers_2.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/branches_in_modifiers_2.sol index f37f0568425b..2b845fbc3810 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/branches_in_modifiers_2.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/branches_in_modifiers_2.sol @@ -41,3 +41,4 @@ contract C { // Warning 4661: (351-365): BMC: Assertion violation happens here. // Warning 4661: (602-619): BMC: Assertion violation happens here. // Warning 4661: (748-762): BMC: Assertion violation happens here. +// Info 6002: BMC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init.sol index eb2f58105422..c262e2481be5 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init.sol @@ -39,3 +39,4 @@ contract C is B { // Warning 4661: (389-412): BMC: Assertion violation happens here. // Warning 4661: (489-513): BMC: Assertion violation happens here. // Warning 4661: (533-546): BMC: Assertion violation happens here. +// Info 6002: BMC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init_chain_alternate.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init_chain_alternate.sol index 6364eb1670a7..63e49db4cefa 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init_chain_alternate.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init_chain_alternate.sol @@ -26,3 +26,4 @@ contract D is C { // SMTEngine: bmc // ---- // Warning 4661: (286-300): BMC: Assertion violation happens here. +// Info 6002: BMC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init_diamond.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init_diamond.sol index b72555b69357..4a7794ac9b26 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init_diamond.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructor_state_variable_init_diamond.sol @@ -68,3 +68,4 @@ contract D4 is B, C { // Warning 4661: (736-751): BMC: Assertion violation happens here. // Warning 4661: (827-841): BMC: Assertion violation happens here. // Warning 4661: (860-874): BMC: Assertion violation happens here. +// Info 6002: BMC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructors.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructors.sol index afc48b4feeb7..3d06983fece4 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructors.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/constructors.sol @@ -29,3 +29,4 @@ contract C is B { // Warning 4661: (277-291): BMC: Assertion violation happens here. // Warning 4661: (310-324): BMC: Assertion violation happens here. // Warning 4661: (343-357): BMC: Assertion violation happens here. +// Info 6002: BMC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/nested_if.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/nested_if.sol index 378c9dc92d5e..f496f3989886 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/nested_if.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/nested_if.sol @@ -24,3 +24,4 @@ contract C { // ---- // Warning 4661: (114-141): BMC: Assertion violation happens here. // Warning 6838: (299-315): BMC: Condition is always false. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/return_in_both_branches.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/return_in_both_branches.sol index 992d0ee1de60..60abfb09cd2f 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/return_in_both_branches.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/return_in_both_branches.sol @@ -19,3 +19,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 5740: (232-240): Unreachable code. +// Info 6002: BMC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if.sol index aed7b0bb3f4b..3c9ff6097af7 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: bmc // ---- +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_array.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_array.sol index 76e416905975..a5f9f3a5c2af 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_array.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_array.sol @@ -26,3 +26,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 4661: (172-189): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_state_var.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_state_var.sol index 20dd68eaa271..db4abe9c74a4 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_state_var.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_state_var.sol @@ -20,3 +20,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 4661: (99-113): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_struct.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_struct.sol index 3976333cdfa3..9f987ceaead3 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_struct.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_struct.sol @@ -23,3 +23,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 4661: (123-139): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_struct_2.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_struct_2.sol index aad44b7ea894..d001ed3d5b76 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_struct_2.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_struct_2.sol @@ -23,3 +23,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 4661: (123-139): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_tuple.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_tuple.sol index 5c5bb12973a3..589931f68d67 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_tuple.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/simple_if_tuple.sol @@ -25,3 +25,4 @@ contract C { // ---- // Warning 4661: (127-141): BMC: Assertion violation happens here. // Warning 4661: (161-175): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/triple_nested_if.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/triple_nested_if.sol index d3d7cb50c6fd..7c25f5b82ae4 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/triple_nested_if.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/branches_with_return/triple_nested_if.sol @@ -18,3 +18,4 @@ contract C { // ==== // SMTEngine: bmc // ---- +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/implicit_constructor_with_function_calls.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/implicit_constructor_with_function_calls.sol index 56c7eca756d3..a3e974489ded 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/implicit_constructor_with_function_calls.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/implicit_constructor_with_function_calls.sol @@ -15,3 +15,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 4661: (172-187): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/msg_value_4.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/msg_value_4.sol index 8ac34fad573a..bb89407a4cfc 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/msg_value_4.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/msg_value_4.sol @@ -14,3 +14,4 @@ contract B { // SMTEngine: bmc // ---- // Warning 4661: (154-176): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/range_check.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/range_check.sol index cfedc8fd6974..a11373322507 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/range_check.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/range_check.sol @@ -62,3 +62,4 @@ contract D { // Warning 8417: (598-614): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 8417: (1447-1463): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 8417: (1481-1497): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. +// Info 6002: BMC: 44 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/staticcall_balance.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/staticcall_balance.sol index 167cea38c009..cfbdebfdd84d 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/staticcall_balance.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/staticcall_balance.sol @@ -10,3 +10,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 9302: (88-105): Return value of low-level calls not used. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/staticcall_state_var.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/staticcall_state_var.sol index 50f959997699..ad50613c2747 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/staticcall_state_var.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/staticcall_state_var.sol @@ -10,3 +10,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 9302: (66-83): Return value of low-level calls not used. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/timestamp.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/timestamp.sol index 6b24cc593a11..93064ff621ca 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/timestamp.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/timestamp.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: bmc // ---- +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/try_multiple_catch_clauses_2.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/try_multiple_catch_clauses_2.sol index ce81f2666a57..279d22b4c7ca 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/try_multiple_catch_clauses_2.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/try_multiple_catch_clauses_2.sol @@ -21,3 +21,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 4661: (306-320): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/bmc_coverage/try_multiple_returned_values_with_tuple.sol b/test/libsolidity/smtCheckerTests/bmc_coverage/try_multiple_returned_values_with_tuple.sol index f79d82c1249f..75458fada26b 100644 --- a/test/libsolidity/smtCheckerTests/bmc_coverage/try_multiple_returned_values_with_tuple.sol +++ b/test/libsolidity/smtCheckerTests/bmc_coverage/try_multiple_returned_values_with_tuple.sol @@ -25,3 +25,4 @@ contract C { // SMTEngine: bmc // ---- // Warning 4661: (336-351): BMC: Assertion violation happens here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/complex/slither/external_function.sol b/test/libsolidity/smtCheckerTests/complex/slither/external_function.sol index 3f5096a3b56c..936ad1703784 100644 --- a/test/libsolidity/smtCheckerTests/complex/slither/external_function.sol +++ b/test/libsolidity/smtCheckerTests/complex/slither/external_function.sol @@ -83,6 +83,6 @@ contract InternalCall { // Warning 2018: (1111-1173): Function state mutability can be restricted to pure // Warning 2018: (1179-1241): Function state mutability can be restricted to pure // Warning 2018: (1247-1309): Function state mutability can be restricted to pure -// Warning 4588: (681-716): Assertion checker does not yet implement this type of function call. -// Warning 4588: (854-886): Assertion checker does not yet implement this type of function call. +// Warning 8729: (681-716): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. +// Warning 8729: (854-886): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. // Warning 5729: (1370-1375): BMC does not yet implement this type of function call. diff --git a/test/libsolidity/smtCheckerTests/control_flow/assignment_in_declaration.sol b/test/libsolidity/smtCheckerTests/control_flow/assignment_in_declaration.sol index ab36162f61ff..3f9e379a522e 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/assignment_in_declaration.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/assignment_in_declaration.sol @@ -4,3 +4,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_1.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_1.sol index 724e7e3d446f..229a93ddc2aa 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_1.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_1.sol @@ -12,3 +12,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_2.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_2.sol index 4ccfedf0d7fe..299da87e8744 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_2.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_assert_condition_2.sol @@ -16,3 +16,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_1.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_1.sol index 21f1f5c7f268..b70b2024a07e 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_1.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_1.sol @@ -22,5 +22,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (327-341): CHC: Assertion violation happens here.\nCounterexample:\nx = 7\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g()\n C.f() -- internal call -// Info 1180: Contract invariant(s) for :C:\n((x = 0) || (x = 7))\n +// Warning 6328: (327-341): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_2.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_2.sol index aa79a71fafdc..974c32506b51 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_2.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_2.sol @@ -24,3 +24,4 @@ contract C { // SMTIgnoreOS: macos // ---- // Warning 6328: (333-347): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_3.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_3.sol index ace158bb9fc0..6889f36d6de8 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_3.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_3.sol @@ -22,5 +22,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (326-340): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g()\n C.f() -- internal call -// Info 1180: Contract invariant(s) for :C:\n((x = 0) || (x = 3))\n +// Warning 6328: (326-340): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_4.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_4.sol index 44910fa62c7a..135f18b29016 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_4.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_4.sol @@ -24,4 +24,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (333-347): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n((x = 0) || (x = 7))\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_1.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_1.sol index 78ecc2cd1182..a76f41104460 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_1.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_1.sol @@ -10,3 +10,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_2.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_2.sol index 8a24bd978ee3..36618ec5c286 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_2.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_2.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_3.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_3.sol index 94abb286ddb7..deda2c85146a 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_3.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_3.sol @@ -12,3 +12,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_4.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_4.sol index fb1323f173cb..95589bfebaf9 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_4.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_4.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_5.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_5.sol index 41b511cc33a1..82665aec92a4 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_5.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_5.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_6.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_6.sol index 337d0789c564..c388054ca700 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_6.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_merge_variables_6.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/branches_in_modifiers.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/branches_in_modifiers.sol index 32d647762de0..42315c89f5cc 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/branches_in_modifiers.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/branches_in_modifiers.sol @@ -23,5 +23,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (70-84): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.test() -// Info 1180: Contract invariant(s) for :C:\n(x = 0)\n +// Warning 6328: (70-84): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/branches_in_modifiers_2.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/branches_in_modifiers_2.sol index f08a26bf7046..d297959c86b7 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/branches_in_modifiers_2.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/branches_in_modifiers_2.sol @@ -44,6 +44,7 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (255-269): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.test()\n C.reset_if_overflow() -- internal call -// Warning 6328: (502-519): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\noldx = 1\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.set(1)\nState: x = 1\nC.test()\n C.reset_if_overflow() -- internal call -// Warning 6328: (615-629): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.set(10)\nState: x = 10\nC.test()\n C.reset_if_overflow() -- internal call +// Warning 6328: (255-269): CHC: Assertion violation happens here. +// Warning 6328: (502-519): CHC: Assertion violation happens here. +// Warning 6328: (615-629): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init.sol index 3f660be66ad1..d33f9571b0c8 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init.sol @@ -35,7 +35,8 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (297-311): CHC: Assertion violation happens here.\nCounterexample:\ny = 2, x = (- 1)\na = 1\n\nTransaction trace:\nC.constructor(1) -// Warning 6328: (389-412): CHC: Assertion violation happens here.\nCounterexample:\ny = 2, x = (- 1)\na = 1\n\nTransaction trace:\nC.constructor(1) -// Warning 6328: (489-513): CHC: Assertion violation happens here.\nCounterexample:\ny = 4, x = 0\na = 0\n\nTransaction trace:\nC.constructor(0) -// Warning 6328: (533-546): CHC: Assertion violation happens here.\nCounterexample:\ny = 4, x = 0\na = 0\n\nTransaction trace:\nC.constructor(0) +// Warning 6328: (297-311): CHC: Assertion violation happens here. +// Warning 6328: (389-412): CHC: Assertion violation happens here. +// Warning 6328: (489-513): CHC: Assertion violation happens here. +// Warning 6328: (533-546): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init_chain_alternate.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init_chain_alternate.sol index 805a75bbb058..22148e0b3237 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init_chain_alternate.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init_chain_alternate.sol @@ -27,3 +27,4 @@ contract D is C { // SMTIgnoreCex: yes // ---- // Warning 6328: (286-300): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init_diamond.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init_diamond.sol index 7eb23a120e8e..6890370334a4 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init_diamond.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructor_state_variable_init_diamond.sol @@ -60,11 +60,12 @@ contract D4 is B, C { // ==== // SMTEngine: all // ---- -// Warning 6328: (337-351): CHC: Assertion violation happens here.\nCounterexample:\nz = 1, y = 1, x = 0\n\nTransaction trace:\nD1.constructor() -// Warning 6328: (370-385): CHC: Assertion violation happens here.\nCounterexample:\nz = 1, y = 1, x = 0\n\nTransaction trace:\nD1.constructor() -// Warning 6328: (460-474): CHC: Assertion violation happens here.\nCounterexample:\nz = 2, y = 1, x = (- 1)\n\nTransaction trace:\nD2.constructor() -// Warning 6328: (493-507): CHC: Assertion violation happens here.\nCounterexample:\nz = 2, y = 1, x = (- 1)\n\nTransaction trace:\nD2.constructor() -// Warning 6328: (670-684): CHC: Assertion violation happens here.\nCounterexample:\nz = 1, y = 2, x = 1\n\nTransaction trace:\nD3.constructor() -// Warning 6328: (736-751): CHC: Assertion violation happens here.\nCounterexample:\nz = 1, y = 2, x = 1\n\nTransaction trace:\nD3.constructor() -// Warning 6328: (827-841): CHC: Assertion violation happens here.\nCounterexample:\nz = 2, y = 2, x = (- 1)\n\nTransaction trace:\nD4.constructor() -// Warning 6328: (860-874): CHC: Assertion violation happens here.\nCounterexample:\nz = 2, y = 2, x = (- 1)\n\nTransaction trace:\nD4.constructor() +// Warning 6328: (337-351): CHC: Assertion violation happens here. +// Warning 6328: (370-385): CHC: Assertion violation happens here. +// Warning 6328: (460-474): CHC: Assertion violation happens here. +// Warning 6328: (493-507): CHC: Assertion violation happens here. +// Warning 6328: (670-684): CHC: Assertion violation happens here. +// Warning 6328: (736-751): CHC: Assertion violation happens here. +// Warning 6328: (827-841): CHC: Assertion violation happens here. +// Warning 6328: (860-874): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructors.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructors.sol index d17a3f42123b..def9bea42f66 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructors.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/constructors.sol @@ -26,6 +26,7 @@ contract C is B { // SMTEngine: all // ---- // Warning 5740: (119-124): Unreachable code. -// Warning 6328: (277-291): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\na = 1\n\nTransaction trace:\nC.constructor(1) -// Warning 6328: (310-324): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\na = 1\n\nTransaction trace:\nC.constructor(1) -// Warning 6328: (343-357): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\na = 0\n\nTransaction trace:\nC.constructor(0) +// Warning 6328: (277-291): CHC: Assertion violation happens here. +// Warning 6328: (310-324): CHC: Assertion violation happens here. +// Warning 6328: (343-357): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/nested_if.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/nested_if.sol index 43a4aea30d39..ecccf8885ad7 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/nested_if.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/nested_if.sol @@ -22,5 +22,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (114-141): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\nb = 2\n\nTransaction trace:\nC.constructor()\nC.test(0, 2)\n C.nested_if(0, 2) -- internal call\n C.nested_if(0, 2) -- internal call +// Warning 6328: (114-141): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (299-315): BMC: Condition is always false. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/return_in_both_branches.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/return_in_both_branches.sol index 803b018576ad..f5294a6b6733 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/return_in_both_branches.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/return_in_both_branches.sol @@ -19,3 +19,4 @@ contract C { // SMTEngine: all // ---- // Warning 5740: (232-240): Unreachable code. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if.sol index f9153471be7e..627ffa27f940 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_array.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_array.sol index bf48eb32e0c2..2b41f3abe26c 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_array.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_array.sol @@ -25,4 +25,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (172-189): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0]\n\nTransaction trace:\nC.constructor()\nState: a = [0, 0]\nC.check()\n C.conditional_store() -- internal call +// Warning 6328: (172-189): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_state_var.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_state_var.sol index d3e74c01ab25..4df0b8ce3133 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_state_var.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_state_var.sol @@ -19,4 +19,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (99-113): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.check()\n C.conditional_increment() -- internal call +// Warning 6328: (99-113): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_struct.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_struct.sol index e04cd91d7641..02d1689373e0 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_struct.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_struct.sol @@ -22,4 +22,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (123-139): CHC: Assertion violation happens here.\nCounterexample:\ns = {x: 0}\n\nTransaction trace:\nC.constructor()\nState: s = {x: 0}\nC.check()\n C.conditional_increment() -- internal call +// Warning 6328: (123-139): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_struct_2.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_struct_2.sol index d9fcb93bde6a..87fbcc18a49f 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_struct_2.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_struct_2.sol @@ -22,4 +22,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (123-139): CHC: Assertion violation happens here.\nCounterexample:\ns = {x: 0}\n\nTransaction trace:\nC.constructor()\nState: s = {x: 0}\nC.check()\n C.conditional_increment() -- internal call +// Warning 6328: (123-139): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_tuple.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_tuple.sol index a9008ae259d7..f3fce1f0d437 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_tuple.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/simple_if_tuple.sol @@ -23,5 +23,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (127-141): CHC: Assertion violation happens here.\nCounterexample:\nx = 2, y = 2\n\nTransaction trace:\nC.constructor()\nState: x = 0, y = 0\nC.check()\n C.conditional_increment() -- internal call -// Warning 6328: (161-175): CHC: Assertion violation happens here.\nCounterexample:\nx = 2, y = 2\n\nTransaction trace:\nC.constructor()\nState: x = 0, y = 0\nC.check()\n C.conditional_increment() -- internal call +// Warning 6328: (127-141): CHC: Assertion violation happens here. +// Warning 6328: (161-175): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/triple_nested_if.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/triple_nested_if.sol index 472ef8785ec4..c6d6450f399f 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/triple_nested_if.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_with_return/triple_nested_if.sol @@ -19,4 +19,4 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Info 1180: Contract invariant(s) for :C:\n((c <= 0) && (a <= 0) && (b <= 0))\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch.sol b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch.sol index e71daa8a5d8f..fd76ceab4f78 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_2.sol b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_2.sol index da8239492614..8d8cdae53cb4 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_2.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_2.sol @@ -20,3 +20,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_3.sol b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_3.sol index f526c958e1e3..462ff871c234 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_3.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_3.sol @@ -20,3 +20,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_4.sol b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_4.sol index db3550a52eec..dbe7fc079cb9 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_4.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_branch_4.sol @@ -25,3 +25,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_else_branch.sol b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_else_branch.sol index b13e976a20b4..b99811b8e76b 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_else_branch.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_else_branch.sol @@ -16,3 +16,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_modifier_branch.sol b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_modifier_branch.sol index 0eff935e0c7e..52f110108c74 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_modifier_branch.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_modifier_branch.sol @@ -19,3 +19,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_placeholder_inside_modifier_branch.sol b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_placeholder_inside_modifier_branch.sol index d1a67b475e2c..ce53546295c8 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_placeholder_inside_modifier_branch.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/function_call_inside_placeholder_inside_modifier_branch.sol @@ -20,3 +20,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/require.sol b/test/libsolidity/smtCheckerTests/control_flow/require.sol index c59777d7ce96..31b243a3afab 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/require.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/require.sol @@ -31,4 +31,5 @@ contract C { // SMTEngine: all // ---- // Warning 6321: (396-409): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (415-432): CHC: Assertion violation happens here.\nCounterexample:\nx = true\n\nTransaction trace:\nC.constructor()\nState: x = false\nC.i()\n C.m() -- internal call +// Warning 6328: (415-432): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/return_1.sol b/test/libsolidity/smtCheckerTests/control_flow/return_1.sol index 95f9b2e561ef..2d532f7755e8 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/return_1.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/return_1.sol @@ -19,3 +19,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/return_1_fail.sol b/test/libsolidity/smtCheckerTests/control_flow/return_1_fail.sol index 59de4bc0ff63..375e726091d6 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/return_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/return_1_fail.sol @@ -24,3 +24,4 @@ contract C { // Warning 6328: (241-267): CHC: Assertion violation happens here. // Warning 6328: (271-297): CHC: Assertion violation happens here. // Warning 6328: (301-329): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/return_2.sol b/test/libsolidity/smtCheckerTests/control_flow/return_2.sol index 54f265eeecbb..92f030e82562 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/return_2.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/return_2.sol @@ -28,3 +28,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 11 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/return_2_fail.sol b/test/libsolidity/smtCheckerTests/control_flow/return_2_fail.sol index 7fcce53a19ad..0596647de19e 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/return_2_fail.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/return_2_fail.sol @@ -37,3 +37,4 @@ contract C { // Warning 6328: (404-425): CHC: Assertion violation happens here. // Warning 6328: (429-457): CHC: Assertion violation happens here. // Warning 6328: (461-484): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/revert.sol b/test/libsolidity/smtCheckerTests/control_flow/revert.sol index 14f6e988db36..a19e745aa72f 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/revert.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/revert.sol @@ -33,4 +33,5 @@ contract C { // Warning 5740: (83-96): Unreachable code. // Warning 5740: (188-201): Unreachable code. // Warning 6321: (375-388): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (394-411): CHC: Assertion violation happens here.\nCounterexample:\nx = true\n\nTransaction trace:\nC.constructor()\nState: x = false\nC.i()\n C.m() -- internal call +// Warning 6328: (394-411): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/revert_complex_flow.sol b/test/libsolidity/smtCheckerTests/control_flow/revert_complex_flow.sol index 5af670bda8a3..848f1edbf4a2 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/revert_complex_flow.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/revert_complex_flow.sol @@ -14,5 +14,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (150-164): CHC: Assertion violation happens here.\nCounterexample:\n\nb = false\na = 0\nc = 2\n\nTransaction trace:\nC.constructor()\nC.f(false, 0) +// Warning 6328: (150-164): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (122-123): BMC: Condition is always false. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and.sol index 6c4cfdc42b11..118e66ce7692 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and.sol @@ -15,3 +15,4 @@ contract c { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_fail.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_fail.sol index 198d4dc3eeef..0935d29c6439 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_fail.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_fail.sol @@ -15,4 +15,5 @@ contract c { // ==== // SMTEngine: all // ---- -// Warning 6328: (194-203): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n = false\nb = false\n\nTransaction trace:\nc.constructor()\nState: x = 0\nc.g()\n c.f() -- internal call\n c.f() -- internal call +// Warning 6328: (194-203): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_inside_branch.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_inside_branch.sol index 25ab73a1941c..0f4736f3ab3c 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_inside_branch.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_inside_branch.sol @@ -17,5 +17,6 @@ contract c { // ==== // SMTEngine: all // ---- -// Warning 6328: (169-185): CHC: Assertion violation happens here.\nCounterexample:\nx = 101\n = false\nb = true\n\nTransaction trace:\nc.constructor()\nState: x = 0\nc.g()\n c.f() -- internal call -// Warning 6328: (209-219): CHC: Assertion violation happens here.\nCounterexample:\nx = 101\n = false\nb = true\n\nTransaction trace:\nc.constructor()\nState: x = 0\nc.g()\n c.f() -- internal call +// Warning 6328: (169-185): CHC: Assertion violation happens here. +// Warning 6328: (209-219): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both.sol index 74f1ebb4e878..0b79769d5c0b 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both.sol @@ -15,3 +15,4 @@ contract c { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both_fail.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both_fail.sol index 29bb061473e0..d21d8e041287 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both_fail.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_need_both_fail.sol @@ -15,4 +15,5 @@ contract c { // ==== // SMTEngine: all // ---- -// Warning 6328: (192-202): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n = false\nb = true\n\nTransaction trace:\nc.constructor()\nState: x = 0\nc.g()\n c.f() -- internal call\n c.f() -- internal call +// Warning 6328: (192-202): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or.sol index c8926fbaa470..437a7890dd7e 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or.sol @@ -15,3 +15,4 @@ contract c { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_fail.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_fail.sol index 8b0766e0ac4e..8ac219ae5434 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_fail.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_fail.sol @@ -15,4 +15,5 @@ contract c { // ==== // SMTEngine: all // ---- -// Warning 6328: (192-202): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n = false\nb = true\n\nTransaction trace:\nc.constructor()\nState: x = 0\nc.g()\n c.f() -- internal call\n c.f() -- internal call +// Warning 6328: (192-202): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_inside_branch.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_inside_branch.sol index 9bec38227c8b..8d23f1e4e056 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_inside_branch.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_inside_branch.sol @@ -24,4 +24,5 @@ contract c { // ==== // SMTEngine: all // ---- -// Warning 6328: (327-337): CHC: Assertion violation happens here.\nCounterexample:\nx = 102\na = false\n = false\nb = true\n\nTransaction trace:\nc.constructor()\nState: x = 0\nc.g(false)\n c.f() -- internal call\n c.f() -- internal call +// Warning 6328: (327-337): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both.sol index 4581a29fac74..237a90004546 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both.sol @@ -15,3 +15,4 @@ contract c { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both_fail.sol b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both_fail.sol index 8b623c9aab5b..ea71f34b051a 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both_fail.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/short_circuit_or_need_both_fail.sol @@ -15,4 +15,5 @@ contract c { // ==== // SMTEngine: all // ---- -// Warning 6328: (192-202): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n = false\nb = true\n\nTransaction trace:\nc.constructor()\nState: x = 0\nc.g()\n c.f() -- internal call\n c.f() -- internal call +// Warning 6328: (192-202): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_1.sol b/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_1.sol index 5166afabb8b8..ce0ce630b147 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_1.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_1.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (127-141): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 11\na = 4\n\nTransaction trace:\nC.constructor()\nC.f(11) +// Warning 6328: (127-141): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_2.sol b/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_2.sol index 92be3c3ee926..4ceff5f3fcad 100644 --- a/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_2.sol +++ b/test/libsolidity/smtCheckerTests/control_flow/ways_to_merge_variables_2.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (127-141): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 11\na = 4\n\nTransaction trace:\nC.constructor()\nC.f(11) +// Warning 6328: (127-141): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/crypto/crypto_functions_over_blocks.sol b/test/libsolidity/smtCheckerTests/crypto/crypto_functions_over_blocks.sol index 126d9c627f8b..99d6f7c78152 100644 --- a/test/libsolidity/smtCheckerTests/crypto/crypto_functions_over_blocks.sol +++ b/test/libsolidity/smtCheckerTests/crypto/crypto_functions_over_blocks.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/crypto/crypto_functions_same_input_over_state_same_output.sol b/test/libsolidity/smtCheckerTests/crypto/crypto_functions_same_input_over_state_same_output.sol index aae296695ad1..a39cfc88f0f3 100644 --- a/test/libsolidity/smtCheckerTests/crypto/crypto_functions_same_input_over_state_same_output.sol +++ b/test/libsolidity/smtCheckerTests/crypto/crypto_functions_same_input_over_state_same_output.sol @@ -37,3 +37,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/crypto/crypto_functions_same_input_same_output.sol b/test/libsolidity/smtCheckerTests/crypto/crypto_functions_same_input_same_output.sol index 2db313e3b84b..a6abfdec92c1 100644 --- a/test/libsolidity/smtCheckerTests/crypto/crypto_functions_same_input_same_output.sol +++ b/test/libsolidity/smtCheckerTests/crypto/crypto_functions_same_input_same_output.sol @@ -27,3 +27,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_bmc_trusted.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_bmc_trusted.sol new file mode 100644 index 000000000000..81ddc515e1b4 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_bmc_trusted.sol @@ -0,0 +1,18 @@ +contract D { + uint x; + function f() public view returns (uint) { return x; } +} + +contract C { + function g() public { + D d = new D(); + uint y = d.f(); + assert(y == 0); // should fail in BMC + } +} +// ==== +// SMTEngine: bmc +// SMTExtCalls: trusted +// ---- +// Warning 8729: (124-131): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. +// Warning 4661: (153-167): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_bmc_untrusted.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_bmc_untrusted.sol new file mode 100644 index 000000000000..f69a8d6c72eb --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_bmc_untrusted.sol @@ -0,0 +1,17 @@ +contract D { + uint x; + function f() public view returns (uint) { return x; } +} + +contract C { + function g() public { + D d = new D(); + uint y = d.f(); + assert(y == 0); // should fail in ext calls untrusted mode + } +} +// ==== +// SMTEngine: bmc +// ---- +// Warning 8729: (124-131): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. +// Warning 4661: (153-167): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_trusted.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted.sol new file mode 100644 index 000000000000..00d0f5d6a1d4 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted.sol @@ -0,0 +1,17 @@ +contract D { + uint x; + function f() public view returns (uint) { return x; } +} + +contract C { + function g() public { + D d = new D(); + uint y = d.f(); + assert(y == 0); // should hold in ext calls trusted mode + } +} +// ==== +// SMTEngine: all +// SMTExtCalls: trusted +// ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_addresses.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_addresses.sol new file mode 100644 index 000000000000..01c68790c843 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_addresses.sol @@ -0,0 +1,19 @@ +contract D { + uint x; +} + +contract C { + function f() public { + D d1 = new D(); + D d2 = new D(); + + assert(d1 != d2); // should hold in ext calls trusted mode + assert(address(this) != address(d1)); // should hold in ext calls trusted mode + assert(address(this) != address(d2)); // should hold in ext calls trusted mode + } +} +// ==== +// SMTEngine: all +// SMTExtCalls: trusted +// ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_flow.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_flow.sol new file mode 100644 index 000000000000..dcc81be6432e --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_flow.sol @@ -0,0 +1,31 @@ +contract D { + uint x; + function inc() public { ++x; } + function f() public view returns (uint) { return x; } +} + +contract C { + function f() public { + D d = new D(); + assert(d.f() == 0); // should hold + d.inc(); + assert(d.f() == 1); // should hold + d = new D(); + assert(d.f() == 0); // should hold + assert(d.f() == 1); // should fail + } +} +// ==== +// SMTEngine: all +// SMTExtCalls: trusted +// SMTIgnoreOS: macos +// ---- +// Warning 4984: (47-50): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. +// Warning 6328: (167-185): CHC: Assertion violation might happen here. +// Warning 6328: (215-233): CHC: Assertion violation might happen here. +// Warning 6328: (267-285): CHC: Assertion violation might happen here. +// Warning 6328: (304-322): CHC: Assertion violation happens here. +// Warning 2661: (47-50): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Warning 4661: (167-185): BMC: Assertion violation happens here. +// Warning 4661: (215-233): BMC: Assertion violation happens here. +// Warning 4661: (267-285): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_keep_storage_constraints.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_keep_storage_constraints.sol new file mode 100644 index 000000000000..f31f9a3e1469 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_keep_storage_constraints.sol @@ -0,0 +1,17 @@ +contract D { + uint x; +} + +contract C { + uint y; + function g() public { + D d = new D(); + assert(y == 0); // should hold + } +} +// ==== +// SMTEngine: all +// SMTExtCalls: trusted +// ---- +// Warning 2072: (72-75): Unused local variable. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow.sol new file mode 100644 index 000000000000..b2712306c9d3 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow.sol @@ -0,0 +1,25 @@ +contract D { + uint x; + function inc() public { ++x; } + function f() public view returns (uint) { return x; } +} + +contract C { + D d; + constructor() { + d = new D(); + assert(d.f() == 0); // should hold + } + function g() public view { + assert(d.f() == 0); // should fail + } +} +// ==== +// SMTEngine: all +// SMTExtCalls: trusted +// SMTIgnoreOS: macos +// ---- +// Warning 4984: (47-50): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. +// Warning 6328: (233-251): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. +// Warning 2661: (47-50): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_2.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_2.sol new file mode 100644 index 000000000000..0f904454312e --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_2.sol @@ -0,0 +1,20 @@ +contract D { + uint x; + function f() public view returns (uint) { return x; } +} + +contract C { + D d; + constructor() { + d = new D(); + assert(d.f() == 0); // should hold + } + function g() public view { + assert(d.f() == 0); // should hold + } +} +// ==== +// SMTEngine: all +// SMTExtCalls: trusted +// ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_3.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_3.sol new file mode 100644 index 000000000000..260909b87a25 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_3.sol @@ -0,0 +1,21 @@ +contract D { + uint x; + function s(uint _x) public { x = _x; } + function f() public view returns (uint) { return x; } +} + +contract C { + D d; + constructor() { + d = new D(); + } + function g() public view { + assert(d.f() == 0); // should fail + } +} +// ==== +// SMTContract: C +// SMTEngine: all +// SMTExtCalls: trusted +// ---- +// Warning 6328: (204-222): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_4.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_4.sol new file mode 100644 index 000000000000..5bd27c3b822d --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_trusted_state_flow_4.sol @@ -0,0 +1,20 @@ +contract D { + bool b; + function s() public { b = true; } + function f() public view returns (bool) { return b; } +} + +contract C { + D d; + constructor() { + d = new D(); + } + function g() public view { + assert(d.f()); // should fail + } +} +// ==== +// SMTEngine: all +// SMTExtCalls: trusted +// ---- +// Warning 6328: (199-212): CHC: Assertion violation happens here.\nCounterexample:\nd = (- 1)\n\nTransaction trace:\nC.constructor()\nState: d = (- 1)\nC.g()\n D.f() -- trusted external call diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted.sol new file mode 100644 index 000000000000..a28d4621054f --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted.sol @@ -0,0 +1,17 @@ +contract D { + uint x; + function f() public view returns (uint) { return x; } +} + +contract C { + function g() public { + D d = new D(); + uint y = d.f(); + assert(y == 0); // should fail in ext calls untrusted mode + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 8729: (124-131): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. +// Warning 6328: (153-167): CHC: Assertion violation happens here.\nCounterexample:\n\nd = 0\ny = 1\n\nTransaction trace:\nC.constructor()\nC.g()\n d.f() -- untrusted external call diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted_addresses.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted_addresses.sol new file mode 100644 index 000000000000..c934e152b27c --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted_addresses.sol @@ -0,0 +1,22 @@ +contract D { + uint x; +} + +contract C { + function f() public { + D d1 = new D(); + D d2 = new D(); + + assert(d1 != d2); // should fail in ext calls untrusted mode + assert(address(this) != address(d1)); // should fail in ext calls untrusted mode + assert(address(this) != address(d2)); // should fail in ext calls untrusted mode + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 8729: (70-77): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. +// Warning 8729: (88-95): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. +// Warning 6328: (100-116): CHC: Assertion violation happens here.\nCounterexample:\n\nd1 = 0\nd2 = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (163-199): CHC: Assertion violation happens here.\nCounterexample:\n\nd1 = 21238\nd2 = 21238\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (246-282): CHC: Assertion violation happens here.\nCounterexample:\n\nd1 = 21238\nd2 = 21238\n\nTransaction trace:\nC.constructor()\nC.f() diff --git a/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted_erase_storage_constraints.sol b/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted_erase_storage_constraints.sol new file mode 100644 index 000000000000..be18b33f633a --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deploy_untrusted_erase_storage_constraints.sol @@ -0,0 +1,17 @@ +contract D { + uint x; +} + +contract C { + uint y; + function g() public { + D d = new D(); + assert(y == 0); // should fail in ext calls untrusted mode + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 2072: (72-75): Unused local variable. +// Warning 8729: (78-85): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. +// Warning 6328: (89-103): CHC: Assertion violation happens here.\nCounterexample:\ny = 1\nd = 0\n\nTransaction trace:\nC.constructor()\nState: y = 0\nC.g() diff --git a/test/libsolidity/smtCheckerTests/deployment/deployment_trusted_with_value_1.sol b/test/libsolidity/smtCheckerTests/deployment/deployment_trusted_with_value_1.sol new file mode 100644 index 000000000000..37f5ca80a3e9 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/deployment/deployment_trusted_with_value_1.sol @@ -0,0 +1,21 @@ +contract A { + constructor() payable {} +} + +contract B { + function f() public payable { + require(address(this).balance == 100); + A a = new A{value: 50}(); + assert(address(this).balance == 50); // should hold + assert(address(this).balance == 60); // should fail + assert(address(a).balance >= 50); // should hold + assert(address(a).balance == 50); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// ---- +// Warning 6328: (211-246): CHC: Assertion violation happens here. +// Warning 6328: (316-348): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_abstract_constructor_trusted_1.sol b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_constructor_trusted_1.sol new file mode 100644 index 000000000000..985ee26d16ee --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_constructor_trusted_1.sol @@ -0,0 +1,29 @@ +contract D { + constructor(uint _x) { x = _x; } + uint public x; +} + +contract E { + constructor() { x = 2; } + uint public x; +} + +contract C { + constructor() { + address d = address(new D(42)); + assert(D(d).x() == 42); // should hold + assert(D(d).x() == 43); // should fail + uint y = E(d).x(); + assert(y == 2); // should fail, it would still call D.x() == 42 + assert(y == 42); // should hold, but fails due to false positive + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// ---- +// Warning 6328: (231-253): CHC: Assertion violation happens here. +// Warning 6328: (293-307): CHC: Assertion violation happens here. +// Warning 6328: (359-374): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_abstract_constructor_trusted_2.sol b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_constructor_trusted_2.sol new file mode 100644 index 000000000000..b078a32eff5b --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_constructor_trusted_2.sol @@ -0,0 +1,26 @@ +contract D { + constructor(uint _x) { x = _x; } + function setD(uint _x) public { x = _x; } + uint public x; +} + +contract C { + constructor() { + address d = address(new D(42)); + assert(D(d).x() == 42); // should hold + assert(D(d).x() == 21); // should fail + d.call(abi.encodeCall(D.setD, (21))); + assert(D(d).x() == 21); // should hold, but false positive cus low level calls are not handled precisely + assert(D(d).x() == 42); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// ---- +// Warning 9302: (257-293): Return value of low-level calls not used. +// Warning 6328: (216-238): CHC: Assertion violation happens here. +// Warning 6328: (297-319): CHC: Assertion violation happens here. +// Warning 6328: (404-426): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_1.sol b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_1.sol new file mode 100644 index 000000000000..904a5967499d --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_1.sol @@ -0,0 +1,29 @@ +contract D { + constructor(uint _x) { x = _x; } + uint public x; +} + +contract E { + constructor() { x = 2; } + uint public x; +} + +contract C { + function f() public { + address d = address(new D(42)); + assert(D(d).x() == 42); // should hold + assert(D(d).x() == 43); // should fail + uint y = E(d).x(); + assert(y == 2); // should fail, it would still call D.x() == 42 + assert(y == 42); // should hold, but fails due to false positive + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// ---- +// Warning 6328: (237-259): CHC: Assertion violation happens here. +// Warning 6328: (299-313): CHC: Assertion violation happens here. +// Warning 6328: (365-380): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_2.sol b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_2.sol new file mode 100644 index 000000000000..41d771b5ed93 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_2.sol @@ -0,0 +1,26 @@ +contract D { + constructor(uint _x) { x = _x; } + function setD(uint _x) public { x = _x; } + uint public x; +} + +contract C { + function f() public { + address d = address(new D(42)); + assert(D(d).x() == 42); // should hold + assert(D(d).x() == 21); // should fail + d.call(abi.encodeCall(D.setD, (21))); + assert(D(d).x() == 21); // should hold, but false positive cus low level calls are not handled precisely + assert(D(d).x() == 42); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// ---- +// Warning 9302: (263-299): Return value of low-level calls not used. +// Warning 6328: (222-244): CHC: Assertion violation happens here. +// Warning 6328: (303-325): CHC: Assertion violation happens here. +// Warning 6328: (410-432): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_3.sol b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_3.sol new file mode 100644 index 000000000000..b224dae2fdbe --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/call_abstract_trusted_3.sol @@ -0,0 +1,30 @@ +contract D { + constructor(uint _x) { x = _x; } + function setD(uint _x) public { x = _x; } + uint public x; +} + +contract C { + uint x; + + function f() public { + x = 666; + address d = address(new D(42)); + assert(D(d).x() == 42); // should hold + assert(D(d).x() == 21); // should fail + d.call(abi.encodeCall(D.setD, (21))); + assert(D(d).x() == 21); // should hold, but false positive cus low level calls are not handled precisely + assert(D(d).x() == 42); // should fail + assert(x == 666); // should hold, C's storage should not have been havoced + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// ---- +// Warning 9302: (284-320): Return value of low-level calls not used. +// Warning 6328: (243-265): CHC: Assertion violation happens here. +// Warning 6328: (324-346): CHC: Assertion violation happens here. +// Warning 6328: (431-453): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_constructor_1.sol b/test/libsolidity/smtCheckerTests/external_calls/call_constructor_1.sol index a4dd5f5317f3..9c29f329ea69 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/call_constructor_1.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/call_constructor_1.sol @@ -9,3 +9,4 @@ contract C { // SMTEngine: all // ---- // Warning 9302: (51-66): Return value of low-level calls not used. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_constructor_2.sol b/test/libsolidity/smtCheckerTests/external_calls/call_constructor_2.sol index 2d2f32acf203..b7e735b4d151 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/call_constructor_2.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/call_constructor_2.sol @@ -12,3 +12,4 @@ contract C { // SMTEngine: all // ---- // Warning 9302: (94-109): Return value of low-level calls not used. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_mutex.sol b/test/libsolidity/smtCheckerTests/external_calls/call_mutex.sol index e85eb00aab95..f238fd636f48 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/call_mutex.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/call_mutex.sol @@ -23,4 +23,4 @@ contract C { // SMTEngine: all // ---- // Warning 9302: (218-234): Return value of low-level calls not used. -// Info 1180: Reentrancy property(ies) for :C:\n((lock' || !lock) && ( <= 0) && (!lock || ((x' + ((- 1) * x)) = 0)))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(y == x)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_reentrancy_view.sol b/test/libsolidity/smtCheckerTests/external_calls/call_reentrancy_view.sol index 87a9e2261459..89ed906fbd79 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/call_reentrancy_view.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/call_reentrancy_view.sol @@ -15,4 +15,4 @@ contract C { // Warning 2519: (106-112): This declaration shadows an existing declaration. // Warning 2072: (106-112): Unused local variable. // Warning 2072: (114-131): Unused local variable. -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\nReentrancy property(ies) for :C:\n((!(x <= 0) || (x' <= 0)) && (!(x <= 0) || ( <= 0)))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(x == 0)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/call_safe.sol b/test/libsolidity/smtCheckerTests/external_calls/call_safe.sol index e4e3abc24f6b..0f6548d926f9 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/call_safe.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/call_safe.sol @@ -11,3 +11,4 @@ contract C { // ---- // Warning 2072: (57-63): Unused local variable. // Warning 2072: (65-82): Unused local variable. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external.sol b/test/libsolidity/smtCheckerTests/external_calls/external.sol index 659329e0b89d..5ddb61a2226d 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external.sol @@ -18,4 +18,4 @@ contract C { // SMTEngine: all // ---- // Warning 6328: (167-181): CHC: Assertion violation happens here. -// Info 1180: Reentrancy property(ies) for :C:\n!( = 1)\n = 0 -> no errors\n = 1 -> Overflow at ++x\n = 3 -> Assertion failed at assert(x < 10)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_1_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_1_trusted.sol new file mode 100644 index 000000000000..6f2b717b5e87 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_1_trusted.sol @@ -0,0 +1,22 @@ +contract State { + function f(uint _x) public pure returns (uint) { + assert(_x < 100); // should fail + return _x; + } +} +contract C { + State s; + uint z = s.f(2); + + function f() public view { + assert(z == 2); // should hold in trusted mode + } +} +// ==== +// SMTContract: C +// SMTEngine: all +// SMTExtCalls: trusted +// SMTIgnoreInv: yes +// ---- +// Warning 6328: (69-85): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_2.sol index 3fbdd8511ba8..48bcf93a381f 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_2.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_2.sol @@ -13,5 +13,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (87-101): CHC: Assertion violation happens here.\nCounterexample:\nz = 2\n_x = 0\n = 0\n\nTransaction trace:\nC.constructor()\nState: z = 2\nC.g(0) -// Info 1180: Contract invariant(s) for :C:\n(!(z >= 3) && !(z <= 1))\n +// Warning 6328: (87-101): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_2_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_2_trusted.sol new file mode 100644 index 000000000000..c2b8f83938c5 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_2_trusted.sol @@ -0,0 +1,17 @@ +contract C { + uint z = this.g(2); + + function g(uint _x) public pure returns (uint) { + assert(_x > 0); // should fail + return _x; + } + + function f() public view { + assert(z == 2); // should hold + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 6328: (87-101): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_3_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_3_trusted.sol new file mode 100644 index 000000000000..590664055d6b --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_3_trusted.sol @@ -0,0 +1,25 @@ +contract State { + function f(uint _x) public pure returns (uint) { + assert(_x < 100); // should fail + return _x; + } +} +contract C { + State s; + uint z; + + constructor() { + z = s.f(2); + } + + function f() public view { + assert(z == 2); // should hold in trusted mode + } +} +// ==== +// SMTContract: C +// SMTEngine: all +// SMTExtCalls: trusted +// ---- +// Warning 6328: (69-85): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_reentrancy_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_reentrancy_1.sol index 5dbdaae27d1d..75fb4a7c84c3 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_reentrancy_1.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_from_constructor_reentrancy_1.sol @@ -15,3 +15,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (253-267): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_1.sol new file mode 100644 index 000000000000..c6b46b2f87bf --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_1.sol @@ -0,0 +1,42 @@ +contract A { + uint x; + function setX(uint _x) public { + x = _x; + } + function getX() public view returns (uint) { + return x; + } +} + +contract B { + A a; + constructor() { + a = new A(); + assert(a.getX() == 0); // should hold + } + function g() public view { + assert(a.getX() == 0); // should fail because A.setX() can be called without B + } + function getX() public view returns (uint) { + return a.getX(); + } +} + +contract C { + B b; + constructor() { + b = new B(); + assert(b.getX() == 0); // should hold + } + function f() public view { + assert(b.getX() == 0); // should fail because A.setX() can be called without A + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreOS: macos +// ---- +// Warning 6328: (256-277): CHC: Assertion violation happens here. +// Warning 6328: (533-554): CHC: Assertion violation might happen here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_2.sol new file mode 100644 index 000000000000..c1d567cfec7d --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_2.sol @@ -0,0 +1,53 @@ +contract A { + uint x; + address immutable owner; + constructor() { + owner = msg.sender; + } + function setX(uint _x) public { + require(msg.sender == owner); + x = _x; + } + function getX() public view returns (uint) { + return x; + } +} + +contract B { + A a; + constructor() { + a = new A(); + assert(a.getX() == 0); // should hold + } + function g() public view { + assert(a.getX() == 0); // should hold, but fails because + // the nondet_interface constraint added for `A a` in between + // txs of `B` does not have the constraint that `msg.sender != address(this)` + // so `A.setX` is allowed with `msg.sender = address(this)` inside + // the current rules defining nondet_interface. + // If we want to support that, we likely need a new type of nondet_interface + // `nondet_interface_with_tx` that contains tx data as well as restricts + // every further `nondet_interface_with_tx` to not have that `msg.sender`. + } + function getX() public view returns (uint) { + return a.getX(); + } +} + +contract C { + B b; + constructor() { + b = new B(); + assert(b.getX() == 0); // should hold + } + function f() public view { + assert(b.getX() == 0); // should hold + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// ---- +// Warning 6328: (434-455): CHC: Assertion violation happens here. +// Warning 6328: (1270-1291): CHC: Assertion violation might happen here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_3.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_3.sol new file mode 100644 index 000000000000..ff17649dd968 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_3.sol @@ -0,0 +1,46 @@ +contract A { + uint x; + address immutable owner; + constructor() { + owner = msg.sender; + } + function setX(uint _x) public { + require(msg.sender == owner); + x = _x; + } + function getX() public view returns (uint) { + return x; + } +} + +contract B { + A a; + constructor() { + a = new A(); + assert(a.getX() == 0); // should hold + } + function g() public { + a.setX(42); + } + function getX() public view returns (uint) { + return a.getX(); + } +} + +contract C { + B b; + constructor() { + b = new B(); + assert(b.getX() == 0); // should hold + } + function f() public view { + assert(b.getX() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreOS: macos +// ---- +// Warning 6328: (561-582): CHC: Assertion violation might happen here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_4.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_4.sol new file mode 100644 index 000000000000..766f6e133446 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_4.sol @@ -0,0 +1,49 @@ +contract A { + uint x; + address immutable owner; + constructor() { + owner = msg.sender; + } + function setX(uint _x) public { + require(msg.sender == owner); + x = _x; + } + function getX() public view returns (uint) { + return x; + } +} + +contract B { + A a; + address immutable owner; + constructor() { + owner = msg.sender; + a = new A(); + assert(a.getX() == 0); // should hold + } + function g() public { + require(msg.sender == owner); + a.setX(42); + } + function getX() public view returns (uint) { + return a.getX(); + } +} + +contract C { + B b; + constructor() { + b = new B(); + assert(b.getX() == 0); // should hold + } + function f() public view { + assert(b.getX() == 0); // should hold + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreOS: macos +// ---- +// Warning 6328: (641-662): CHC: Assertion violation might happen here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_5.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_5.sol new file mode 100644 index 000000000000..9313858ce2b1 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_indirect_5.sol @@ -0,0 +1,51 @@ +contract A { + uint x; + address immutable owner; + constructor() { + owner = msg.sender; + } + function setX(uint _x) public { + require(msg.sender == owner); + x = _x; + } + function getX() public view returns (uint) { + return x; + } +} + +contract B { + A a; + address immutable owner; + constructor() { + owner = msg.sender; + a = new A(); + } + function g() public { + require(msg.sender == owner); + a.setX(42); + } + function getX() public view returns (uint) { + return a.getX(); + } +} + +contract C { + B b; + constructor() { + b = new B(); + assert(b.getX() == 0); // should hold + } + function f() public view { + assert(b.getX() == 0); // should fail + } + function h() public { + b.g(); + } +} +// ==== +// SMTContract: C +// SMTEngine: chc +// SMTExtCalls: trusted +// ---- +// Warning 6328: (601-622): CHC: Assertion violation might happen here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_1.sol new file mode 100644 index 000000000000..6b4493231231 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_1.sol @@ -0,0 +1,18 @@ +contract C { + uint x; + function i() public { ++x; } + function f() public { + x = 0; + this.i(); + assert(x == 1); // should hold in trusted mode + assert(x != 1); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// SMTTargets: assert +// ---- +// Warning 6328: (147-161): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_2.sol new file mode 100644 index 000000000000..55e8848800a3 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_2.sol @@ -0,0 +1,17 @@ +contract C { + uint x; + function i() public { ++x; } + function f() public { + x = 0; + ((this)).i(); + assert(x == 1); // should hold in trusted mode + assert(x != 1); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (151-165): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_3.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_3.sol new file mode 100644 index 000000000000..5435e5dcd493 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_semantic_this_3.sol @@ -0,0 +1,18 @@ +contract C { + uint x; + function i() public { ++x; } + function f() public { + x = 0; + C c = this; + c.i(); + assert(x == 1); // should hold in trusted mode + assert(x != 1); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (158-172): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_struct_trusted_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_struct_trusted_1.sol new file mode 100644 index 000000000000..6075548dbd08 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_struct_trusted_1.sol @@ -0,0 +1,24 @@ +contract D { + uint public x; +} + +contract C { + struct S { + address d; + } + S[] ss; + constructor() { + ss.push(S(address(new D()))); + assert(D(ss[0].d).x() == 0); // should hold + } + function f() public view { + assert(D(ss[0].d).x() == 0); // should hold, but fails because we havoc the state + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (210-237): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_struct_trusted_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_struct_trusted_2.sol new file mode 100644 index 000000000000..c8834ab85ebf --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_struct_trusted_2.sol @@ -0,0 +1,25 @@ +contract D { + uint public x; + function setD(uint _x) public { x = _x; } +} + +contract C { + struct S { + address d; + } + S[] ss; + constructor() { + ss.push(S(address(new D()))); + assert(D(ss[0].d).x() == 0); // should hold + } + function f() public view { + assert(D(ss[0].d).x() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (253-280): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_trusted_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_trusted_1.sol new file mode 100644 index 000000000000..4a7da79323d0 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_trusted_1.sol @@ -0,0 +1,22 @@ +contract D { + uint public x; + function setD(uint _x) public { x = _x; } +} + +contract C { + address[] ds; + constructor() { + ds.push(address(new D())); + assert(D(ds[0]).x() == 0); // should hold + } + function f() public view { + assert(D(ds[0]).x() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (226-251): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_trusted_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_trusted_2.sol new file mode 100644 index 000000000000..846087997dde --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_array_trusted_2.sol @@ -0,0 +1,21 @@ +contract D { + uint public x; +} + +contract C { + address[] ds; + constructor() { + ds.push(address(new D())); + assert(D(ds[0]).x() == 0); // should hold + } + function f() public view { + assert(D(ds[0]).x() == 0); // should hold, but fails because we havoc the state + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (183-208): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_1.sol new file mode 100644 index 000000000000..3f1c7acbec77 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_1.sol @@ -0,0 +1,25 @@ +contract D { + uint public x; + function setD(uint _x) public { x = _x; } +} + +contract C { + struct S { + address d; + } + S s; + constructor() { + s.d = address(new D()); + assert(D(s.d).x() == 0); // should hold + } + function f() public view { + assert(D(s.d).x() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (240-263): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_2.sol new file mode 100644 index 000000000000..146141fbab51 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_2.sol @@ -0,0 +1,24 @@ +contract D { + uint public x; +} + +contract C { + struct S { + address d; + } + S s; + constructor() { + s.d = address(new D()); + assert(D(s.d).x() == 0); // should hold + } + function f() public view { + assert(D(s.d).x() == 0); // should hold, but fails because we havoc the state + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (197-220): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_3.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_3.sol new file mode 100644 index 000000000000..b2711cb51cc4 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_3.sol @@ -0,0 +1,27 @@ +contract D { + uint public x; +} + +contract C { + struct S { + address d; + } + struct T { + S s; + } + T t; + constructor() { + t.s.d = address(new D()); + assert(D(t.s.d).x() == 0); // should hold + } + function f() public view { + assert(D(t.s.d).x() == 0); // should hold, but fails because we havoc the state + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (223-248): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_4.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_4.sol new file mode 100644 index 000000000000..e8387b74c370 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_address_inside_struct_trusted_4.sol @@ -0,0 +1,28 @@ +contract D { + uint public x; + function setD(uint _x) public { x = _x; } +} + +contract C { + struct S { + address d; + } + struct T { + S s; + } + T t; + constructor() { + t.s.d = address(new D()); + assert(D(t.s.d).x() == 0); // should hold + } + function f() public view { + assert(D(t.s.d).x() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (266-291): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_struct_trusted_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_struct_trusted_1.sol new file mode 100644 index 000000000000..aefad8a75a7d --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_struct_trusted_1.sol @@ -0,0 +1,24 @@ +contract D { + uint public x; +} + +contract C { + struct S { + D d; + } + S[] ss; + constructor() { + ss.push(S(new D())); + assert(ss[0].d.x() == 0); // should hold + } + function f() public view { + assert(ss[0].d.x() == 0); // should hold, but fails because we havoc the state + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (192-216): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_struct_trusted_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_struct_trusted_2.sol new file mode 100644 index 000000000000..3f03cd713bb7 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_struct_trusted_2.sol @@ -0,0 +1,25 @@ +contract D { + uint public x; + function setD(uint _x) public { x = _x; } +} + +contract C { + struct S { + D d; + } + S[] ss; + constructor() { + ss.push(S(new D())); + assert(ss[0].d.x() == 0); // should hold + } + function f() public view { + assert(ss[0].d.x() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (235-259): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_trusted_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_trusted_1.sol new file mode 100644 index 000000000000..017e760e7096 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_trusted_1.sol @@ -0,0 +1,22 @@ +contract D { + uint public x; + function setD(uint _x) public { x = _x; } +} + +contract C { + D[] ds; + constructor() { + ds.push(new D()); + assert(ds[0].x() == 0); // should hold + } + function f() public view { + assert(ds[0].x() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (208-230): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_trusted_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_trusted_2.sol new file mode 100644 index 000000000000..0ac805b2f626 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_array_trusted_2.sol @@ -0,0 +1,22 @@ +contract D { + uint public x; +} + +contract C { + D[] ds; + constructor() { + ds.push(new D()); + assert(ds[0].x() == 0); // should hold + } + function f() public view { + assert(ds[0].x() == 0); // should hold, but fails because we havoc the state + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// SMTTargets: assert +// ---- +// Warning 6328: (165-187): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_1.sol new file mode 100644 index 000000000000..f7c705c10d99 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_1.sol @@ -0,0 +1,25 @@ +contract D { + uint public x; + function setD(uint _x) public { x = _x; } +} + +contract C { + struct S { + D d; + } + S s; + constructor() { + s.d = new D(); + assert(s.d.x() == 0); // should hold + } + function f() public view { + assert(s.d.x() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (222-242): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_2.sol new file mode 100644 index 000000000000..50bab6173b91 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_2.sol @@ -0,0 +1,25 @@ +contract D { + uint public x; +} + +contract C { + struct S { + D d; + } + S s; + constructor() { + s.d = new D(); + assert(s.d.x() == 0); // should hold + } + function f() public view { + assert(s.d.x() == 0); // should hold, but fails because we havoc the state + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// SMTTargets: assert +// ---- +// Warning 6328: (179-199): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_3.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_3.sol new file mode 100644 index 000000000000..7a5791c6dda2 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_3.sol @@ -0,0 +1,28 @@ +contract D { + uint public x; +} + +contract C { + struct S { + D d; + } + struct T { + S s; + } + T t; + constructor() { + t.s.d = new D(); + assert(t.s.d.x() == 0); // should hold + } + function f() public view { + assert(t.s.d.x() == 0); // should hold, but fails because we havoc the state + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// SMTTargets: assert +// ---- +// Warning 6328: (205-227): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_4.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_4.sol new file mode 100644 index 000000000000..3bc9abafa86e --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_state_var_contract_inside_struct_trusted_4.sol @@ -0,0 +1,28 @@ +contract D { + uint public x; + function setD(uint _x) public { x = _x; } +} + +contract C { + struct S { + D d; + } + struct T { + S s; + } + T t; + constructor() { + t.s.d = new D(); + assert(t.s.d.x() == 0); // should hold + } + function f() public view { + assert(t.s.d.x() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (248-270): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_this_with_value_1.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_this_with_value_1.sol index 06390b12ca95..fbf4140b258c 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_call_this_with_value_1.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_this_with_value_1.sol @@ -12,3 +12,4 @@ contract C { // SMTEngine: all // ---- // Warning 6328: (157-192): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_call_this_with_value_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_call_this_with_value_2.sol index fc2d844d9d50..0cdf7ec8b5fc 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_call_this_with_value_2.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_call_this_with_value_2.sol @@ -1,7 +1,11 @@ contract C { function g(uint i) public { require(address(this).balance == 100); + // if called address is same as this, don't do anything with the value stuff + // or fix the receiving end this.h{value: i}(); + uint x = address(this).balance; + assert(x == 100); // should hold assert(address(this).balance == 100); // should hold assert(address(this).balance == 90); // should fail } @@ -12,4 +16,5 @@ contract C { // SMTEngine: all // SMTIgnoreCex: yes // ---- -// Warning 6328: (162-197): CHC: Assertion violation happens here. +// Warning 6328: (340-375): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash.sol index 8f5b162a0dc1..6b8d41adeaec 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_hash.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash.sol @@ -28,4 +28,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (390-412): CHC: Assertion violation happens here. -// Info 1180: Reentrancy property(ies) for :C:\n!( = 1)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(prevOwner == owner)\n = 3 -> Assertion failed at assert(sig_1 == sig_2)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_pure.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_pure.sol index 2e837478d89b..514e6a5cedb5 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_pure.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_pure.sol @@ -30,4 +30,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (398-420): CHC: Assertion violation happens here. -// Info 1180: Reentrancy property(ies) for :C:\n!( = 1)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(prevOwner == owner)\n = 3 -> Assertion failed at assert(sig_1 == sig_2)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_pure_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_pure_trusted.sol new file mode 100644 index 000000000000..aa5cb40374a2 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_pure_trusted.sol @@ -0,0 +1,33 @@ +contract Crypto { + function hash(bytes32) external pure returns (bytes32) { + return bytes32(0); + } +} + +contract C { + address owner; + bytes32 sig_1; + bytes32 sig_2; + Crypto d; + + constructor() { + owner = msg.sender; + } + + function f1(bytes32 _msg) public { + address prevOwner = owner; + sig_1 = d.hash(_msg); + sig_2 = d.hash(_msg); + assert(prevOwner == owner); + } + + function inv() public view { + assert(sig_1 == sig_2); + } +} +// ==== +// SMTContract: C +// SMTEngine: all +// SMTExtCalls: trusted +// ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state.sol index 317400e1d127..90b91e9b268f 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state.sol @@ -36,4 +36,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (495-532): CHC: Assertion violation happens here. -// Info 1180: Reentrancy property(ies) for :C:\n(((owner + ((- 1) * owner')) >= 0) && !( = 1) && ((owner + ((- 1) * owner')) <= 0))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(prevOwner == owner)\n = 3 -> Assertion failed at assert(owner == address(0) || y != z)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_2.sol index be9f698e15cb..2fc1f0302763 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_2.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_2.sol @@ -43,3 +43,4 @@ contract C { // ---- // Warning 2018: (33-88): Function state mutability can be restricted to view // Warning 6328: (367-381): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_2_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_2_trusted.sol new file mode 100644 index 000000000000..720b202332e3 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_2_trusted.sol @@ -0,0 +1,47 @@ +contract State { + C c; + constructor(C _c) { + c = _c; + } + function f() public view returns (uint) { + return c.g(); + } +} + +contract C { + address owner; + uint y; + uint z; + State s; + bool insidef; + + constructor() { + owner = msg.sender; + s = new State(this); + } + + function zz() public { + require(insidef); + z = 3; + } + + function f() public { + require(!insidef); + address prevOwner = owner; + insidef = true; + s.f(); + assert(z == y); + assert(prevOwner == owner); + insidef = false; + } + + function g() public view returns (uint) { + return y; + } +} +// ==== +// SMTContract: C +// SMTEngine: chc +// SMTExtCalls: trusted +// ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_3.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_3.sol index 8372285ee7c5..80e27e7e2a77 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_3.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_3.sol @@ -41,3 +41,5 @@ contract C { // ==== // SMTEngine: all // SMTIgnoreInv: yes +// ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_indirect_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_indirect_trusted.sol new file mode 100644 index 000000000000..8000b3267d9e --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_indirect_trusted.sol @@ -0,0 +1,56 @@ +contract Other { + C c; + constructor(C _c) { + c = _c; + } + function h() public { + c.setOwner(address(0)); + } +} + +contract State { + uint x; + Other o; + C c; + constructor(C _c) { + c = _c; + o = new Other(_c); + } + function f() public returns (uint) { + o.h(); + return c.g(); + } +} + +contract C { + address owner; + uint y; + State s; + + constructor() { + owner = msg.sender; + s = new State(this); + } + + function setOwner(address _owner) public { + owner = _owner; + } + + function f() public { + address prevOwner = owner; + uint z = s.f(); + assert(z == y); // should hold + assert(prevOwner == owner); // should not hold because of reentrancy + } + + function g() public view returns (uint) { + return y; + } +} +// ==== +// SMTContract: C +// SMTEngine: chc +// SMTExtCalls: trusted +// ---- +// Warning 6328: (531-545): CHC: Assertion violation might happen here. +// Warning 6328: (564-590): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_trusted.sol new file mode 100644 index 000000000000..34df5c0e0fb9 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_trusted.sol @@ -0,0 +1,38 @@ +contract State { + C c; + constructor(C _c) { + c = _c; + } + function f() public view returns (uint) { + return c.g(); + } +} + +contract C { + address owner; + uint y; + State s; + + constructor() { + owner = msg.sender; + s = new State(this); + } + + function f() public view { + address prevOwner = owner; + uint z = s.f(); + assert(z == y); + assert(prevOwner == owner); + } + + function g() public view returns (uint) { + return y; + } +} +// ==== +// SMTContract: C +// SMTEngine: chc +// SMTExtCalls: trusted +// ---- +// Warning 6328: (314-328): CHC: Assertion violation might happen here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_unsafe_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_unsafe_trusted.sol new file mode 100644 index 000000000000..4d179ddf8254 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_reentrancy_unsafe_trusted.sol @@ -0,0 +1,44 @@ +contract State { + C c; + constructor(C _c) { + c = _c; + } + function f() public returns (uint) { + c.setOwner(address(0)); + return c.g(); + } +} + +contract C { + address owner; + uint y; + State s; + + constructor() { + owner = msg.sender; + s = new State(this); + } + + function setOwner(address _owner) public { + owner = _owner; + } + + function f() public { + address prevOwner = owner; + uint z = s.f(); + assert(z == y); // should hold + assert(prevOwner == owner); // should not hold because of reentrancy + } + + function g() public view returns (uint) { + return y; + } +} +// ==== +// SMTContract: C +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreOS: macos +// ---- +// Warning 6328: (396-410): CHC: Assertion violation might happen here. +// Warning 6328: (429-455): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_trusted.sol new file mode 100644 index 000000000000..1c557f7a6ddd --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_trusted.sol @@ -0,0 +1,36 @@ +contract State { + uint x; + function f() public returns (uint) { + if (x == 0) x = 1; + else if (x == 1) x = 2; + else if (x == 2) x = 0; + return x; + } +} + +contract C { + address owner; + uint y; + uint z; + State s; + + constructor() { + s = new State(); + owner = msg.sender; + } + + function f() public { + address prevOwner = owner; + y = s.f(); + z = s.f(); + assert(prevOwner == owner); + assert(y != z); + } +} +// ==== +// SMTContract: C +// SMTEngine: chc +// SMTExtCalls: trusted +// ---- +// Warning 6328: (355-381): CHC: Assertion violation might happen here. +// Warning 6328: (385-399): CHC: Assertion violation might happen here. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_unsafe_trusted.sol b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_unsafe_trusted.sol new file mode 100644 index 000000000000..7d217e145a8b --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/external_hash_known_code_state_unsafe_trusted.sol @@ -0,0 +1,40 @@ +contract State { + uint x; + function f() public returns (uint) { + if (x == 0) x = 1; + else if (x == 1) x = 2; + else if (x == 2) x = 0; + return x; + } +} + +contract C { + address owner; + uint y; + uint z; + State s; + + constructor() { + owner = msg.sender; + s = new State(); + } + + function setOwner(address _owner) public { + owner = _owner; + } + + function f() public { + address prevOwner = owner; + y = s.f(); + z = s.f(); + assert(prevOwner == owner); + assert(y != z); + } +} +// ==== +// SMTContract: C +// SMTEngine: chc +// SMTExtCalls: trusted +// ---- +// Warning 6328: (421-447): CHC: Assertion violation might happen here. +// Warning 6328: (451-465): CHC: Assertion violation might happen here. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_inc1_inc2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_inc1_inc2.sol index 25a93b233a3f..0a874a7824aa 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_inc1_inc2.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_inc1_inc2.sol @@ -27,3 +27,4 @@ contract C { // SMTEngine: all // ---- // Warning 2018: (203-322): Function state mutability can be restricted to view +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_2.sol b/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_2.sol index 19ff2bbad86d..268db82b4632 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_2.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_2.sol @@ -13,4 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (117-131): CHC: Assertion violation happens here.\nCounterexample:\nlocked = false\ntarget = 0x0\n\nTransaction trace:\nC.constructor()\nState: locked = true\nC.call(0x0)\n D(target).e() -- untrusted external call, synthesized as:\n C.call(0x0) -- reentrant call +// Warning 6328: (117-131): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_3.sol b/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_3.sol index 590133a7846b..cfe12434c3ea 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_3.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_3.sol @@ -32,3 +32,4 @@ contract C is A { // SMTIgnoreOS: macos // ---- // Warning 6328: (154-168): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_crypto.sol b/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_crypto.sol index ba9d4ce04329..2cac5443b284 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_crypto.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_crypto.sol @@ -25,7 +25,8 @@ contract C { } // ==== // SMTEngine: all -// SMTIgnoreInv: yes // SMTIgnoreCex: yes +// SMTIgnoreInv: yes // ---- // Warning 6328: (302-333): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/external_safe.sol b/test/libsolidity/smtCheckerTests/external_calls/external_safe.sol index b50185449b78..593aba289ca3 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/external_safe.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/external_safe.sol @@ -18,3 +18,4 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/mutex.sol b/test/libsolidity/smtCheckerTests/external_calls/mutex.sol index 79b5ac15381e..ffe23ae8dde7 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/mutex.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/mutex.sol @@ -28,3 +28,4 @@ contract C { // SMTEngine: all // SMTIgnoreInv: yes // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/staticcall_mutex.sol b/test/libsolidity/smtCheckerTests/external_calls/staticcall_mutex.sol index b7fa571972ad..54b0d36fb2d1 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/staticcall_mutex.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/staticcall_mutex.sol @@ -23,4 +23,4 @@ contract C { // SMTEngine: all // ---- // Warning 9302: (218-240): Return value of low-level calls not used. -// Info 1180: Reentrancy property(ies) for :C:\n((!lock || ( <= 0)) && (lock' || !lock))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(y == x)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/staticcall_mutex_2.sol b/test/libsolidity/smtCheckerTests/external_calls/staticcall_mutex_2.sol index f87cf5f74320..19b5e54618e8 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/staticcall_mutex_2.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/staticcall_mutex_2.sol @@ -24,4 +24,4 @@ contract C { // ---- // Warning 9302: (212-234): Return value of low-level calls not used. // Warning 2018: (164-271): Function state mutability can be restricted to view -// Info 1180: Reentrancy property(ies) for :C:\n( <= 0)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(y == x)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/staticcall_reentrancy_view.sol b/test/libsolidity/smtCheckerTests/external_calls/staticcall_reentrancy_view.sol index ee9e571890d6..70a817315d03 100644 --- a/test/libsolidity/smtCheckerTests/external_calls/staticcall_reentrancy_view.sol +++ b/test/libsolidity/smtCheckerTests/external_calls/staticcall_reentrancy_view.sol @@ -15,4 +15,4 @@ contract C { // Warning 2072: (106-112): Unused local variable. // Warning 2072: (114-131): Unused local variable. // Warning 2018: (72-188): Function state mutability can be restricted to view -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\nReentrancy property(ies) for :C:\n((!(x <= 0) || (x' <= 0)) && (!(x <= 0) || ( <= 0)))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(x == 0)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/token_trusted_transfer_correct.sol b/test/libsolidity/smtCheckerTests/external_calls/token_trusted_transfer_correct.sol new file mode 100644 index 000000000000..f9f65bb7bdf5 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/token_trusted_transfer_correct.sol @@ -0,0 +1,66 @@ +interface Token { + function balanceOf(address _a) external view returns (uint); + function transfer(address _to, uint _amt) external; +} + +contract TokenCorrect is Token { + mapping (address => uint) balance; + constructor(address _a, uint _b) { + balance[_a] = _b; + } + function balanceOf(address _a) public view override returns (uint) { + return balance[_a]; + } + function transfer(address _to, uint _amt) public override { + require(balance[msg.sender] >= _amt); + balance[msg.sender] -= _amt; + balance[_to] += _amt; + } +} + +contract Test { + function property_transfer(address _token, address _to, uint _amt) public { + require(_to != address(this)); + + TokenCorrect t = TokenCorrect(_token); + + uint xPre = t.balanceOf(address(this)); + require(xPre >= _amt); + uint yPre = t.balanceOf(_to); + + t.transfer(_to, _amt); + uint xPost = t.balanceOf(address(this)); + uint yPost = t.balanceOf(_to); + + assert(xPost == xPre - _amt); + assert(yPost == yPre + _amt); + } + + function test_concrete() public { + TokenCorrect t = new TokenCorrect(address(this), 1000); + + uint b = t.balanceOf(address(this)); + assert(b == 1000); + + address other = address(0x333); + require(address(this) != other); + + uint c = t.balanceOf(other); + assert(c == 0); + + t.transfer(other, 100); + + uint d = t.balanceOf(address(this)); + assert(d == 900); + + uint e = t.balanceOf(other); + assert(e == 100); + } +} +// ==== +// SMTContract: Test +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/external_calls/token_trusted_transfer_wrong.sol b/test/libsolidity/smtCheckerTests/external_calls/token_trusted_transfer_wrong.sol new file mode 100644 index 000000000000..2aee3c8d3283 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/external_calls/token_trusted_transfer_wrong.sol @@ -0,0 +1,69 @@ +interface Token { + function balanceOf(address _a) external view returns (uint); + function transfer(address _to, uint _amt) external; +} + +contract TokenWrong is Token { + mapping (address => uint) balance; + constructor(address _a, uint _b) { + balance[_a] = _b; + } + function balanceOf(address _a) public view override returns (uint) { + return balance[_a]; + } + function transfer(address _to, uint _amt) public override { + require(balance[msg.sender] >= _amt); + // Commented out to make this token implementation wrong. + //balance[msg.sender] -= _amt; + balance[_to] += _amt; + } +} + +contract Test { + function property_transfer(address _token, address _to, uint _amt) public { + require(_to != address(this)); + + TokenWrong t = TokenWrong(_token); + + uint xPre = t.balanceOf(address(this)); + require(xPre >= _amt); + uint yPre = t.balanceOf(_to); + + t.transfer(_to, _amt); + uint xPost = t.balanceOf(address(this)); + uint yPost = t.balanceOf(_to); + + assert(xPost == xPre - _amt); // should fail + assert(yPost == yPre + _amt); + } + + function test_concrete() public { + TokenWrong t = new TokenWrong(address(this), 1000); + + uint b = t.balanceOf(address(this)); + assert(b == 1000); + + address other = address(0x333); + require(address(this) != other); + + uint c = t.balanceOf(other); + assert(c == 0); + + t.transfer(other, 100); + + uint d = t.balanceOf(address(this)); + assert(d == 900); // should fail + + uint e = t.balanceOf(other); + assert(e == 100); + } +} +// ==== +// SMTContract: Test +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (950-978): CHC: Assertion violation happens here. +// Warning 6328: (1370-1386): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/constant_string_at_file_level.sol b/test/libsolidity/smtCheckerTests/file_level/constant_string_at_file_level.sol index fe2ebfdde366..55120bcb4aaa 100644 --- a/test/libsolidity/smtCheckerTests/file_level/constant_string_at_file_level.sol +++ b/test/libsolidity/smtCheckerTests/file_level/constant_string_at_file_level.sol @@ -38,4 +38,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (968-983): CHC: Assertion violation happens here.\nCounterexample:\n\nw = 56\nz = 1\nt = 0x61626300ff5f5f00000000000000000000000000000000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n C.g() -- internal call\n C.h() -- internal call\n C.i() -- internal call +// Warning 6328: (968-983): CHC: Assertion violation happens here. +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/constants_at_file_level_referencing.sol b/test/libsolidity/smtCheckerTests/file_level/constants_at_file_level_referencing.sol index ad86ff26d128..c7be224866b2 100644 --- a/test/libsolidity/smtCheckerTests/file_level/constants_at_file_level_referencing.sol +++ b/test/libsolidity/smtCheckerTests/file_level/constants_at_file_level_referencing.sol @@ -63,3 +63,4 @@ contract C { // Warning 6328: (s2.sol:704-725): CHC: Assertion violation happens here. // Warning 6328: (s2.sol:890-911): CHC: Assertion violation happens here. // Warning 6328: (s2.sol:980-994): CHC: Assertion violation happens here. +// Info 1391: CHC: 24 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/easy.sol b/test/libsolidity/smtCheckerTests/file_level/easy.sol index 43ddb076cc7b..07ad9f0793e0 100644 --- a/test/libsolidity/smtCheckerTests/file_level/easy.sol +++ b/test/libsolidity/smtCheckerTests/file_level/easy.sol @@ -14,4 +14,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (222-239): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.g()\n C.f(7) -- internal call\n add(7, 2) -- internal call\n C.f(8) -- internal call\n add(8, 2) -- internal call +// Warning 6328: (222-239): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/enum.sol b/test/libsolidity/smtCheckerTests/file_level/enum.sol index 81525b029e5c..0cefa021a7cd 100644 --- a/test/libsolidity/smtCheckerTests/file_level/enum.sol +++ b/test/libsolidity/smtCheckerTests/file_level/enum.sol @@ -20,4 +20,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (247-267): CHC: Assertion violation happens here.\nCounterexample:\n\ne1 = 0\ne2 = 1\n\nTransaction trace:\nC.constructor()\nC.f()\n allocate(true) -- internal call\n allocate(false) -- internal call +// Warning 6328: (247-267): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/file_level_call_via_module.sol b/test/libsolidity/smtCheckerTests/file_level/file_level_call_via_module.sol index 0297428c6dd1..95468f129d98 100644 --- a/test/libsolidity/smtCheckerTests/file_level/file_level_call_via_module.sol +++ b/test/libsolidity/smtCheckerTests/file_level/file_level_call_via_module.sol @@ -18,5 +18,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (b.sol:208-222): CHC: Assertion violation happens here.\nCounterexample:\n\na = 7\nb = 3\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n a.sol:f(2) -- internal call\n a.sol:f([0x61, 0x62, 0x63]) -- internal call -// Warning 6328: (b.sol:274-288): CHC: Assertion violation happens here.\nCounterexample:\n\na = 7\nb = 3\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n a.sol:f(2) -- internal call\n a.sol:f([0x61, 0x62, 0x63]) -- internal call +// Warning 6328: (b.sol:208-222): CHC: Assertion violation happens here. +// Warning 6328: (b.sol:274-288): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/free_namesake_contract_function.sol b/test/libsolidity/smtCheckerTests/file_level/free_namesake_contract_function.sol index 32b7e17169d4..3119fd1c84c7 100644 --- a/test/libsolidity/smtCheckerTests/file_level/free_namesake_contract_function.sol +++ b/test/libsolidity/smtCheckerTests/file_level/free_namesake_contract_function.sol @@ -11,4 +11,5 @@ contract C { // SMTEngine: all // ---- // Warning 2519: (170-226): This declaration shadows an existing declaration. -// Warning 6328: (130-149): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.g()\n C.f() -- internal call\n C.f() -- internal call +// Warning 6328: (130-149): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/import.sol b/test/libsolidity/smtCheckerTests/file_level/import.sol index 7bc2a54451c0..445953637f7e 100644 --- a/test/libsolidity/smtCheckerTests/file_level/import.sol +++ b/test/libsolidity/smtCheckerTests/file_level/import.sol @@ -25,3 +25,4 @@ contract C { // ---- // Warning 6328: (B:238-252): CHC: Assertion violation happens here. // Warning 6328: (B:308-322): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/module_constants_1.sol b/test/libsolidity/smtCheckerTests/file_level/module_constants_1.sol index 5993f5e94e49..45109a6fef30 100644 --- a/test/libsolidity/smtCheckerTests/file_level/module_constants_1.sol +++ b/test/libsolidity/smtCheckerTests/file_level/module_constants_1.sol @@ -22,5 +22,6 @@ contract C { // ==== // SMTEngine: chc // ---- -// Warning 6328: (s3.sol:223-238): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 89\ny = 88\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call -// Warning 6328: (s3.sol:291-306): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 89\ny = 88\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call +// Warning 6328: (s3.sol:223-238): CHC: Assertion violation happens here. +// Warning 6328: (s3.sol:291-306): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/module_constants_functions_1.sol b/test/libsolidity/smtCheckerTests/file_level/module_constants_functions_1.sol index d3b0e4c6bd84..27527ab8e139 100644 --- a/test/libsolidity/smtCheckerTests/file_level/module_constants_functions_1.sol +++ b/test/libsolidity/smtCheckerTests/file_level/module_constants_functions_1.sol @@ -40,7 +40,8 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (s3.sol:327-342): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 13\ny = 89\nz = 42\nt = 89\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n s1.sol:fre() -- internal call\n s2.sol:foo() -- internal call -// Warning 6328: (s3.sol:396-411): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 13\ny = 89\nz = 42\nt = 89\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n s1.sol:fre() -- internal call\n s2.sol:foo() -- internal call -// Warning 6328: (s3.sol:465-480): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 13\ny = 89\nz = 42\nt = 89\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n s1.sol:fre() -- internal call\n s2.sol:foo() -- internal call -// Warning 6328: (s3.sol:534-549): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 13\ny = 89\nz = 42\nt = 89\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n s1.sol:fre() -- internal call\n s2.sol:foo() -- internal call +// Warning 6328: (s3.sol:327-342): CHC: Assertion violation happens here. +// Warning 6328: (s3.sol:396-411): CHC: Assertion violation happens here. +// Warning 6328: (s3.sol:465-480): CHC: Assertion violation happens here. +// Warning 6328: (s3.sol:534-549): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/new_operator.sol b/test/libsolidity/smtCheckerTests/file_level/new_operator.sol index 8a0f118ae7c1..925f53bc9c01 100644 --- a/test/libsolidity/smtCheckerTests/file_level/new_operator.sol +++ b/test/libsolidity/smtCheckerTests/file_level/new_operator.sol @@ -14,5 +14,5 @@ contract D { // ==== // SMTEngine: all // ---- -// Warning 4588: (78-85): Assertion checker does not yet implement this type of function call. +// Warning 8729: (78-85): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. // Warning 6328: (133-152): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f()\n test() -- internal call\n (new C()).x() -- untrusted external call diff --git a/test/libsolidity/smtCheckerTests/file_level/overloads.sol b/test/libsolidity/smtCheckerTests/file_level/overloads.sol index 7224464b4f72..b645705595a6 100644 --- a/test/libsolidity/smtCheckerTests/file_level/overloads.sol +++ b/test/libsolidity/smtCheckerTests/file_level/overloads.sol @@ -15,4 +15,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (229-243): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\ny = 3\n\nTransaction trace:\nC.constructor()\nC.g()\n f(2) -- internal call\n f([0x61, 0x62, 0x63]) -- internal call +// Warning 6328: (229-243): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/same_constants_different_files.sol b/test/libsolidity/smtCheckerTests/file_level/same_constants_different_files.sol index 948baf1985c8..7a8bcc0aabcd 100644 --- a/test/libsolidity/smtCheckerTests/file_level/same_constants_different_files.sol +++ b/test/libsolidity/smtCheckerTests/file_level/same_constants_different_files.sol @@ -29,3 +29,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/file_level/struct.sol b/test/libsolidity/smtCheckerTests/file_level/struct.sol index b9b811e6830a..664e1ac5fee4 100644 --- a/test/libsolidity/smtCheckerTests/file_level/struct.sol +++ b/test/libsolidity/smtCheckerTests/file_level/struct.sol @@ -23,5 +23,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (317-333): CHC: Assertion violation happens here.\nCounterexample:\n\ns = {x: 2, a: [1]}\n\nTransaction trace:\nC.constructor()\nC.f()\n allocate(2, 1) -- internal call -// Warning 6328: (352-371): CHC: Assertion violation happens here.\nCounterexample:\n\ns = {x: 2, a: [1]}\n\nTransaction trace:\nC.constructor()\nC.f()\n allocate(2, 1) -- internal call +// Warning 6328: (317-333): CHC: Assertion violation happens here. +// Warning 6328: (352-371): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/function_selector/function_types_sig.sol b/test/libsolidity/smtCheckerTests/function_selector/function_types_sig.sol index 54199e89c8b3..45910c66629d 100644 --- a/test/libsolidity/smtCheckerTests/function_selector/function_types_sig.sol +++ b/test/libsolidity/smtCheckerTests/function_selector/function_types_sig.sol @@ -25,5 +25,6 @@ contract C { // SMTEngine: all // ---- // Warning 7650: (251-263): Assertion checker does not yet support this expression. -// Warning 6328: (437-462): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.check()\n C.f() -- internal call\n C.g() -- internal call -// Warning 6328: (507-532): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.check()\n C.f() -- internal call\n C.g() -- internal call\n C.i() -- internal call\n C.i() -- internal call +// Warning 6328: (437-462): CHC: Assertion violation happens here. +// Warning 6328: (507-532): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/function_selector/homer.sol b/test/libsolidity/smtCheckerTests/function_selector/homer.sol index 552a4d895cd2..f4536e5bf0eb 100644 --- a/test/libsolidity/smtCheckerTests/function_selector/homer.sol +++ b/test/libsolidity/smtCheckerTests/function_selector/homer.sol @@ -43,4 +43,5 @@ contract Homer is ERC165, Simpson { // ==== // SMTEngine: all // ---- -// Warning 6328: (1340-1395): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nHomer.constructor()\nHomer.check()\n Homer.supportsInterface(0x73b6b492) -- internal call\n Homer.supportsInterface(0x01ffc9a7) -- internal call\n Homer.supportsInterface(0x8b9eb9ca) -- internal call +// Warning 6328: (1340-1395): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/function_selector/selector.sol b/test/libsolidity/smtCheckerTests/function_selector/selector.sol index fdcd3f85e8f2..486f48c45a28 100644 --- a/test/libsolidity/smtCheckerTests/function_selector/selector.sol +++ b/test/libsolidity/smtCheckerTests/function_selector/selector.sol @@ -6,3 +6,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/function_selector/selector_3.sol b/test/libsolidity/smtCheckerTests/function_selector/selector_3.sol index 7d2da3c572b9..c4dd67e17915 100644 --- a/test/libsolidity/smtCheckerTests/function_selector/selector_3.sol +++ b/test/libsolidity/smtCheckerTests/function_selector/selector_3.sol @@ -11,4 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (142-184): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, y = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, y = 0\nC.f() +// Warning 6328: (142-184): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy.sol index 5e191776130e..d95dbdce93a8 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy.sol @@ -14,4 +14,5 @@ contract A is C { // ==== // SMTEngine: all // ---- -// Warning 6328: (120-134): CHC: Assertion violation happens here.\nCounterexample:\na = 2\n\nTransaction trace:\nA.constructor() +// Warning 6328: (120-134): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_2.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_2.sol index c10ec05bffec..62d9c83ec5e0 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_2.sol @@ -5,4 +5,5 @@ contract J is C { constructor() C(3) { assert(a == 4); } } // ==== // SMTEngine: all // ---- -// Warning 6328: (211-225): CHC: Assertion violation happens here.\nCounterexample:\na = 3\n\nTransaction trace:\nJ.constructor() +// Warning 6328: (211-225): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol index 84fdaf87d458..9e79ebfbb673 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_3.sol @@ -23,3 +23,4 @@ contract A is B { // ---- // Warning 4984: (171-176): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (200-218): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol index b7cacc0f62a0..3cefaa78af42 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_4.sol @@ -19,5 +19,6 @@ contract A is B { // ==== // SMTEngine: all // ---- -// Warning 4984: (166-171): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\na = 0\nx = 115792089237316195423570985008687907853269984665640564039457584007913129639934\n\nTransaction trace:\nA.constructor(115792089237316195423570985008687907853269984665640564039457584007913129639934) -// Warning 4984: (175-180): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\na = 0\nx = 115792089237316195423570985008687907853269984665640564039457584007913129639935\n\nTransaction trace:\nA.constructor(115792089237316195423570985008687907853269984665640564039457584007913129639935) +// Warning 4984: (166-171): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Warning 4984: (175-180): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol index 55b17509e9fe..44ccc2b74e7b 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond.sol @@ -29,3 +29,4 @@ contract A is B2, B1 { // ---- // Warning 4984: (168-173): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (270-288): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol index 878612d041a2..d826bc38792e 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_2.sol @@ -29,3 +29,4 @@ contract A is B2, B1 { // ---- // Warning 4984: (168-173): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (270-288): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol index 6a2b07919980..593a2ae7d145 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_3.sol @@ -32,3 +32,4 @@ contract A is B2, B1 { // Warning 4984: (193-198): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 4984: (209-214): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (302-318): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle.sol index ef24859eec78..bf1c0ee604de 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle.sol @@ -21,4 +21,5 @@ contract A is B, B2 { // SMTEngine: all // ---- // Warning 5667: (132-138): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (162-176): CHC: Assertion violation happens here.\nCounterexample:\na = 2\nx = 0\n\nTransaction trace:\nA.constructor(0) +// Warning 6328: (162-176): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle_empty_base.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle_empty_base.sol index 9aeb14a770c6..57a0f40d7bd0 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle_empty_base.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_diamond_empty_middle_empty_base.sol @@ -19,3 +19,4 @@ contract A is B, B2 { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_chain.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_chain.sol index cd5308ded774..113e80dab24c 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_chain.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_chain.sol @@ -20,4 +20,5 @@ contract A is B { // SMTEngine: all // ---- // Warning 5667: (162-168): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (192-206): CHC: Assertion violation happens here.\nCounterexample:\na = 2\nx = 0\n\nTransaction trace:\nA.constructor(0) +// Warning 6328: (192-206): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_middle.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_middle.sol index 00a74d5057ed..8c6ca28e3715 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_middle.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_empty_middle.sol @@ -18,4 +18,5 @@ contract A is B { // SMTEngine: all // ---- // Warning 5667: (106-112): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (140-154): CHC: Assertion violation happens here.\nCounterexample:\na = 2\nx = 0\n\nTransaction trace:\nA.constructor(0) +// Warning 6328: (140-154): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain.sol index c2b6c1a271fb..75d5efb42ce3 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain.sol @@ -28,4 +28,5 @@ contract A is B { // SMTEngine: all // ---- // Warning 5667: (222-228): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (252-266): CHC: Assertion violation happens here.\nCounterexample:\na = 4\nx = 0\n\nTransaction trace:\nA.constructor(0) +// Warning 6328: (252-266): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_empty_base.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_empty_base.sol index 531266d72b27..4eac4fe97904 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_empty_base.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_empty_base.sol @@ -24,3 +24,4 @@ contract A is B { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_local_vars.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_local_vars.sol index 50a91a7e0e8c..ea1f31aad531 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_local_vars.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_local_vars.sol @@ -33,4 +33,5 @@ contract A is B { // SMTEngine: all // ---- // Warning 5667: (264-270): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (325-340): CHC: Assertion violation happens here.\nCounterexample:\na = 4\nx = 0\na1 = 4\na2 = 5\n\nTransaction trace:\nA.constructor(0) +// Warning 6328: (325-340): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol index 15cc66a0d6a6..2d49cd1e3871 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params.sol @@ -29,3 +29,4 @@ contract A is B { // ---- // Warning 4984: (215-220): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (296-310): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol index 933762ac809f..383392c632c6 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_hierarchy_mixed_chain_with_params_2.sol @@ -24,4 +24,5 @@ contract A is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (234-248): CHC: Assertion violation happens here.\nCounterexample:\na = 3\n\nTransaction trace:\nB.constructor() +// Warning 6328: (234-248): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_simple.sol b/test/libsolidity/smtCheckerTests/functions/constructor_simple.sol index 2db9622ea47c..ef0a5467823e 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_simple.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_simple.sol @@ -15,3 +15,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (108-122): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_state_value.sol b/test/libsolidity/smtCheckerTests/functions/constructor_state_value.sol index 48819f839fd1..1726c89fe895 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_state_value.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_state_value.sol @@ -15,3 +15,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (112-126): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_state_value_inherited.sol b/test/libsolidity/smtCheckerTests/functions/constructor_state_value_inherited.sol index 165dc6ae6e42..1fc6e011f0d3 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_state_value_inherited.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_state_value_inherited.sol @@ -17,3 +17,4 @@ contract C is B { // SMTIgnoreCex: yes // ---- // Warning 6328: (132-146): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/constructor_state_value_parameter.sol b/test/libsolidity/smtCheckerTests/functions/constructor_state_value_parameter.sol index 8fd9bf9a21eb..008338ba81a7 100644 --- a/test/libsolidity/smtCheckerTests/functions/constructor_state_value_parameter.sol +++ b/test/libsolidity/smtCheckerTests/functions/constructor_state_value_parameter.sol @@ -16,3 +16,4 @@ contract C { // ---- // Warning 4984: (82-87): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (129-143): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/function_call_does_not_clear_local_vars.sol b/test/libsolidity/smtCheckerTests/functions/function_call_does_not_clear_local_vars.sol index 7fd4fcff1ea7..32b51d53f9c1 100644 --- a/test/libsolidity/smtCheckerTests/functions/function_call_does_not_clear_local_vars.sol +++ b/test/libsolidity/smtCheckerTests/functions/function_call_does_not_clear_local_vars.sol @@ -11,3 +11,4 @@ contract C { // SMTEngine: all // ---- // Warning 5740: (122-136): Unreachable code. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/function_inline_chain.sol b/test/libsolidity/smtCheckerTests/functions/function_inline_chain.sol index 252ac146ea99..47ace2a9d398 100644 --- a/test/libsolidity/smtCheckerTests/functions/function_inline_chain.sol +++ b/test/libsolidity/smtCheckerTests/functions/function_inline_chain.sol @@ -21,3 +21,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var.sol b/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var.sol index 55d9084676ae..bd74fe1b5215 100644 --- a/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var.sol +++ b/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var.sol @@ -16,4 +16,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (176-190): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\nb = true\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g(true)\n C.f() -- internal call +// Warning 6328: (176-190): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_2.sol b/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_2.sol index 15b46a9ab841..3f45d8b58c8c 100644 --- a/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_2.sol @@ -17,3 +17,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_3.sol b/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_3.sol index 7b7118b93ade..0795c832e775 100644 --- a/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/function_inside_branch_modify_state_var_3.sol @@ -24,5 +24,6 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (176-190): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\nb = true\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g(true)\n C.f() -- internal call -// Warning 6328: (288-302): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\nb = false\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.h(false)\n C.f() -- internal call +// Warning 6328: (176-190): CHC: Assertion violation happens here. +// Warning 6328: (288-302): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_attached_1.sol b/test/libsolidity/smtCheckerTests/functions/functions_attached_1.sol index 6e094b13e478..0a646d0e5923 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_attached_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_attached_1.sol @@ -18,3 +18,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_attached_1_fail.sol b/test/libsolidity/smtCheckerTests/functions/functions_attached_1_fail.sol index 8b6bb58f0168..e739aa57c376 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_attached_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_attached_1_fail.sol @@ -18,4 +18,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (228-244): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\ny = 1000\n\nTransaction trace:\nC.constructor()\nC.f(1)\n L.add(1, 999) -- internal call +// Warning 6328: (228-244): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_external_1.sol b/test/libsolidity/smtCheckerTests/functions/functions_external_1.sol index 3a87f34c9d1d..56090df24cfb 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_external_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_external_1.sol @@ -16,5 +16,7 @@ contract C } // ==== // SMTEngine: all -// SMTIgnoreOS: macos // SMTIgnoreInv: yes +// SMTIgnoreOS: macos +// ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_external_2.sol b/test/libsolidity/smtCheckerTests/functions/functions_external_2.sol index 5efcb2da1b9d..d3373b62d63a 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_external_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_external_2.sol @@ -25,4 +25,4 @@ contract C // SMTIgnoreOS: macos // ---- // Warning 6328: (234-253): CHC: Assertion violation happens here. -// Info 1180: Reentrancy property(ies) for :C:\n!( = 1)\n((!((map[1] + ((- 1) * map[0])) <= 0) || ((map'[1] + ((- 1) * map'[0])) <= 0)) && !( = 2) && (!((map[1] + ((- 1) * map[0])) >= 0) || ((map'[0] + ((- 1) * map'[1])) <= 0)))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(map[0] == map[1])\n = 2 -> Assertion failed at assert(map[0] == map[1])\n = 3 -> Assertion failed at assert(map[0] == 0)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_external_3.sol b/test/libsolidity/smtCheckerTests/functions/functions_external_3.sol index d83970977b48..6f80e1e0af02 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_external_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_external_3.sol @@ -18,4 +18,4 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Reentrancy property(ies) for :C:\n!( >= 2)\n( <= 0)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(map[0] == map[1])\n = 2 -> Assertion failed at assert(map[0] == map[1])\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_identifier_nested_tuple_1.sol b/test/libsolidity/smtCheckerTests/functions/functions_identifier_nested_tuple_1.sol index fb3228aca9d2..bddefceb9155 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_identifier_nested_tuple_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_identifier_nested_tuple_1.sol @@ -14,4 +14,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n((x = 0) || (x = 1))\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_identifier_nested_tuple_2.sol b/test/libsolidity/smtCheckerTests/functions/functions_identifier_nested_tuple_2.sol index 898dceceeeab..8e491d8dbf3b 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_identifier_nested_tuple_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_identifier_nested_tuple_2.sol @@ -19,3 +19,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_identity_1.sol b/test/libsolidity/smtCheckerTests/functions/functions_identity_1.sol index be3cf4f041b7..5bf37f0815cd 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_identity_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_identity_1.sol @@ -13,3 +13,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_identity_2.sol b/test/libsolidity/smtCheckerTests/functions/functions_identity_2.sol index 604f3b275c0f..1ecdd5c8b87d 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_identity_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_identity_2.sol @@ -17,3 +17,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_identity_as_tuple.sol b/test/libsolidity/smtCheckerTests/functions/functions_identity_as_tuple.sol index c139a2a66cd0..4c9885ff6e34 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_identity_as_tuple.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_identity_as_tuple.sol @@ -13,3 +13,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol b/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol index b35ec1d7155e..a6c1539f56ef 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol @@ -17,3 +17,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol b/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol index f69d47baf59e..843679a52b8c 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol @@ -17,4 +17,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (212-228): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\ny = 1000\n\nTransaction trace:\nC.constructor()\nC.f(1)\n L.add(1, 999) -- internal call +// Warning 6328: (212-228): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_recursive.sol b/test/libsolidity/smtCheckerTests/functions/functions_recursive.sol index e6cb394b50b9..4f664fb04102 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_recursive.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_recursive.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_recursive_indirect.sol b/test/libsolidity/smtCheckerTests/functions/functions_recursive_indirect.sol index 530b469009e0..903afbbcd1a3 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_recursive_indirect.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_recursive_indirect.sol @@ -23,4 +23,4 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(a <= 0)\n +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_storage_var_1.sol b/test/libsolidity/smtCheckerTests/functions/functions_storage_var_1.sol index 084df11c9285..b7148bc7305b 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_storage_var_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_storage_var_1.sol @@ -14,3 +14,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_storage_var_2.sol b/test/libsolidity/smtCheckerTests/functions/functions_storage_var_2.sol index 606061564905..5bfb5dcc8e71 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_storage_var_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_storage_var_2.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/address.sol b/test/libsolidity/smtCheckerTests/functions/getters/address.sol index 92bb2761d551..cf8c9158308e 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/address.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/address.sol @@ -14,5 +14,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (171-197): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0, y = 0x0\na = 0x0\nb = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0, y = 0x0\nC.f() -// Warning 6328: (249-275): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0, y = 0x0\na = 0x0\nb = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0, y = 0x0\nC.f() +// Warning 6328: (171-197): CHC: Assertion violation happens here. +// Warning 6328: (249-275): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/array_1.sol b/test/libsolidity/smtCheckerTests/functions/getters/array_1.sol index d44d15f284fe..658e0b859c53 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/array_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/array_1.sol @@ -17,4 +17,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (187-201): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n!(a.length <= 2)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/array_2.sol b/test/libsolidity/smtCheckerTests/functions/getters/array_2.sol index ebc7877f0a22..3c9fc7eb8050 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/array_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/array_2.sol @@ -20,4 +20,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (242-256): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n!(a.length <= 2)\n!(a[2].length <= 3)\n +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_1.sol b/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_1.sol index 5038294ed56a..209b00f5f319 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_1.sol @@ -15,4 +15,4 @@ contract D { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :D:\n(items[1][2][3].y <= 0)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_2.sol b/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_2.sol index 6c7b0a1b3781..36ea9da2fe07 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_2.sol @@ -19,4 +19,5 @@ contract D { // ==== // SMTEngine: all // ---- -// Warning 6328: (267-281): CHC: Assertion violation happens here.\nCounterexample:\nitems = [{x: 42, y: 43}]\na = 42\nb = 43\n\nTransaction trace:\nD.constructor()\nState: items = []\nD.test() +// Warning 6328: (267-281): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_3.sol b/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_3.sol index d089d2edae7f..abe50e8a5445 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/array_of_structs_3.sol @@ -21,4 +21,5 @@ contract D { // ==== // SMTEngine: all // ---- -// Warning 6328: (322-336): CHC: Assertion violation happens here.\nCounterexample:\nitems = [{x: 42, y: 43, arr: [0]}]\ntmp = [0]\na = 42\nb = 43\n\nTransaction trace:\nD.constructor()\nState: items = []\nD.test() +// Warning 6328: (322-336): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/bytes.sol b/test/libsolidity/smtCheckerTests/functions/getters/bytes.sol index ec0531a4fbfe..63522d6106f2 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/bytes.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/bytes.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (162-201): CHC: Assertion violation happens here.\nCounterexample:\nstr2 = [0x63]\na2 = [0x63]\n\nTransaction trace:\nC.constructor()\nState: str2 = [0x63]\nC.f() +// Warning 6328: (162-201): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/contract.sol b/test/libsolidity/smtCheckerTests/functions/getters/contract.sol index a9d6982ef27a..7da893bd3644 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/contract.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/contract.sol @@ -12,4 +12,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (123-158): CHC: Assertion violation happens here.\nCounterexample:\nd = 0\ne = 0\n\nTransaction trace:\nC.constructor()\nState: d = 0\nC.f() +// Warning 6328: (123-158): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/double_access.sol b/test/libsolidity/smtCheckerTests/functions/getters/double_access.sol index e90cc2cfdee4..844773ba5398 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/double_access.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/double_access.sol @@ -16,4 +16,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (193-207): CHC: Assertion violation happens here.\nCounterexample:\ns = {u: 0}\nu = 0\nv = 0\n\nTransaction trace:\nC.constructor()\nState: s = {u: 0}\nC.f() +// Warning 6328: (193-207): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/enum.sol b/test/libsolidity/smtCheckerTests/functions/getters/enum.sol index 66df04474743..fabe444506ba 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/enum.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/enum.sol @@ -12,4 +12,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (210-245): CHC: Assertion violation happens here.\nCounterexample:\nchoice = 0\ne = 0\n\nTransaction trace:\nC.constructor()\nState: choice = 0\nC.f() +// Warning 6328: (210-245): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/external_getter_1.sol b/test/libsolidity/smtCheckerTests/functions/getters/external_getter_1.sol new file mode 100644 index 000000000000..31397eedf385 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/functions/getters/external_getter_1.sol @@ -0,0 +1,23 @@ +contract D { + uint public d; + function g() public { + ++d; + } +} + +contract C { + function f() public { + D a = new D(); + assert(a.d() == 0); // should hold + a.g(); + assert(a.d() == 1); // should hold + assert(a.d() == 0); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (203-221): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/external_getter_2.sol b/test/libsolidity/smtCheckerTests/functions/getters/external_getter_2.sol new file mode 100644 index 000000000000..ad8ddcd022c5 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/functions/getters/external_getter_2.sol @@ -0,0 +1,34 @@ +contract E { + uint public e; + function setE(uint _e) public { + e = _e; + } +} + +contract D { + E e; + constructor(E _e) { + e = _e; + } + function setE(uint x) public { + e.setE(x); + } +} + +contract C { + function f() public { + E e = new E(); + D d = new D(e); + assert(e.e() == 0); // should hold + d.setE(42); + assert(e.e() == 42); // should hold + assert(e.e() == 2); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTTargets: assert +// ---- +// Warning 6328: (344-362): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/external_getter_this_1.sol b/test/libsolidity/smtCheckerTests/functions/getters/external_getter_this_1.sol new file mode 100644 index 000000000000..f23af4f3261d --- /dev/null +++ b/test/libsolidity/smtCheckerTests/functions/getters/external_getter_this_1.sol @@ -0,0 +1,19 @@ +contract C { + uint public x; + + function f() public { + x = 2; + x = 3; + uint y = this.x(); + assert(y == 3); // should hold + assert(y == 2); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// SMTTargets: assert +// ---- +// Warning 6328: (127-141): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/external_getter_this_2.sol b/test/libsolidity/smtCheckerTests/functions/getters/external_getter_this_2.sol new file mode 100644 index 000000000000..0673b14ab0a5 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/functions/getters/external_getter_this_2.sol @@ -0,0 +1,20 @@ +contract C { + uint public x; + + function f() public { + x = 2; + x = 3; + C c = this; + uint y = c.x(); + assert(y == 3); // should hold + assert(y == 2); // should fail + } +} +// ==== +// SMTEngine: chc +// SMTExtCalls: trusted +// SMTIgnoreCex: yes +// SMTTargets: assert +// ---- +// Warning 6328: (138-152): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/fixed_bytes.sol b/test/libsolidity/smtCheckerTests/functions/getters/fixed_bytes.sol index ac47ded035bd..6edf2a88c48a 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/fixed_bytes.sol @@ -14,5 +14,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (159-175): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0, y = 0x0\na = 0x0\nb = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0, y = 0x0\nC.f() -// Warning 6328: (227-245): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0, y = 0x0\na = 0x0\nb = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0, y = 0x0\nC.f() +// Warning 6328: (159-175): CHC: Assertion violation happens here. +// Warning 6328: (227-245): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/mapping_1.sol b/test/libsolidity/smtCheckerTests/functions/getters/mapping_1.sol index 6e133fedada4..1077c2ee23e3 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/mapping_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/mapping_1.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (142-156): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (142-156): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/mapping_2.sol b/test/libsolidity/smtCheckerTests/functions/getters/mapping_2.sol index 814a0a2ad2e2..c97084164f1d 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/mapping_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/mapping_2.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (166-180): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (166-180): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/mapping_with_cast.sol b/test/libsolidity/smtCheckerTests/functions/getters/mapping_with_cast.sol index a64a52c34605..b78f44d5c755 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/mapping_with_cast.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/mapping_with_cast.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (147-161): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (147-161): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_1.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_1.sol index 30907bd67310..6e221e6547a0 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_1.sol @@ -16,5 +16,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (210-224): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 42\n\nTransaction trace:\nC.constructor()\nC.f() -// Info 1180: Contract invariant(s) for :C:\n!(m[0].length <= 1)\n +// Warning 6328: (210-224): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_10.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_10.sol index 56032d9d5f50..ce840d7d90a4 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_10.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_10.sol @@ -20,4 +20,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (256-270): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n!(m.length <= 0)\n!(m[0][1].length <= 2)\n +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_2.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_2.sol index c3a3d660de1e..934eb854292c 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_2.sol @@ -21,4 +21,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (274-288): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n!(m[0].length <= 1)\n!(m[0][1].length <= 2)\n +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_3.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_3.sol index 0083f92d8960..8471d6f26e4b 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_3.sol @@ -24,4 +24,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(m[0].length <= 1)\n!(m[0][1].length <= 2)\n!(m[0][1][2].length <= 3)\n +// Info 1391: CHC: 18 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_4.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_4.sol index 43047758efe8..3e0f0b63fa0f 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_4.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_4.sol @@ -19,4 +19,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (260-274): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n!(m[0][1].length <= 2)\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_5.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_5.sol index 2e8abe5dcd07..17c280e0401b 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_5.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_5.sol @@ -23,4 +23,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (354-368): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n!(m[0][1].length <= 2)\n!(m[0][1][2].length <= 3)\n +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_6.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_6.sol index d7964552d6c4..08af1f555801 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_6.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_6.sol @@ -19,4 +19,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(m[0][1][2].length <= 3)\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_7.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_7.sol index fc4c9efcf999..d22fe68d4ab0 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_7.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_7.sol @@ -15,5 +15,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (192-206): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 42\n\nTransaction trace:\nC.constructor()\nC.f() -// Info 1180: Contract invariant(s) for :C:\n!(m.length <= 0)\n +// Warning 6328: (192-206): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_8.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_8.sol index 0b2b6fadf79c..d57591c739f5 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_8.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_8.sol @@ -17,5 +17,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (232-246): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 42\n\nTransaction trace:\nC.constructor()\nC.f() -// Info 1180: Contract invariant(s) for :C:\n!(m.length <= 0)\n!(m[0].length <= 1)\n +// Warning 6328: (232-246): CHC: Assertion violation happens here. +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_9.sol b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_9.sol index be6bc23834ca..8bb9f9fb723d 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_9.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/nested_arrays_mappings_9.sol @@ -15,5 +15,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (218-232): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 42\n\nTransaction trace:\nC.constructor()\nC.f() -// Info 1180: Contract invariant(s) for :C:\n!(m.length <= 0)\n +// Warning 6328: (218-232): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/static_array.sol b/test/libsolidity/smtCheckerTests/functions/getters/static_array.sol index d66545e437bf..a7b057beecce 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/static_array.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/static_array.sol @@ -12,5 +12,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (162-184): CHC: Assertion violation happens here.\nCounterexample:\nx = [42, 1]\n\nTransaction trace:\nC.constructor()\nState: x = [42, 1]\nC.f() -// Info 1180: Contract invariant(s) for :C:\n!(x.length <= 1)\n +// Warning 6328: (162-184): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/string.sol b/test/libsolidity/smtCheckerTests/functions/getters/string.sol index 7369fd0fb1bb..9649372f72d1 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/string.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/string.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (178-224): CHC: Assertion violation happens here.\nCounterexample:\nstr1 = [0x62]\na1 = [0x62]\n\nTransaction trace:\nC.constructor()\nState: str1 = [0x62]\nC.f() +// Warning 6328: (178-224): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/struct_1.sol b/test/libsolidity/smtCheckerTests/functions/getters/struct_1.sol index 73e6f33168bd..521f108e0cd2 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/struct_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/struct_1.sol @@ -27,4 +27,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (338-355): CHC: Assertion violation happens here.\nCounterexample:\ns = {x: 0, t: {t: 0}, b: false, a: []}\ny = 0\nc = false\nt = {t: 0}\n\nTransaction trace:\nC.constructor()\nState: s = {x: 0, t: {t: 0}, b: false, a: []}\nC.f() +// Warning 6328: (338-355): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/struct_2.sol b/test/libsolidity/smtCheckerTests/functions/getters/struct_2.sol index 4fa8b0e3f6f7..eec69480a5d7 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/struct_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/struct_2.sol @@ -17,4 +17,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (175-189): CHC: Assertion violation happens here.\nCounterexample:\ns = {a: [0, 0], u: 0}\nu = 0\n\nTransaction trace:\nC.constructor()\nState: s = {a: [0, 0], u: 0}\nC.f() +// Warning 6328: (175-189): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/struct_3.sol b/test/libsolidity/smtCheckerTests/functions/getters/struct_3.sol index ddeaa655b2ae..ea68e0485d97 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/struct_3.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/struct_3.sol @@ -22,3 +22,4 @@ contract C { // SMTEngine: all // ---- // Warning 6328: (307-326): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/struct_4.sol b/test/libsolidity/smtCheckerTests/functions/getters/struct_4.sol index 3e300edbb698..345959354fb4 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/struct_4.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/struct_4.sol @@ -21,3 +21,4 @@ contract C { // Warning 2072: (146-183): Unused local variable. // Warning 8364: (187-193): Assertion checker does not yet implement type function () view external returns (contract D,function () external returns (uint256)) // Warning 6328: (234-269): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/struct_with_reassignment.sol b/test/libsolidity/smtCheckerTests/functions/getters/struct_with_reassignment.sol index c2d0d4426210..4f4f8e13c0d2 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/struct_with_reassignment.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/struct_with_reassignment.sol @@ -28,5 +28,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (255-272): CHC: Assertion violation happens here.\nCounterexample:\ns = {x: 1, b: false}\nx = 1\nb = false\ny = 0\nc = false\n\nTransaction trace:\nC.constructor()\nState: s = {x: 1, b: false}\nC.f() -// Warning 6328: (377-391): CHC: Assertion violation happens here.\nCounterexample:\ns = {x: 42, b: false}\nx = 1\nb = false\ny = 42\nc = false\n\nTransaction trace:\nC.constructor()\nState: s = {x: 1, b: false}\nC.f() +// Warning 6328: (255-272): CHC: Assertion violation happens here. +// Warning 6328: (377-391): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/getters/uint.sol b/test/libsolidity/smtCheckerTests/functions/getters/uint.sol index b85d47284a9e..35a781dd7611 100644 --- a/test/libsolidity/smtCheckerTests/functions/getters/uint.sol +++ b/test/libsolidity/smtCheckerTests/functions/getters/uint.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (114-128): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f() +// Warning 6328: (114-128): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/internal_call_state_var_init_2.sol b/test/libsolidity/smtCheckerTests/functions/internal_call_state_var_init_2.sol index 8094870be681..4a8ed0d7184d 100644 --- a/test/libsolidity/smtCheckerTests/functions/internal_call_state_var_init_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/internal_call_state_var_init_2.sol @@ -9,3 +9,4 @@ contract c { // SMTEngine: all // ---- // Warning 6321: (54-58): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1.sol b/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1.sol index c3c231ede5b2..f42bdb7dc3f5 100644 --- a/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1.sol @@ -22,4 +22,4 @@ contract C{ // SMTIgnoreOS: macos // ---- // Warning 5667: (37-43): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Info 1180: Contract invariant(s) for :C:\n!(x >= 2)\n(!(x <= 0) && !(x >= 2))\n(!(x >= 2) && !(x <= 0))\n +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1_fail.sol b/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1_fail.sol index d067795ac83b..1aaa973f3ab2 100644 --- a/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_1_fail.sol @@ -21,9 +21,9 @@ contract C{ // SMTEngine: all // ---- // Warning 5667: (37-43): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (49-63): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor(0) -// Warning 6328: (105-119): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor(0)\nState: x = 1\nC.f() -// Warning 6328: (137-151): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor(0)\nState: x = 1\nC.f()\n C.g() -- internal call -// Warning 6328: (187-201): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor(0)\nState: x = 1\nC.f()\n C.g() -- internal call -// Warning 6328: (212-226): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor(0)\nState: x = 1\nC.f()\n C.g() -- internal call -// Info 1180: Contract invariant(s) for :C:\n!(x >= 2)\n +// Warning 6328: (49-63): CHC: Assertion violation happens here. +// Warning 6328: (105-119): CHC: Assertion violation happens here. +// Warning 6328: (137-151): CHC: Assertion violation happens here. +// Warning 6328: (187-201): CHC: Assertion violation happens here. +// Warning 6328: (212-226): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1.sol b/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1.sol index 7bceab1ad720..3ad9aa488085 100644 --- a/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1.sol @@ -17,3 +17,4 @@ contract C is A { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1_fail.sol b/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1_fail.sol index 6b997ada3525..9f2fca60cefb 100644 --- a/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/functions/internal_call_with_assertion_inheritance_1_fail.sol @@ -17,6 +17,7 @@ contract C is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (49-63): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor() -// Warning 6328: (115-129): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor() -// Warning 6328: (147-161): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor() +// Warning 6328: (49-63): CHC: Assertion violation happens here. +// Warning 6328: (115-129): CHC: Assertion violation happens here. +// Warning 6328: (147-161): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1.sol b/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1.sol index 4bca2544e195..e7e6ec61ce21 100644 --- a/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1.sol @@ -21,4 +21,4 @@ contract C{ // SMTEngine: all // ---- // Warning 5667: (37-43): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Info 1180: Contract invariant(s) for :C:\n!(x <= 0)\n!(x >= 2)\n(!(x <= 0) && !(x >= 2))\n +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1_fail.sol b/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1_fail.sol index c0f524e10642..34d793d0677e 100644 --- a/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1_fail.sol @@ -21,7 +21,7 @@ contract C{ // SMTEngine: all // ---- // Warning 5667: (37-43): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (49-63): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor(0) -// Warning 6328: (105-119): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor(0)\nState: x = 1\nC.f() -// Warning 6328: (151-165): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor(0)\nState: x = 1\nC.f()\n C.g() -- internal call\n C.g() -- internal call -// Info 1180: Contract invariant(s) for :C:\n!(x <= 0)\n!(x >= 2)\n +// Warning 6328: (49-63): CHC: Assertion violation happens here. +// Warning 6328: (105-119): CHC: Assertion violation happens here. +// Warning 6328: (151-165): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/library_after_contract.sol b/test/libsolidity/smtCheckerTests/functions/library_after_contract.sol index 3801cf24a7b8..e98556f99455 100644 --- a/test/libsolidity/smtCheckerTests/functions/library_after_contract.sol +++ b/test/libsolidity/smtCheckerTests/functions/library_after_contract.sol @@ -15,3 +15,4 @@ library L { // SMTEngine: all // ---- // Warning 2018: (98-157): Function state mutability can be restricted to pure +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/library_constant.sol b/test/libsolidity/smtCheckerTests/functions/library_constant.sol index ddb9008519e6..53349f0b6c30 100644 --- a/test/libsolidity/smtCheckerTests/functions/library_constant.sol +++ b/test/libsolidity/smtCheckerTests/functions/library_constant.sol @@ -19,5 +19,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (103-122): CHC: Assertion violation happens here.\nCounterexample:\nTON = 1000\n\nTransaction trace:\nl1.constructor()\nState: TON = 1000\nl1.f1() -// Warning 4984: (196-201): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\n\nx = 115792089237316195423570985008687907853269984665640564039457584007913129639935\n\nTransaction trace:\nC.constructor()\nC.f(115792089237316195423570985008687907853269984665640564039457584007913129639935)\n l1.f2(115792089237316195423570985008687907853269984665640564039457584007913129639935, 1) -- internal call +// Warning 6328: (103-122): CHC: Assertion violation happens here. +// Warning 4984: (196-201): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/library_constant_2.sol b/test/libsolidity/smtCheckerTests/functions/library_constant_2.sol index ac352b43d8cc..bfa260301d95 100644 --- a/test/libsolidity/smtCheckerTests/functions/library_constant_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/library_constant_2.sol @@ -8,3 +8,4 @@ library l1 { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/payable_2.sol b/test/libsolidity/smtCheckerTests/functions/payable_2.sol index 3035080eacea..2a381fd4f907 100644 --- a/test/libsolidity/smtCheckerTests/functions/payable_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/payable_2.sol @@ -25,4 +25,5 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (261-283): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.g2(){ msg.value: 3529 }\n C.i() -- internal call +// Warning 6328: (261-283): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/super_function_assert.sol b/test/libsolidity/smtCheckerTests/functions/super_function_assert.sol index 85e97661ce2d..3bec690e64e0 100644 --- a/test/libsolidity/smtCheckerTests/functions/super_function_assert.sol +++ b/test/libsolidity/smtCheckerTests/functions/super_function_assert.sol @@ -29,6 +29,6 @@ contract D is C { // ==== // SMTEngine: all // ---- -// Warning 6328: (205-219): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor()\nState: x = 0\nA.proxy()\n C.f() -- internal call\n A.f() -- internal call -// Warning 6328: (328-342): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nD.constructor()\nState: x = 0\nA.proxy()\n D.f() -- internal call\n C.f() -- internal call\n A.f() -- internal call -// Info 1180: Contract invariant(s) for :A:\n((x = 0) || (x = 2))\nContract invariant(s) for :D:\n((x = 0) || (x = 2))\n +// Warning 6328: (205-219): CHC: Assertion violation happens here. +// Warning 6328: (328-342): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/this_external_call.sol b/test/libsolidity/smtCheckerTests/functions/this_external_call.sol index 10ace899927f..c079ba49ed3f 100644 --- a/test/libsolidity/smtCheckerTests/functions/this_external_call.sol +++ b/test/libsolidity/smtCheckerTests/functions/this_external_call.sol @@ -13,3 +13,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/this_external_call_2.sol b/test/libsolidity/smtCheckerTests/functions/this_external_call_2.sol index ed7110d53992..7d7064c97f3e 100644 --- a/test/libsolidity/smtCheckerTests/functions/this_external_call_2.sol +++ b/test/libsolidity/smtCheckerTests/functions/this_external_call_2.sol @@ -13,4 +13,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (108-123): CHC: Assertion violation happens here.\nCounterexample:\na = 42\nx = 42\n\nTransaction trace:\nC.constructor()\nState: a = 0\nC.f(42)\n C.g(42) -- trusted external call +// Warning 6328: (108-123): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/this_external_call_return.sol b/test/libsolidity/smtCheckerTests/functions/this_external_call_return.sol index 9e2d5d8c1dbb..06ba5dd45524 100644 --- a/test/libsolidity/smtCheckerTests/functions/this_external_call_return.sol +++ b/test/libsolidity/smtCheckerTests/functions/this_external_call_return.sol @@ -14,3 +14,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/this_external_call_sender.sol b/test/libsolidity/smtCheckerTests/functions/this_external_call_sender.sol index 5a425ca781b6..4907a7402b57 100644 --- a/test/libsolidity/smtCheckerTests/functions/this_external_call_sender.sol +++ b/test/libsolidity/smtCheckerTests/functions/this_external_call_sender.sol @@ -27,3 +27,4 @@ contract C { // ---- // Warning 6328: (314-346): CHC: Assertion violation happens here. // Warning 6328: (356-388): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/this_external_call_tx_origin.sol b/test/libsolidity/smtCheckerTests/functions/this_external_call_tx_origin.sol index 9b2699421616..6b07cf2d3c4a 100644 --- a/test/libsolidity/smtCheckerTests/functions/this_external_call_tx_origin.sol +++ b/test/libsolidity/smtCheckerTests/functions/this_external_call_tx_origin.sol @@ -12,3 +12,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/this_state.sol b/test/libsolidity/smtCheckerTests/functions/this_state.sol index 126add6406e0..dec101060d8c 100644 --- a/test/libsolidity/smtCheckerTests/functions/this_state.sol +++ b/test/libsolidity/smtCheckerTests/functions/this_state.sol @@ -13,4 +13,4 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n((x = 0) || (x = 2))\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/virtual_function_assert.sol b/test/libsolidity/smtCheckerTests/functions/virtual_function_assert.sol index 4c5e381310f5..d39aaad5f9a1 100644 --- a/test/libsolidity/smtCheckerTests/functions/virtual_function_assert.sol +++ b/test/libsolidity/smtCheckerTests/functions/virtual_function_assert.sol @@ -19,5 +19,5 @@ contract C is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (227-241): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nA.proxy()\n C.f() -- internal call -// Info 1180: Contract invariant(s) for :A:\n((x >= 0) && (x <= 0))\n +// Warning 6328: (227-241): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/functions/virtual_function_called_by_constructor.sol b/test/libsolidity/smtCheckerTests/functions/virtual_function_called_by_constructor.sol index 0117f9b49d8d..b4deddc7ce1d 100644 --- a/test/libsolidity/smtCheckerTests/functions/virtual_function_called_by_constructor.sol +++ b/test/libsolidity/smtCheckerTests/functions/virtual_function_called_by_constructor.sol @@ -25,6 +25,6 @@ contract C is A { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (199-214): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nA.constructor()\nState: x = 2\nA.i() -// Warning 6328: (387-401): CHC: Assertion violation happens here.\nCounterexample:\nx = 10\n\nTransaction trace:\nC.constructor()\nState: x = 10\nC.i() -// Info 1180: Contract invariant(s) for :A:\n(!(x <= 1) && !(x >= 3))\nContract invariant(s) for :C:\n(!(x >= 11) && !(x <= 9))\n +// Warning 6328: (199-214): CHC: Assertion violation happens here. +// Warning 6328: (387-401): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/imports/ExtCall.sol b/test/libsolidity/smtCheckerTests/imports/ExtCall.sol index 047148a90cce..7675bc42ea8c 100644 --- a/test/libsolidity/smtCheckerTests/imports/ExtCall.sol +++ b/test/libsolidity/smtCheckerTests/imports/ExtCall.sol @@ -39,4 +39,4 @@ contract ExtCallTest { // SMTIgnoreCex: yes // ---- // Warning 6328: (ExtCall.sol:362-381): CHC: Assertion violation happens here. -// Warning 4588: (ExtCall.t.sol:110-123): Assertion checker does not yet implement this type of function call. +// Warning 8729: (ExtCall.t.sol:110-123): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. diff --git a/test/libsolidity/smtCheckerTests/imports/import_as_module_1.sol b/test/libsolidity/smtCheckerTests/imports/import_as_module_1.sol index 7796d3a9af12..cd9a647619d7 100644 --- a/test/libsolidity/smtCheckerTests/imports/import_as_module_1.sol +++ b/test/libsolidity/smtCheckerTests/imports/import_as_module_1.sol @@ -17,4 +17,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (A:117-132): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n_y = 0\n\nTransaction trace:\nD.constructor()\nState: x = 0\nD.f(0)\n C.g(0) -- internal call +// Warning 6328: (A:117-132): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/imports/import_as_module_2.sol b/test/libsolidity/smtCheckerTests/imports/import_as_module_2.sol index 8ddef2da9e0e..1298f1f09762 100644 --- a/test/libsolidity/smtCheckerTests/imports/import_as_module_2.sol +++ b/test/libsolidity/smtCheckerTests/imports/import_as_module_2.sol @@ -17,6 +17,7 @@ function f(uint _x) pure { } // ==== // SMTEngine: all +// SMTIgnoreOS: macos // ---- // Warning 6328: (A:50-64): CHC: Assertion violation happens here.\nCounterexample:\n\n_y = 0\n\nTransaction trace:\nD.constructor()\nD.g(0)\n s1.sol:f(200) -- internal call\n s1.sol:f(0) -- internal call\n A:f(10) -- internal call\n A:f(0) -- internal call // Warning 6328: (s1.sol:28-44): CHC: Assertion violation happens here.\nCounterexample:\n\n_y = 0\n\nTransaction trace:\nD.constructor()\nD.g(0)\n s1.sol:f(200) -- internal call\n s1.sol:f(0) -- internal call diff --git a/test/libsolidity/smtCheckerTests/imports/import_base.sol b/test/libsolidity/smtCheckerTests/imports/import_base.sol index 4ad65335764b..3e8aeefe4845 100644 --- a/test/libsolidity/smtCheckerTests/imports/import_base.sol +++ b/test/libsolidity/smtCheckerTests/imports/import_base.sol @@ -20,4 +20,5 @@ contract Der is Base { // ==== // SMTEngine: all // ---- -// Warning 6328: (der:173-186): CHC: Assertion violation happens here.\nCounterexample:\nx = 3, a = 0x0\ny = 0\n\nTransaction trace:\nDer.constructor()\nState: x = 0, a = 0x0\nDer.g(0)\n Base.f() -- internal call +// Warning 6328: (der:173-186): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/imports/import_library_2.sol b/test/libsolidity/smtCheckerTests/imports/import_library_2.sol index acf2acda43ab..a1c3160ea23a 100644 --- a/test/libsolidity/smtCheckerTests/imports/import_library_2.sol +++ b/test/libsolidity/smtCheckerTests/imports/import_library_2.sol @@ -26,3 +26,4 @@ contract ERC20 { // SMTEngine: all // ---- // Warning 3944: (ERC20.sol:157-162): CHC: Underflow (resulting value less than 0) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_1.sol b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_1.sol index 0fd50860252a..587a23bb0207 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_1.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_1.sol @@ -15,5 +15,5 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (52-66): CHC: Assertion violation happens here.\nCounterexample:\ny = 0, x = 1\n\nTransaction trace:\nC.constructor()\nState: y = 0, x = 0\nC.g()\n B.f() -- internal call -// Info 1180: Contract invariant(s) for :B:\n(x <= 0)\n +// Warning 6328: (52-66): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_2.sol b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_2.sol index 039388704f39..97c79428b760 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_2.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_2.sol @@ -22,4 +22,5 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (54-68): CHC: Assertion violation happens here.\nCounterexample:\ny = 0, z = 0, w = 0, a = 0, b = 0, x = 1\n\nTransaction trace:\nC.constructor()\nState: y = 0, z = 0, w = 0, a = 0, b = 0, x = 0\nC.g()\n A.f() -- internal call +// Warning 6328: (54-68): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_3.sol b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_3.sol index 4d9067e07461..c92b0c5014ef 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_3.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_3.sol @@ -28,4 +28,5 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (64-78): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g()\n B.f() -- internal call\n A.f() -- internal call\n C.v() -- internal call +// Warning 6328: (64-78): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_4.sol b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_4.sol index 4bf6520fb551..593a6ba3aa84 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_4.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_4.sol @@ -35,4 +35,5 @@ contract C is B, A1 { // ==== // SMTEngine: all // ---- -// Warning 6328: (64-78): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g()\n C.f() -- internal call\n A1.f() -- internal call\n B.f() -- internal call\n A.f() -- internal call\n C.v() -- internal call +// Warning 6328: (64-78): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_5.sol b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_5.sol index 507b10824afe..818906cd3a55 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_5.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_5.sol @@ -29,4 +29,5 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (97-111): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g()\n B.f() -- internal call\n A.f() -- internal call\n C.v() -- internal call\n A.v() -- internal call +// Warning 6328: (97-111): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_6.sol b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_6.sol index 21d8a3dcc150..04033a00f0de 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_6.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_6.sol @@ -31,4 +31,5 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (183-197): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nA.constructor()\nState: x = 0\nA.g()\n A.v() -- internal call +// Warning 6328: (183-197): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_7.sol b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_7.sol index db63f27c760f..e33e6a3bc0f8 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_7.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_7.sol @@ -22,4 +22,5 @@ contract C is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (56-70): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g()\n A.f() -- internal call\n C.v() -- internal call +// Warning 6328: (56-70): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_9.sol b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_9.sol index a87a8eeb6852..2ec47f7d94f9 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_9.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/base_contract_assertion_fail_9.sol @@ -28,6 +28,6 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (62-76): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor()\nState: x = 0\nB.f()\n A.f() -- internal call\n C.v() -- internal call -// Warning 6328: (131-145): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nA.constructor()\nState: x = 0\nA.f()\n A.v() -- internal call -// Info 1180: Contract invariant(s) for :A:\n(x = 0)\n +// Warning 6328: (62-76): CHC: Assertion violation happens here. +// Warning 6328: (131-145): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_inheritance_specifier_1.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_inheritance_specifier_1.sol index a67223b5a3a8..edc345c428dd 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_inheritance_specifier_1.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_inheritance_specifier_1.sol @@ -32,5 +32,6 @@ contract C is Z(5) { // ==== // SMTEngine: all // ---- -// Warning 4984: (292-299): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\nx = 1\nz = 115792089237316195423570985008687907853269984665640564039457584007913129639935\n\nTransaction trace:\nZ.constructor(115792089237316195423570985008687907853269984665640564039457584007913129639935) -// Warning 6328: (367-380): CHC: Assertion violation happens here.\nCounterexample:\nx = 6\n\nTransaction trace:\nC.constructor() +// Warning 4984: (292-299): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Warning 6328: (367-380): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_inheritance_specifier_2.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_inheritance_specifier_2.sol index 497fa6076f30..f97b0b7eced3 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_inheritance_specifier_2.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_inheritance_specifier_2.sol @@ -37,3 +37,4 @@ contract C is Z(5) { // Warning 4984: (110-116): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 4984: (300-307): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (376-390): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_1.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_1.sol index 6ca597ed15a2..16b6db133cc6 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_1.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_1.sol @@ -33,3 +33,4 @@ contract C is Z, B { // ---- // Warning 4984: (105-112): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (351-365): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_2.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_2.sol index 130da425e026..55ee0e77b2fa 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_2.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_2.sol @@ -30,4 +30,5 @@ contract C is Z, B { // ==== // SMTEngine: all // ---- -// Warning 6328: (349-363): CHC: Assertion violation happens here.\nCounterexample:\nk = 2, x = 1\n\nTransaction trace:\nC.constructor() +// Warning 6328: (349-363): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_3.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_3.sol index a1a9b9b6e69d..ebaffc714892 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_3.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_3.sol @@ -33,3 +33,4 @@ contract C is Z, B { // ---- // Warning 4984: (105-112): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (361-375): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_4.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_4.sol index c670aff15d7c..35cb038ae4ab 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_4.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_4.sol @@ -33,3 +33,4 @@ contract C is Z, B { // ---- // Warning 4984: (105-112): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (361-375): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_5.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_5.sol index e97b990ee309..a8d87ce26b8d 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_5.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_5.sol @@ -38,3 +38,4 @@ contract C is Z, B { // ---- // Warning 4984: (105-112): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (423-437): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_6.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_6.sol index 3d92a3626fda..76ba20735efd 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_6.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_6.sol @@ -35,4 +35,5 @@ contract C is Z, B { // ==== // SMTEngine: all // ---- -// Warning 6328: (416-430): CHC: Assertion violation happens here.\nCounterexample:\nk = 42, x = 1\n\nTransaction trace:\nC.constructor() +// Warning 6328: (416-430): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_7.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_7.sol index b63c3c79d87b..d861ac2edb88 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_7.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_7.sol @@ -32,4 +32,5 @@ contract C is Z { // ==== // SMTEngine: all // ---- -// Warning 6328: (354-367): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor() +// Warning 6328: (354-367): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_8.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_8.sol index 0164cf437fdc..5815f9ed610c 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_8.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_8.sol @@ -18,5 +18,6 @@ contract C is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (185-199): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor() -// Warning 6328: (218-234): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor() +// Warning 6328: (185-199): CHC: Assertion violation happens here. +// Warning 6328: (218-234): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_9.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_9.sol index fed5ebf34a17..bfb7abb98cea 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_9.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_base_calls_with_side_effects_9.sol @@ -19,6 +19,7 @@ contract C is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (191-205): CHC: Assertion violation happens here.\nCounterexample:\nx = 42\n\nTransaction trace:\nC.constructor() -// Warning 6328: (224-238): CHC: Assertion violation happens here.\nCounterexample:\nx = 42\n\nTransaction trace:\nC.constructor() -// Warning 6328: (257-273): CHC: Assertion violation happens here.\nCounterexample:\nx = 42\n\nTransaction trace:\nC.constructor() +// Warning 6328: (191-205): CHC: Assertion violation happens here. +// Warning 6328: (224-238): CHC: Assertion violation happens here. +// Warning 6328: (257-273): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol index 15cc66a0d6a6..2d49cd1e3871 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_hierarchy_mixed_chain_with_params.sol @@ -29,3 +29,4 @@ contract A is B { // ---- // Warning 4984: (215-220): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (296-310): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init.sol index be9545837244..db94b516f204 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init.sol @@ -8,4 +8,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (64-78): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor() +// Warning 6328: (64-78): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_asserts.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_asserts.sol index e9bf3f65cf3a..03b634ba941d 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_asserts.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_asserts.sol @@ -33,7 +33,8 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (247-261): CHC: Assertion violation happens here.\nCounterexample:\ny = 2, x = (- 1)\na = 1\n\nTransaction trace:\nC.constructor(1) -// Warning 6328: (339-362): CHC: Assertion violation happens here.\nCounterexample:\ny = 2, x = (- 1)\na = 1\n\nTransaction trace:\nC.constructor(1) -// Warning 6328: (439-463): CHC: Assertion violation happens here.\nCounterexample:\ny = 4, x = 0\na = 0\n\nTransaction trace:\nC.constructor(0) -// Warning 6328: (483-496): CHC: Assertion violation happens here.\nCounterexample:\ny = 4, x = 0\na = 0\n\nTransaction trace:\nC.constructor(0) +// Warning 6328: (247-261): CHC: Assertion violation happens here. +// Warning 6328: (339-362): CHC: Assertion violation happens here. +// Warning 6328: (439-463): CHC: Assertion violation happens here. +// Warning 6328: (483-496): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_base.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_base.sol index 7435a54f592a..0ebbed1dbd27 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_base.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_base.sol @@ -11,4 +11,5 @@ contract D is C { // ==== // SMTEngine: all // ---- -// Warning 6328: (84-98): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nD.constructor() +// Warning 6328: (84-98): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain.sol index bba7b3e138dd..f9382fb64e65 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain.sol @@ -19,4 +19,5 @@ contract D is C { // ==== // SMTEngine: all // ---- -// Warning 6328: (178-192): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\nTransaction trace:\nD.constructor() +// Warning 6328: (178-192): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_alternate.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_alternate.sol index c9a9f970fd46..e3be37f2b174 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_alternate.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_alternate.sol @@ -18,4 +18,5 @@ contract D is C { // ==== // SMTEngine: all // ---- -// Warning 6328: (152-166): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nD.constructor() +// Warning 6328: (152-166): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol index f02e416a4849..09833f14de50 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all.sol @@ -26,3 +26,4 @@ contract A is B { // Warning 4984: (125-130): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 4984: (184-189): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (243-261): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol index e223ad5f7f9e..035a901b0ec1 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_run_all_2.sol @@ -26,3 +26,4 @@ contract A is B { // Warning 4984: (125-131): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 4984: (185-190): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6328: (241-259): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_tree.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_tree.sol index 71e9071f12f7..e98ddcb63c2e 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_tree.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_chain_tree.sol @@ -39,5 +39,6 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Warning 6328: (403-417): CHC: Assertion violation happens here.\nCounterexample:\nz = 0, x = 1\nc = (- 1)\n\nTransaction trace:\nC.constructor((- 1)) -// Warning 6328: (450-463): CHC: Assertion violation happens here.\nCounterexample:\nz = 0, x = 0\nc = 0\n\nTransaction trace:\nC.constructor(0) +// Warning 6328: (403-417): CHC: Assertion violation happens here. +// Warning 6328: (450-463): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond.sol index a31d5894c5b4..ed61c1c2b1ca 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond.sol @@ -17,4 +17,5 @@ contract D is B, C { // ==== // SMTEngine: all // ---- -// Warning 6328: (129-143): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nD.constructor() +// Warning 6328: (129-143): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond_middle.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond_middle.sol index c7c63f00fe74..8590b0bcfa86 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond_middle.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_diamond_middle.sol @@ -25,5 +25,6 @@ contract D is B, C { // ==== // SMTEngine: all // ---- -// Warning 6328: (134-148): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nD.constructor() -// Warning 6328: (223-237): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\nTransaction trace:\nD.constructor() +// Warning 6328: (134-148): CHC: Assertion violation happens here. +// Warning 6328: (223-237): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_function_call.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_function_call.sol index ca2f0b770aa7..031f5a1c0edd 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_function_call.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_state_variable_init_function_call.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/constructor_uses_function_base.sol b/test/libsolidity/smtCheckerTests/inheritance/constructor_uses_function_base.sol index 0a4599a3d187..1c0defa916cb 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/constructor_uses_function_base.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/constructor_uses_function_base.sol @@ -18,4 +18,4 @@ contract C is B { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(!(y <= 41) && !(y >= 43))\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/diamond_super_1.sol b/test/libsolidity/smtCheckerTests/inheritance/diamond_super_1.sol index 580597f4f4b7..7af69f2e4aed 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/diamond_super_1.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/diamond_super_1.sol @@ -29,4 +29,5 @@ contract D is B, C { // ==== // SMTEngine: all // ---- -// Warning 6328: (437-452): CHC: Assertion violation happens here.\nCounterexample:\n\nr = 15\n\nTransaction trace:\nD.constructor()\nD.f()\n C.f() -- internal call\n B.f() -- internal call\n A.f() -- internal call +// Warning 6328: (437-452): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/diamond_super_2.sol b/test/libsolidity/smtCheckerTests/inheritance/diamond_super_2.sol index c8d3c9c0e9b1..c5f838397375 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/diamond_super_2.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/diamond_super_2.sol @@ -30,5 +30,6 @@ contract D is B, C { // ==== // SMTEngine: all // ---- -// Warning 6328: (443-458): CHC: Assertion violation happens here.\nCounterexample:\n\nr = 22\n\nTransaction trace:\nD.constructor()\nD.f()\n C.f() -- internal call\n B.f() -- internal call\n A.f() -- internal call -// Warning 6328: (477-492): CHC: Assertion violation happens here.\nCounterexample:\n\nr = 22\n\nTransaction trace:\nD.constructor()\nD.f()\n C.f() -- internal call\n B.f() -- internal call\n A.f() -- internal call +// Warning 6328: (443-458): CHC: Assertion violation happens here. +// Warning 6328: (477-492): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/diamond_super_3.sol b/test/libsolidity/smtCheckerTests/inheritance/diamond_super_3.sol index b8487e3212bd..af22069eb66f 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/diamond_super_3.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/diamond_super_3.sol @@ -32,5 +32,5 @@ contract E is C,D { // ==== // SMTEngine: all // ---- -// Warning 6328: (379-394): CHC: Assertion violation happens here.\nCounterexample:\nx = 111\n\nTransaction trace:\nE.constructor()\nState: x = 0\nE.f()\n C.f() -- internal call\n B.f() -- internal call\n A.f() -- internal call -// Info 1180: Contract invariant(s) for :C:\n((x = 0) || (x = 111))\nContract invariant(s) for :D:\n((x = 0) || (x = 101))\nContract invariant(s) for :E:\n((x = 0) || (x = 111))\nContract invariant(s) for :B:\n((x = 0) || (x = 101))\n +// Warning 6328: (379-394): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/implicit_constructor_hierarchy.sol b/test/libsolidity/smtCheckerTests/inheritance/implicit_constructor_hierarchy.sol index c8b2f96c5859..f43195d62141 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/implicit_constructor_hierarchy.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/implicit_constructor_hierarchy.sol @@ -14,5 +14,7 @@ contract C is B { } // ==== // SMTEngine: all -// SMTSolvers: z3 // SMTIgnoreInv: yes +// SMTSolvers: z3 +// ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/implicit_only_constructor_hierarchy.sol b/test/libsolidity/smtCheckerTests/inheritance/implicit_only_constructor_hierarchy.sol index 653bb23b70b4..799bba43b89c 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/implicit_only_constructor_hierarchy.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/implicit_only_constructor_hierarchy.sol @@ -20,4 +20,4 @@ contract C is B { // SMTEngine: all // SMTSolvers: z3 // ---- -// Info 1180: Contract invariant(s) for :A:\n(x <= 0)\nContract invariant(s) for :C:\n(x <= 0)\nContract invariant(s) for :B:\n(x <= 0)\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/overriden_function_static_call_parent.sol b/test/libsolidity/smtCheckerTests/inheritance/overriden_function_static_call_parent.sol index 89a48f17c632..b339e5a14aa3 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/overriden_function_static_call_parent.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/overriden_function_static_call_parent.sol @@ -21,3 +21,4 @@ contract Child is Base { // ---- // Warning 5667: (52-58): Unused function parameter. Remove or comment out the variable name to silence this warning. // Warning 6328: (282-296): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/state_variables.sol b/test/libsolidity/smtCheckerTests/inheritance/state_variables.sol index 680926355547..0b92796708f3 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/state_variables.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/state_variables.sol @@ -15,3 +15,4 @@ contract C is Base { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/state_variables_2.sol b/test/libsolidity/smtCheckerTests/inheritance/state_variables_2.sol index 2264e460cfff..fd1fbccac64c 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/state_variables_2.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/state_variables_2.sol @@ -17,3 +17,4 @@ contract C is Base2 { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inheritance/state_variables_3.sol b/test/libsolidity/smtCheckerTests/inheritance/state_variables_3.sol index 636bd0367994..03a1e79772bd 100644 --- a/test/libsolidity/smtCheckerTests/inheritance/state_variables_3.sol +++ b/test/libsolidity/smtCheckerTests/inheritance/state_variables_3.sol @@ -16,3 +16,4 @@ contract C is Base { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_2.sol b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_2.sol index 68ac2ee390cd..ad18cb325e6d 100644 --- a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_2.sol +++ b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_2.sol @@ -12,4 +12,5 @@ contract C { // SMTEngine: all // ---- // Warning 7737: (82-101): Inline assembly may cause SMTChecker to produce spurious warnings (false positives). -// Warning 6328: (138-147): CHC: Assertion violation happens here.\nCounterexample:\n\n = false\nb = false\nx = 42\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (138-147): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_3.sol b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_3.sol index 838b69e5d532..73cdcd4d8dec 100644 --- a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_3.sol +++ b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_3.sol @@ -12,4 +12,5 @@ contract C { // SMTEngine: all // ---- // Warning 7737: (106-125): Inline assembly may cause SMTChecker to produce spurious warnings (false positives). -// Warning 6328: (203-212): CHC: Assertion violation happens here.\nCounterexample:\n\n = false\nb = false\nc = true\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (203-212): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_4.sol b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_4.sol index 1915ca821a98..59db8c8c4d23 100644 --- a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_4.sol +++ b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_4.sol @@ -13,3 +13,4 @@ contract C { // SMTEngine: all // ---- // Warning 7737: (82-101): Inline assembly may cause SMTChecker to produce spurious warnings (false positives). +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_5.sol b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_5.sol index dc91a6822859..b81ae7663a24 100644 --- a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_5.sol +++ b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_5.sol @@ -23,3 +23,4 @@ contract C { // SMTEngine: all // ---- // Warning 7737: (156-187): Inline assembly may cause SMTChecker to produce spurious warnings (false positives). +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_6.sol b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_6.sol index e7f4e37c6219..21a32c0f4c78 100644 --- a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_6.sol +++ b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_6.sol @@ -22,3 +22,4 @@ contract C { // SMTEngine: all // ---- // Warning 7737: (157-193): Inline assembly may cause SMTChecker to produce spurious warnings (false positives). +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_local_storage_access_inside_function.sol b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_local_storage_access_inside_function.sol index 9d44025814ed..b8df9f3e9e42 100644 --- a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_local_storage_access_inside_function.sol +++ b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_local_storage_access_inside_function.sol @@ -22,3 +22,4 @@ contract C { // Warning 7737: (83-149): Inline assembly may cause SMTChecker to produce spurious warnings (false positives). // Warning 6328: (152-167): CHC: Assertion violation happens here. // Warning 6328: (186-200): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_local_storage_pointer.sol b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_local_storage_pointer.sol index 13232a650d1d..390ce10ad279 100644 --- a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_local_storage_pointer.sol +++ b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_local_storage_pointer.sol @@ -21,3 +21,4 @@ contract C { // Warning 7737: (170-205): Inline assembly may cause SMTChecker to produce spurious warnings (false positives). // Warning 6328: (208-229): CHC: Assertion violation happens here. // Warning 6328: (248-269): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_memory_write.sol b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_memory_write.sol index e8c8896ab2f3..7eb441392fa9 100644 --- a/test/libsolidity/smtCheckerTests/inline_assembly/assembly_memory_write.sol +++ b/test/libsolidity/smtCheckerTests/inline_assembly/assembly_memory_write.sol @@ -26,3 +26,4 @@ contract C { // Warning 7737: (156-187): Inline assembly may cause SMTChecker to produce spurious warnings (false positives). // Warning 6328: (190-208): CHC: Assertion violation happens here. // Warning 6328: (227-244): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/invariants/loop_basic.sol b/test/libsolidity/smtCheckerTests/invariants/loop_basic.sol index 6bac672ebac3..f43b61f8dbcf 100644 --- a/test/libsolidity/smtCheckerTests/invariants/loop_basic.sol +++ b/test/libsolidity/smtCheckerTests/invariants/loop_basic.sol @@ -11,3 +11,4 @@ contract Simple { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/invariants/loop_basic_for.sol b/test/libsolidity/smtCheckerTests/invariants/loop_basic_for.sol index 10ff0d5933a3..dcc731bf8e20 100644 --- a/test/libsolidity/smtCheckerTests/invariants/loop_basic_for.sol +++ b/test/libsolidity/smtCheckerTests/invariants/loop_basic_for.sol @@ -9,3 +9,4 @@ contract Simple { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/invariants/loop_nested.sol b/test/libsolidity/smtCheckerTests/invariants/loop_nested.sol index aea9c95ab9a5..d14c2a2a3e38 100644 --- a/test/libsolidity/smtCheckerTests/invariants/loop_nested.sol +++ b/test/libsolidity/smtCheckerTests/invariants/loop_nested.sol @@ -17,3 +17,4 @@ contract Simple { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/invariants/loop_nested_for.sol b/test/libsolidity/smtCheckerTests/invariants/loop_nested_for.sol index 3513c15d334a..55f5b617de7a 100644 --- a/test/libsolidity/smtCheckerTests/invariants/loop_nested_for.sol +++ b/test/libsolidity/smtCheckerTests/invariants/loop_nested_for.sol @@ -14,3 +14,4 @@ contract Simple { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/invariants/state_machine_1.sol b/test/libsolidity/smtCheckerTests/invariants/state_machine_1.sol index 4e74d4ea68d6..fd0610eafb55 100644 --- a/test/libsolidity/smtCheckerTests/invariants/state_machine_1.sol +++ b/test/libsolidity/smtCheckerTests/invariants/state_machine_1.sol @@ -33,3 +33,4 @@ contract C { // SMTIgnoreOS: macos // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/do_while_1_fail.sol b/test/libsolidity/smtCheckerTests/loops/do_while_1_fail.sol index 96fbf7557fc0..6ebaa26738fc 100644 --- a/test/libsolidity/smtCheckerTests/loops/do_while_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/do_while_1_fail.sol @@ -12,4 +12,5 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- -// Warning 6328: (110-124): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 14\n\nTransaction trace:\nC.constructor()\nC.f(13) +// Warning 6328: (110-124): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/do_while_1_false_positives.sol b/test/libsolidity/smtCheckerTests/loops/do_while_1_false_positives.sol index 776ff1bf3236..f49fb588eb38 100644 --- a/test/libsolidity/smtCheckerTests/loops/do_while_1_false_positives.sol +++ b/test/libsolidity/smtCheckerTests/loops/do_while_1_false_positives.sol @@ -12,3 +12,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/do_while_break.sol b/test/libsolidity/smtCheckerTests/loops/do_while_break.sol index 6e1b7eafe012..7d779c473472 100644 --- a/test/libsolidity/smtCheckerTests/loops/do_while_break.sol +++ b/test/libsolidity/smtCheckerTests/loops/do_while_break.sol @@ -14,3 +14,4 @@ contract C { // ---- // Warning 5740: (71-76): Unreachable code. // Warning 5740: (89-95): Unreachable code. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/do_while_break_2.sol b/test/libsolidity/smtCheckerTests/loops/do_while_break_2.sol index 3f1d6af00270..c7710320a04c 100644 --- a/test/libsolidity/smtCheckerTests/loops/do_while_break_2.sol +++ b/test/libsolidity/smtCheckerTests/loops/do_while_break_2.sol @@ -18,3 +18,4 @@ contract C { // ---- // Warning 5740: (95-100): Unreachable code. // Warning 5740: (114-118): Unreachable code. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/do_while_continue.sol b/test/libsolidity/smtCheckerTests/loops/do_while_continue.sol index ce989722efea..5564b6a5914f 100644 --- a/test/libsolidity/smtCheckerTests/loops/do_while_continue.sol +++ b/test/libsolidity/smtCheckerTests/loops/do_while_continue.sol @@ -13,3 +13,4 @@ contract C { // SMTSolvers: z3 // ---- // Warning 5740: (74-79): Unreachable code. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_1_break.sol b/test/libsolidity/smtCheckerTests/loops/for_1_break.sol index d1d2a50bd80f..31b92ef0a339 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_1_break.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_1_break.sol @@ -17,3 +17,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_1_break_fail.sol b/test/libsolidity/smtCheckerTests/loops/for_1_break_fail.sol index fa7a489e4f9c..271d220f0423 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_1_break_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_1_break_fail.sol @@ -16,4 +16,5 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- -// Warning 6328: (168-183): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\nb = false\n\nTransaction trace:\nC.constructor()\nC.f(0, false) +// Warning 6328: (168-183): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_1_continue.sol b/test/libsolidity/smtCheckerTests/loops/for_1_continue.sol index b9b90923c1e6..66193a31f7e6 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_1_continue.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_1_continue.sol @@ -15,3 +15,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_1_continue_fail.sol b/test/libsolidity/smtCheckerTests/loops/for_1_continue_fail.sol index 2e4d5a0f738d..d35e727cc3fa 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_1_continue_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_1_continue_fail.sol @@ -13,4 +13,5 @@ contract C // SMTSolvers: z3 // ---- // Warning 5667: (33-39): Unused function parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (109-123): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 10\nb = false\n\nTransaction trace:\nC.constructor()\nC.f(9, false) +// Warning 6328: (109-123): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_1_fail.sol b/test/libsolidity/smtCheckerTests/loops/for_1_fail.sol index 84d36aa6699f..7d179aa101d9 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_1_fail.sol @@ -14,5 +14,6 @@ contract C // SMTSolvers: z3 // ---- // Warning 4984: (143-148): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. -// Warning 6328: (156-170): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 14\n\nTransaction trace:\nC.constructor()\nC.f(4) +// Warning 6328: (156-170): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 2661: (143-148): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. diff --git a/test/libsolidity/smtCheckerTests/loops/for_1_false_positive.sol b/test/libsolidity/smtCheckerTests/loops/for_1_false_positive.sol index 3b6842b419c6..46694d785a62 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_1_false_positive.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_1_false_positive.sol @@ -13,4 +13,5 @@ contract C // SMTEngine: all // ---- // Warning 4984: (106-111): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 2661: (106-111): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. diff --git a/test/libsolidity/smtCheckerTests/loops/for_break_direct.sol b/test/libsolidity/smtCheckerTests/loops/for_break_direct.sol index baedb4a97e26..a25f0fcc1baf 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_break_direct.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_break_direct.sol @@ -11,3 +11,4 @@ contract C // SMTSolvers: z3 // ---- // Warning 5740: (69-72): Unreachable code. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_1.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_1.sol index dbf9bd82b5fc..155aa45bfd5f 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_1.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_1.sol @@ -9,3 +9,4 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_2.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_2.sol index 0c9327c626ec..212feb824563 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_2.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_2.sol @@ -9,3 +9,4 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_3.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_3.sol index befdb4491926..ae6392bdfc62 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_3.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_3.sol @@ -9,3 +9,4 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_6.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_6.sol index 2056510be18a..976d2540a77f 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_6.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_6.sol @@ -12,3 +12,4 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_memory.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_memory.sol index c51e7ca0c6f1..953a6d507cfc 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_memory.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_memory.sol @@ -24,3 +24,4 @@ contract LoopFor2 { // SMTIgnoreCex: yes // ---- // Warning 2072: (202-217): Unused local variable. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_storage.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_storage.sol index c5fa1f288d7c..53a6142a6e4e 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_storage.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_memory_storage.sol @@ -27,3 +27,4 @@ contract LoopFor2 { // SMTIgnoreOS: macos // SMTSolvers: z3 // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_storage_memory.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_storage_memory.sol index dbcf88a80676..d52cc2c99046 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_storage_memory.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_array_assignment_storage_memory.sol @@ -23,3 +23,4 @@ contract LoopFor2 { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_1.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_1.sol index 781463d5a14a..d667a55c854d 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_1.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_1.sol @@ -9,4 +9,5 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (90-96): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_2.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_2.sol index ede2e433561d..65caca9826b3 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_2.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_2.sol @@ -12,4 +12,5 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (106-112): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_3.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_3.sol index 0beae52d7a07..e5219bad58f0 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_3.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_trivial_condition_3.sol @@ -17,3 +17,4 @@ contract C { // SMTSolvers: z3 // ---- // Warning 2072: (83-89): Unused local variable. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/for_loop_unreachable_1.sol b/test/libsolidity/smtCheckerTests/loops/for_loop_unreachable_1.sol index c040ecb984b3..4fdaa6bcf059 100644 --- a/test/libsolidity/smtCheckerTests/loops/for_loop_unreachable_1.sol +++ b/test/libsolidity/smtCheckerTests/loops/for_loop_unreachable_1.sol @@ -9,4 +9,5 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (90-95): BMC: Condition is always false. diff --git a/test/libsolidity/smtCheckerTests/loops/while_1.sol b/test/libsolidity/smtCheckerTests/loops/while_1.sol index 4ce223d128f8..ffb407fee1ae 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_1.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_1.sol @@ -15,3 +15,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_1_break.sol b/test/libsolidity/smtCheckerTests/loops/while_1_break.sol index 8b78b1fa8f36..136509f63ece 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_1_break.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_1_break.sol @@ -17,3 +17,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_1_break_fail.sol b/test/libsolidity/smtCheckerTests/loops/while_1_break_fail.sol index ac4071e7f601..84ec71f4c834 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_1_break_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_1_break_fail.sol @@ -17,4 +17,5 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- -// Warning 6328: (185-200): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\nb = false\n\nTransaction trace:\nC.constructor()\nC.f(0, false) +// Warning 6328: (185-200): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_1_continue.sol b/test/libsolidity/smtCheckerTests/loops/while_1_continue.sol index 46d291c89afe..b2e63a3bc2ad 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_1_continue.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_1_continue.sol @@ -16,3 +16,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_1_fail.sol b/test/libsolidity/smtCheckerTests/loops/while_1_fail.sol index f679e3e59aa1..941bd541560b 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_1_fail.sol @@ -12,4 +12,5 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- -// Warning 6328: (106-120): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 14\n\nTransaction trace:\nC.constructor()\nC.f(14) +// Warning 6328: (106-120): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_1_infinite.sol b/test/libsolidity/smtCheckerTests/loops/while_1_infinite.sol index 8281d238d48d..bbd7bfe4ede0 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_1_infinite.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_1_infinite.sol @@ -20,3 +20,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_2.sol b/test/libsolidity/smtCheckerTests/loops/while_2.sol index 53323c27554b..b4d0edacd46d 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_2.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_2.sol @@ -14,3 +14,4 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_2_break.sol b/test/libsolidity/smtCheckerTests/loops/while_2_break.sol index d844ba676b46..5e2bbd44834e 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_2_break.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_2_break.sol @@ -15,3 +15,4 @@ contract C // SMTSolvers: z3 // ---- // Warning 5740: (95-98): Unreachable code. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_2_break_fail.sol b/test/libsolidity/smtCheckerTests/loops/while_2_break_fail.sol index 49b82c0e9daf..95e5b4c344a2 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_2_break_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_2_break_fail.sol @@ -16,3 +16,4 @@ contract C // ---- // Warning 5740: (87-90): Unreachable code. // Warning 6328: (98-112): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_2_fail.sol b/test/libsolidity/smtCheckerTests/loops/while_2_fail.sol index 9a1cbe695a2c..95324dd6568b 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_2_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_2_fail.sol @@ -14,3 +14,4 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_break_direct.sol b/test/libsolidity/smtCheckerTests/loops/while_break_direct.sol index 47515ecad1e2..783a2f268936 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_break_direct.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_break_direct.sol @@ -11,4 +11,5 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (65-71): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_memory.sol b/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_memory.sol index 6ee19dfa4d4e..be350ef5e22d 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_memory.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_memory.sol @@ -30,3 +30,4 @@ contract LoopFor2 { // ---- // Warning 2072: (202-217): Unused local variable. // Warning 2072: (225-231): Unused local variable. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_storage.sol b/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_storage.sol index 788c36e378fa..1e5e2fbe9b93 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_storage.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_memory_storage.sol @@ -34,3 +34,4 @@ contract LoopFor2 { // SMTSolvers: z3 // ---- // Warning 2072: (280-286): Unused local variable. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_storage_storage.sol b/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_storage_storage.sol index f6f1f3210783..ed7ebdfba570 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_storage_storage.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_loop_array_assignment_storage_storage.sol @@ -26,6 +26,7 @@ contract LoopFor2 { // SMTEngine: all // ---- // Warning 6368: (288-292): CHC: Out of bounds access might happen here. -// Warning 6368: (459-463): CHC: Out of bounds access happens here.\nCounterexample:\nb = [1, 0], c = [0, 0]\nn = 1\na = []\ni = 1\n\nTransaction trace:\nLoopFor2.constructor()\nState: b = [], c = []\nLoopFor2.p()\nState: b = [0], c = [0]\nLoopFor2.p()\nState: b = [0, 0], c = [0, 0]\nLoopFor2.testUnboundedForLoop(1) -// Warning 6328: (452-471): CHC: Assertion violation happens here.\nCounterexample:\nb = [1, 0], c = [0, 0]\nn = 1\ni = 1\n\nTransaction trace:\nLoopFor2.constructor()\nState: b = [], c = []\nLoopFor2.p()\nState: b = [0], c = [0]\nLoopFor2.p()\nState: b = [0, 0], c = [0, 0]\nLoopFor2.testUnboundedForLoop(1) -// Warning 6328: (475-494): CHC: Assertion violation happens here.\nCounterexample:\nb = [1, 0], c = [0, 0]\nn = 1\ni = 1\n\nTransaction trace:\nLoopFor2.constructor()\nState: b = [], c = []\nLoopFor2.p()\nState: b = [0], c = [0]\nLoopFor2.p()\nState: b = [0, 0], c = [0, 0]\nLoopFor2.testUnboundedForLoop(1) +// Warning 6368: (459-463): CHC: Out of bounds access happens here. +// Warning 6328: (452-471): CHC: Assertion violation happens here. +// Warning 6328: (475-494): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_loop_simple_2.sol b/test/libsolidity/smtCheckerTests/loops/while_loop_simple_2.sol index b8c04fa92443..e71e73ee945f 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_loop_simple_2.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_loop_simple_2.sol @@ -10,3 +10,4 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_loop_simple_4.sol b/test/libsolidity/smtCheckerTests/loops/while_loop_simple_4.sol index 6cc75f2dc9fc..f5ee2dfaff37 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_loop_simple_4.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_loop_simple_4.sol @@ -10,3 +10,4 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_loop_simple_5.sol b/test/libsolidity/smtCheckerTests/loops/while_loop_simple_5.sol index bbcd6cd31fdf..5a085fdb023b 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_loop_simple_5.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_loop_simple_5.sol @@ -12,4 +12,5 @@ contract C { // SMTEngine: all // SMTSolvers: z3 // ---- -// Warning 6328: (192-206): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f(0, 0) +// Warning 6328: (192-206): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_nested_break.sol b/test/libsolidity/smtCheckerTests/loops/while_nested_break.sol index 696cdf3dd0f2..8f80745b8b53 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_nested_break.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_nested_break.sol @@ -30,3 +30,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_nested_break_fail.sol b/test/libsolidity/smtCheckerTests/loops/while_nested_break_fail.sol index 5a1bc93953aa..60ce3be9ba15 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_nested_break_fail.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_nested_break_fail.sol @@ -29,5 +29,6 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (296-311): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 10\nb = false\nc = true\n\nTransaction trace:\nC.constructor()\nC.f(0, 9, false, true) -// Warning 6328: (347-362): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 15\ny = 0\nb = true\nc = false\n\nTransaction trace:\nC.constructor()\nC.f(9, 0, true, false) +// Warning 6328: (296-311): CHC: Assertion violation happens here. +// Warning 6328: (347-362): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/loops/while_nested_continue.sol b/test/libsolidity/smtCheckerTests/loops/while_nested_continue.sol index c175d233c622..eee4d91df644 100644 --- a/test/libsolidity/smtCheckerTests/loops/while_nested_continue.sol +++ b/test/libsolidity/smtCheckerTests/loops/while_nested_continue.sol @@ -28,3 +28,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/math/addmod_1.sol b/test/libsolidity/smtCheckerTests/math/addmod_1.sol index 62272c59575d..3ec75c8c7c5d 100644 --- a/test/libsolidity/smtCheckerTests/math/addmod_1.sol +++ b/test/libsolidity/smtCheckerTests/math/addmod_1.sol @@ -12,6 +12,7 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4281: (108-133): CHC: Division by zero happens here.\nCounterexample:\n\ny = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (137-151): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 4281: (230-245): CHC: Division by zero happens here.\nCounterexample:\n\nx = 0\ny = 0\nk = 0\n = 0\n\nTransaction trace:\nC.constructor()\nC.g(0, 0, 0) +// Warning 4281: (108-133): CHC: Division by zero happens here. +// Warning 6328: (137-151): CHC: Assertion violation happens here. +// Warning 4281: (230-245): CHC: Division by zero happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/math/addmod_mulmod.sol b/test/libsolidity/smtCheckerTests/math/addmod_mulmod.sol index 39d1c81106aa..b957a9b41219 100644 --- a/test/libsolidity/smtCheckerTests/math/addmod_mulmod.sol +++ b/test/libsolidity/smtCheckerTests/math/addmod_mulmod.sol @@ -9,5 +9,6 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (60-110): BMC: Condition is always false. // Warning 6838: (125-175): BMC: Condition is always false. diff --git a/test/libsolidity/smtCheckerTests/math/addmod_mulmod_zero.sol b/test/libsolidity/smtCheckerTests/math/addmod_mulmod_zero.sol index 4d36da6b5749..90a4f8b9d046 100644 --- a/test/libsolidity/smtCheckerTests/math/addmod_mulmod_zero.sol +++ b/test/libsolidity/smtCheckerTests/math/addmod_mulmod_zero.sol @@ -22,7 +22,8 @@ contract C { // SMTEngine: all // ---- // Warning 6321: (220-227): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 4281: (61-76): CHC: Division by zero happens here.\nCounterexample:\n\nd = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.f(0) -// Warning 6328: (80-93): CHC: Assertion violation happens here.\nCounterexample:\n\nd = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.f(0) -// Warning 4281: (147-162): CHC: Division by zero happens here.\nCounterexample:\n\nd = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.g(0) -// Warning 6328: (166-179): CHC: Assertion violation happens here.\nCounterexample:\n\nd = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.g(0) +// Warning 4281: (61-76): CHC: Division by zero happens here. +// Warning 6328: (80-93): CHC: Assertion violation happens here. +// Warning 4281: (147-162): CHC: Division by zero happens here. +// Warning 6328: (166-179): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/math/addmulmod.sol b/test/libsolidity/smtCheckerTests/math/addmulmod.sol index 1979e4e56aae..478121284a77 100644 --- a/test/libsolidity/smtCheckerTests/math/addmulmod.sol +++ b/test/libsolidity/smtCheckerTests/math/addmulmod.sol @@ -17,3 +17,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/math/mulmod_1.sol b/test/libsolidity/smtCheckerTests/math/mulmod_1.sol index 2a3648f3f3cd..de15f362a3b6 100644 --- a/test/libsolidity/smtCheckerTests/math/mulmod_1.sol +++ b/test/libsolidity/smtCheckerTests/math/mulmod_1.sol @@ -12,6 +12,7 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4281: (108-133): CHC: Division by zero happens here.\nCounterexample:\n\ny = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (137-151): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 4281: (230-245): CHC: Division by zero happens here.\nCounterexample:\n\nx = 0\ny = 0\nk = 0\n = 0\n\nTransaction trace:\nC.constructor()\nC.g(0, 0, 0) +// Warning 4281: (108-133): CHC: Division by zero happens here. +// Warning 6328: (137-151): CHC: Assertion violation happens here. +// Warning 4281: (230-245): CHC: Division by zero happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_code_after_placeholder.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_code_after_placeholder.sol index 3634cecb6ad1..5f08811b5c6c 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_code_after_placeholder.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_code_after_placeholder.sol @@ -21,4 +21,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (103-116): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g(115792089237316195423570985008687907853269984665640564039457584007913129639935)\nState: x = 115792089237316195423570985008687907853269984665640564039457584007913129639935\nC.f() +// Warning 6328: (103-116): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_control_flow.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_control_flow.sol index 1d466b5373e7..f348bf24d031 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_control_flow.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_control_flow.sol @@ -15,4 +15,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (111-124): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f() +// Warning 6328: (111-124): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_branch.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_branch.sol index 08a0c9f4c3e7..187305a6eb3e 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_branch.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_branch.sol @@ -24,4 +24,5 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (233-238): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_multi_branches.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_multi_branches.sol index d3467d0b89b0..db597db2a33f 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_multi_branches.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_inside_branch_assignment_multi_branches.sol @@ -34,5 +34,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (540-554): CHC: Assertion violation happens here.\nCounterexample:\nx = 1, owner = 0x0\ny = 1\n\nTransaction trace:\nC.constructor()\nState: x = 0, owner = 0x0\nC.g(1){ msg.sender: 0x0 } -// Info 1180: Contract invariant(s) for :C:\n(owner <= 0)\n +// Warning 6328: (540-554): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_multi.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_multi.sol index d3a4bd92f95a..292c44ae1c11 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_multi.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_multi.sol @@ -26,4 +26,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (137-150): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g(1)\nState: x = 1\nC.f() +// Warning 6328: (137-150): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions.sol index f1804abe85e3..fb503bb7b299 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions.sol @@ -22,4 +22,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (278-291): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\na = 1\nb = 0\n\nTransaction trace:\nC.constructor()\nC.f(1)\n C.g(1, 0) -- internal call +// Warning 6328: (278-291): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions_recursive.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions_recursive.sol index 4281dcdd579a..1e55dab19bed 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions_recursive.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_functions_recursive.sol @@ -19,3 +19,4 @@ contract C // ---- // Warning 5740: (137-157): Unreachable code. // Warning 5740: (199-237): Unreachable code. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_parameters.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_parameters.sol index 2f6a820a5397..31578a311438 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_parameters.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_multi_parameters.sol @@ -13,4 +13,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (131-144): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\na = 1\nb = 0\n\nTransaction trace:\nC.constructor()\nC.f(1) +// Warning 6328: (131-144): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_overflow.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_overflow.sol index 25141b8bf31e..b3c5b8ed0fdb 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_overflow.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_overflow.sol @@ -15,4 +15,4 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_1.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_1.sol index bed6b448e2db..9165ed13311a 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_1.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_1.sol @@ -20,4 +20,5 @@ contract B is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (209-223): CHC: Assertion violation happens here.\nCounterexample:\ns = 42\nx = 42\n\nTransaction trace:\nB.constructor()\nState: s = 0\nB.set(42)\nState: s = 42\nA.f() +// Warning 6328: (209-223): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_3.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_3.sol index 4e408059c8ca..f85e1b3baec0 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_3.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_3.sol @@ -18,4 +18,5 @@ contract B is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (94-104): CHC: Assertion violation happens here.\nCounterexample:\ns = true\nx = true\n\nTransaction trace:\nB.constructor()\nState: s = false\nA.f() +// Warning 6328: (94-104): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_4.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_4.sol index 39be35cb6dcd..652dd811f3d4 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_4.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_overriding_4.sol @@ -36,7 +36,7 @@ contract D is B,C { // ==== // SMTEngine: all // ---- -// Warning 6328: (160-174): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nB.constructor()\nState: x = 0\nA.f() -// Warning 6328: (193-207): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor()\nState: x = 0\nA.f() -// Warning 6328: (226-240): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\nTransaction trace:\nD.constructor()\nState: x = 0\nA.f() -// Info 1180: Contract invariant(s) for :C:\n((x = 0) || (x = 2))\nContract invariant(s) for :D:\n((x = 0) || (x = 3))\nContract invariant(s) for :B:\n((x = 0) || (x = 1))\n +// Warning 6328: (160-174): CHC: Assertion violation happens here. +// Warning 6328: (193-207): CHC: Assertion violation happens here. +// Warning 6328: (226-240): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_parameters.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_parameters.sol index 7c360c454fcf..761dd8a3bc82 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_parameters.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_parameters.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_return.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_return.sol index 2b9c95a3f82f..baa295d8515a 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_return.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_return.sol @@ -18,3 +18,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_simple.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_simple.sol index ef3da25adb9f..7875bb80f9bd 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_simple.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_simple.sol @@ -14,3 +14,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations.sol index 82014aa6b964..26197459b041 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations.sol @@ -17,3 +17,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations_2.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations_2.sol index 5641e2812b4e..d6bc51ffd5c3 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations_2.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_two_invocations_2.sol @@ -16,5 +16,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (76-90): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f() -// Info 1180: Contract invariant(s) for :C:\n(x = 3)\n +// Warning 6328: (76-90): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_two_placeholders.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_two_placeholders.sol index 940445d63af8..00b6fab519ce 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_two_placeholders.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_two_placeholders.sol @@ -23,4 +23,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (123-137): CHC: Assertion violation happens here.\nCounterexample:\nx = 3\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g(1)\nState: x = 1\nC.f() +// Warning 6328: (123-137): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/modifiers/modifier_virtual_static_call_2.sol b/test/libsolidity/smtCheckerTests/modifiers/modifier_virtual_static_call_2.sol index 43d41f755b81..b270fb2bb5e1 100644 --- a/test/libsolidity/smtCheckerTests/modifiers/modifier_virtual_static_call_2.sol +++ b/test/libsolidity/smtCheckerTests/modifiers/modifier_virtual_static_call_2.sol @@ -20,5 +20,5 @@ contract C is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (83-98): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f() -// Info 1180: Contract invariant(s) for :C:\n((x >= 0) && (x <= 0))\n +// Warning 6328: (83-98): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/natspec/abstract_free_function_1.sol b/test/libsolidity/smtCheckerTests/natspec/abstract_free_function_1.sol new file mode 100644 index 000000000000..d013670594ed --- /dev/null +++ b/test/libsolidity/smtCheckerTests/natspec/abstract_free_function_1.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.13; + +contract C { + function f(uint x) external pure { + uint t = msb(x); + assert(t == 0); // should fail + } +} + +/// @custom:smtchecker abstract-function-nondet +function msb(uint256 x) pure returns (uint256 result) {} + +// ==== +// SMTEngine: chc +// ---- +// Warning 6328: (144-158): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/natspec/abstract_function_nondet_pow_no_abstraction.sol b/test/libsolidity/smtCheckerTests/natspec/abstract_function_nondet_pow_no_abstraction.sol index 2a2f16c477f9..b9bca0357a91 100644 --- a/test/libsolidity/smtCheckerTests/natspec/abstract_function_nondet_pow_no_abstraction.sol +++ b/test/libsolidity/smtCheckerTests/natspec/abstract_function_nondet_pow_no_abstraction.sol @@ -35,3 +35,5 @@ contract C { } // ==== // SMTEngine: chc +// ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/natspec/abstract_function_nondet_pow_with_abstraction.sol b/test/libsolidity/smtCheckerTests/natspec/abstract_function_nondet_pow_with_abstraction.sol index a80708d304f1..e0647000a2cf 100644 --- a/test/libsolidity/smtCheckerTests/natspec/abstract_function_nondet_pow_with_abstraction.sol +++ b/test/libsolidity/smtCheckerTests/natspec/abstract_function_nondet_pow_with_abstraction.sol @@ -33,3 +33,5 @@ contract C { } // ==== // SMTEngine: chc +// ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/natspec/safe_assert_false_positive_pure.sol b/test/libsolidity/smtCheckerTests/natspec/safe_assert_false_positive_pure.sol index ed160d95c2c8..552c8d4f60e6 100644 --- a/test/libsolidity/smtCheckerTests/natspec/safe_assert_false_positive_pure.sol +++ b/test/libsolidity/smtCheckerTests/natspec/safe_assert_false_positive_pure.sol @@ -28,4 +28,4 @@ contract C { // Warning 2018: (33-335): Function state mutability can be restricted to view // Warning 2018: (457-524): Function state mutability can be restricted to pure // Warning 6328: (135-150): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\n(y <= 0)\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/assignment_chain_tuple_contract_2.sol b/test/libsolidity/smtCheckerTests/operators/assignment_chain_tuple_contract_2.sol index 4c97f8a698ac..461761bafa8b 100644 --- a/test/libsolidity/smtCheckerTests/operators/assignment_chain_tuple_contract_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/assignment_chain_tuple_contract_2.sol @@ -10,4 +10,5 @@ contract C { } } // ---- -// Warning 6328: (174-188): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor()\nState: x = 2\nC.g() +// Warning 6328: (174-188): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/assignment_chain_tuple_contract_3.sol b/test/libsolidity/smtCheckerTests/operators/assignment_chain_tuple_contract_3.sol index 08b87282e073..6496ec525bf0 100644 --- a/test/libsolidity/smtCheckerTests/operators/assignment_chain_tuple_contract_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/assignment_chain_tuple_contract_3.sol @@ -18,5 +18,6 @@ contract D is C { } } // ---- -// Warning 6328: (95-109): CHC: Assertion violation happens here.\nCounterexample:\ny = 3, x = 3\n\nTransaction trace:\nD.constructor()\nState: y = 3, x = 3\nC.f() -// Warning 6328: (180-194): CHC: Assertion violation happens here.\nCounterexample:\nx = 2\n\nTransaction trace:\nC.constructor()\nState: x = 2\nC.g() +// Warning 6328: (95-109): CHC: Assertion violation happens here. +// Warning 6328: (180-194): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable.sol b/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable.sol index efa29edc1123..40eb48672ebe 100644 --- a/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable.sol +++ b/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable.sol @@ -30,3 +30,4 @@ contract A { // SMTIgnoreInv: yes // ---- // Warning 6328: (392-408): CHC: Assertion violation happens here. +// Info 1391: CHC: 17 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array.sol b/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array.sol index 292eab85d2d3..3a93659f4361 100644 --- a/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array.sol +++ b/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array.sol @@ -12,5 +12,5 @@ contract A { // ==== // SMTEngine: all // ---- -// Warning 6328: (124-146): CHC: Assertion violation happens here.\nCounterexample:\na = []\n\nTransaction trace:\nA.constructor()\nState: a = []\nA.f() -// Info 1180: Contract invariant(s) for :A:\n(a.length <= 0)\n +// Warning 6328: (124-146): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array_2.sol b/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array_2.sol index 2554356c588c..694d110e195e 100644 --- a/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array_2.sol @@ -9,3 +9,4 @@ contract A { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array_3.sol b/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array_3.sol index 7a925d1341fc..0fe3e68bea1d 100644 --- a/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/assignment_contract_member_variable_array_3.sol @@ -26,8 +26,8 @@ contract A { // ==== // SMTEngine: all // ---- -// Warning 6368: (318-322): CHC: Out of bounds access happens here.\nCounterexample:\na = [0, 0]\nu = []\nb = [0, 0]\n\nTransaction trace:\nA.constructor()\nState: a = [1]\nA.f() -// Warning 6328: (311-328): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0]\nb = [0, 0]\n\nTransaction trace:\nA.constructor()\nState: a = [1]\nA.f() -// Warning 6368: (422-426): CHC: Out of bounds access happens here.\nCounterexample:\na = [0, 0]\nu = []\nb = [0, 0]\n\nTransaction trace:\nA.constructor()\nState: a = [1]\nA.f() -// Warning 6328: (415-432): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0]\nb = [0, 0]\n\nTransaction trace:\nA.constructor()\nState: a = [1]\nA.f() -// Info 1180: Contract invariant(s) for :A:\n!(a.length <= 0)\n +// Warning 6368: (318-322): CHC: Out of bounds access happens here. +// Warning 6328: (311-328): CHC: Assertion violation happens here. +// Warning 6368: (422-426): CHC: Out of bounds access happens here. +// Warning 6328: (415-432): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/assignment_module_contract_member_variable.sol b/test/libsolidity/smtCheckerTests/operators/assignment_module_contract_member_variable.sol index 781476de25de..baa1c75a474a 100644 --- a/test/libsolidity/smtCheckerTests/operators/assignment_module_contract_member_variable.sol +++ b/test/libsolidity/smtCheckerTests/operators/assignment_module_contract_member_variable.sol @@ -29,6 +29,6 @@ contract A { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (AASource:159-178): CHC: Assertion violation happens here.\nCounterexample:\nx = (- 1), y = (- 2)\n\nTransaction trace:\nA.constructor()\nState: x = 0, y = 0\nA.a()\nState: x = (- 2), y = (- 2)\nA.a() -// Warning 6328: (AASource:370-386): CHC: Assertion violation happens here.\nCounterexample:\nx = 8, y = (- 2)\n\nTransaction trace:\nA.constructor()\nState: x = 0, y = 0\nA.a() -// Info 1180: Contract invariant(s) for AASource:A:\n(((x = 0) && (y = 0)) || ((x = (- 2)) && (y = (- 2))))\n +// Warning 6328: (AASource:159-178): CHC: Assertion violation happens here. +// Warning 6328: (AASource:370-386): CHC: Assertion violation happens here. +// Info 1391: CHC: 16 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_and_fixed_bytes.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_and_fixed_bytes.sol index 64d31bff062a..175702d6837b 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_and_fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_and_fixed_bytes.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (237-285): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (237-285): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_and_int.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_and_int.sol index 611fd95986b2..4bae4f67b87c 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_and_int.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_and_int.sol @@ -15,4 +15,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (71-89): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\ny = 0\nz = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (71-89): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_and_rational.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_and_rational.sol index 1f4c6c3d1af2..ec649ce7b097 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_and_rational.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_and_rational.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (43-61): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (43-61): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_and_uint.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_and_uint.sol index 47f0dcba2890..fcf2bdfca8de 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_and_uint.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_and_uint.sol @@ -13,6 +13,7 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (74-92): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (147-170): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\ny = 65535\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (174-197): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\ny = 65535\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (74-92): CHC: Assertion violation happens here. +// Warning 6328: (147-170): CHC: Assertion violation happens here. +// Warning 6328: (174-197): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_combo.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_combo.sol index 19fdaf9472cb..0a0822dd9b19 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_combo.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_combo.sol @@ -10,3 +10,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_not_fixed_bytes.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_not_fixed_bytes.sol index 6a9d4e90ac0b..c028baf9f580 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_not_fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_not_fixed_bytes.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (100-123): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0xffff\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (100-123): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_not_int.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_not_int.sol index e254d5b40c4c..cf6d09000613 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_not_int.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_not_int.sol @@ -15,7 +15,8 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (58-73): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (89-104): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (120-138): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 15\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (152-167): CHC: Assertion violation happens here.\nCounterexample:\n\nx = (- 1)\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (58-73): CHC: Assertion violation happens here. +// Warning 6328: (89-104): CHC: Assertion violation happens here. +// Warning 6328: (120-138): CHC: Assertion violation happens here. +// Warning 6328: (152-167): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_not_uint.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_not_uint.sol index 8cf205e9c013..19b33bd6e696 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_not_uint.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_not_uint.sol @@ -11,5 +11,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (126-146): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\ny = 65280\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (150-170): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\ny = 65280\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (126-146): CHC: Assertion violation happens here. +// Warning 6328: (150-170): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_operators_do_not_throw_exceptions.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_operators_do_not_throw_exceptions.sol new file mode 100644 index 000000000000..f1e89940907b --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_operators_do_not_throw_exceptions.sol @@ -0,0 +1,13 @@ +contract C { + // tests that bitwise operators are parsed from z3 answer + function test(uint x, uint y) public pure { + x | y; + x & y; + x ^ y; + assert(true); + } +} +// ==== +// SMTEngine: all +// ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_or_fixed_bytes.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_or_fixed_bytes.sol index acbe3fa6da04..9ae3b79e6e19 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_or_fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_or_fixed_bytes.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (150-175): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0x0\nb = 0xff\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (150-175): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_or_int.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_or_int.sol index cc96e9b1ee04..9f1ff33277ef 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_or_int.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_or_int.sol @@ -17,5 +17,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (111-129): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 0\nz = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (234-253): CHC: Assertion violation happens here.\nCounterexample:\n\nx = (- 1)\ny = 200\nz = 255\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (111-129): CHC: Assertion violation happens here. +// Warning 6328: (234-253): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_or_uint.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_or_uint.sol index d6ebdf4983ee..e66c5e8c5e9f 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_or_uint.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_or_uint.sol @@ -13,5 +13,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (122-143): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\ny = 65280\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (174-197): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\ny = 65280\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (122-143): CHC: Assertion violation happens here. +// Warning 6328: (174-197): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_rational_1.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_rational_1.sol index 14794f6e7877..1783a4e35594 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_rational_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_rational_1.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_rational_2.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_rational_2.sol index 3d3f373a0c45..5dc27441790f 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_rational_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_rational_2.sol @@ -12,4 +12,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (148-161): CHC: Assertion violation happens here.\nCounterexample:\n\nx = (- 2)\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (148-161): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_xor_fixed_bytes.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_xor_fixed_bytes.sol index 62cf620d6646..927097552d85 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_xor_fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_xor_fixed_bytes.sol @@ -11,3 +11,4 @@ contract Simp { // SMTIgnoreCex: yes // ---- // Warning 6328: (140-171): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_xor_int.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_xor_int.sol index 1075480cb456..67b2246eac72 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_xor_int.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_xor_int.sol @@ -15,5 +15,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (156-173): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\ny = 0\nz = (- 1)\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (214-231): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 7\ny = 3\nz = (- 1)\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (156-173): CHC: Assertion violation happens here. +// Warning 6328: (214-231): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bitwise_xor_uint.sol b/test/libsolidity/smtCheckerTests/operators/bitwise_xor_uint.sol index 6d28cdbcf01e..6dcbcc8bef8a 100644 --- a/test/libsolidity/smtCheckerTests/operators/bitwise_xor_uint.sol +++ b/test/libsolidity/smtCheckerTests/operators/bitwise_xor_uint.sol @@ -13,5 +13,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (122-143): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\ny = 65280\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (174-197): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 255\ny = 65280\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (122-143): CHC: Assertion violation happens here. +// Warning 6328: (174-197): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/bytes_new.sol b/test/libsolidity/smtCheckerTests/operators/bytes_new.sol index b961c53d5246..2c9d5e39c663 100644 --- a/test/libsolidity/smtCheckerTests/operators/bytes_new.sol +++ b/test/libsolidity/smtCheckerTests/operators/bytes_new.sol @@ -34,5 +34,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6368: (468-472): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = [0x12, 0x34, 0x0]\n\nTransaction trace:\nC.constructor()\nC.h() -// Warning 6368: (490-494): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = [0x12, 0x34, 0x0]\n\nTransaction trace:\nC.constructor()\nC.h() +// Warning 6368: (468-472): CHC: Out of bounds access happens here. +// Warning 6368: (490-494): CHC: Out of bounds access happens here. +// Info 1391: CHC: 23 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_add.sol b/test/libsolidity/smtCheckerTests/operators/compound_add.sol index 804f7c3cbe18..7a18b1c7ee4e 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_add.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_add.sol @@ -11,4 +11,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (118-133): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 200\n\nTransaction trace:\nC.constructor()\nC.f(0) +// Warning 6328: (118-133): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_add_array_index.sol b/test/libsolidity/smtCheckerTests/operators/compound_add_array_index.sol index 4186f39fecc4..5d8b4aaa18cf 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_add_array_index.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_add_array_index.sol @@ -20,4 +20,5 @@ contract C // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (262-284): CHC: Assertion violation happens here.\nCounterexample:\narray = [200, 0]\nx = 0\np = 0\n\nTransaction trace:\nC.constructor()\nState: array = [0, 0]\nC.f(0, 0) +// Warning 6328: (262-284): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_add_chain.sol b/test/libsolidity/smtCheckerTests/operators/compound_add_chain.sol index 2e706f946455..07a41244c1c5 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_add_chain.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_add_chain.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_add_mapping.sol b/test/libsolidity/smtCheckerTests/operators/compound_add_mapping.sol index ab133cefc91a..e0025230722e 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_add_mapping.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_add_mapping.sol @@ -13,4 +13,5 @@ contract C // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (165-185): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\np = 0\n\nTransaction trace:\nC.constructor()\nC.f(0, 0) +// Warning 6328: (165-185): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_1.sol b/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_1.sol index 6e6a106e2c46..5922c59df5a1 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_1.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (115-129): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\ny = 2\n\nTransaction trace:\nC.constructor()\nC.f(2) +// Warning 6328: (115-129): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_2.sol b/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_2.sol index bd81c17a45a7..9290d364ef01 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_2.sol @@ -18,4 +18,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (259-280): CHC: Assertion violation happens here.\nCounterexample:\narray = [2, 0]\nx = 2\np = 0\n\nTransaction trace:\nC.constructor()\nState: array = [0, 0]\nC.f(2, 0) +// Warning 6328: (259-280): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_3.sol b/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_3.sol index aa90aa2529dd..6611531157a2 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_assignment_division_3.sol @@ -12,4 +12,5 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (162-181): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\np = 0\n\nTransaction trace:\nC.constructor()\nC.f(2, 0) +// Warning 6328: (162-181): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_assignment_right_shift.sol b/test/libsolidity/smtCheckerTests/operators/compound_assignment_right_shift.sol index ca035131b24f..01f89d97a909 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_assignment_right_shift.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_assignment_right_shift.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_fixed_bytes.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_fixed_bytes.sol index b634e8468933..d596ddb895fe 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_fixed_bytes.sol @@ -13,4 +13,5 @@ contract C { // SMTEngine: all // ---- // Warning 6321: (51-57): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (177-191): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0x0\na = 0x0\nb = 0xf0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (177-191): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_int.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_int.sol index d634a1922b51..0797321f6df5 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_int.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_int.sol @@ -18,4 +18,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (81-95): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (81-95): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_uint.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_uint.sol index 2e86c4b3a409..3fe528cef58b 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_uint.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_and_uint.sol @@ -28,6 +28,7 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (144-158): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 3\nc = 0\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (347-366): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 3\nc = 0\nx = 255\ny = 255\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (473-490): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 3\nc = 0\nx = 255\ny = 65535\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (144-158): CHC: Assertion violation happens here. +// Warning 6328: (347-366): CHC: Assertion violation happens here. +// Warning 6328: (473-490): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_fixed_bytes.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_fixed_bytes.sol index edcf3230b9d2..f8206376d8f0 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_fixed_bytes.sol @@ -13,4 +13,5 @@ contract C { // SMTEngine: all // ---- // Warning 6321: (51-57): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (177-191): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0x0\na = 0xff\nb = 0xff\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (177-191): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_int.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_int.sol index 5d92940b7b2d..3309b5d8f505 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_int.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_int.sol @@ -18,4 +18,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (81-95): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (81-95): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_int_1.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_int_1.sol index fdd8c55cce3e..d3fbc3222571 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_int_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_int_1.sol @@ -20,3 +20,4 @@ contract C { // Warning 6368: (166-171): CHC: Out of bounds access might happen here. // Warning 6368: (166-174): CHC: Out of bounds access might happen here. // Warning 6328: (142-180): CHC: Assertion violation might happen here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_uint.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_uint.sol index e36d166a5e80..d022f87e6c13 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_uint.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_uint.sol @@ -24,6 +24,7 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (88-102): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 7\nc = 0\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (265-282): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 7\nc = 7\nx = 255\ny = 65535\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (391-410): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 7\nc = 7\nx = 65280\ny = 61951\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (88-102): CHC: Assertion violation happens here. +// Warning 6328: (265-282): CHC: Assertion violation happens here. +// Warning 6328: (391-410): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_uint_1.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_uint_1.sol index 802dd27ffac3..f0916cf7e869 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_uint_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_or_uint_1.sol @@ -14,3 +14,4 @@ contract C { // Warning 6368: (115-119): CHC: Out of bounds access might happen here. // Warning 6368: (141-145): CHC: Out of bounds access might happen here. // Warning 6328: (134-151): CHC: Assertion violation might happen here. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal.sol index a682f4692ea9..57d47eb1cd7d 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal.sol @@ -17,3 +17,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (123-142): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal_2.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal_2.sol index 59bd6c7b95de..70f9095f8439 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal_2.sol @@ -14,4 +14,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (147-165): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0x646567\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (147-165): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal_3.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal_3.sol index 396088e3c519..81b92965859d 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_string_literal_3.sol @@ -18,5 +18,6 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (229-276): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0x6062606464666060606260646466606060626064646660606062606464666060\nz = 0x6062606464666060606260646466606060626064646660606062606464666060\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (394-437): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0x63666566676e616263666566676e616263666566676e616263666566676e6162\nz = 0x63666566676e616263666566676e616263666566676e616263666566676e6162\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (229-276): CHC: Assertion violation happens here. +// Warning 6328: (394-437): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_fixed_bytes.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_fixed_bytes.sol index 6856f72e09f0..58902c22deec 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_fixed_bytes.sol @@ -13,4 +13,5 @@ contract C { // SMTEngine: all // ---- // Warning 6321: (51-57): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (178-195): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0x0\na = 0xff\nb = 0xf0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (178-195): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_int.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_int.sol index 30ee76277941..58cb7c5be38a 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_int.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_int.sol @@ -15,4 +15,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (81-95): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 1\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (81-95): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_uint.sol b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_uint.sol index 1e88cc52ee76..6d2daabb556d 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_uint.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_bitwise_xor_uint.sol @@ -24,6 +24,7 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (88-102): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 4\nc = 0\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (265-282): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 4\nc = 4\nx = 255\ny = 65280\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (389-408): CHC: Assertion violation happens here.\nCounterexample:\n\nv = 4\nc = 4\nx = 65280\ny = 65280\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (88-102): CHC: Assertion violation happens here. +// Warning 6328: (265-282): CHC: Assertion violation happens here. +// Warning 6328: (389-408): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_mul.sol b/test/libsolidity/smtCheckerTests/operators/compound_mul.sol index 4262cdd7ce98..c04affe2d9e8 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_mul.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_mul.sol @@ -11,4 +11,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (117-131): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 100\n\nTransaction trace:\nC.constructor()\nC.f(0) +// Warning 6328: (117-131): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_mul_array_index.sol b/test/libsolidity/smtCheckerTests/operators/compound_mul_array_index.sol index 37a00b06381d..18b2792d1c25 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_mul_array_index.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_mul_array_index.sol @@ -15,4 +15,5 @@ contract C // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (226-247): CHC: Assertion violation happens here.\nCounterexample:\narray = [100]\nx = 0\np = 0\n\nTransaction trace:\nC.constructor()\nState: array = []\nC.q()\nState: array = [0]\nC.f(0, 0) +// Warning 6328: (226-247): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_mul_mapping.sol b/test/libsolidity/smtCheckerTests/operators/compound_mul_mapping.sol index 42775cc9b273..df7c9d0399c1 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_mul_mapping.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_mul_mapping.sol @@ -11,5 +11,7 @@ contract C } // ==== // SMTEngine: all +// SMTIgnoreCex: yes // ---- -// Warning 6328: (164-183): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\np = 0\n\nTransaction trace:\nC.constructor()\nC.f(0, 0) +// Warning 6328: (164-183): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_shl_1.sol b/test/libsolidity/smtCheckerTests/operators/compound_shl_1.sol index 281543e1c8f5..b2b1af4a8749 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_shl_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_shl_1.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_sub.sol b/test/libsolidity/smtCheckerTests/operators/compound_sub.sol index 0c4394bb7b5a..bcfb3f785ca5 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_sub.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_sub.sol @@ -11,4 +11,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (117-131): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 90\ny = 90\n\nTransaction trace:\nC.constructor()\nC.f(90) +// Warning 6328: (117-131): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_sub_array_index.sol b/test/libsolidity/smtCheckerTests/operators/compound_sub_array_index.sol index 5c9b1181fe45..9d44f4156777 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_sub_array_index.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_sub_array_index.sol @@ -16,3 +16,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (226-247): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/compound_sub_mapping.sol b/test/libsolidity/smtCheckerTests/operators/compound_sub_mapping.sol index 9c8b27359a43..b10763319d35 100644 --- a/test/libsolidity/smtCheckerTests/operators/compound_sub_mapping.sol +++ b/test/libsolidity/smtCheckerTests/operators/compound_sub_mapping.sol @@ -14,3 +14,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (164-183): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_2.sol b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_2.sol index c33c12c294de..38dee0b2274e 100644 --- a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_2.sol @@ -10,3 +10,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (99-113): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_3.sol b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_3.sol index 4dd9e8eff86d..34763bd23907 100644 --- a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_3.sol @@ -12,3 +12,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (128-141): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_4.sol b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_4.sol index 7ddf0770614d..1e9b40211717 100644 --- a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_4.sol +++ b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_4.sol @@ -23,3 +23,4 @@ contract C { // SMTEngine: all // ---- // Warning 2072: (240-246): Unused local variable. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_6.sol b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_6.sol index b26fcbd93c09..87ca405b9978 100644 --- a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_6.sol +++ b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_6.sol @@ -25,4 +25,4 @@ contract C { // SMTIgnoreOS: macos // ---- // Warning 2072: (255-261): Unused local variable. -// Info 1180: Reentrancy property(ies) for :C:\n((!(x' >= 3) || (a' = a)) && ( <= 0) && (!(x' <= 0) || !(x >= 2)) && (!(x <= 2) || !(x' >= 3)))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(x == 2 || x == 1)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_function_2.sol b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_function_2.sol index a448bf1cbcd5..ebd04d04380c 100644 --- a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_function_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_function_2.sol @@ -18,3 +18,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (345-359): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_nested_always_true.sol b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_nested_always_true.sol index 484d175b02a5..3aa38daca2be 100644 --- a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_nested_always_true.sol +++ b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_nested_always_true.sol @@ -8,4 +8,5 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (114-116): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_statevar_1.sol b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_statevar_1.sol index a7664cc78e6e..32d5435d3883 100644 --- a/test/libsolidity/smtCheckerTests/operators/conditional_assignment_statevar_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/conditional_assignment_statevar_1.sol @@ -14,7 +14,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4984: (134-140): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. // Warning 4984: (143-146): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. -// Warning 2661: (134-140): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 2661: (143-146): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. diff --git a/test/libsolidity/smtCheckerTests/operators/const_exp_1.sol b/test/libsolidity/smtCheckerTests/operators/const_exp_1.sol index d33defde95c6..54d37f8ba1ac 100644 --- a/test/libsolidity/smtCheckerTests/operators/const_exp_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/const_exp_1.sol @@ -12,4 +12,5 @@ contract C { // SMTEngine: all // ---- // Warning 2018: (65-173): Function state mutability can be restricted to pure -// Warning 6328: (139-154): CHC: Assertion violation happens here.\nCounterexample:\nx = 2, y = 1024\n\nTransaction trace:\nC.constructor()\nState: x = 2, y = 1024\nC.f() +// Warning 6328: (139-154): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/constant_propagation_1.sol b/test/libsolidity/smtCheckerTests/operators/constant_propagation_1.sol index 74502ed2a675..a7dc70472efe 100644 --- a/test/libsolidity/smtCheckerTests/operators/constant_propagation_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/constant_propagation_1.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (251-281): CHC: Assertion violation happens here.\nCounterexample:\nDEPOSIT_CONTRACT_TREE_DEPTH = 32, MAX_DEPOSIT_COUNT = 4294967295\n\nTransaction trace:\nC.constructor()\nState: DEPOSIT_CONTRACT_TREE_DEPTH = 32, MAX_DEPOSIT_COUNT = 4294967295\nC.f() +// Warning 6328: (251-281): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/constant_propagation_2.sol b/test/libsolidity/smtCheckerTests/operators/constant_propagation_2.sol index 5b8206e29299..a38fd31d47c9 100644 --- a/test/libsolidity/smtCheckerTests/operators/constant_propagation_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/constant_propagation_2.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_array.sol b/test/libsolidity/smtCheckerTests/operators/delete_array.sol index fb71fc03bb0e..0fae64446077 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_array.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_array.sol @@ -17,4 +17,5 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (121-122): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_array_2d.sol b/test/libsolidity/smtCheckerTests/operators/delete_array_2d.sol index 32f2526cc644..d13e1e36bdd2 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_array_2d.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_array_2d.sol @@ -17,4 +17,4 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(true && !(a.length <= 2))\n(true && !(a[2].length <= 3))\n +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_array_index.sol b/test/libsolidity/smtCheckerTests/operators/delete_array_index.sol index 4f9001115897..a56bfed559c9 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_array_index.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_array_index.sol @@ -20,5 +20,5 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(a.length <= 2)\n +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (154-155): BMC: Condition is always false. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_array_index_2d.sol b/test/libsolidity/smtCheckerTests/operators/delete_array_index_2d.sol index 80a692429d04..71d260907e3d 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_array_index_2d.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_array_index_2d.sol @@ -27,5 +27,5 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (315-335): CHC: Assertion violation might happen here. -// Info 1180: Contract invariant(s) for :C:\n!(a.length <= 1)\n +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 4661: (315-335): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_array_push.sol b/test/libsolidity/smtCheckerTests/operators/delete_array_push.sol index 86a3ab5cce40..d65a2fdc2596 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_array_push.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_array_push.sol @@ -19,3 +19,4 @@ contract C { // ---- // Warning 6328: (143-190): CHC: Assertion violation happens here. // Warning 6328: (363-408): CHC: Assertion violation happens here. +// Info 1391: CHC: 16 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_function.sol b/test/libsolidity/smtCheckerTests/operators/delete_function.sol index 63dad1ab0bde..510254e8ea94 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_function.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_function.sol @@ -28,5 +28,5 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(a.length <= 2)\n +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (262-263): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_function_type_3.sol b/test/libsolidity/smtCheckerTests/operators/delete_function_type_3.sol index b334b982ecb6..33a31d6c4840 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_function_type_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_function_type_3.sol @@ -17,3 +17,4 @@ contract C { // Warning 6368: (149-155): CHC: Out of bounds access happens here. // Warning 6368: (172-178): CHC: Out of bounds access happens here. // Warning 6328: (165-184): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_multid_array.sol b/test/libsolidity/smtCheckerTests/operators/delete_multid_array.sol index 7849a78583e3..53a1a253e00e 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_multid_array.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_multid_array.sol @@ -57,3 +57,4 @@ contract C { // SMTEngine: all // SMTIgnoreCex: yes // ---- +// Info 1391: CHC: 27 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_struct.sol b/test/libsolidity/smtCheckerTests/operators/delete_struct.sol index cb68e6d4bd4d..76338a0a7c73 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_struct.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_struct.sol @@ -17,3 +17,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/delete_tuple.sol b/test/libsolidity/smtCheckerTests/operators/delete_tuple.sol index ab8a1bb2081e..1925197829de 100644 --- a/test/libsolidity/smtCheckerTests/operators/delete_tuple.sol +++ b/test/libsolidity/smtCheckerTests/operators/delete_tuple.sol @@ -6,3 +6,4 @@ contract A{ // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/division_2.sol b/test/libsolidity/smtCheckerTests/operators/division_2.sol index cf27cd6c1f4b..8704c665474e 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_2.sol @@ -7,3 +7,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/division_3.sol b/test/libsolidity/smtCheckerTests/operators/division_3.sol index 99b5df2a4d78..af4ed582e5d0 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_3.sol @@ -7,4 +7,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4984: (95-100): CHC: Overflow (resulting value larger than 2**255 - 1) happens here.\nCounterexample:\n\nx = (- 57896044618658097711785492504343953926634992332820282019728792003956564819968)\ny = (- 1)\n = 0\n\nTransaction trace:\nC.constructor()\nC.f((- 57896044618658097711785492504343953926634992332820282019728792003956564819968), (- 1)) +// Warning 4984: (95-100): CHC: Overflow (resulting value larger than 2**255 - 1) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/division_4.sol b/test/libsolidity/smtCheckerTests/operators/division_4.sol index 57ca07d846df..54403b1ec1e0 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_4.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_4.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/division_6.sol b/test/libsolidity/smtCheckerTests/operators/division_6.sol index 741bfa0b5170..69d4ee580a00 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_6.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_6.sol @@ -11,5 +11,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4984: (120-125): CHC: Overflow (resulting value larger than 255) happens here.\nCounterexample:\n\na = 128\nb = 2\n = 0\nc = 0\n\nTransaction trace:\nC.constructor()\nC.mul(128, 2) +// Warning 4984: (120-125): CHC: Overflow (resulting value larger than 255) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (137-147): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_1.sol b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_1.sol index 93765e175ff2..5d3725f3d293 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_1.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_2.sol b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_2.sol index 7c0218e35593..29af565a223e 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_2.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_3.sol b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_3.sol index 715930c5e39c..573f6d246812 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_3.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_4.sol b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_4.sol index d0d9d20d7d1c..6610bc524461 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_4.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_4.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_5.sol b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_5.sol index 87a809879315..97faba60fb3b 100644 --- a/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_5.sol +++ b/test/libsolidity/smtCheckerTests/operators/division_truncates_correctly_5.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol b/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol index 33011472b25d..d925ca4491c6 100644 --- a/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol +++ b/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol @@ -30,4 +30,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (475-489): CHC: Assertion violation happens here.\nCounterexample:\n\na = 2\nb = 2\n\nTransaction trace:\nC.constructor()\nC.call()\n L.l(2, 3) -- internal call\n L.l(3, 3) -- internal call\n C.f(1, 2, true) -- internal call\n C.f(1, 2, false) -- internal call +// Warning 6328: (475-489): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/index_access_for_bytes.sol b/test/libsolidity/smtCheckerTests/operators/index_access_for_bytes.sol index 4cb34c49eb12..71dac3e08a86 100644 --- a/test/libsolidity/smtCheckerTests/operators/index_access_for_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/index_access_for_bytes.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (152-173): CHC: Assertion violation happens here.\nCounterexample:\n\nx = [0x0, 0x11, 0x22, 0x33]\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (152-173): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/index_access_for_bytesNN.sol b/test/libsolidity/smtCheckerTests/operators/index_access_for_bytesNN.sol index e73554c1e90e..c516675d6e5f 100644 --- a/test/libsolidity/smtCheckerTests/operators/index_access_for_bytesNN.sol +++ b/test/libsolidity/smtCheckerTests/operators/index_access_for_bytesNN.sol @@ -9,3 +9,4 @@ contract C { // SMTIgnoreOS: macos // ---- // Warning 6368: (76-90): CHC: Out of bounds access might happen here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/index_access_for_string.sol b/test/libsolidity/smtCheckerTests/operators/index_access_for_string.sol index b1c8e38373a5..535335de0d46 100644 --- a/test/libsolidity/smtCheckerTests/operators/index_access_for_string.sol +++ b/test/libsolidity/smtCheckerTests/operators/index_access_for_string.sol @@ -10,3 +10,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/index_access_side_effect.sol b/test/libsolidity/smtCheckerTests/operators/index_access_side_effect.sol index ae526775f9a3..d18f605f7c5e 100644 --- a/test/libsolidity/smtCheckerTests/operators/index_access_side_effect.sol +++ b/test/libsolidity/smtCheckerTests/operators/index_access_side_effect.sol @@ -21,7 +21,8 @@ contract C { // ==== // SMTEngine: all // SMTIgnoreCex: yes +// SMTIgnoreOS: macos // ---- // Warning 6328: (335-354): CHC: Assertion violation might happen here. -// Info 1180: Contract invariant(s) for :C:\n!(a.length <= 2)\n!(a.length <= 3)\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 4661: (335-354): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/operators/integer_new.sol b/test/libsolidity/smtCheckerTests/operators/integer_new.sol index bd52a4eb40bf..d85fb4073c54 100644 --- a/test/libsolidity/smtCheckerTests/operators/integer_new.sol +++ b/test/libsolidity/smtCheckerTests/operators/integer_new.sol @@ -34,5 +34,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6368: (474-478): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = [18, 52, 0]\n\nTransaction trace:\nC.constructor()\nC.h() -// Warning 6368: (496-500): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = [18, 52, 0]\n\nTransaction trace:\nC.constructor()\nC.h() +// Warning 6368: (474-478): CHC: Out of bounds access happens here. +// Warning 6368: (496-500): CHC: Out of bounds access happens here. +// Info 1391: CHC: 23 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/mod.sol b/test/libsolidity/smtCheckerTests/operators/mod.sol index 5c867b629cac..a600ef03f1d3 100644 --- a/test/libsolidity/smtCheckerTests/operators/mod.sol +++ b/test/libsolidity/smtCheckerTests/operators/mod.sol @@ -10,3 +10,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/mod_even.sol b/test/libsolidity/smtCheckerTests/operators/mod_even.sol index 804b8fb79857..b6195bac9baa 100644 --- a/test/libsolidity/smtCheckerTests/operators/mod_even.sol +++ b/test/libsolidity/smtCheckerTests/operators/mod_even.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/mod_n.sol b/test/libsolidity/smtCheckerTests/operators/mod_n.sol index c1bd2d40afd2..a9b0b464a69e 100644 --- a/test/libsolidity/smtCheckerTests/operators/mod_n.sol +++ b/test/libsolidity/smtCheckerTests/operators/mod_n.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/mod_n_uint16.sol b/test/libsolidity/smtCheckerTests/operators/mod_n_uint16.sol index 27c296812bb3..a45fd3ef251d 100644 --- a/test/libsolidity/smtCheckerTests/operators/mod_n_uint16.sol +++ b/test/libsolidity/smtCheckerTests/operators/mod_n_uint16.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/mod_signed.sol b/test/libsolidity/smtCheckerTests/operators/mod_signed.sol index 8dc9355ce623..2e640f53fd77 100644 --- a/test/libsolidity/smtCheckerTests/operators/mod_signed.sol +++ b/test/libsolidity/smtCheckerTests/operators/mod_signed.sol @@ -12,3 +12,5 @@ contract C { // SMTEngine: all // ---- // Warning 6328: (131-148): CHC: Assertion violation might happen here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/compound_shift_left.sol b/test/libsolidity/smtCheckerTests/operators/shifts/compound_shift_left.sol index 334464c0c93b..f5313726a28f 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/compound_shift_left.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/compound_shift_left.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/compound_shift_right.sol b/test/libsolidity/smtCheckerTests/operators/shifts/compound_shift_right.sol index 3722a99764fb..d566bf24eddc 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/compound_shift_right.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/compound_shift_right.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_cleanup.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_cleanup.sol index 86f4be1bd639..14ae9f72f0a4 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_cleanup.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_cleanup.sol @@ -16,3 +16,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (182-197): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_left.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_left.sol index 2dd96ac75bf7..ac8a961f8479 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_left.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_left.sol @@ -27,3 +27,4 @@ contract C { // Warning 6328: (330-364): CHC: Assertion violation happens here. // Warning 6328: (504-597): CHC: Assertion violation happens here. // Warning 6328: (674-704): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_larger_type.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_larger_type.sol index 3b0557c42173..0867aa4cb47f 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_larger_type.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_larger_type.sol @@ -11,4 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (138-158): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0\nx = 254\ny = 1\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (138-158): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_uint32.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_uint32.sol index c900c66ed518..7e0128dca99b 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_uint32.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_uint32.sol @@ -27,3 +27,4 @@ contract C { // Warning 6328: (327-365): CHC: Assertion violation happens here. // Warning 6328: (449-485): CHC: Assertion violation happens here. // Warning 6328: (560-588): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_uint8.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_uint8.sol index 9210c12e617b..bbbea4ef71a8 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_uint8.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_left_uint8.sol @@ -17,3 +17,4 @@ contract C { // ---- // Warning 6328: (209-238): CHC: Assertion violation happens here. // Warning 6328: (310-335): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_overflow.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_overflow.sol index fcf699f22540..efe69945cc35 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_overflow.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_overflow.sol @@ -37,3 +37,4 @@ contract C { // Warning 6328: (511-537): CHC: Assertion violation happens here. // Warning 6328: (611-637): CHC: Assertion violation happens here. // Warning 6328: (709-735): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right.sol index f14f1c9277e5..6d893efcc1cc 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right.sol @@ -27,3 +27,4 @@ contract C { // Warning 6328: (321-352): CHC: Assertion violation happens here. // Warning 6328: (427-455): CHC: Assertion violation happens here. // Warning 6328: (673-769): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_literal.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_literal.sol index 5cc26ee78157..61de9aa43fb5 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_literal.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_literal.sol @@ -38,3 +38,4 @@ contract C { // Warning 6328: (501-524): CHC: Assertion violation happens here. // Warning 6328: (595-619): CHC: Assertion violation happens here. // Warning 6328: (690-714): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue.sol index 2e0411f7b38f..773a77bc0dd5 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue.sol @@ -38,3 +38,4 @@ contract C { // Warning 6328: (516-541): CHC: Assertion violation happens here. // Warning 6328: (614-639): CHC: Assertion violation happens here. // Warning 6328: (712-737): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int16.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int16.sol index 3c145a1ad11a..043a640aafcd 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int16.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int16.sol @@ -37,3 +37,4 @@ contract C { // Warning 6328: (514-539): CHC: Assertion violation happens here. // Warning 6328: (612-637): CHC: Assertion violation happens here. // Warning 6328: (710-735): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int32.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int32.sol index a64734d7d16f..94b212a631a5 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int32.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int32.sol @@ -37,3 +37,4 @@ contract C { // Warning 6328: (514-539): CHC: Assertion violation happens here. // Warning 6328: (612-637): CHC: Assertion violation happens here. // Warning 6328: (710-735): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int8.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int8.sol index eaab703db5d9..400f26cf340f 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int8.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_negative_lvalue_int8.sol @@ -37,3 +37,4 @@ contract C { // Warning 6328: (483-506): CHC: Assertion violation happens here. // Warning 6328: (577-600): CHC: Assertion violation happens here. // Warning 6328: (671-694): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint32.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint32.sol index cfe4cc8d03e7..9e68e22ef852 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint32.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint32.sol @@ -27,3 +27,4 @@ contract C { // Warning 6328: (317-346): CHC: Assertion violation happens here. // Warning 6328: (421-451): CHC: Assertion violation happens here. // Warning 6328: (526-556): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint8.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint8.sol index 7738e30fed44..864a760e9188 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint8.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint8.sol @@ -17,3 +17,4 @@ contract C { // ---- // Warning 6328: (207-232): CHC: Assertion violation happens here. // Warning 6328: (302-325): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shift_underflow_negative_rvalue.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shift_underflow_negative_rvalue.sol index 9d8c3e7963f0..d02e1440237b 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shift_underflow_negative_rvalue.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shift_underflow_negative_rvalue.sol @@ -22,3 +22,4 @@ contract C { // ---- // Warning 6328: (312-341): CHC: Assertion violation happens here. // Warning 6328: (417-446): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/shifts/shr_unused.sol b/test/libsolidity/smtCheckerTests/operators/shifts/shr_unused.sol index c39cdc7d1c82..8f34b530b944 100644 --- a/test/libsolidity/smtCheckerTests/operators/shifts/shr_unused.sol +++ b/test/libsolidity/smtCheckerTests/operators/shifts/shr_unused.sol @@ -8,3 +8,4 @@ contract C { // SMTEngine: all // ---- // UnimplementedFeatureError: Not yet implemented - FixedPointType. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/slice.sol b/test/libsolidity/smtCheckerTests/operators/slice.sol index 068122a660b9..29f89295f0d7 100644 --- a/test/libsolidity/smtCheckerTests/operators/slice.sol +++ b/test/libsolidity/smtCheckerTests/operators/slice.sol @@ -12,3 +12,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/slice_bytes.sol b/test/libsolidity/smtCheckerTests/operators/slice_bytes.sol index 037403a1b194..8c8c95361f59 100644 --- a/test/libsolidity/smtCheckerTests/operators/slice_bytes.sol +++ b/test/libsolidity/smtCheckerTests/operators/slice_bytes.sol @@ -7,3 +7,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/slice_default_end.sol b/test/libsolidity/smtCheckerTests/operators/slice_default_end.sol index c6f421a0cb28..b017b7ff0bfc 100644 --- a/test/libsolidity/smtCheckerTests/operators/slice_default_end.sol +++ b/test/libsolidity/smtCheckerTests/operators/slice_default_end.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/slice_default_start.sol b/test/libsolidity/smtCheckerTests/operators/slice_default_start.sol index 2dcb635193c3..ef422245d3f8 100644 --- a/test/libsolidity/smtCheckerTests/operators/slice_default_start.sol +++ b/test/libsolidity/smtCheckerTests/operators/slice_default_start.sol @@ -12,5 +12,6 @@ contract C { // ---- // Warning 6328: (150-182): CHC: Assertion violation might happen here. // Warning 6328: (186-218): CHC: Assertion violation might happen here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 4661: (150-182): BMC: Assertion violation happens here. // Warning 4661: (186-218): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/operators/slices_3.sol b/test/libsolidity/smtCheckerTests/operators/slices_3.sol index d23c0814069e..530b870cef44 100644 --- a/test/libsolidity/smtCheckerTests/operators/slices_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/slices_3.sol @@ -14,3 +14,4 @@ function f(int[] calldata b, uint256 start, uint256 end) public returns (int) { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_1.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_1.sol new file mode 100644 index 000000000000..ce475d91bed1 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_1.sol @@ -0,0 +1,9 @@ +contract C { + function f(uint x) public pure returns (uint) { + return x > 0 ? x - 1 : 0; // Underflow cannot happen + } +} +// ==== +// SMTEngine: chc +// ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_2.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_2.sol new file mode 100644 index 000000000000..3f2e42efd7db --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_2.sol @@ -0,0 +1,14 @@ +contract C { + + function decrement(uint x) private pure returns (uint) { + return x - 1; // No underflow, the method can be called only with positive value + } + + function f(uint x) public pure returns (uint) { + return x > 0 ? decrement(x) : 0; + } +} +// ==== +// SMTEngine: chc +// ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_3.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_3.sol new file mode 100644 index 000000000000..dac62d380da6 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_3.sol @@ -0,0 +1,31 @@ +abstract contract D { + function d() external virtual returns (uint); +} + +contract C { + + D d; + uint v; + bool guard = true; + + function inc() public { + ++v; + } + + function dec() public { + if (guard) return; + --v; + } + + function f() public returns (uint) { + guard = false; + uint ret = v > 0 ? d.d() : 0; + guard = true; + return ret; + } +} +// ==== +// SMTEngine: chc +// SMTTargets: underflow +// ---- +// Warning 3944: (206-209): CHC: Underflow (resulting value less than 0) happens here. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_double_function_call.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_double_function_call.sol new file mode 100644 index 000000000000..96d00ff60bb6 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_double_function_call.sol @@ -0,0 +1,4 @@ +contract C { function decrement(uint x) private pure returns (uint) { return x - 1; } function decrement2(uint x) private pure returns (uint) { return x - 1; } function f(uint x) public pure returns (uint) { return x > 0 ? decrement(x) : decrement2(x); } } +// ---- +// Warning 3944: (151-156): CHC: Underflow (resulting value less than 0) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_external_code_1.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_external_code_1.sol new file mode 100644 index 000000000000..7da04b464835 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_external_code_1.sol @@ -0,0 +1,32 @@ +abstract contract D { + function d() external virtual returns (uint); +} + +contract C { + + D d; + uint v; + bool guard = true; + + function inc() public { + ++v; + } + + function dec() public { + if (guard) return; + --v; + guard = true; + } + + function f() public returns (uint) { + guard = false; + uint ret = v > 0 ? d.d() : 0; + guard = true; + return ret; + } +} +// ==== +// SMTEngine: chc +// SMTTargets: underflow +// ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_1.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_1.sol new file mode 100644 index 000000000000..d2722fc04945 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_1.sol @@ -0,0 +1,15 @@ +contract C { + + function unreachable() private pure returns (uint) { + assert(false); + return 0; + } + + function f(uint x) public pure returns (uint) { + return x <= 1 ? 0 : x < 2 ? unreachable() : 0; + } +} +// ==== +// SMTEngine: chc +// ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_2.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_2.sol new file mode 100644 index 000000000000..71e294fb49bc --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_2.sol @@ -0,0 +1,27 @@ +contract C { + + function decrement(uint x) private pure returns (uint) { + return x - 1; + } + + function decrement2(uint x) private pure returns (uint) { + return x - 1; + } + + function increment(uint x) private pure returns (uint) { + return x + 1; + } + + function increment2(uint x) private pure returns (uint) { + return x + 1; + } + + function f(uint x) public pure returns (uint) { + return x < 10 ? (x > 0 ? decrement(x) : increment(x)) : (x > 100 ? increment2(x) : decrement2(x)); + } +} +// ==== +// SMTEngine: chc +// ---- +// Warning 4984: (317-322): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_3.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_3.sol new file mode 100644 index 000000000000..0638e4838e10 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_3.sol @@ -0,0 +1,19 @@ +contract C { + + function increment(uint x) private pure returns (uint) { + return x + 1; + } + + function increment2(uint x) private pure returns (uint) { + return x + 1; + } + + function f(uint x) public pure returns (uint) { + return x < 10 ? (x > 0 ? 0 : increment(x)) : (x > 100 ? increment2(x) : 0); + } +} +// ==== +// SMTEngine: chc +// ---- +// Warning 4984: (160-165): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_4.sol b/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_4.sol new file mode 100644 index 000000000000..295590228d58 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/ternary_operator_nested_4.sol @@ -0,0 +1,24 @@ +contract C { + + uint s = 1; + + function decrement() private returns (uint) { + return --s; + } + + function increment() private returns (uint) { + return ++s; + } + + function f(uint x) public returns (uint) { + require(s > 0 && s < 10); + uint olds = s; + uint ret = x < 1 ? increment() : decrement(); + assert(s != olds); + return ret; + } +} +// ==== +// SMTEngine: chc +// ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/tuple_rationals_conditional.sol b/test/libsolidity/smtCheckerTests/operators/tuple_rationals_conditional.sol index 805c923d5dd4..c5732293af58 100644 --- a/test/libsolidity/smtCheckerTests/operators/tuple_rationals_conditional.sol +++ b/test/libsolidity/smtCheckerTests/operators/tuple_rationals_conditional.sol @@ -10,3 +10,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_add.sol b/test/libsolidity/smtCheckerTests/operators/unary_add.sol index 1b304dd4b624..9716624b2a15 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_add.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_add.sol @@ -14,4 +14,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (161-174): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 4\na = 3\nb = 3\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (161-174): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_add_array.sol b/test/libsolidity/smtCheckerTests/operators/unary_add_array.sol index 8c3296e09ffb..a45a5b980421 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_add_array.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_add_array.sol @@ -21,3 +21,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (278-291): CHC: Assertion violation happens here. +// Info 1391: CHC: 10 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_add_array_push_1.sol b/test/libsolidity/smtCheckerTests/operators/unary_add_array_push_1.sol index 03dedaae995b..4617fa91c789 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_add_array_push_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_add_array_push_1.sol @@ -11,4 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (150-168): CHC: Assertion violation happens here.\nCounterexample:\nx = [1]\n\nTransaction trace:\nC.constructor()\nState: x = []\nC.f() +// Warning 6328: (150-168): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_add_array_push_2.sol b/test/libsolidity/smtCheckerTests/operators/unary_add_array_push_2.sol index b1cef5e40be2..a6cacac08a26 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_add_array_push_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_add_array_push_2.sol @@ -18,4 +18,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(data.length <= 1)\n!(data[1].d.length <= 3)\n +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_add_mapping.sol b/test/libsolidity/smtCheckerTests/operators/unary_add_mapping.sol index e52f3f3e350a..5b208787ec76 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_add_mapping.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_add_mapping.sol @@ -17,3 +17,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (211-224): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_add_overflows_correctly.sol b/test/libsolidity/smtCheckerTests/operators/unary_add_overflows_correctly.sol index 459d5adb7b1e..f1d57fa9674a 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_add_overflows_correctly.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_add_overflows_correctly.sol @@ -13,4 +13,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4984: (61-64): CHC: Overflow (resulting value larger than 255) happens here.\nCounterexample:\nx = 255\n\nTransaction trace:\nC.constructor()\nState: x = 254\nC.inc_pre()\nState: x = 255\nC.inc_pre() +// Warning 4984: (61-64): CHC: Overflow (resulting value larger than 255) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_add_overflows_correctly_struct.sol b/test/libsolidity/smtCheckerTests/operators/unary_add_overflows_correctly_struct.sol index ebc23359ff9e..12687d9e1820 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_add_overflows_correctly_struct.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_add_overflows_correctly_struct.sol @@ -21,4 +21,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4984: (112-117): CHC: Overflow (resulting value larger than 255) happens here.\nCounterexample:\ns = {x: 255}\n\nTransaction trace:\nC.constructor()\nState: s = {x: 254}\nC.inc_pre()\nState: s = {x: 255}\nC.inc_pre() +// Warning 4984: (112-117): CHC: Overflow (resulting value larger than 255) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_1.sol b/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_1.sol index a1cecae869ab..72b292306efa 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_1.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_1.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_2.sol b/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_2.sol index 42402a2766dc..e61109c36fcf 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_2.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_2.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_3.sol b/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_3.sol index 90b8a02bdbe7..bef3d128035f 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_3.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_operators_tuple_3.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (108-118): CHC: Assertion violation happens here.\nCounterexample:\n\nb = true\nx = 1\n\nTransaction trace:\nC.constructor()\nC.f(true) +// Warning 6328: (108-118): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_sub.sol b/test/libsolidity/smtCheckerTests/operators/unary_sub.sol index ada46b98f4cb..adf70fe42ce1 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_sub.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_sub.sol @@ -14,4 +14,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (161-174): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 3\na = 4\nb = 4\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (161-174): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_sub_array.sol b/test/libsolidity/smtCheckerTests/operators/unary_sub_array.sol index 657cece75fb9..f0cfe36cf58c 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_sub_array.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_sub_array.sol @@ -19,3 +19,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (275-288): CHC: Assertion violation happens here. +// Info 1391: CHC: 10 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/unary_sub_mapping.sol b/test/libsolidity/smtCheckerTests/operators/unary_sub_mapping.sol index 49ece25924bf..20f2c838091c 100644 --- a/test/libsolidity/smtCheckerTests/operators/unary_sub_mapping.sol +++ b/test/libsolidity/smtCheckerTests/operators/unary_sub_mapping.sol @@ -17,3 +17,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (211-224): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_division_same_as_builtin.sol b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_division_same_as_builtin.sol new file mode 100644 index 000000000000..20889af057c8 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_division_same_as_builtin.sol @@ -0,0 +1,16 @@ +type U is uint; +using {div as /} for U global; + +function div(U x, U y) pure returns (U) { + return U.wrap(U.unwrap(x) / U.unwrap(y)); +} + +contract C { + function f(U x, U y) public pure returns (U) { + return x / y; // FIXME: should detect div by zero + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 6756: (218-223): User-defined operators are not yet supported by SMTChecker. This invocation of operator / has been ignored, which may lead to incorrect results. diff --git a/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_division_with_safe_division_by_zero.sol b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_division_with_safe_division_by_zero.sol new file mode 100644 index 000000000000..edc4d2a9791c --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_division_with_safe_division_by_zero.sol @@ -0,0 +1,19 @@ +type U is uint; +using {div as /} for U global; + +function div(U x, U y) pure returns (U) { + if (U.unwrap(y) == 0) + return U.wrap(0); + + return U.wrap(U.unwrap(x) / U.unwrap(y)); +} + +contract C { + function f(U x, U y) public pure returns (U) { + return x / y; // no div by zero possible here + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 6756: (271-276): User-defined operators are not yet supported by SMTChecker. This invocation of operator / has been ignored, which may lead to incorrect results. diff --git a/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operations_on_constants.sol b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operations_on_constants.sol new file mode 100644 index 000000000000..10ec6a199320 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operations_on_constants.sol @@ -0,0 +1,104 @@ +type I16 is int16; +using { + bitor as |, bitand as &, bitxor as ^, bitnot as ~, + add as +, sub as -, unsub as -, mul as *, div as /, mod as %, + eq as ==, noteq as !=, lt as <, gt as >, leq as <=, geq as >= +} for I16 global; + +function bitor(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) | I16.unwrap(y)); } +function bitand(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) & I16.unwrap(y)); } +function bitxor(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) ^ I16.unwrap(y)); } +function bitnot(I16 x) pure returns (I16) { return I16.wrap(~I16.unwrap(x)); } + +function add(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) + I16.unwrap(y)); } +function sub(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) - I16.unwrap(y)); } +function unsub(I16 x) pure returns (I16) { return I16.wrap(-I16.unwrap(x)); } +function mul(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) * I16.unwrap(y)); } +function div(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) / I16.unwrap(y)); } +function mod(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) % I16.unwrap(y)); } + +function eq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) == I16.unwrap(y); } +function noteq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) != I16.unwrap(y); } +function lt(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) < I16.unwrap(y); } +function gt(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) > I16.unwrap(y); } +function leq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) <= I16.unwrap(y); } +function geq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) >= I16.unwrap(y); } + +contract C { + I16 constant MINUS_TWO = I16.wrap(-2); + I16 constant ZERO = I16.wrap(0); + I16 constant ONE = I16.wrap(1); + I16 constant TWO = I16.wrap(2); + I16 constant THREE = I16.wrap(3); + I16 constant FOUR = I16.wrap(4); + + function testBitwise() public pure { + assert(ONE | TWO == THREE); // FIXME: should hold + assert(ONE & THREE == ZERO); // FIXME: should hold + assert(TWO ^ TWO == ZERO); // FIXME: should hold + assert(~ONE == MINUS_TWO); // FIXME: should hold + } + + function testArithmetic() public pure { + assert(TWO + TWO == FOUR); // FIXME: should hold + assert(TWO - TWO == ZERO); // FIXME: should hold + assert(-TWO == MINUS_TWO); // FIXME: should hold + assert(TWO * TWO == FOUR); // FIXME: should hold + assert(TWO / TWO == ONE); // FIXME: should hold + assert(TWO % TWO == ZERO); // FIXME: should hold + } + + function testComparison() public pure { + assert(TWO == TWO); // FIXME: should hold + assert(!(TWO != TWO)); // FIXME: should hold + assert(!(TWO < TWO)); // FIXME: should hold + assert(!(TWO > TWO)); // FIXME: should hold + assert(TWO <= TWO); // FIXME: should hold + assert(TWO >= TWO); // FIXME: should hold + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 6756: (2019-2028): User-defined operators are not yet supported by SMTChecker. This invocation of operator | has been ignored, which may lead to incorrect results. +// Warning 6756: (2019-2037): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2077-2088): User-defined operators are not yet supported by SMTChecker. This invocation of operator & has been ignored, which may lead to incorrect results. +// Warning 6756: (2077-2096): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2136-2145): User-defined operators are not yet supported by SMTChecker. This invocation of operator ^ has been ignored, which may lead to incorrect results. +// Warning 6756: (2136-2153): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6156: (2193-2197): User-defined operators are not yet supported by SMTChecker. This invocation of operator ~ has been ignored, which may lead to incorrect results. +// Warning 6756: (2193-2210): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2301-2310): User-defined operators are not yet supported by SMTChecker. This invocation of operator + has been ignored, which may lead to incorrect results. +// Warning 6756: (2301-2318): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2358-2367): User-defined operators are not yet supported by SMTChecker. This invocation of operator - has been ignored, which may lead to incorrect results. +// Warning 6756: (2358-2375): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6156: (2415-2419): User-defined operators are not yet supported by SMTChecker. This invocation of operator - has been ignored, which may lead to incorrect results. +// Warning 6756: (2415-2432): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2472-2481): User-defined operators are not yet supported by SMTChecker. This invocation of operator * has been ignored, which may lead to incorrect results. +// Warning 6756: (2472-2489): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2529-2538): User-defined operators are not yet supported by SMTChecker. This invocation of operator / has been ignored, which may lead to incorrect results. +// Warning 6756: (2529-2545): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2585-2594): User-defined operators are not yet supported by SMTChecker. This invocation of operator % has been ignored, which may lead to incorrect results. +// Warning 6756: (2585-2602): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2693-2703): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2745-2755): User-defined operators are not yet supported by SMTChecker. This invocation of operator != has been ignored, which may lead to incorrect results. +// Warning 6756: (2798-2807): User-defined operators are not yet supported by SMTChecker. This invocation of operator < has been ignored, which may lead to incorrect results. +// Warning 6756: (2850-2859): User-defined operators are not yet supported by SMTChecker. This invocation of operator > has been ignored, which may lead to incorrect results. +// Warning 6756: (2900-2910): User-defined operators are not yet supported by SMTChecker. This invocation of operator <= has been ignored, which may lead to incorrect results. +// Warning 6756: (2950-2960): User-defined operators are not yet supported by SMTChecker. This invocation of operator >= has been ignored, which may lead to incorrect results. +// Warning 6328: (2012-2038): CHC: Assertion violation happens here. +// Warning 6328: (2070-2097): CHC: Assertion violation happens here. +// Warning 6328: (2129-2154): CHC: Assertion violation happens here. +// Warning 6328: (2186-2211): CHC: Assertion violation happens here. +// Warning 6328: (2294-2319): CHC: Assertion violation happens here. +// Warning 6328: (2351-2376): CHC: Assertion violation happens here. +// Warning 6328: (2408-2433): CHC: Assertion violation happens here. +// Warning 6328: (2465-2490): CHC: Assertion violation happens here. +// Warning 6328: (2522-2546): CHC: Assertion violation happens here. +// Warning 6328: (2578-2603): CHC: Assertion violation happens here. +// Warning 6328: (2686-2704): CHC: Assertion violation happens here. +// Warning 6328: (2736-2757): CHC: Assertion violation happens here. +// Warning 6328: (2789-2809): CHC: Assertion violation happens here. +// Warning 6328: (2841-2861): CHC: Assertion violation happens here. +// Warning 6328: (2893-2911): CHC: Assertion violation happens here. +// Warning 6328: (2943-2961): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operations_on_constants_fail.sol b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operations_on_constants_fail.sol new file mode 100644 index 000000000000..c30bb21c1da5 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operations_on_constants_fail.sol @@ -0,0 +1,104 @@ +type I16 is int16; +using { + bitor as |, bitand as &, bitxor as ^, bitnot as ~, + add as +, sub as -, unsub as -, mul as *, div as /, mod as %, + eq as ==, noteq as !=, lt as <, gt as >, leq as <=, geq as >= +} for I16 global; + +function bitor(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) | I16.unwrap(y)); } +function bitand(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) & I16.unwrap(y)); } +function bitxor(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) ^ I16.unwrap(y)); } +function bitnot(I16 x) pure returns (I16) { return I16.wrap(~I16.unwrap(x)); } + +function add(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) + I16.unwrap(y)); } +function sub(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) - I16.unwrap(y)); } +function unsub(I16 x) pure returns (I16) { return I16.wrap(-I16.unwrap(x)); } +function mul(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) * I16.unwrap(y)); } +function div(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) / I16.unwrap(y)); } +function mod(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) % I16.unwrap(y)); } + +function eq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) == I16.unwrap(y); } +function noteq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) != I16.unwrap(y); } +function lt(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) < I16.unwrap(y); } +function gt(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) > I16.unwrap(y); } +function leq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) <= I16.unwrap(y); } +function geq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) >= I16.unwrap(y); } + +contract C { + I16 constant MINUS_TWO = I16.wrap(-2); + I16 constant ZERO = I16.wrap(0); + I16 constant ONE = I16.wrap(1); + I16 constant TWO = I16.wrap(2); + I16 constant THREE = I16.wrap(3); + I16 constant FOUR = I16.wrap(4); + + function testBitwise() public pure { + assert(ONE | TWO == FOUR); // should fail + assert(ONE & THREE == FOUR); // should fail + assert(TWO ^ TWO == FOUR); // should fail + assert(~ONE == FOUR); // should fail + } + + function testArithmetic() public pure { + assert(TWO + THREE == FOUR); // should fail + assert(TWO - TWO == FOUR); // should fail + assert(-TWO == FOUR); // should fail + assert(TWO * THREE == FOUR); // should fail + assert(TWO / TWO == FOUR); // should fail + assert(TWO % TWO == FOUR); // should fail + } + + function testComparison() public pure { + assert(!(TWO == TWO)); // should fail + assert(TWO != TWO); // should fail + assert(TWO < TWO); // should fail + assert(TWO > TWO); // should fail + assert(!(TWO <= TWO)); // should fail + assert(!(TWO >= TWO)); // should fail + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 6756: (2019-2028): User-defined operators are not yet supported by SMTChecker. This invocation of operator | has been ignored, which may lead to incorrect results. +// Warning 6756: (2019-2036): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2069-2080): User-defined operators are not yet supported by SMTChecker. This invocation of operator & has been ignored, which may lead to incorrect results. +// Warning 6756: (2069-2088): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2121-2130): User-defined operators are not yet supported by SMTChecker. This invocation of operator ^ has been ignored, which may lead to incorrect results. +// Warning 6756: (2121-2138): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6156: (2171-2175): User-defined operators are not yet supported by SMTChecker. This invocation of operator ~ has been ignored, which may lead to incorrect results. +// Warning 6756: (2171-2183): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2267-2278): User-defined operators are not yet supported by SMTChecker. This invocation of operator + has been ignored, which may lead to incorrect results. +// Warning 6756: (2267-2286): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2319-2328): User-defined operators are not yet supported by SMTChecker. This invocation of operator - has been ignored, which may lead to incorrect results. +// Warning 6756: (2319-2336): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6156: (2369-2373): User-defined operators are not yet supported by SMTChecker. This invocation of operator - has been ignored, which may lead to incorrect results. +// Warning 6756: (2369-2381): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2414-2425): User-defined operators are not yet supported by SMTChecker. This invocation of operator * has been ignored, which may lead to incorrect results. +// Warning 6756: (2414-2433): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2466-2475): User-defined operators are not yet supported by SMTChecker. This invocation of operator / has been ignored, which may lead to incorrect results. +// Warning 6756: (2466-2483): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2516-2525): User-defined operators are not yet supported by SMTChecker. This invocation of operator % has been ignored, which may lead to incorrect results. +// Warning 6756: (2516-2533): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2619-2629): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2663-2673): User-defined operators are not yet supported by SMTChecker. This invocation of operator != has been ignored, which may lead to incorrect results. +// Warning 6756: (2706-2715): User-defined operators are not yet supported by SMTChecker. This invocation of operator < has been ignored, which may lead to incorrect results. +// Warning 6756: (2748-2757): User-defined operators are not yet supported by SMTChecker. This invocation of operator > has been ignored, which may lead to incorrect results. +// Warning 6756: (2792-2802): User-defined operators are not yet supported by SMTChecker. This invocation of operator <= has been ignored, which may lead to incorrect results. +// Warning 6756: (2838-2848): User-defined operators are not yet supported by SMTChecker. This invocation of operator >= has been ignored, which may lead to incorrect results. +// Warning 6328: (2012-2037): CHC: Assertion violation happens here. +// Warning 6328: (2062-2089): CHC: Assertion violation happens here. +// Warning 6328: (2114-2139): CHC: Assertion violation happens here. +// Warning 6328: (2164-2184): CHC: Assertion violation happens here. +// Warning 6328: (2260-2287): CHC: Assertion violation happens here. +// Warning 6328: (2312-2337): CHC: Assertion violation happens here. +// Warning 6328: (2362-2382): CHC: Assertion violation happens here. +// Warning 6328: (2407-2434): CHC: Assertion violation happens here. +// Warning 6328: (2459-2484): CHC: Assertion violation happens here. +// Warning 6328: (2509-2534): CHC: Assertion violation happens here. +// Warning 6328: (2610-2631): CHC: Assertion violation happens here. +// Warning 6328: (2656-2674): CHC: Assertion violation happens here. +// Warning 6328: (2699-2716): CHC: Assertion violation happens here. +// Warning 6328: (2741-2758): CHC: Assertion violation happens here. +// Warning 6328: (2783-2804): CHC: Assertion violation happens here. +// Warning 6328: (2829-2850): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operator_matches_equivalent_function_call.sol b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operator_matches_equivalent_function_call.sol new file mode 100644 index 000000000000..9d09e2f296ee --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_operator_matches_equivalent_function_call.sol @@ -0,0 +1,106 @@ +type I16 is int16; +using { + bitor as |, bitand as &, bitxor as ^, bitnot as ~, + add as +, sub as -, unsub as -, mul as *, div as /, mod as %, + eq as ==, noteq as !=, lt as <, gt as >, leq as <=, geq as >= +} for I16 global; + +function bitor(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) | I16.unwrap(y)); } +function bitand(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) & I16.unwrap(y)); } +function bitxor(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) ^ I16.unwrap(y)); } +function bitnot(I16 x) pure returns (I16) { return I16.wrap(~I16.unwrap(x)); } + +function add(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) + I16.unwrap(y)); } +function sub(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) - I16.unwrap(y)); } +function unsub(I16 x) pure returns (I16) { return I16.wrap(-I16.unwrap(x)); } +function mul(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) * I16.unwrap(y)); } +function div(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) / I16.unwrap(y)); } +function mod(I16 x, I16 y) pure returns (I16) { return I16.wrap(I16.unwrap(x) % I16.unwrap(y)); } + +function eq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) == I16.unwrap(y); } +function noteq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) != I16.unwrap(y); } +function lt(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) < I16.unwrap(y); } +function gt(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) > I16.unwrap(y); } +function leq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) <= I16.unwrap(y); } +function geq(I16 x, I16 y) pure returns (bool) { return I16.unwrap(x) >= I16.unwrap(y); } + +contract C { + function testBitwise(I16 x, I16 y) public pure { + assert(x | y == bitor(x, y)); // FIXME: should hold + assert(x & y == bitand(x, y)); // FIXME: should hold + assert(x ^ y == bitxor(x, y)); // FIXME: should hold + assert(~x == bitnot(x)); // FIXME: should hold + } + + function testArithmetic(I16 x, I16 y) public pure { + assert(x + y == add(x, y)); // FIXME: should hold + assert(x - y == sub(x, y)); // FIXME: should hold + assert(-x == unsub(x)); // FIXME: should hold + assert(x * y == mul(x, y)); // FIXME: should hold + assert(x / y == div(x, y)); // FIXME: should hold + assert(x % y == mod(x, y)); // FIXME: should hold + } + + function testComparison(I16 x, I16 y) public pure { + assert((x == y) == eq(x, y)); // FIXME: should hold + assert((x != y) == noteq(x, y)); // FIXME: should hold + assert((x < y) == lt(x, y)); // FIXME: should hold + assert((x > y) == gt(x, y)); // FIXME: should hold + assert((x <= y) == leq(x, y)); // FIXME: should hold + assert((x >= y) == geq(x, y)); // FIXME: should hold + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 6756: (1803-1808): User-defined operators are not yet supported by SMTChecker. This invocation of operator | has been ignored, which may lead to incorrect results. +// Warning 6756: (1803-1823): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (1863-1868): User-defined operators are not yet supported by SMTChecker. This invocation of operator & has been ignored, which may lead to incorrect results. +// Warning 6756: (1863-1884): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (1924-1929): User-defined operators are not yet supported by SMTChecker. This invocation of operator ^ has been ignored, which may lead to incorrect results. +// Warning 6756: (1924-1945): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6156: (1985-1987): User-defined operators are not yet supported by SMTChecker. This invocation of operator ~ has been ignored, which may lead to incorrect results. +// Warning 6756: (1985-2000): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2103-2108): User-defined operators are not yet supported by SMTChecker. This invocation of operator + has been ignored, which may lead to incorrect results. +// Warning 6756: (2103-2121): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2161-2166): User-defined operators are not yet supported by SMTChecker. This invocation of operator - has been ignored, which may lead to incorrect results. +// Warning 6756: (2161-2179): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6156: (2219-2221): User-defined operators are not yet supported by SMTChecker. This invocation of operator - has been ignored, which may lead to incorrect results. +// Warning 6756: (2219-2233): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2273-2278): User-defined operators are not yet supported by SMTChecker. This invocation of operator * has been ignored, which may lead to incorrect results. +// Warning 6756: (2273-2291): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2331-2336): User-defined operators are not yet supported by SMTChecker. This invocation of operator / has been ignored, which may lead to incorrect results. +// Warning 6756: (2331-2349): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2389-2394): User-defined operators are not yet supported by SMTChecker. This invocation of operator % has been ignored, which may lead to incorrect results. +// Warning 6756: (2389-2407): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2511-2517): User-defined operators are not yet supported by SMTChecker. This invocation of operator == has been ignored, which may lead to incorrect results. +// Warning 6756: (2571-2577): User-defined operators are not yet supported by SMTChecker. This invocation of operator != has been ignored, which may lead to incorrect results. +// Warning 6756: (2634-2639): User-defined operators are not yet supported by SMTChecker. This invocation of operator < has been ignored, which may lead to incorrect results. +// Warning 6756: (2693-2698): User-defined operators are not yet supported by SMTChecker. This invocation of operator > has been ignored, which may lead to incorrect results. +// Warning 6756: (2752-2758): User-defined operators are not yet supported by SMTChecker. This invocation of operator <= has been ignored, which may lead to incorrect results. +// Warning 6756: (2813-2819): User-defined operators are not yet supported by SMTChecker. This invocation of operator >= has been ignored, which may lead to incorrect results. +// Warning 3944: (679-708): CHC: Underflow (resulting value less than -32768) happens here. +// Warning 4984: (679-708): CHC: Overflow (resulting value larger than 32767) happens here. +// Warning 3944: (777-806): CHC: Underflow (resulting value less than -32768) happens here. +// Warning 4984: (777-806): CHC: Overflow (resulting value larger than 32767) happens here. +// Warning 3944: (953-982): CHC: Underflow (resulting value less than -32768) happens here. +// Warning 4984: (953-982): CHC: Overflow (resulting value larger than 32767) happens here. +// Warning 4281: (1051-1080): CHC: Division by zero happens here. +// Warning 4281: (1149-1178): CHC: Division by zero happens here. +// Warning 6328: (1796-1824): CHC: Assertion violation happens here. +// Warning 6328: (1856-1885): CHC: Assertion violation happens here. +// Warning 6328: (1917-1946): CHC: Assertion violation happens here. +// Warning 6328: (1978-2001): CHC: Assertion violation happens here. +// Warning 6328: (2096-2122): CHC: Assertion violation happens here. +// Warning 6328: (2154-2180): CHC: Assertion violation happens here. +// Warning 6328: (2212-2234): CHC: Assertion violation happens here. +// Warning 6328: (2266-2292): CHC: Assertion violation happens here. +// Warning 6328: (2324-2350): CHC: Assertion violation happens here. +// Warning 6328: (2382-2408): CHC: Assertion violation happens here. +// Warning 6328: (2503-2531): CHC: Assertion violation happens here. +// Warning 6328: (2563-2594): CHC: Assertion violation happens here. +// Warning 6328: (2626-2653): CHC: Assertion violation happens here. +// Warning 6328: (2685-2712): CHC: Assertion violation happens here. +// Warning 6328: (2744-2773): CHC: Assertion violation happens here. +// Warning 6328: (2805-2834): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_overflow.sol b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_overflow.sol new file mode 100644 index 000000000000..21ed55c1c23a --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/userDefined/user_defined_overflow.sol @@ -0,0 +1,24 @@ +type U8 is uint8; +using {add as +} for U8 global; + +function add(U8 x, U8 y) pure returns (U8) { + return U8.wrap(U8.unwrap(x) + U8.unwrap(y)); // FIXME: should detect possible overflow here +} + +contract C { + U8 x = U8.wrap(254); + + function inc() public { + x = x + U8.wrap(1); // FIXME: should detect possible overflow here + } + + function check() view public { + U8 y = x; + assert(U8.unwrap(y) < 256); + } +} +// ==== +// SMTEngine: all +// ---- +// Warning 6756: (274-288): User-defined operators are not yet supported by SMTChecker. This invocation of operator + has been ignored, which may lead to incorrect results. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/array_1.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/array_1.sol index 0f5a63b07cb1..bc37a3130178 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/array_1.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/array_1.sol @@ -23,5 +23,6 @@ contract C { // Warning 4984: (112-115): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. // Warning 3944: (181-184): CHC: Underflow (resulting value less than 0) might happen here. // Warning 6368: (259-263): CHC: Out of bounds access happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 2661: (112-115): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 4144: (181-184): BMC: Underflow (resulting value less than 0) happens here. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2.sol index d331abef7b31..77f4548fd292 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2.sol @@ -21,4 +21,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n((l + ((- 1) * a.length)) <= 0)\n +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_1.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_1.sol index 81c788e2b6bc..a52707c58a1c 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_1.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_1.sol @@ -14,3 +14,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_2.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_2.sol index 0eb84c2741c4..63fa1cf7c7fd 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_2.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_2.sol @@ -13,4 +13,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6368: (224-231): CHC: Out of bounds access happens here.\nCounterexample:\na = [[]]\ni = 0\nj = 0\n = 0\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.p()\nState: a = [[]]\nC.r(0, 0) +// Warning 6368: (224-231): CHC: Out of bounds access happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_3.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_3.sol index 328616e7cf1b..8fad49b80638 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_3.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_3.sol @@ -14,3 +14,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_4.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_4.sol index 1976543363df..2a9f39d1a2fa 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_4.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/array_2d_4.sol @@ -16,10 +16,12 @@ contract C { // ---- // Warning 4984: (184-197): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. // Warning 4984: (199-202): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. -// Warning 6368: (228-232): CHC: Out of bounds access happens here.\nCounterexample:\na = []\ni = 0\nj = 0\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.r() +// Warning 6368: (228-232): CHC: Out of bounds access happens here. // Warning 4984: (228-244): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. // Warning 4984: (246-249): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. -// Warning 6368: (255-259): CHC: Out of bounds access happens here.\nCounterexample:\na = []\ni = 0\nj = 0\n\nTransaction trace:\nC.constructor()\nState: a = []\nC.r() +// Warning 6368: (255-259): CHC: Out of bounds access happens here. // Warning 6368: (255-262): CHC: Out of bounds access happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 2661: (184-197): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 2661: (228-244): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Info 6002: BMC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/array_4.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/array_4.sol index 372292916d50..ab895696fbb4 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/array_4.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/array_4.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_1.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_1.sol index a8a4c577c536..464188441dea 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_1.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_1.sol @@ -6,3 +6,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_3.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_3.sol index 8c2ec749a282..5d0dd95f827b 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_3.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_3.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_4.sol b/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_4.sol index 83e68b4801c1..fd94acfee5e4 100644 --- a/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_4.sol +++ b/test/libsolidity/smtCheckerTests/out_of_bounds/fixed_bytes_4.sol @@ -9,3 +9,4 @@ contract C { // SMTEngine: all // ---- // Warning 5667: (36-42): Unused function parameter. Remove or comment out the variable name to silence this warning. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/overflow_constant_bound.sol b/test/libsolidity/smtCheckerTests/overflow/overflow_constant_bound.sol index 816f96810ad5..c5e7ecf38920 100644 --- a/test/libsolidity/smtCheckerTests/overflow/overflow_constant_bound.sol +++ b/test/libsolidity/smtCheckerTests/overflow/overflow_constant_bound.sol @@ -14,4 +14,5 @@ contract DepositContract { // SMTEngine: all // ---- // Warning 4984: (256-277): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 2661: (256-277): BMC: Overflow (resulting value larger than 2**256 - 1) happens here. diff --git a/test/libsolidity/smtCheckerTests/overflow/overflow_mul.sol b/test/libsolidity/smtCheckerTests/overflow/overflow_mul.sol index efb0135e975d..c43aba43c51b 100644 --- a/test/libsolidity/smtCheckerTests/overflow/overflow_mul.sol +++ b/test/libsolidity/smtCheckerTests/overflow/overflow_mul.sol @@ -13,4 +13,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 4984: (87-92): CHC: Overflow (resulting value larger than 255) happens here.\nCounterexample:\n\nx = 100\n = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f(0) +// Warning 4984: (87-92): CHC: Overflow (resulting value larger than 255) happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/overflow_mul_cex_with_array.sol b/test/libsolidity/smtCheckerTests/overflow/overflow_mul_cex_with_array.sol index c90c32bee0db..3dd28c7ad668 100644 --- a/test/libsolidity/smtCheckerTests/overflow/overflow_mul_cex_with_array.sol +++ b/test/libsolidity/smtCheckerTests/overflow/overflow_mul_cex_with_array.sol @@ -11,3 +11,4 @@ contract C { // ---- // Warning 4984: (111-114): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 6368: (106-115): CHC: Out of bounds access happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/overflow_mul_signed.sol b/test/libsolidity/smtCheckerTests/overflow/overflow_mul_signed.sol index d0cadffacd7a..16e7d0a2095b 100644 --- a/test/libsolidity/smtCheckerTests/overflow/overflow_mul_signed.sol +++ b/test/libsolidity/smtCheckerTests/overflow/overflow_mul_signed.sol @@ -13,4 +13,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 4984: (136-143): CHC: Overflow (resulting value larger than 127) happens here.\nCounterexample:\n\nx = 100\n = 0\ny = (- 56)\n\nTransaction trace:\nC.constructor()\nC.f(0) +// Warning 4984: (136-143): CHC: Overflow (resulting value larger than 127) happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/overflow_sum.sol b/test/libsolidity/smtCheckerTests/overflow/overflow_sum.sol index 6d4275dbf613..100c4bfc07d9 100644 --- a/test/libsolidity/smtCheckerTests/overflow/overflow_sum.sol +++ b/test/libsolidity/smtCheckerTests/overflow/overflow_sum.sol @@ -15,4 +15,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 4984: (185-192): CHC: Overflow (resulting value larger than 255) happens here.\nCounterexample:\n\nx = 255\n = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f(0) +// Warning 4984: (185-192): CHC: Overflow (resulting value larger than 255) happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/overflow_sum_signed.sol b/test/libsolidity/smtCheckerTests/overflow/overflow_sum_signed.sol index 97ee103b4e93..b26189f5082a 100644 --- a/test/libsolidity/smtCheckerTests/overflow/overflow_sum_signed.sol +++ b/test/libsolidity/smtCheckerTests/overflow/overflow_sum_signed.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/signed_guard_sub_overflow.sol b/test/libsolidity/smtCheckerTests/overflow/signed_guard_sub_overflow.sol index a26795e5386d..65bf721dcb05 100644 --- a/test/libsolidity/smtCheckerTests/overflow/signed_guard_sub_overflow.sol +++ b/test/libsolidity/smtCheckerTests/overflow/signed_guard_sub_overflow.sol @@ -8,4 +8,5 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 4984: (96-101): CHC: Overflow (resulting value larger than 2**255 - 1) happens here.\nCounterexample:\n\nx = 0\ny = (- 57896044618658097711785492504343953926634992332820282019728792003956564819968)\n = 0\n\nTransaction trace:\nC.constructor()\nC.f(0, (- 57896044618658097711785492504343953926634992332820282019728792003956564819968)) +// Warning 4984: (96-101): CHC: Overflow (resulting value larger than 2**255 - 1) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/signed_guard_sum_overflow.sol b/test/libsolidity/smtCheckerTests/overflow/signed_guard_sum_overflow.sol index 9c89abbe9076..7704e2d7e001 100644 --- a/test/libsolidity/smtCheckerTests/overflow/signed_guard_sum_overflow.sol +++ b/test/libsolidity/smtCheckerTests/overflow/signed_guard_sum_overflow.sol @@ -10,3 +10,4 @@ contract C { // ---- // Warning 3944: (78-83): CHC: Underflow (resulting value less than -2**255) happens here. // Warning 4984: (78-83): CHC: Overflow (resulting value larger than 2**255 - 1) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/underflow_sub.sol b/test/libsolidity/smtCheckerTests/overflow/underflow_sub.sol index 29dd1597534d..aadeff533175 100644 --- a/test/libsolidity/smtCheckerTests/overflow/underflow_sub.sol +++ b/test/libsolidity/smtCheckerTests/overflow/underflow_sub.sol @@ -13,3 +13,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/underflow_sub_signed.sol b/test/libsolidity/smtCheckerTests/overflow/underflow_sub_signed.sol index 295e32849891..c62198109e4b 100644 --- a/test/libsolidity/smtCheckerTests/overflow/underflow_sub_signed.sol +++ b/test/libsolidity/smtCheckerTests/overflow/underflow_sub_signed.sol @@ -17,3 +17,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/overflow/unsigned_guard_sub_overflow.sol b/test/libsolidity/smtCheckerTests/overflow/unsigned_guard_sub_overflow.sol index 6a96ab6b265f..afc0c2682752 100644 --- a/test/libsolidity/smtCheckerTests/overflow/unsigned_guard_sub_overflow.sol +++ b/test/libsolidity/smtCheckerTests/overflow/unsigned_guard_sub_overflow.sol @@ -7,3 +7,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2_value_types.sol b/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2_value_types.sol index 46ff93166eaa..25bd93f5b34a 100644 --- a/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2_value_types.sol +++ b/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2_value_types.sol @@ -12,3 +12,4 @@ contract C { // ---- // Warning 2072: (91-98): Unused local variable. // Warning 2072: (146-153): Unused local variable. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/abi_decode_simple.sol b/test/libsolidity/smtCheckerTests/special/abi_decode_simple.sol index eea336609395..576728365289 100644 --- a/test/libsolidity/smtCheckerTests/special/abi_decode_simple.sol +++ b/test/libsolidity/smtCheckerTests/special/abi_decode_simple.sol @@ -13,4 +13,5 @@ contract C { // Warning 2072: (82-86): Unused local variable. // Warning 2072: (140-150): Unused local variable. // Warning 2072: (152-156): Unused local variable. -// Warning 6328: (220-236): CHC: Assertion violation happens here.\nCounterexample:\n\na1 = 2437\nb1 = 0x0b\nc1 = 10\na2 = 2437\nb2 = 0x0b\nc2 = 10\n\nTransaction trace:\nC.constructor()\nC.f(data) +// Warning 6328: (220-236): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/block_vars_bmc_internal.sol b/test/libsolidity/smtCheckerTests/special/block_vars_bmc_internal.sol index 273590f65a96..6d367b5c6dd5 100644 --- a/test/libsolidity/smtCheckerTests/special/block_vars_bmc_internal.sol +++ b/test/libsolidity/smtCheckerTests/special/block_vars_bmc_internal.sol @@ -43,3 +43,4 @@ contract C { // Warning 4661: (752-781): BMC: Assertion violation happens here. // Warning 4661: (809-839): BMC: Assertion violation happens here. // Warning 4661: (867-903): BMC: Assertion violation happens here. +// Info 6002: BMC: 12 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/block_vars_chc_internal.sol b/test/libsolidity/smtCheckerTests/special/block_vars_chc_internal.sol index 3e06779a0f95..71e21aa4be03 100644 --- a/test/libsolidity/smtCheckerTests/special/block_vars_chc_internal.sol +++ b/test/libsolidity/smtCheckerTests/special/block_vars_chc_internal.sol @@ -40,3 +40,4 @@ contract C { // Warning 8417: (155-171): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 8417: (641-657): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 6328: (932-961): CHC: Assertion violation happens here. +// Info 1391: CHC: 12 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/blockhash.sol b/test/libsolidity/smtCheckerTests/special/blockhash.sol index 2a7cc39faa86..65432370118e 100644 --- a/test/libsolidity/smtCheckerTests/special/blockhash.sol +++ b/test/libsolidity/smtCheckerTests/special/blockhash.sol @@ -13,3 +13,4 @@ contract C // ---- // Warning 6328: (52-76): CHC: Assertion violation happens here. // Warning 6328: (80-104): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/chainid.sol b/test/libsolidity/smtCheckerTests/special/chainid.sol index d2fd59f10ca3..3cb4003dfcff 100644 --- a/test/libsolidity/smtCheckerTests/special/chainid.sol +++ b/test/libsolidity/smtCheckerTests/special/chainid.sol @@ -6,3 +6,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/ether_units.sol b/test/libsolidity/smtCheckerTests/special/ether_units.sol index 40242e50da01..9c0e8ea71ff0 100644 --- a/test/libsolidity/smtCheckerTests/special/ether_units.sol +++ b/test/libsolidity/smtCheckerTests/special/ether_units.sol @@ -11,6 +11,7 @@ contract D { // ==== // SMTEngine: all // ---- -// Warning 6328: (89-130): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f() -// Warning 6328: (170-201): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f() -// Warning 6328: (243-276): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f() +// Warning 6328: (89-130): CHC: Assertion violation happens here. +// Warning 6328: (170-201): CHC: Assertion violation happens here. +// Warning 6328: (243-276): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/event.sol b/test/libsolidity/smtCheckerTests/special/event.sol index 2788eeecdc98..a5ddafc58dac 100644 --- a/test/libsolidity/smtCheckerTests/special/event.sol +++ b/test/libsolidity/smtCheckerTests/special/event.sol @@ -27,4 +27,5 @@ contract C { // ---- // Warning 6321: (247-251): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. // Warning 6321: (397-401): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (407-416): CHC: Assertion violation happens here.\nCounterexample:\nx = false\n\nTransaction trace:\nC.constructor()\nState: x = true\nC.h()\n C.h_data() -- internal call\n C.h_data() -- internal call +// Warning 6328: (407-416): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/gasleft.sol b/test/libsolidity/smtCheckerTests/special/gasleft.sol index 416c2668e0e1..29b8e0dc0755 100644 --- a/test/libsolidity/smtCheckerTests/special/gasleft.sol +++ b/test/libsolidity/smtCheckerTests/special/gasleft.sol @@ -10,5 +10,6 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (43-64): CHC: Assertion violation happens here.\nCounterexample:\n\ng = 0\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (90-111): CHC: Assertion violation happens here.\nCounterexample:\n\ng = 0\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (43-64): CHC: Assertion violation happens here. +// Warning 6328: (90-111): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_data.sol b/test/libsolidity/smtCheckerTests/special/msg_data.sol index 90022508f215..37552a2b91e5 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_data.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_data.sol @@ -25,3 +25,4 @@ contract C // ---- // Warning 6328: (120-147): CHC: Assertion violation happens here. // Warning 6328: (467-494): CHC: Assertion violation happens here. +// Info 1391: CHC: 16 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_sender_1.sol b/test/libsolidity/smtCheckerTests/special/msg_sender_1.sol index 743f663e632f..af6d79021e6f 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_sender_1.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_sender_1.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_sender_2.sol b/test/libsolidity/smtCheckerTests/special/msg_sender_2.sol index 96075e68a86c..71cb0e123528 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_sender_2.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_sender_2.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_sender_3.sol b/test/libsolidity/smtCheckerTests/special/msg_sender_3.sol index d531ee6ef24f..4ca48fb4c75f 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_sender_3.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_sender_3.sol @@ -20,3 +20,4 @@ contract D { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_sender_fail_1.sol b/test/libsolidity/smtCheckerTests/special/msg_sender_fail_1.sol index ecfc53e9815e..e285f97d91b8 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_sender_fail_1.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_sender_fail_1.sol @@ -12,3 +12,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (122-145): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_sender_range.sol b/test/libsolidity/smtCheckerTests/special/msg_sender_range.sol index e33843e6405d..f78200cd3b11 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_sender_range.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_sender_range.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_sig.sol b/test/libsolidity/smtCheckerTests/special/msg_sig.sol index cf701f6d0a33..45fa054364b8 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_sig.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_sig.sol @@ -25,6 +25,7 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (43-72): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.sig: 0x26121ff0 } -// Warning 6328: (370-399): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.sig: 0x26121ff0 }\n C.fi() -- internal call\n C.gi() -- internal call -// Warning 6328: (510-539): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.h(){ msg.sig: 0xb8c9d365 } +// Warning 6328: (43-72): CHC: Assertion violation happens here. +// Warning 6328: (370-399): CHC: Assertion violation happens here. +// Warning 6328: (510-539): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_value_1.sol b/test/libsolidity/smtCheckerTests/special/msg_value_1.sol index 51e696f56a19..3f8b50ba0fd5 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_value_1.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_value_1.sol @@ -6,5 +6,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4984: (55-68): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.value: 115792089237316195423570985008687907853269984665640564039457584007913129639931 } -// Warning 4984: (55-80): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.value: 57896044618658097711785492504343953926634992332820282019728792003956564819966 } +// Warning 4984: (55-68): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Warning 4984: (55-80): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_value_3.sol b/test/libsolidity/smtCheckerTests/special/msg_value_3.sol index 79302b142982..4035dffaa809 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_value_3.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_value_3.sol @@ -13,4 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\nlock\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_value_4.sol b/test/libsolidity/smtCheckerTests/special/msg_value_4.sol index 82edb4a3939f..cab8c0aa58a4 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_value_4.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_value_4.sol @@ -13,4 +13,5 @@ contract B { // ==== // SMTEngine: all // ---- -// Warning 6328: (154-176): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nB.constructor(){ msg.value: 39 } +// Warning 6328: (154-176): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_1.sol b/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_1.sol index 8b69352c2e37..07a2bb35bf65 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_1.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_1.sol @@ -14,4 +14,5 @@ contract C is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (68-82): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nA.constructor(){ msg.value: 1 } +// Warning 6328: (68-82): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_2.sol b/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_2.sol index 10b8ef0c2a50..942607bd8a6f 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_2.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_2.sol @@ -14,5 +14,6 @@ contract C is A { // ==== // SMTEngine: all // ---- -// Warning 6328: (60-74): CHC: Assertion violation happens here.\nCounterexample:\nv = 0, x = 1\n\nTransaction trace:\nC.constructor(){ msg.value: 1 } -// Warning 6328: (240-254): CHC: Assertion violation happens here.\nCounterexample:\nv = 1, x = 1\n\nTransaction trace:\nC.constructor(){ msg.value: 1 } +// Warning 6328: (60-74): CHC: Assertion violation happens here. +// Warning 6328: (240-254): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_3.sol b/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_3.sol index 4e1d2a99f5f4..b2f083e025e4 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_3.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_value_inheritance_3.sol @@ -19,4 +19,5 @@ contract C is A, B { // ==== // SMTEngine: all // ---- -// Warning 6328: (60-74): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor(){ msg.value: 1 } +// Warning 6328: (60-74): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_vars_bmc_internal.sol b/test/libsolidity/smtCheckerTests/special/msg_vars_bmc_internal.sol index 100284dd7ce5..f96f588019a9 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_vars_bmc_internal.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_vars_bmc_internal.sol @@ -30,3 +30,4 @@ contract C { // Warning 4661: (460-488): BMC: Assertion violation happens here. // Warning 4661: (516-538): BMC: Assertion violation happens here. // Warning 4661: (566-592): BMC: Assertion violation happens here. +// Info 6002: BMC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/msg_vars_chc_internal.sol b/test/libsolidity/smtCheckerTests/special/msg_vars_chc_internal.sol index 475cc2291e8d..2a39b5de4527 100644 --- a/test/libsolidity/smtCheckerTests/special/msg_vars_chc_internal.sol +++ b/test/libsolidity/smtCheckerTests/special/msg_vars_chc_internal.sol @@ -29,4 +29,5 @@ contract C { // ==== // SMTEngine: chc // ---- -// Warning 6328: (645-668): CHC: Assertion violation happens here.\nCounterexample:\ndata = [0x26, 0x12, 0x1f, 0xf0], sender = 0x0, sig = 0x26121ff0, value = 42\n\nTransaction trace:\nC.constructor()\nState: data = [], sender = 0x0, sig = 0x0, value = 0\nC.f(){ msg.data: [0x26, 0x12, 0x1f, 0xf0], msg.sender: 0x0, msg.sig: 0x26121ff0, msg.value: 42 }\n C.g() -- internal call +// Warning 6328: (645-668): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/prevrandao.sol b/test/libsolidity/smtCheckerTests/special/prevrandao.sol index 0237c7550582..4bc818ba1606 100644 --- a/test/libsolidity/smtCheckerTests/special/prevrandao.sol +++ b/test/libsolidity/smtCheckerTests/special/prevrandao.sol @@ -14,3 +14,4 @@ contract C // Warning 8417: (179-195): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 6328: (58-96): CHC: Assertion violation happens here. // Warning 6328: (115-153): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/range_check.sol b/test/libsolidity/smtCheckerTests/special/range_check.sol index 62187f46a6a5..210aed4daea4 100644 --- a/test/libsolidity/smtCheckerTests/special/range_check.sol +++ b/test/libsolidity/smtCheckerTests/special/range_check.sol @@ -63,3 +63,4 @@ contract D { // Warning 8417: (598-614): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 8417: (1447-1463): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 8417: (1481-1497): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. +// Info 1391: CHC: 44 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/shadowing_1.sol b/test/libsolidity/smtCheckerTests/special/shadowing_1.sol index d545483141f2..27fb60bad355 100644 --- a/test/libsolidity/smtCheckerTests/special/shadowing_1.sol +++ b/test/libsolidity/smtCheckerTests/special/shadowing_1.sol @@ -22,3 +22,4 @@ contract C { // Warning 2319: (149-160): This declaration shadows a builtin symbol. // Warning 2319: (189-203): This declaration shadows a builtin symbol. // Warning 6328: (274-297): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/this_state.sol b/test/libsolidity/smtCheckerTests/special/this_state.sol index 121874606510..703488db7f40 100644 --- a/test/libsolidity/smtCheckerTests/special/this_state.sol +++ b/test/libsolidity/smtCheckerTests/special/this_state.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/time_units.sol b/test/libsolidity/smtCheckerTests/special/time_units.sol index 2462f9312758..922fb402078d 100644 --- a/test/libsolidity/smtCheckerTests/special/time_units.sol +++ b/test/libsolidity/smtCheckerTests/special/time_units.sol @@ -15,8 +15,9 @@ contract D { // ==== // SMTEngine: all // ---- -// Warning 6328: (69-91): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f() -// Warning 6328: (131-163): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f() -// Warning 6328: (201-231): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f() -// Warning 6328: (265-291): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f() -// Warning 6328: (325-352): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nD.constructor()\nD.f() +// Warning 6328: (69-91): CHC: Assertion violation happens here. +// Warning 6328: (131-163): CHC: Assertion violation happens here. +// Warning 6328: (201-231): CHC: Assertion violation happens here. +// Warning 6328: (265-291): CHC: Assertion violation happens here. +// Warning 6328: (325-352): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/timestamp.sol b/test/libsolidity/smtCheckerTests/special/timestamp.sol index 09c04fb4356a..31bd09694c2b 100644 --- a/test/libsolidity/smtCheckerTests/special/timestamp.sol +++ b/test/libsolidity/smtCheckerTests/special/timestamp.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/timestamp_2.sol b/test/libsolidity/smtCheckerTests/special/timestamp_2.sol index 7173185da8e5..c9520840b8bd 100644 --- a/test/libsolidity/smtCheckerTests/special/timestamp_2.sol +++ b/test/libsolidity/smtCheckerTests/special/timestamp_2.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4984: (107-126): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\nx = 115792089237316195423570985008687907853269984665640564039457584007913129639935\n\nTransaction trace:\nC.constructor(){ block.timestamp: 115792089237316195423570985008687907853269984665640564039457584007913129639935 } +// Warning 4984: (107-126): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/tx_data_gasleft_changes.sol b/test/libsolidity/smtCheckerTests/special/tx_data_gasleft_changes.sol index 3f8c4c16220e..a30f25b7f7b9 100644 --- a/test/libsolidity/smtCheckerTests/special/tx_data_gasleft_changes.sol +++ b/test/libsolidity/smtCheckerTests/special/tx_data_gasleft_changes.sol @@ -20,3 +20,4 @@ contract C { // ---- // Warning 6328: (91-117): CHC: Assertion violation happens here. // Warning 6328: (186-212): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/tx_data_immutable.sol b/test/libsolidity/smtCheckerTests/special/tx_data_immutable.sol index c15dfb1cfef2..c66ce565393a 100644 --- a/test/libsolidity/smtCheckerTests/special/tx_data_immutable.sol +++ b/test/libsolidity/smtCheckerTests/special/tx_data_immutable.sol @@ -67,3 +67,4 @@ contract C { // Warning 8417: (293-309): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 8417: (645-661): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. // Warning 8417: (1127-1143): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain. +// Info 1391: CHC: 26 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/tx_vars_bmc_internal.sol b/test/libsolidity/smtCheckerTests/special/tx_vars_bmc_internal.sol index 137864a337ef..03db677c0826 100644 --- a/test/libsolidity/smtCheckerTests/special/tx_vars_bmc_internal.sol +++ b/test/libsolidity/smtCheckerTests/special/tx_vars_bmc_internal.sol @@ -20,3 +20,4 @@ contract C { // ---- // Warning 4661: (233-259): BMC: Assertion violation happens here. // Warning 4661: (287-314): BMC: Assertion violation happens here. +// Info 6002: BMC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/tx_vars_chc_internal.sol b/test/libsolidity/smtCheckerTests/special/tx_vars_chc_internal.sol index 6e876daf3080..6aa6640305a6 100644 --- a/test/libsolidity/smtCheckerTests/special/tx_vars_chc_internal.sol +++ b/test/libsolidity/smtCheckerTests/special/tx_vars_chc_internal.sol @@ -21,4 +21,5 @@ contract C { // SMTEngine: chc // SMTIgnoreOS: macos // ---- -// Warning 6328: (343-377): CHC: Assertion violation happens here.\nCounterexample:\ngas = 0, origin = 0x0\n\nTransaction trace:\nC.constructor()\nState: gas = 0, origin = 0x0\nC.f(){ tx.gasprice: 0, tx.origin: 0x0 }\n C.g() -- internal call +// Warning 6328: (343-377): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/special/tx_vars_reentrancy_1.sol b/test/libsolidity/smtCheckerTests/special/tx_vars_reentrancy_1.sol index 0f511a05d1e4..7af8c96c894d 100644 --- a/test/libsolidity/smtCheckerTests/special/tx_vars_reentrancy_1.sol +++ b/test/libsolidity/smtCheckerTests/special/tx_vars_reentrancy_1.sol @@ -11,6 +11,7 @@ contract C { } // ==== // SMTEngine: all +// SMTIgnoreCex: yes // SMTIgnoreOS: macos // ---- // Warning 6328: (135-169): CHC: Assertion violation happens here.\nCounterexample:\n\n_i = 0\nx = 5892\n\nTransaction trace:\nC.constructor()\nC.g(0){ msg.value: 11 }\n _i.f() -- untrusted external call, synthesized as:\n C.g(0){ msg.value: 32278 } -- reentrant call\n _i.f() -- untrusted external call diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_1.sol b/test/libsolidity/smtCheckerTests/try_catch/try_1.sol index 02a1273e435f..b1500256c4a0 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_1.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_1.sol @@ -20,4 +20,5 @@ contract C { // SMTEngine: all // ---- // Warning 5667: (163-177): Unused try/catch parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (221-236): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\nsuccess = false\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f() +// Warning 6328: (221-236): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_2.sol b/test/libsolidity/smtCheckerTests/try_catch/try_2.sol index f2ea2e555481..724d7b74ec30 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_2.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_2.sol @@ -18,3 +18,4 @@ contract C { // SMTEngine: all // ---- // Warning 5667: (155-169): Unused try/catch parameter. Remove or comment out the variable name to silence this warning. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_3.sol b/test/libsolidity/smtCheckerTests/try_catch/try_3.sol index 4244f50967ef..77e53f86088d 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_3.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_3.sol @@ -23,4 +23,5 @@ contract C { // SMTEngine: all // ---- // Warning 5667: (259-273): Unused try/catch parameter. Remove or comment out the variable name to silence this warning. -// Warning 6328: (280-294): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\ns = []\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f()\n C.postinc() -- internal call +// Warning 6328: (280-294): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_4.sol b/test/libsolidity/smtCheckerTests/try_catch/try_4.sol index 289f3943d7d0..9090e71f2c8d 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_4.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_4.sol @@ -26,4 +26,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (320-334): CHC: Assertion violation happens here. -// Info 1180: Reentrancy property(ies) for :C:\n!( = 1)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(x == 0)\n = 2 -> Assertion failed at assert(x == 1)\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_5.sol b/test/libsolidity/smtCheckerTests/try_catch/try_5.sol index 236a26f1bd49..163a879d881d 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_5.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_5.sol @@ -25,5 +25,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (315-329): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, d = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, d = 0\nC.f() -// Info 1180: Reentrancy property(ies) for :C:\n!( = 2)\n((!(x' >= 100) || ((x' + ((- 1) * x)) = 0)) && !( = 1))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(x < 100)\n = 2 -> Assertion failed at assert(x == 0)\n = 3 -> Assertion failed at assert(x == 1)\n +// Warning 6328: (315-329): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_multiple_catch_clauses.sol b/test/libsolidity/smtCheckerTests/try_catch/try_multiple_catch_clauses.sol index 769a618732ec..4605aee86310 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_multiple_catch_clauses.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_multiple_catch_clauses.sol @@ -23,4 +23,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (415-430): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\nsuccess = false\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f() +// Warning 6328: (415-430): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_multiple_catch_clauses_2.sol b/test/libsolidity/smtCheckerTests/try_catch/try_multiple_catch_clauses_2.sol index d11d3a8a6890..b7b5de6417f6 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_multiple_catch_clauses_2.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_multiple_catch_clauses_2.sol @@ -22,3 +22,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (306-320): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_multiple_returned_values.sol b/test/libsolidity/smtCheckerTests/try_catch/try_multiple_returned_values.sol index abef4c76a450..a53f0c13fe84 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_multiple_returned_values.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_multiple_returned_values.sol @@ -22,7 +22,7 @@ contract C { // SMTEngine: all // ---- // Warning 2519: (164-170): This declaration shadows an existing declaration. -// Warning 6328: (185-199): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, d = 0\nx = 1\nc = false\n\nTransaction trace:\nC.constructor()\nState: x = 0, d = 0\nC.f()\n d.d() -- untrusted external call -// Warning 6328: (273-283): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, d = 0\nx = 1\nc = true\n\nTransaction trace:\nC.constructor()\nState: x = 0, d = 0\nC.f()\n d.d() -- untrusted external call -// Warning 6328: (393-407): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, d = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, d = 0\nC.f() -// Info 1180: Reentrancy property(ies) for :C:\n!( = 3)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(x == 0)\n = 2 -> Assertion failed at assert(!c)\n = 3 -> Assertion failed at assert(x == 0)\n = 4 -> Assertion failed at assert(x == 1)\n +// Warning 6328: (185-199): CHC: Assertion violation happens here. +// Warning 6328: (273-283): CHC: Assertion violation happens here. +// Warning 6328: (393-407): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_multiple_returned_values_with_tuple.sol b/test/libsolidity/smtCheckerTests/try_catch/try_multiple_returned_values_with_tuple.sol index d6b62ea9959f..ccbd444232ce 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_multiple_returned_values_with_tuple.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_multiple_returned_values_with_tuple.sol @@ -24,4 +24,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (321-336): CHC: Assertion violation happens here.\nCounterexample:\n\nsuccess = false\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (321-336): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_nested_1.sol b/test/libsolidity/smtCheckerTests/try_catch/try_nested_1.sol index dfbfb978a4e5..2407d893fbfe 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_nested_1.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_nested_1.sol @@ -21,3 +21,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (280-295): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_nested_2.sol b/test/libsolidity/smtCheckerTests/try_catch/try_nested_2.sol index 5c15fb54fa42..e1935cf97e30 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_nested_2.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_nested_2.sol @@ -22,3 +22,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (342-362): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_nested_3.sol b/test/libsolidity/smtCheckerTests/try_catch/try_nested_3.sol index bbb65a23657d..7ce761a80219 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_nested_3.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_nested_3.sol @@ -20,4 +20,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (323-343): CHC: Assertion violation happens here.\nCounterexample:\n\nchoice = 1\n\nTransaction trace:\nC.constructor()\nC.f()\n C.g() -- trusted external call +// Warning 6328: (323-343): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_new.sol b/test/libsolidity/smtCheckerTests/try_catch/try_new.sol index e7075e076550..5c98c279d2a0 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_new.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_new.sol @@ -28,5 +28,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4588: (231-245): Assertion checker does not yet implement this type of function call. -// Warning 4588: (492-507): Assertion checker does not yet implement this type of function call. +// Warning 8729: (231-245): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. +// Warning 8729: (492-507): Contract deployment is only supported in the trusted mode for external calls with the CHC engine. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_public_var.sol b/test/libsolidity/smtCheckerTests/try_catch/try_public_var.sol index 281a7483933e..23c2a7b6c27a 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_public_var.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_public_var.sol @@ -12,4 +12,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (139-152): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f() +// Warning 6328: (139-152): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_public_var_mapping.sol b/test/libsolidity/smtCheckerTests/try_catch/try_public_var_mapping.sol index 43f4b5f03f2a..ae38765c4c48 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_public_var_mapping.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_public_var_mapping.sol @@ -21,4 +21,5 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6328: (280-300): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (280-300): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_string_literal_to_bytes_array.sol b/test/libsolidity/smtCheckerTests/try_catch/try_string_literal_to_bytes_array.sol index c557b08a0e49..93f1a347ddb4 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_string_literal_to_bytes_array.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_string_literal_to_bytes_array.sol @@ -16,3 +16,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/try_catch/try_string_literal_to_fixed_bytes.sol b/test/libsolidity/smtCheckerTests/try_catch/try_string_literal_to_fixed_bytes.sol index b56aa8562431..e84b0f6a4368 100644 --- a/test/libsolidity/smtCheckerTests/try_catch/try_string_literal_to_fixed_bytes.sol +++ b/test/libsolidity/smtCheckerTests/try_catch/try_string_literal_to_fixed_bytes.sol @@ -17,3 +17,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (218-262): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/address_literal.sol b/test/libsolidity/smtCheckerTests/typecast/address_literal.sol index 40540bb5112b..5189b45e9f42 100644 --- a/test/libsolidity/smtCheckerTests/typecast/address_literal.sol +++ b/test/libsolidity/smtCheckerTests/typecast/address_literal.sol @@ -22,5 +22,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (454-468): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0\na = 0x0\nb = 0x01\nc = 0x0\nd = 0x0\ne = 0x12345678\n\nTransaction trace:\nC.constructor()\nState: x = 0x0\nC.g() -// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\n +// Warning 6328: (454-468): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/bytes_to_fixed_bytes_1.sol b/test/libsolidity/smtCheckerTests/typecast/bytes_to_fixed_bytes_1.sol index 1d00e7fe3b47..bc3d92b418be 100644 --- a/test/libsolidity/smtCheckerTests/typecast/bytes_to_fixed_bytes_1.sol +++ b/test/libsolidity/smtCheckerTests/typecast/bytes_to_fixed_bytes_1.sol @@ -11,4 +11,8 @@ contract C { assert(g == 0x0001020304050607080900010203040506070809000102030405060708090001); // should hold } } +// ==== +// SMTEngine: all +// SMTIgnoreCex: yes // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/cast_address_1.sol b/test/libsolidity/smtCheckerTests/typecast/cast_address_1.sol index c29df89899d4..c106dfc1f2d5 100644 --- a/test/libsolidity/smtCheckerTests/typecast/cast_address_1.sol +++ b/test/libsolidity/smtCheckerTests/typecast/cast_address_1.sol @@ -8,3 +8,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/cast_different_size_1.sol b/test/libsolidity/smtCheckerTests/typecast/cast_different_size_1.sol index 618704dd4923..2e0d63326463 100644 --- a/test/libsolidity/smtCheckerTests/typecast/cast_different_size_1.sol +++ b/test/libsolidity/smtCheckerTests/typecast/cast_different_size_1.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/cast_larger_1.sol b/test/libsolidity/smtCheckerTests/typecast/cast_larger_1.sol index c73372f3af57..05383eb3c178 100644 --- a/test/libsolidity/smtCheckerTests/typecast/cast_larger_1.sol +++ b/test/libsolidity/smtCheckerTests/typecast/cast_larger_1.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/cast_larger_2.sol b/test/libsolidity/smtCheckerTests/typecast/cast_larger_2.sol index 5c2fb759ac5f..a608372d279f 100644 --- a/test/libsolidity/smtCheckerTests/typecast/cast_larger_2.sol +++ b/test/libsolidity/smtCheckerTests/typecast/cast_larger_2.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/cast_larger_3.sol b/test/libsolidity/smtCheckerTests/typecast/cast_larger_3.sol index 3a14cbb24b99..fca18d824a44 100644 --- a/test/libsolidity/smtCheckerTests/typecast/cast_larger_3.sol +++ b/test/libsolidity/smtCheckerTests/typecast/cast_larger_3.sol @@ -12,4 +12,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (240-254): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0x1234\nb = 0x12340000\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (240-254): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/cast_smaller_1.sol b/test/libsolidity/smtCheckerTests/typecast/cast_smaller_1.sol index c1c955417f8c..05c8756d4829 100644 --- a/test/libsolidity/smtCheckerTests/typecast/cast_smaller_1.sol +++ b/test/libsolidity/smtCheckerTests/typecast/cast_smaller_1.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/cast_smaller_2.sol b/test/libsolidity/smtCheckerTests/typecast/cast_smaller_2.sol index 81f42f9e218e..66782a49da89 100644 --- a/test/libsolidity/smtCheckerTests/typecast/cast_smaller_2.sol +++ b/test/libsolidity/smtCheckerTests/typecast/cast_smaller_2.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/cast_smaller_3.sol b/test/libsolidity/smtCheckerTests/typecast/cast_smaller_3.sol index 48eab0102147..c524f21bfcd3 100644 --- a/test/libsolidity/smtCheckerTests/typecast/cast_smaller_3.sol +++ b/test/libsolidity/smtCheckerTests/typecast/cast_smaller_3.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/downcast.sol b/test/libsolidity/smtCheckerTests/typecast/downcast.sol index a2fe8b6c8ca0..bba3585f26cf 100644 --- a/test/libsolidity/smtCheckerTests/typecast/downcast.sol +++ b/test/libsolidity/smtCheckerTests/typecast/downcast.sol @@ -46,3 +46,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 20 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol b/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol index 8d2fd6310ae8..c051db017618 100644 --- a/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol +++ b/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/enum_to_uint_max_value.sol b/test/libsolidity/smtCheckerTests/typecast/enum_to_uint_max_value.sol index a382a786d0c4..e65cf683ff39 100644 --- a/test/libsolidity/smtCheckerTests/typecast/enum_to_uint_max_value.sol +++ b/test/libsolidity/smtCheckerTests/typecast/enum_to_uint_max_value.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/function_type_to_function_type_internal.sol b/test/libsolidity/smtCheckerTests/typecast/function_type_to_function_type_internal.sol index 6596c6f59d00..2d3448ee7b0d 100644 --- a/test/libsolidity/smtCheckerTests/typecast/function_type_to_function_type_internal.sol +++ b/test/libsolidity/smtCheckerTests/typecast/function_type_to_function_type_internal.sol @@ -16,7 +16,7 @@ contract C { // Warning 6031: (182-186): Internal error: Expression undefined for SMT solver. // Warning 6031: (190-194): Internal error: Expression undefined for SMT solver. // Warning 7229: (206-212): Assertion checker does not yet implement the type function (uint256) returns (uint256) for comparisons -// Warning 6328: (175-195): CHC: Assertion violation happens here.\nCounterexample:\na = 0, b = 0\n\nTransaction trace:\nC.constructor()\nState: a = 0, b = 0\nC.g()\n C.f(0, 0) -- internal call -// Warning 6328: (199-213): CHC: Assertion violation happens here.\nCounterexample:\na = 0, b = 0\n\nTransaction trace:\nC.constructor()\nState: a = 0, b = 0\nC.g()\n C.f(0, 0) -- internal call // Warning 5729: (182-186): BMC does not yet implement this type of function call. // Warning 5729: (190-194): BMC does not yet implement this type of function call. +// Warning 6328: (175-195): CHC: Assertion violation happens here. +// Warning 6328: (199-213): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/typecast/implicit_cast_string_literal_byte.sol b/test/libsolidity/smtCheckerTests/typecast/implicit_cast_string_literal_byte.sol index 093a20d7fbf9..b98c518a6427 100644 --- a/test/libsolidity/smtCheckerTests/typecast/implicit_cast_string_literal_byte.sol +++ b/test/libsolidity/smtCheckerTests/typecast/implicit_cast_string_literal_byte.sol @@ -13,4 +13,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (153-174): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\nb = 0x0\n\nTransaction trace:\nC.constructor()\nC.f()\n C.g(0x0) -- internal call +// Warning 6328: (153-174): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/number_literal.sol b/test/libsolidity/smtCheckerTests/typecast/number_literal.sol index 7a0d9d467888..af7da87d2c8b 100644 --- a/test/libsolidity/smtCheckerTests/typecast/number_literal.sol +++ b/test/libsolidity/smtCheckerTests/typecast/number_literal.sol @@ -30,3 +30,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/same_size.sol b/test/libsolidity/smtCheckerTests/typecast/same_size.sol index 03fff063d2f2..b55e26064af5 100644 --- a/test/libsolidity/smtCheckerTests/typecast/same_size.sol +++ b/test/libsolidity/smtCheckerTests/typecast/same_size.sol @@ -71,3 +71,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 27 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_dynamic_bytes.sol b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_dynamic_bytes.sol index db54c9035d19..d4e7615ee9e6 100644 --- a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_dynamic_bytes.sol +++ b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_dynamic_bytes.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (173-207): CHC: Assertion violation happens here.\nCounterexample:\n\nb = [0xff, 0xff]\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (173-207): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_constant_initialization_2.sol b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_constant_initialization_2.sol index 189e4626b3c4..013f81554228 100644 --- a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_constant_initialization_2.sol +++ b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_constant_initialization_2.sol @@ -8,3 +8,4 @@ contract MockContract { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_modifier.sol b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_modifier.sol index c3fda61b8453..fb98c5061fc9 100644 --- a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_modifier.sol +++ b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_modifier.sol @@ -9,4 +9,5 @@ contract B { // ==== // SMTEngine: all // ---- -// Warning 6328: (120-142): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0x30313233343536\n\nTransaction trace:\nB.constructor()\nB.f() +// Warning 6328: (120-142): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return.sol b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return.sol index 56ef16374e0f..ecdc253e33b2 100644 --- a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return.sol +++ b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (206-227): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.a()\n C.f1() -- internal call\n C.g() -- internal call\n C.f1() -- internal call\n C.g() -- internal call +// Warning 6328: (206-227): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return_multi.sol b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return_multi.sol index e443beb43db9..4ba6ba2ed5de 100644 --- a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return_multi.sol +++ b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_return_multi.sol @@ -13,4 +13,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (410-429): CHC: Assertion violation happens here.\nCounterexample:\n\nv1 = 0x6162630000000000000000000000000000000000000000000000000000000000\nv2 = 0x646566\n\nTransaction trace:\nC.constructor()\nC.a()\n C.f2() -- internal call\n C.h() -- internal call +// Warning 6328: (410-429): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_upcast.sol b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_upcast.sol index 340e835a493f..be1af11c9bff 100644 --- a/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_upcast.sol +++ b/test/libsolidity/smtCheckerTests/typecast/string_literal_to_fixed_bytes_upcast.sol @@ -7,4 +7,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (43-93): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (43-93): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/string_to_bytes_push_1.sol b/test/libsolidity/smtCheckerTests/typecast/string_to_bytes_push_1.sol index 4910c417e810..01027e2b8db4 100644 --- a/test/libsolidity/smtCheckerTests/typecast/string_to_bytes_push_1.sol +++ b/test/libsolidity/smtCheckerTests/typecast/string_to_bytes_push_1.sol @@ -11,4 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (132-160): CHC: Assertion violation happens here.\nCounterexample:\nx = [0x61, 0x62, 0x63, 0x61]\n\nTransaction trace:\nC.constructor()\nState: x = []\nC.s() +// Warning 6328: (132-160): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/string_to_bytes_push_2.sol b/test/libsolidity/smtCheckerTests/typecast/string_to_bytes_push_2.sol index b3092f04c4b2..827c6e11a606 100644 --- a/test/libsolidity/smtCheckerTests/typecast/string_to_bytes_push_2.sol +++ b/test/libsolidity/smtCheckerTests/typecast/string_to_bytes_push_2.sol @@ -13,3 +13,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (140-168): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/typecast/upcast.sol b/test/libsolidity/smtCheckerTests/typecast/upcast.sol index 45c0221533e2..db9e90dfd7c6 100644 --- a/test/libsolidity/smtCheckerTests/typecast/upcast.sol +++ b/test/libsolidity/smtCheckerTests/typecast/upcast.sol @@ -67,3 +67,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 23 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/address_call.sol b/test/libsolidity/smtCheckerTests/types/address_call.sol index 8ea3894827df..063909f873f0 100644 --- a/test/libsolidity/smtCheckerTests/types/address_call.sol +++ b/test/libsolidity/smtCheckerTests/types/address_call.sol @@ -25,3 +25,4 @@ contract C // Warning 2072: (127-166): Unused local variable. // Warning 2072: (191-207): Unused local variable. // Warning 6328: (227-242): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/address_staticcall.sol b/test/libsolidity/smtCheckerTests/types/address_staticcall.sol index 9d00904ad7f4..3479a38bb380 100644 --- a/test/libsolidity/smtCheckerTests/types/address_staticcall.sol +++ b/test/libsolidity/smtCheckerTests/types/address_staticcall.sol @@ -22,4 +22,4 @@ contract C // Warning 2072: (127-166): Unused local variable. // Warning 2072: (191-207): Unused local variable. // Warning 6328: (233-248): CHC: Assertion violation happens here. -// Info 1180: Reentrancy property(ies) for :C:\n!( >= 2)\n!( >= 3)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(success)\n = 2 -> Assertion failed at assert(x == 0)\n = 3 -> Assertion failed at assert(map[0] == 0)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/address_transfer_3.sol b/test/libsolidity/smtCheckerTests/types/address_transfer_3.sol index 928ac1e8e3e0..02d20c4f5bc4 100644 --- a/test/libsolidity/smtCheckerTests/types/address_transfer_3.sol +++ b/test/libsolidity/smtCheckerTests/types/address_transfer_3.sol @@ -13,3 +13,5 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. +// Info 6002: BMC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_1.sol b/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_1.sol index 4e315f6efcf3..07f0c9c1f5b3 100644 --- a/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_1.sol +++ b/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_1.sol @@ -51,3 +51,4 @@ contract C // Warning 6368: (730-742): CHC: Out of bounds access happens here. // Warning 6328: (692-749): CHC: Assertion violation happens here. // Warning 6368: (850-854): CHC: Out of bounds access happens here. +// Info 1391: CHC: 12 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_2.sol b/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_2.sol index 7eccaf68f9c9..e90d4fbf8c3a 100644 --- a/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_2.sol +++ b/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_2.sol @@ -31,3 +31,4 @@ contract C // Warning 6368: (584-588): CHC: Out of bounds access happens here. // Warning 6328: (577-594): CHC: Assertion violation happens here. // Warning 6368: (605-609): CHC: Out of bounds access happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_3.sol b/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_3.sol index 7e89f1c9d00a..c23074566373 100644 --- a/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_3.sol +++ b/test/libsolidity/smtCheckerTests/types/array_aliasing_memory_3.sol @@ -28,4 +28,4 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n!(array.length <= 0)\n +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_1.sol b/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_1.sol index 3f1b6cdd435f..199ccbc160c3 100644 --- a/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_1.sol +++ b/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_1.sol @@ -53,3 +53,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 2018: (957-1329): Function state mutability can be restricted to view +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_2.sol b/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_2.sol index 48d1f8130195..b9e726d97edb 100644 --- a/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_2.sol +++ b/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_2.sol @@ -35,3 +35,4 @@ contract C // Warning 6368: (659-663): CHC: Out of bounds access happens here. // Warning 6328: (652-669): CHC: Assertion violation happens here. // Warning 6368: (741-745): CHC: Out of bounds access happens here. +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_3.sol b/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_3.sol index f74fad8af12c..3d8dbc056561 100644 --- a/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_3.sol +++ b/test/libsolidity/smtCheckerTests/types/array_aliasing_storage_3.sol @@ -39,3 +39,4 @@ contract C // Warning 6368: (955-959): CHC: Out of bounds access happens here. // Warning 6328: (948-965): CHC: Assertion violation happens here. // Warning 6368: (976-980): CHC: Out of bounds access happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_branch_1d.sol b/test/libsolidity/smtCheckerTests/types/array_branch_1d.sol index b04c632e9181..43b6cc0d4174 100644 --- a/test/libsolidity/smtCheckerTests/types/array_branch_1d.sol +++ b/test/libsolidity/smtCheckerTests/types/array_branch_1d.sol @@ -13,3 +13,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (143-159): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_branch_3d.sol b/test/libsolidity/smtCheckerTests/types/array_branch_3d.sol index fad9d2bbac4a..8ba3f013707d 100644 --- a/test/libsolidity/smtCheckerTests/types/array_branch_3d.sol +++ b/test/libsolidity/smtCheckerTests/types/array_branch_3d.sol @@ -22,5 +22,5 @@ contract C // Warning 6368: (152-162): CHC: Out of bounds access might happen here. // Warning 6368: (177-184): CHC: Out of bounds access might happen here. // Warning 6368: (177-187): CHC: Out of bounds access might happen here. -// Warning 6328: (170-192): CHC: Assertion violation happens here.\nCounterexample:\nc = [[[0]]]\nb = false\n\nTransaction trace:\nC.constructor()\nState: c = [[[0]]]\nC.f(false) -// Info 1180: Contract invariant(s) for :C:\n!(c.length <= 0)\n +// Warning 6328: (170-192): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_branches_1d.sol b/test/libsolidity/smtCheckerTests/types/array_branches_1d.sol index 748409ba2f10..61abb418d6e0 100644 --- a/test/libsolidity/smtCheckerTests/types/array_branches_1d.sol +++ b/test/libsolidity/smtCheckerTests/types/array_branches_1d.sol @@ -13,3 +13,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_branches_2d.sol b/test/libsolidity/smtCheckerTests/types/array_branches_2d.sol index 95a6904a530d..f4743dcc5657 100644 --- a/test/libsolidity/smtCheckerTests/types/array_branches_2d.sol +++ b/test/libsolidity/smtCheckerTests/types/array_branches_2d.sol @@ -18,3 +18,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 10 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_branches_3d.sol b/test/libsolidity/smtCheckerTests/types/array_branches_3d.sol index b2fd9132780f..ecd419eea6ac 100644 --- a/test/libsolidity/smtCheckerTests/types/array_branches_3d.sol +++ b/test/libsolidity/smtCheckerTests/types/array_branches_3d.sol @@ -22,4 +22,4 @@ contract C // Warning 6368: (152-162): CHC: Out of bounds access might happen here. // Warning 6368: (177-184): CHC: Out of bounds access might happen here. // Warning 6368: (177-187): CHC: Out of bounds access might happen here. -// Info 1180: Contract invariant(s) for :C:\n!(c.length <= 0)\n +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_branches_3d_show_unproved.sol b/test/libsolidity/smtCheckerTests/types/array_branches_3d_show_unproved.sol index 689fc045d9e0..acd5744726d5 100644 --- a/test/libsolidity/smtCheckerTests/types/array_branches_3d_show_unproved.sol +++ b/test/libsolidity/smtCheckerTests/types/array_branches_3d_show_unproved.sol @@ -23,4 +23,4 @@ contract C // Warning 6368: (152-162): CHC: Out of bounds access might happen here. // Warning 6368: (177-184): CHC: Out of bounds access might happen here. // Warning 6368: (177-187): CHC: Out of bounds access might happen here. -// Info 1180: Contract invariant(s) for :C:\n!(c.length <= 0)\n +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_dynamic_1.sol b/test/libsolidity/smtCheckerTests/types/array_dynamic_1.sol index 7f3667ec46cf..2aba2bbeb092 100644 --- a/test/libsolidity/smtCheckerTests/types/array_dynamic_1.sol +++ b/test/libsolidity/smtCheckerTests/types/array_dynamic_1.sol @@ -17,3 +17,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_dynamic_1_fail.sol b/test/libsolidity/smtCheckerTests/types/array_dynamic_1_fail.sol index 8c243d4ae634..bc512b557487 100644 --- a/test/libsolidity/smtCheckerTests/types/array_dynamic_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/types/array_dynamic_1_fail.sol @@ -12,4 +12,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (172-194): CHC: Assertion violation happens here.\nCounterexample:\narray = [200]\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nState: array = []\nC.p()\nState: array = [0]\nC.f(0, 0) +// Warning 6328: (172-194): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_dynamic_2.sol b/test/libsolidity/smtCheckerTests/types/array_dynamic_2.sol index de8cc2066f64..5e421cf49931 100644 --- a/test/libsolidity/smtCheckerTests/types/array_dynamic_2.sol +++ b/test/libsolidity/smtCheckerTests/types/array_dynamic_2.sol @@ -10,5 +10,6 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6368: (98-106): CHC: Out of bounds access happens here.\nCounterexample:\narray = []\nx = 0\ny = 0\nz = 0\nt = 0\n\nTransaction trace:\nC.constructor()\nState: array = []\nC.f(0, 0, 0, 0) -// Warning 6368: (98-109): CHC: Out of bounds access happens here.\nCounterexample:\narray = []\nx = 0\ny = 0\nz = 0\nt = 0\n\nTransaction trace:\nC.constructor()\nState: array = []\nC.f(0, 0, 0, 0) +// Warning 6368: (98-106): CHC: Out of bounds access happens here. +// Warning 6368: (98-109): CHC: Out of bounds access happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_dynamic_2_fail.sol b/test/libsolidity/smtCheckerTests/types/array_dynamic_2_fail.sol index fc53eb69b2ff..fa55bd7f77f2 100644 --- a/test/libsolidity/smtCheckerTests/types/array_dynamic_2_fail.sol +++ b/test/libsolidity/smtCheckerTests/types/array_dynamic_2_fail.sol @@ -16,3 +16,4 @@ contract C // SMTEngine: all // ---- // Warning 6328: (245-270): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_dynamic_3.sol b/test/libsolidity/smtCheckerTests/types/array_dynamic_3.sol index f03c98f0f09e..ae90faa4ebee 100644 --- a/test/libsolidity/smtCheckerTests/types/array_dynamic_3.sol +++ b/test/libsolidity/smtCheckerTests/types/array_dynamic_3.sol @@ -13,3 +13,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 10 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_dynamic_3_fail.sol b/test/libsolidity/smtCheckerTests/types/array_dynamic_3_fail.sol index a98511ed183c..76732c141365 100644 --- a/test/libsolidity/smtCheckerTests/types/array_dynamic_3_fail.sol +++ b/test/libsolidity/smtCheckerTests/types/array_dynamic_3_fail.sol @@ -17,3 +17,4 @@ contract C // SMTEngine: all // ---- // Warning 6328: (318-346): CHC: Assertion violation happens here. +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1.sol b/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1.sol index 4873f840d201..7387e8125d1c 100644 --- a/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1.sol +++ b/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1_fail.sol b/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1_fail.sol index 6ca6fc67aa7b..004bab44d83d 100644 --- a/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/types/array_dynamic_parameter_1_fail.sol @@ -12,3 +12,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (144-166): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_literal_1.sol b/test/libsolidity/smtCheckerTests/types/array_literal_1.sol index 49f65c06d462..79a1d08ab3e3 100644 --- a/test/libsolidity/smtCheckerTests/types/array_literal_1.sol +++ b/test/libsolidity/smtCheckerTests/types/array_literal_1.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_literal_2.sol b/test/libsolidity/smtCheckerTests/types/array_literal_2.sol index 0062594d8ac3..1136a9d1f3c9 100644 --- a/test/libsolidity/smtCheckerTests/types/array_literal_2.sol +++ b/test/libsolidity/smtCheckerTests/types/array_literal_2.sol @@ -11,4 +11,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (167-187): CHC: Assertion violation happens here.\nCounterexample:\n\na = [1, 2, 3]\nb = [1, 2, 4]\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (167-187): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_literal_3.sol b/test/libsolidity/smtCheckerTests/types/array_literal_3.sol index 3152f0e1e9f4..52baec977d6b 100644 --- a/test/libsolidity/smtCheckerTests/types/array_literal_3.sol +++ b/test/libsolidity/smtCheckerTests/types/array_literal_3.sol @@ -11,3 +11,4 @@ contract C // SMTEngine: all // ---- // Warning 6328: (168-188): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_literal_4.sol b/test/libsolidity/smtCheckerTests/types/array_literal_4.sol index bf2f66ccdf68..1c95ea98ea84 100644 --- a/test/libsolidity/smtCheckerTests/types/array_literal_4.sol +++ b/test/libsolidity/smtCheckerTests/types/array_literal_4.sol @@ -11,3 +11,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_literal_5.sol b/test/libsolidity/smtCheckerTests/types/array_literal_5.sol index f152e2cb17e7..7c4c9d3d9a15 100644 --- a/test/libsolidity/smtCheckerTests/types/array_literal_5.sol +++ b/test/libsolidity/smtCheckerTests/types/array_literal_5.sol @@ -13,4 +13,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (176-196): CHC: Assertion violation happens here.\nCounterexample:\ns = [1, 2, 3]\na = [1, 2, 3]\n\nTransaction trace:\nC.constructor()\nState: s = []\nC.f() +// Warning 6328: (176-196): CHC: Assertion violation happens here. +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_literal_6.sol b/test/libsolidity/smtCheckerTests/types/array_literal_6.sol index 0ce378e4249e..e612b08a280f 100644 --- a/test/libsolidity/smtCheckerTests/types/array_literal_6.sol +++ b/test/libsolidity/smtCheckerTests/types/array_literal_6.sol @@ -14,5 +14,6 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (146-174): CHC: Assertion violation happens here.\nCounterexample:\n\na = [1, 2, 3]\nb = [1, 2, 4, 3]\nc = [1, 2, 4, 3]\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (235-255): CHC: Assertion violation happens here.\nCounterexample:\n\na = [1, 2, 3]\nb = [1, 2, 4, 3]\nc = [1, 2, 4, 3]\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (146-174): CHC: Assertion violation happens here. +// Warning 6328: (235-255): CHC: Assertion violation happens here. +// Info 1391: CHC: 11 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_literal_7.sol b/test/libsolidity/smtCheckerTests/types/array_literal_7.sol index 6a0c13e92a8a..21e345023d7f 100644 --- a/test/libsolidity/smtCheckerTests/types/array_literal_7.sol +++ b/test/libsolidity/smtCheckerTests/types/array_literal_7.sol @@ -22,3 +22,4 @@ contract C // ---- // Warning 6328: (226-254): CHC: Assertion violation happens here. // Warning 6328: (315-335): CHC: Assertion violation happens here. +// Info 1391: CHC: 13 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_1.sol b/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_1.sol index 65f629cb2b26..3f9c89734fcb 100644 --- a/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_1.sol +++ b/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_1.sol @@ -38,3 +38,4 @@ contract C // ---- // Warning 6368: (706-720): CHC: Out of bounds access happens here. // Warning 6328: (699-730): CHC: Assertion violation happens here. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_2.sol b/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_2.sol index cd1d77d8df9b..5ac20c96f869 100644 --- a/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_2.sol +++ b/test/libsolidity/smtCheckerTests/types/array_mapping_aliasing_2.sol @@ -34,6 +34,7 @@ contract C // ==== // SMTEngine: all // SMTIgnoreCex: yes +// SMTIgnoreOS: macos // ---- // Warning 6368: (439-453): CHC: Out of bounds access happens here. // Warning 6368: (465-480): CHC: Out of bounds access might happen here. @@ -44,4 +45,4 @@ contract C // Warning 6368: (850-866): CHC: Out of bounds access happens here. // Warning 6368: (850-869): CHC: Out of bounds access happens here. // Warning 6328: (936-956): CHC: Assertion violation happens here. -// Warning 6368: (1029-1043): CHC: Out of bounds access might happen here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_1.sol b/test/libsolidity/smtCheckerTests/types/array_static_1.sol index ce84a1e72a93..3d33caa490c7 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_1.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_1.sol @@ -11,3 +11,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_1_fail.sol b/test/libsolidity/smtCheckerTests/types/array_static_1_fail.sol index 616c19c21ca5..0ab524c758aa 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_1_fail.sol @@ -11,4 +11,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (135-157): CHC: Assertion violation happens here.\nCounterexample:\narray = [200, 0, 0, 0, 0, 0, 0, 0, 0, 0]\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nState: array = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\nC.f(0, 0) +// Warning 6328: (135-157): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_2.sol b/test/libsolidity/smtCheckerTests/types/array_static_2.sol index 7aaca71fdbdc..c90d4a299a6d 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_2.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_2.sol @@ -12,3 +12,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_2_fail.sol b/test/libsolidity/smtCheckerTests/types/array_static_2_fail.sol index c48f45e11980..e0146c85f86a 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_2_fail.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_2_fail.sol @@ -12,4 +12,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (214-239): CHC: Assertion violation happens here.\nCounterexample:\narray = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]\nx = 0\ny = 0\nz = 0\nt = 0\n\nTransaction trace:\nC.constructor()\nState: array = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]\nC.f(0, 0, 0, 0) +// Warning 6328: (214-239): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_3.sol b/test/libsolidity/smtCheckerTests/types/array_static_3.sol index 54f13b1f8e44..a1ca13a80196 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_3.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_3.sol @@ -13,3 +13,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 10 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_3_fail.sol b/test/libsolidity/smtCheckerTests/types/array_static_3_fail.sol index c7773a9b4933..b299de21c6de 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_3_fail.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_3_fail.sol @@ -13,4 +13,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (268-296): CHC: Assertion violation happens here.\nCounterexample:\narray = [[[200, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]]\nx = 0\ny = 0\nz = 0\nt = 0\nw = 0\nv = 0\n\nTransaction trace:\nC.constructor()\nState: array = [[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]]\nC.f(0, 0, 0, 0, 0, 0) +// Warning 6328: (268-296): CHC: Assertion violation happens here. +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_aliasing_memory_5.sol b/test/libsolidity/smtCheckerTests/types/array_static_aliasing_memory_5.sol index 16bb147c99ef..8e6d23ab6c00 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_aliasing_memory_5.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_aliasing_memory_5.sol @@ -16,4 +16,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (385-402): CHC: Assertion violation happens here.\nCounterexample:\n\na = [2440, 11]\nb = [1, 8]\nc = [15, 15]\n\nTransaction trace:\nC.constructor()\nC.f([2, 13], [0, 8], [42, 12]) +// Warning 6328: (385-402): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_aliasing_storage_5.sol b/test/libsolidity/smtCheckerTests/types/array_static_aliasing_storage_5.sol index 4592e9526d79..73863078834c 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_aliasing_storage_5.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_aliasing_storage_5.sol @@ -24,3 +24,4 @@ contract C // SMTEngine: all // SMTIgnoreCex: yes // ---- +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_1.sol b/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_1.sol index f415cfd95593..7ee1acf47b35 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_1.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_1.sol @@ -28,4 +28,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (456-487): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n!(severalMaps3d.length <= 1)\n!(severalMaps8.length <= 1)\n +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_2.sol b/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_2.sol index ca1a58018243..1f167b8586ab 100644 --- a/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_2.sol +++ b/test/libsolidity/smtCheckerTests/types/array_static_mapping_aliasing_2.sol @@ -34,4 +34,4 @@ contract C // Warning 6368: (612-627): CHC: Out of bounds access might happen here. // Warning 6328: (860-880): CHC: Assertion violation happens here. // Warning 6368: (936-952): CHC: Out of bounds access might happen here. -// Warning 6368: (936-955): CHC: Out of bounds access might happen here. +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bool_int_mixed_1.sol b/test/libsolidity/smtCheckerTests/types/bool_int_mixed_1.sol index cd9ba747229f..2e75ad33ded8 100644 --- a/test/libsolidity/smtCheckerTests/types/bool_int_mixed_1.sol +++ b/test/libsolidity/smtCheckerTests/types/bool_int_mixed_1.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bool_int_mixed_2.sol b/test/libsolidity/smtCheckerTests/types/bool_int_mixed_2.sol index 23f57dfe9acc..ac6dd87eb04a 100644 --- a/test/libsolidity/smtCheckerTests/types/bool_int_mixed_2.sol +++ b/test/libsolidity/smtCheckerTests/types/bool_int_mixed_2.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bool_int_mixed_3.sol b/test/libsolidity/smtCheckerTests/types/bool_int_mixed_3.sol index 1e5f9b848b3f..7039ae1bf324 100644 --- a/test/libsolidity/smtCheckerTests/types/bool_int_mixed_3.sol +++ b/test/libsolidity/smtCheckerTests/types/bool_int_mixed_3.sol @@ -21,3 +21,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bool_simple_2.sol b/test/libsolidity/smtCheckerTests/types/bool_simple_2.sol index 44daa8912840..7e23d77d65c9 100644 --- a/test/libsolidity/smtCheckerTests/types/bool_simple_2.sol +++ b/test/libsolidity/smtCheckerTests/types/bool_simple_2.sol @@ -5,5 +5,6 @@ contract C { } // ==== // SMTEngine: all +// SMTIgnoreCex: yes // ---- // Warning 6328: (66-80): CHC: Assertion violation happens here.\nCounterexample:\n\nx = true\ny = false\n\nTransaction trace:\nC.constructor()\nC.f(true, false) diff --git a/test/libsolidity/smtCheckerTests/types/bool_simple_3.sol b/test/libsolidity/smtCheckerTests/types/bool_simple_3.sol index e9dbf9d95aef..fdc08d441bb2 100644 --- a/test/libsolidity/smtCheckerTests/types/bool_simple_3.sol +++ b/test/libsolidity/smtCheckerTests/types/bool_simple_3.sol @@ -7,3 +7,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bool_simple_4.sol b/test/libsolidity/smtCheckerTests/types/bool_simple_4.sol index 58688c361a51..cafb34c2279e 100644 --- a/test/libsolidity/smtCheckerTests/types/bool_simple_4.sol +++ b/test/libsolidity/smtCheckerTests/types/bool_simple_4.sol @@ -10,3 +10,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bool_simple_5.sol b/test/libsolidity/smtCheckerTests/types/bool_simple_5.sol index 791298852b6c..c19a5fa16b02 100644 --- a/test/libsolidity/smtCheckerTests/types/bool_simple_5.sol +++ b/test/libsolidity/smtCheckerTests/types/bool_simple_5.sol @@ -7,3 +7,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bool_simple_6.sol b/test/libsolidity/smtCheckerTests/types/bool_simple_6.sol index 55da224c7c8c..eab6282f0231 100644 --- a/test/libsolidity/smtCheckerTests/types/bool_simple_6.sol +++ b/test/libsolidity/smtCheckerTests/types/bool_simple_6.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bytes_2.sol b/test/libsolidity/smtCheckerTests/types/bytes_2.sol index a0ab43bbf8f9..5b27d56bfcc1 100644 --- a/test/libsolidity/smtCheckerTests/types/bytes_2.sol +++ b/test/libsolidity/smtCheckerTests/types/bytes_2.sol @@ -13,3 +13,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (237-259): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bytes_2_fail.sol b/test/libsolidity/smtCheckerTests/types/bytes_2_fail.sol index 6acec4beff57..66fa8ae3e6d3 100644 --- a/test/libsolidity/smtCheckerTests/types/bytes_2_fail.sol +++ b/test/libsolidity/smtCheckerTests/types/bytes_2_fail.sol @@ -11,3 +11,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (129-151): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/bytes_length.sol b/test/libsolidity/smtCheckerTests/types/bytes_length.sol index e965e9f31a83..ea69bc3a442f 100644 --- a/test/libsolidity/smtCheckerTests/types/bytes_length.sol +++ b/test/libsolidity/smtCheckerTests/types/bytes_length.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/contract_3.sol b/test/libsolidity/smtCheckerTests/types/contract_3.sol index 8c3f93f510fe..657999c0b7fc 100644 --- a/test/libsolidity/smtCheckerTests/types/contract_3.sol +++ b/test/libsolidity/smtCheckerTests/types/contract_3.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/contract_address_conversion_2.sol b/test/libsolidity/smtCheckerTests/types/contract_address_conversion_2.sol index c9b31c17de89..0b395c1877c5 100644 --- a/test/libsolidity/smtCheckerTests/types/contract_address_conversion_2.sol +++ b/test/libsolidity/smtCheckerTests/types/contract_address_conversion_2.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/enum_explicit_values.sol b/test/libsolidity/smtCheckerTests/types/enum_explicit_values.sol index edc35f80298f..0d297354b14a 100644 --- a/test/libsolidity/smtCheckerTests/types/enum_explicit_values.sol +++ b/test/libsolidity/smtCheckerTests/types/enum_explicit_values.sol @@ -11,4 +11,4 @@ contract C // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n((d = 0) || (d = 1))\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/enum_in_library.sol b/test/libsolidity/smtCheckerTests/types/enum_in_library.sol index 5b927c8f92c9..57e6d7b435e2 100644 --- a/test/libsolidity/smtCheckerTests/types/enum_in_library.sol +++ b/test/libsolidity/smtCheckerTests/types/enum_in_library.sol @@ -14,3 +14,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/enum_in_struct.sol b/test/libsolidity/smtCheckerTests/types/enum_in_struct.sol index e7b2da712496..d46c120df2b5 100644 --- a/test/libsolidity/smtCheckerTests/types/enum_in_struct.sol +++ b/test/libsolidity/smtCheckerTests/types/enum_in_struct.sol @@ -12,3 +12,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/enum_range.sol b/test/libsolidity/smtCheckerTests/types/enum_range.sol index acb93f873c80..403743e08d2e 100644 --- a/test/libsolidity/smtCheckerTests/types/enum_range.sol +++ b/test/libsolidity/smtCheckerTests/types/enum_range.sol @@ -8,3 +8,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/enum_transitivity.sol b/test/libsolidity/smtCheckerTests/types/enum_transitivity.sol index 35b31ff7edca..1f1811ea61b9 100644 --- a/test/libsolidity/smtCheckerTests/types/enum_transitivity.sol +++ b/test/libsolidity/smtCheckerTests/types/enum_transitivity.sol @@ -11,3 +11,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/fixed_bytes_2.sol b/test/libsolidity/smtCheckerTests/types/fixed_bytes_2.sol index 187689b88f39..c9ce9f14ff8e 100644 --- a/test/libsolidity/smtCheckerTests/types/fixed_bytes_2.sol +++ b/test/libsolidity/smtCheckerTests/types/fixed_bytes_2.sol @@ -12,4 +12,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (83-97): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0\ny = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0\nC.f(0x0)\n C.g() -- internal call +// Warning 6328: (83-97): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_1.sol b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_1.sol index 6a24c1e9c9ed..30d61718a521 100644 --- a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_1.sol +++ b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_1.sol @@ -7,4 +7,4 @@ contract c { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :c:\n!(data2.length <= 5)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_2.sol b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_2.sol index 689db06c748d..33ce3ca25864 100644 --- a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_2.sol +++ b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_2.sol @@ -11,3 +11,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 5667: (43-49): Unused function parameter. Remove or comment out the variable name to silence this warning. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_3.sol b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_3.sol index 305c00a62f96..bb4ef03428e7 100644 --- a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_3.sol +++ b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_3.sol @@ -32,5 +32,5 @@ contract C { // SMTEngine: all // SMTIgnoreOS: macos // ---- -// Warning 6368: (374-381): CHC: Out of bounds access might happen here. // Warning 6368: (456-462): CHC: Out of bounds access happens here. +// Info 1391: CHC: 13 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_4.sol b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_4.sol index ae3bbf9cec9f..b67017112d44 100644 --- a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_4.sol +++ b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_4.sol @@ -12,4 +12,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (231-252): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0xff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff\nz = 0x0\no = 0xff\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (231-252): CHC: Assertion violation happens here. +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_5.sol b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_5.sol index cb3cd1e0f6be..122979feda16 100644 --- a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_5.sol +++ b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_5.sol @@ -11,6 +11,7 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (87-104): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0x01020304\nb = 0x02\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (138-155): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0x01020304\nb = 0x02\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (168-185): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0x01020304\nb = 0x02\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (87-104): CHC: Assertion violation happens here. +// Warning 6328: (138-155): CHC: Assertion violation happens here. +// Warning 6328: (168-185): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_6.sol b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_6.sol index ea4618af3580..e506b9450bff 100644 --- a/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_6.sol +++ b/test/libsolidity/smtCheckerTests/types/fixed_bytes_access_6.sol @@ -10,3 +10,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 18 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/fixed_bytes_range.sol b/test/libsolidity/smtCheckerTests/types/fixed_bytes_range.sol index 607d78dffdbd..b4168dc98e24 100644 --- a/test/libsolidity/smtCheckerTests/types/fixed_bytes_range.sol +++ b/test/libsolidity/smtCheckerTests/types/fixed_bytes_range.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/function_type_arrays.sol b/test/libsolidity/smtCheckerTests/types/function_type_arrays.sol index baa8a1de9d86..1cc490d25fd8 100644 --- a/test/libsolidity/smtCheckerTests/types/function_type_arrays.sol +++ b/test/libsolidity/smtCheckerTests/types/function_type_arrays.sol @@ -13,3 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_1.sol b/test/libsolidity/smtCheckerTests/types/mapping_1.sol index ccbb465a3493..c8d6c4ca710e 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_1.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_1.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_2d_1.sol b/test/libsolidity/smtCheckerTests/types/mapping_2d_1.sol index 1ea1168a0870..9bab80f2ce81 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_2d_1.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_2d_1.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_3.sol b/test/libsolidity/smtCheckerTests/types/mapping_3.sol index 4467cf637829..654f0622b2ff 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_3.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_3.sol @@ -11,3 +11,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_3d_1.sol b/test/libsolidity/smtCheckerTests/types/mapping_3d_1.sol index baa4b00fded6..824e47213d2a 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_3d_1.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_3d_1.sol @@ -10,3 +10,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_4.sol b/test/libsolidity/smtCheckerTests/types/mapping_4.sol index ba6688cd5f37..cdaf3fece282 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_4.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_4.sol @@ -10,4 +10,4 @@ contract C // SMTEngine: all // SMTSolvers: z3 // ---- -// Info 1180: Contract invariant(s) for :C:\n!map[true]\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_aliasing_1.sol b/test/libsolidity/smtCheckerTests/types/mapping_aliasing_1.sol index 36c6f843e755..be126d16e025 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_aliasing_1.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_aliasing_1.sol @@ -18,3 +18,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (233-253): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_aliasing_2.sol b/test/libsolidity/smtCheckerTests/types/mapping_aliasing_2.sol index 79c03a7d5525..54b69b38cea1 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_aliasing_2.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_aliasing_2.sol @@ -34,3 +34,4 @@ contract C // ---- // Warning 6328: (364-384): CHC: Assertion violation happens here. // Warning 6328: (430-448): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_1.sol b/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_1.sol index 10d582f6d183..746b67788848 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_1.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_1.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_2.sol b/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_2.sol index 3b8a8846e52f..a246974e5e72 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_2.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_equal_keys_2.sol @@ -11,3 +11,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (86-100): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/mapping_unsupported_key_type_1.sol b/test/libsolidity/smtCheckerTests/types/mapping_unsupported_key_type_1.sol index 3b3a468af047..17f67b8a1eec 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_unsupported_key_type_1.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_unsupported_key_type_1.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/rational_large_1.sol b/test/libsolidity/smtCheckerTests/types/rational_large_1.sol index a7d969185ebd..0a011b44e7f9 100644 --- a/test/libsolidity/smtCheckerTests/types/rational_large_1.sol +++ b/test/libsolidity/smtCheckerTests/types/rational_large_1.sol @@ -9,4 +9,5 @@ contract c { // SMTEngine: all // ---- // Warning 6321: (48-52): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (96-110): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0\nx = 8\n\nTransaction trace:\nc.constructor()\nc.f() +// Warning 6328: (96-110): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/static_array_implicit_push_2.sol b/test/libsolidity/smtCheckerTests/types/static_array_implicit_push_2.sol index d2499a5feb2a..1040f7cae63c 100644 --- a/test/libsolidity/smtCheckerTests/types/static_array_implicit_push_2.sol +++ b/test/libsolidity/smtCheckerTests/types/static_array_implicit_push_2.sol @@ -8,3 +8,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/static_array_length_1.sol b/test/libsolidity/smtCheckerTests/types/static_array_length_1.sol index 61d18c417835..f8f27898fbde 100644 --- a/test/libsolidity/smtCheckerTests/types/static_array_length_1.sol +++ b/test/libsolidity/smtCheckerTests/types/static_array_length_1.sol @@ -11,3 +11,4 @@ contract C { // ---- // Warning 6328: (102-122): CHC: Assertion violation happens here. // Warning 6328: (141-161): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/static_array_length_2.sol b/test/libsolidity/smtCheckerTests/types/static_array_length_2.sol index f1128583b3c0..bf643100d61d 100644 --- a/test/libsolidity/smtCheckerTests/types/static_array_length_2.sol +++ b/test/libsolidity/smtCheckerTests/types/static_array_length_2.sol @@ -8,5 +8,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (113-133): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x0, 0x0]\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (152-172): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x0, 0x0]\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (113-133): CHC: Assertion violation happens here. +// Warning 6328: (152-172): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/static_array_length_3.sol b/test/libsolidity/smtCheckerTests/types/static_array_length_3.sol index 691c25843b0e..c2d26b45f35c 100644 --- a/test/libsolidity/smtCheckerTests/types/static_array_length_3.sol +++ b/test/libsolidity/smtCheckerTests/types/static_array_length_3.sol @@ -9,5 +9,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (106-126): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x0, 0x0]\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (145-165): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x0, 0x0]\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (106-126): CHC: Assertion violation happens here. +// Warning 6328: (145-165): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/static_array_length_4.sol b/test/libsolidity/smtCheckerTests/types/static_array_length_4.sol index 13efd8bb9b1e..287007762ea0 100644 --- a/test/libsolidity/smtCheckerTests/types/static_array_length_4.sol +++ b/test/libsolidity/smtCheckerTests/types/static_array_length_4.sol @@ -17,7 +17,8 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (132-152): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0], x = 2\n\nTransaction trace:\nC.constructor() -// Warning 6328: (171-191): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0], x = 2\n\nTransaction trace:\nC.constructor() -// Warning 6328: (298-318): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0], x = 0\n\nTransaction trace:\nC.constructor() -// Warning 6328: (337-357): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0], x = 0\n\nTransaction trace:\nC.constructor() +// Warning 6328: (132-152): CHC: Assertion violation happens here. +// Warning 6328: (171-191): CHC: Assertion violation happens here. +// Warning 6328: (298-318): CHC: Assertion violation happens here. +// Warning 6328: (337-357): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/static_array_length_5.sol b/test/libsolidity/smtCheckerTests/types/static_array_length_5.sol index e3ab2189c9a4..1319ca10df86 100644 --- a/test/libsolidity/smtCheckerTests/types/static_array_length_5.sol +++ b/test/libsolidity/smtCheckerTests/types/static_array_length_5.sol @@ -9,6 +9,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (95-115): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0]\n\nTransaction trace:\nC.constructor()\nState: a = [0, 0]\nC.f() -// Warning 6328: (134-154): CHC: Assertion violation happens here.\nCounterexample:\na = [0, 0]\n\nTransaction trace:\nC.constructor()\nState: a = [0, 0]\nC.f() -// Info 1180: Contract invariant(s) for :C:\n(!(a.length <= 1) && !(a.length >= 3))\n +// Warning 6328: (95-115): CHC: Assertion violation happens here. +// Warning 6328: (134-154): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/storage_value_vars_3.sol b/test/libsolidity/smtCheckerTests/types/storage_value_vars_3.sol index 6762b7e7b13b..4fa609633b50 100644 --- a/test/libsolidity/smtCheckerTests/types/storage_value_vars_3.sol +++ b/test/libsolidity/smtCheckerTests/types/storage_value_vars_3.sol @@ -25,3 +25,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/string_length.sol b/test/libsolidity/smtCheckerTests/types/string_length.sol index 86390c32bc26..c6a1e8047d60 100644 --- a/test/libsolidity/smtCheckerTests/types/string_length.sol +++ b/test/libsolidity/smtCheckerTests/types/string_length.sol @@ -16,3 +16,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_1.sol b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_1.sol index c568b2267ba8..0289de4bfd5f 100644 --- a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_1.sol +++ b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_1.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (142-157): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x746573747a0000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000) +// Warning 6328: (142-157): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_2.sol b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_2.sol index fc68b79584f6..65dc7cb20bb3 100644 --- a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_2.sol +++ b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_2.sol @@ -9,4 +9,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (143-158): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x746573747a0000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000) +// Warning 6328: (143-158): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_3.sol b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_3.sol index 7219e15bd017..1c25ccb6a450 100644 --- a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_3.sol +++ b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_3.sol @@ -11,4 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (153-168): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x746573747a0000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000) +// Warning 6328: (153-168): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_4.sol b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_4.sol index 954aee7f45eb..647c3ae248d1 100644 --- a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_4.sol +++ b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_4.sol @@ -15,4 +15,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (228-243): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x746573747a0000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000)\n C.g() -- internal call +// Warning 6328: (228-243): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_5.sol b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_5.sol index 71e331122eb4..70ad2f57c524 100644 --- a/test/libsolidity/smtCheckerTests/types/string_literal_assignment_5.sol +++ b/test/libsolidity/smtCheckerTests/types/string_literal_assignment_5.sol @@ -13,4 +13,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (218-233): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x746573747a0000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000)\n C.g() -- internal call +// Warning 6328: (218-233): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/string_literal_comparison_1.sol b/test/libsolidity/smtCheckerTests/types/string_literal_comparison_1.sol index 3c5742e65f5b..daec90a4d806 100644 --- a/test/libsolidity/smtCheckerTests/types/string_literal_comparison_1.sol +++ b/test/libsolidity/smtCheckerTests/types/string_literal_comparison_1.sol @@ -10,4 +10,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (137-157): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x7465737400000000000000000000000000000000000000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000) +// Warning 6328: (137-157): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_safe.sol b/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_safe.sol index c6e77753f3e6..bc5ddf49ed7a 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_safe.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_safe.sol @@ -33,3 +33,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 29 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_unsafe.sol b/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_unsafe.sol index a6ec06ba10fe..504d3ea54f9c 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_unsafe.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_unsafe.sol @@ -35,3 +35,4 @@ contract C { // SMTEngine: all // ---- // Warning 5667: (151-162): Unused function parameter. Remove or comment out the variable name to silence this warning. +// Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_storage_safe.sol b/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_storage_safe.sol index 109fee7dc682..b2f7b9825c7d 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_storage_safe.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_storage_safe.sol @@ -53,3 +53,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 51 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_memory.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_memory.sol index c596fcdf0173..007c451d58b9 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_memory.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_memory.sol @@ -23,3 +23,4 @@ contract C { // Warning 6328: (176-196): CHC: Assertion violation happens here. // Warning 6328: (200-220): CHC: Assertion violation happens here. // Warning 6328: (370-406): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_1.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_1.sol index 3fd0c0d873a5..df99f8a84b6d 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_1.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_1.sol @@ -21,4 +21,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (270-288): CHC: Assertion violation happens here.\nCounterexample:\ns = {innerM, sum: 21239}\n\nTransaction trace:\nC.constructor(0){ msg.sender: 0x6dc4 }\nState: s = {innerM, sum: 21239}\nC.g() +// Warning 6328: (270-288): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_3.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_3.sol index f9ae95e7c968..416bd6109d93 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_3.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_3.sol @@ -28,3 +28,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (307-327): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_4.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_4.sol index 618b1172d953..480753e28ea1 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_4.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_parameter_storage_4.sol @@ -28,3 +28,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (305-325): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_storage.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_storage.sol index e5d9d60abe5c..3a8699bda721 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_storage.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_aliasing_storage.sol @@ -28,3 +28,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (369-405): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_safe.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_safe.sol index 7bb20ace1036..3bcd573e37ed 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_safe.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_safe.sol @@ -31,3 +31,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 14 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_unsafe_1.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_unsafe_1.sol index 6721630a5f8d..d4acec19bb43 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_unsafe_1.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_unsafe_1.sol @@ -31,8 +31,9 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (196-213): CHC: Assertion violation happens here.\nCounterexample:\n\ns1 = {x: 2, t: {y: 0, a: []}, a: [], ts: []}\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (231-250): CHC: Assertion violation happens here.\nCounterexample:\n\ns1 = {x: 2, t: {y: 3, a: []}, a: [], ts: []}\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (293-313): CHC: Assertion violation happens here.\nCounterexample:\n\ns1 = {x: 2, t: {y: 3, a: []}, a: [0, 0, 4], ts: []}\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (357-380): CHC: Assertion violation happens here.\nCounterexample:\n\ns1 = {x: 2, t: {y: 3, a: []}, a: [0, 0, 4], ts: [{y: 0, a: []}, {y: 0, a: []}, {y: 0, a: []}, {y: 5, a: []}, {y: 0, a: []}, {y: 0, a: []}]}\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (435-461): CHC: Assertion violation happens here.\nCounterexample:\n\ns1 = {x: 2, t: {y: 3, a: []}, a: [0, 0, 4], ts: [{y: 0, a: []}, {y: 0, a: []}, {y: 0, a: []}, {y: 5, a: []}, {y: 0, a: [0, 0, 0, 0, 0, 6]}, {y: 0, a: []}]}\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (196-213): CHC: Assertion violation happens here. +// Warning 6328: (231-250): CHC: Assertion violation happens here. +// Warning 6328: (293-313): CHC: Assertion violation happens here. +// Warning 6328: (357-380): CHC: Assertion violation happens here. +// Warning 6328: (435-461): CHC: Assertion violation happens here. +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_unsafe_2.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_unsafe_2.sol index a1a40d64b859..50c3f1d7f8f2 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_unsafe_2.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_memory_unsafe_2.sol @@ -39,3 +39,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (804-842): CHC: Assertion violation happens here. +// Info 1391: CHC: 10 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_storage_safe.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_storage_safe.sol index 309fbe63d221..86db5aee22c7 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_storage_safe.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_storage_safe.sol @@ -40,3 +40,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 19 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_storage_unsafe_1.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_storage_unsafe_1.sol index 662b4f1d2480..cafc62759f3a 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_storage_unsafe_1.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_array_struct_array_storage_unsafe_1.sol @@ -47,3 +47,4 @@ contract C { // Warning 6328: (266-286): CHC: Assertion violation happens here. // Warning 6328: (404-427): CHC: Assertion violation happens here. // Warning 6328: (578-604): CHC: Assertion violation happens here. +// Info 1391: CHC: 14 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_fixed_bytes_from_string_1.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_fixed_bytes_from_string_1.sol index ec895cdd961b..30d6da4a468e 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_fixed_bytes_from_string_1.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_fixed_bytes_from_string_1.sol @@ -11,4 +11,5 @@ contract C { } // ---- // Warning 5523: (0-31): The SMTChecker pragma has been deprecated and will be removed in the future. Please use the "model checker engine" compiler setting to activate the SMTChecker instead. If the pragma is enabled, all engines will be used. -// Warning 6328: (178-207): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (178-207): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args.sol index 91bd56fc954e..b12882ef7c26 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args.sol @@ -20,4 +20,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (232-255): CHC: Assertion violation happens here.\nCounterexample:\n\ninner = {x: 43}\nouter = {s: {x: 43}, y: 512}\n\nTransaction trace:\nC.constructor()\nC.test() +// Warning 6328: (232-255): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args_2.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args_2.sol index 6a1dd2995d39..8383ef6d69ea 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args_2.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args_2.sol @@ -17,4 +17,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (191-231): CHC: Assertion violation happens here.\nCounterexample:\n\ns = {x: 3, y: 2, z: 1}\n\nTransaction trace:\nC.constructor()\nC.test() +// Warning 6328: (191-231): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_delete_memory.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_delete_memory.sol index b19721725871..3653fa850a65 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_delete_memory.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_delete_memory.sol @@ -18,3 +18,4 @@ contract C { // ---- // Warning 6328: (152-172): CHC: Assertion violation happens here. // Warning 6328: (176-210): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_delete_storage.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_delete_storage.sol index 5c00b306c0a7..12e38a41010b 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_delete_storage.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_delete_storage.sol @@ -23,3 +23,4 @@ contract C { // ---- // Warning 6328: (208-228): CHC: Assertion violation happens here. // Warning 6328: (232-266): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor.sol index c3bb774000b6..0b04379fe522 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor.sol @@ -20,4 +20,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (219-242): CHC: Assertion violation happens here.\nCounterexample:\n\ninner = {x: 43}\nouter = {s: {x: 43}, y: 512}\n\nTransaction trace:\nC.constructor()\nC.test() +// Warning 6328: (219-242): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor_named_args.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor_named_args.sol index b2c876e759db..03bc66617b0f 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor_named_args.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor_named_args.sol @@ -9,3 +9,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_temporary.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_temporary.sol index 5d5b6b0a0471..848b99045760 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_temporary.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_temporary.sol @@ -16,3 +16,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_recursive_5.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_recursive_5.sol index 2d438e6d096c..ca7aee8f21fb 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_recursive_5.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_recursive_5.sol @@ -26,4 +26,5 @@ contract C { // Warning 8364: (166-175): Assertion checker does not yet implement type struct C.S storage ref // Warning 7650: (188-195): Assertion checker does not yet support this expression. // Warning 8364: (188-193): Assertion checker does not yet implement type struct C.S storage ref -// Warning 6328: (159-203): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (159-203): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_return.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_return.sol index a96f0323f4e6..200289f2d5dd 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_return.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_return.sol @@ -18,4 +18,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (256-277): CHC: Assertion violation happens here.\nCounterexample:\n\ns2 = {x: 42, a: [0, 0, 43, 0, 0]}\n\nTransaction trace:\nC.constructor()\nC.f()\n C.s() -- internal call +// Warning 6328: (256-277): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_state_constructor.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_state_constructor.sol index 986781b771eb..7569a41165b3 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_state_constructor.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_state_constructor.sol @@ -13,4 +13,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Contract invariant(s) for :C:\n(!(s.x <= 41) && !(s.x >= 43))\n +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_state_var.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_state_var.sol index ed3aa001dafa..a0dcde7c7218 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_state_var.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_state_var.sol @@ -17,3 +17,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (180-204): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_state_var_array_pop_1.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_state_var_array_pop_1.sol index e3dcb0184723..73e8e4e54b40 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_state_var_array_pop_1.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_state_var_array_pop_1.sol @@ -24,3 +24,4 @@ contract C { // ---- // Warning 2529: (88-97): CHC: Empty array "pop" happens here. // Warning 6328: (197-221): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_state_var_array_pop_2.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_state_var_array_pop_2.sol index 748159516c08..1478e4524197 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_state_var_array_pop_2.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_state_var_array_pop_2.sol @@ -21,3 +21,4 @@ contract C { // ---- // Warning 2529: (100-109): CHC: Empty array "pop" happens here. // Warning 6328: (156-180): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_temporary.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_temporary.sol index a4f3a4d42d1f..342efc4b1030 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_temporary.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_temporary.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_unary_add.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_unary_add.sol index 8bd6de794a50..99314c39ac7b 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_unary_add.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_unary_add.sol @@ -18,3 +18,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (193-213): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_unary_sub.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_unary_sub.sol index 7ce618a0e3f3..f58925201988 100644 --- a/test/libsolidity/smtCheckerTests/types/struct/struct_unary_sub.sol +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_unary_sub.sol @@ -19,3 +19,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (208-228): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct_1.sol b/test/libsolidity/smtCheckerTests/types/struct_1.sol index 1a24decc3dd0..84ad5004d3ea 100644 --- a/test/libsolidity/smtCheckerTests/types/struct_1.sol +++ b/test/libsolidity/smtCheckerTests/types/struct_1.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct_array_branches_1d.sol b/test/libsolidity/smtCheckerTests/types/struct_array_branches_1d.sol index 39cae7f23087..979a72db2544 100644 --- a/test/libsolidity/smtCheckerTests/types/struct_array_branches_1d.sol +++ b/test/libsolidity/smtCheckerTests/types/struct_array_branches_1d.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct_array_branches_2d.sol b/test/libsolidity/smtCheckerTests/types/struct_array_branches_2d.sol index 2d2492a2e8bc..0d45aee14216 100644 --- a/test/libsolidity/smtCheckerTests/types/struct_array_branches_2d.sol +++ b/test/libsolidity/smtCheckerTests/types/struct_array_branches_2d.sol @@ -18,3 +18,4 @@ contract C // SMTIgnoreOS: macos // ---- // Warning 6368: (216-225): CHC: Out of bounds access might happen here. +// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/struct_array_branches_3d.sol b/test/libsolidity/smtCheckerTests/types/struct_array_branches_3d.sol index dbd498327daf..2d46a846d3fd 100644 --- a/test/libsolidity/smtCheckerTests/types/struct_array_branches_3d.sol +++ b/test/libsolidity/smtCheckerTests/types/struct_array_branches_3d.sol @@ -24,3 +24,4 @@ contract C // SMTEngine: all // ---- // Warning 5667: (53-59): Unused function parameter. Remove or comment out the variable name to silence this warning. +// Info 1391: CHC: 11 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_1_chain_1.sol b/test/libsolidity/smtCheckerTests/types/tuple_1_chain_1.sol index 72fd765f4167..bc1b0141019b 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_1_chain_1.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_1_chain_1.sol @@ -8,4 +8,5 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (64-68): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_1_chain_2.sol b/test/libsolidity/smtCheckerTests/types/tuple_1_chain_2.sol index 084c637b9397..0f3c4534597d 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_1_chain_2.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_1_chain_2.sol @@ -8,4 +8,5 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (64-68): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_1_chain_n.sol b/test/libsolidity/smtCheckerTests/types/tuple_1_chain_n.sol index 1f8151920c20..103eccc9738f 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_1_chain_n.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_1_chain_n.sol @@ -8,4 +8,5 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 6838: (64-68): BMC: Condition is always true. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_assignment.sol b/test/libsolidity/smtCheckerTests/types/tuple_assignment.sol index cd1949d2e1cf..9c8f8a4ee26b 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_assignment.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_assignment.sol @@ -11,3 +11,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_assignment_array.sol b/test/libsolidity/smtCheckerTests/types/tuple_assignment_array.sol index 1ae6051c72ad..69ef8ee7c866 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_assignment_array.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_assignment_array.sol @@ -14,3 +14,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_assignment_array_empty.sol b/test/libsolidity/smtCheckerTests/types/tuple_assignment_array_empty.sol index e5f062b572bd..79be48b3ae81 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_assignment_array_empty.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_assignment_array_empty.sol @@ -18,3 +18,4 @@ contract C // SMTIgnoreCex: yes // ---- // Warning 6328: (198-215): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_assignment_compound.sol b/test/libsolidity/smtCheckerTests/types/tuple_assignment_compound.sol index 03a5a22db261..214c20d24db5 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_assignment_compound.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_assignment_compound.sol @@ -10,4 +10,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (89-103): CHC: Assertion violation happens here.\nCounterexample:\n\na = 4\nb = 3\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (89-103): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_assignment_empty.sol b/test/libsolidity/smtCheckerTests/types/tuple_assignment_empty.sol index 7e7795ea19e1..e9dd360c4992 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_assignment_empty.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_assignment_empty.sol @@ -11,4 +11,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (99-113): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\ny = 0\n\nTransaction trace:\nC.constructor()\nC.g() +// Warning 6328: (99-113): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_assignment_multiple_calls.sol b/test/libsolidity/smtCheckerTests/types/tuple_assignment_multiple_calls.sol index c544072214a4..574eb9e8780d 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_assignment_multiple_calls.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_assignment_multiple_calls.sol @@ -13,3 +13,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_declarations.sol b/test/libsolidity/smtCheckerTests/types/tuple_declarations.sol index f0956bfd41ad..e3bb85849f86 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_declarations.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_declarations.sol @@ -9,3 +9,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_declarations_empty.sol b/test/libsolidity/smtCheckerTests/types/tuple_declarations_empty.sol index 10960c983ace..206b201d3ff6 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_declarations_empty.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_declarations_empty.sol @@ -8,3 +8,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_declarations_function.sol b/test/libsolidity/smtCheckerTests/types/tuple_declarations_function.sol index bb71bfdcdcfa..a28269eb29e0 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_declarations_function.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_declarations_function.sol @@ -16,3 +16,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_declarations_function_2.sol b/test/libsolidity/smtCheckerTests/types/tuple_declarations_function_2.sol index 15ca65c864c9..459fd6e21914 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_declarations_function_2.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_declarations_function_2.sol @@ -15,3 +15,4 @@ contract C // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_different_count_assignment_1.sol b/test/libsolidity/smtCheckerTests/types/tuple_different_count_assignment_1.sol index f3f5121a2921..f6541bc750d5 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_different_count_assignment_1.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_different_count_assignment_1.sol @@ -10,4 +10,5 @@ contract C { // SMTEngine: all // ---- // Warning 6321: (47-50): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (125-139): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0\na = 2\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (125-139): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_different_count_assignment_2.sol b/test/libsolidity/smtCheckerTests/types/tuple_different_count_assignment_2.sol index 51b40dda10ad..7806cb60b250 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_different_count_assignment_2.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_different_count_assignment_2.sol @@ -10,4 +10,5 @@ contract C { // SMTEngine: all // ---- // Warning 6321: (47-50): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 6328: (127-141): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0\na = 2\n\nTransaction trace:\nC.constructor()\nC.f() +// Warning 6328: (127-141): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_extra_parens_7.sol b/test/libsolidity/smtCheckerTests/types/tuple_extra_parens_7.sol index 60b305402274..7defe2cdf23a 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_extra_parens_7.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_extra_parens_7.sol @@ -12,4 +12,4 @@ contract C { // ==== // SMTEngine: all // ---- -// Info 1180: Reentrancy property(ies) for :C:\n!( >= 2)\n( <= 0)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(x == 2)\n = 2 -> Assertion failed at assert(y == 3)\n +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_function_2.sol b/test/libsolidity/smtCheckerTests/types/tuple_function_2.sol index bbd92a90a3a7..362755ac96fd 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_function_2.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_function_2.sol @@ -14,4 +14,5 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (166-180): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\ny = 0\n\nTransaction trace:\nC.constructor()\nC.g()\n C.f() -- internal call +// Warning 6328: (166-180): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_function_3.sol b/test/libsolidity/smtCheckerTests/types/tuple_function_3.sol index 92181fe360af..f33f9bfc8489 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_function_3.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_function_3.sol @@ -16,5 +16,6 @@ contract C // ==== // SMTEngine: all // ---- -// Warning 6328: (172-186): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 0\nb = false\n\nTransaction trace:\nC.constructor()\nC.g()\n C.f() -- internal call -// Warning 6328: (190-204): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 0\nb = false\n\nTransaction trace:\nC.constructor()\nC.g()\n C.f() -- internal call +// Warning 6328: (172-186): CHC: Assertion violation happens here. +// Warning 6328: (190-204): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol b/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol index aea54fb1ec34..3336975637d5 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol @@ -16,3 +16,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/type_interfaceid.sol b/test/libsolidity/smtCheckerTests/types/type_interfaceid.sol index 7b5bae6bc90a..cd0d56506e7c 100644 --- a/test/libsolidity/smtCheckerTests/types/type_interfaceid.sol +++ b/test/libsolidity/smtCheckerTests/types/type_interfaceid.sol @@ -28,5 +28,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (416-468): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.g() -// Warning 6328: (503-555): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.h() +// Warning 6328: (416-468): CHC: Assertion violation happens here. +// Warning 6328: (503-555): CHC: Assertion violation happens here. +// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/type_minmax.sol b/test/libsolidity/smtCheckerTests/types/type_minmax.sol index cc9e3c31908b..da9bb1b6d15f 100644 --- a/test/libsolidity/smtCheckerTests/types/type_minmax.sol +++ b/test/libsolidity/smtCheckerTests/types/type_minmax.sol @@ -81,4 +81,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (178-207): CHC: Assertion violation happens here.\nCounterexample:\n\na = 4294967296\n\nTransaction trace:\nC.constructor()\nC.f(4294967296) +// Warning 6328: (178-207): CHC: Assertion violation happens here. +// Info 1391: CHC: 24 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/types/unused_mapping.sol b/test/libsolidity/smtCheckerTests/types/unused_mapping.sol index d8308dada9ac..889cf78a5623 100644 --- a/test/libsolidity/smtCheckerTests/types/unused_mapping.sol +++ b/test/libsolidity/smtCheckerTests/types/unused_mapping.sol @@ -17,3 +17,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/unchecked/block_inside_unchecked.sol b/test/libsolidity/smtCheckerTests/unchecked/block_inside_unchecked.sol index 1d41493fb887..e9321b4607b0 100644 --- a/test/libsolidity/smtCheckerTests/unchecked/block_inside_unchecked.sol +++ b/test/libsolidity/smtCheckerTests/unchecked/block_inside_unchecked.sol @@ -11,3 +11,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/unchecked/flipping_sign_tests.sol b/test/libsolidity/smtCheckerTests/unchecked/flipping_sign_tests.sol index 8a7405c5458e..96b415010596 100644 --- a/test/libsolidity/smtCheckerTests/unchecked/flipping_sign_tests.sol +++ b/test/libsolidity/smtCheckerTests/unchecked/flipping_sign_tests.sol @@ -9,4 +9,5 @@ contract test { // ==== // SMTEngine: all // ---- -// Warning 6328: (110-125): CHC: Assertion violation happens here.\nCounterexample:\n\n = false\nx = (- 57896044618658097711785492504343953926634992332820282019728792003956564819968)\n\nTransaction trace:\ntest.constructor()\ntest.f() +// Warning 6328: (110-125): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/unchecked/inc_dec.sol b/test/libsolidity/smtCheckerTests/unchecked/inc_dec.sol index 47a3a9959173..5af2a6d7adb0 100644 --- a/test/libsolidity/smtCheckerTests/unchecked/inc_dec.sol +++ b/test/libsolidity/smtCheckerTests/unchecked/inc_dec.sol @@ -26,3 +26,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/unchecked/signed_mod.sol b/test/libsolidity/smtCheckerTests/unchecked/signed_mod.sol index 4cc7a57f6671..9d04f9ed6a37 100644 --- a/test/libsolidity/smtCheckerTests/unchecked/signed_mod.sol +++ b/test/libsolidity/smtCheckerTests/unchecked/signed_mod.sol @@ -14,5 +14,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 4281: (85-90): CHC: Division by zero happens here.\nCounterexample:\n\na = 0\nb = 0\n = 0\n\nTransaction trace:\nC.constructor()\nC.f(0, 0) -// Warning 4984: (242-248): CHC: Overflow (resulting value larger than 2**255 - 1) happens here.\nCounterexample:\n\n_check = true\n = 0\nx = (- 57896044618658097711785492504343953926634992332820282019728792003956564819968)\n\nTransaction trace:\nC.constructor()\nC.g(true) +// Warning 4281: (85-90): CHC: Division by zero happens here. +// Warning 4984: (242-248): CHC: Overflow (resulting value larger than 2**255 - 1) happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/unsupported/assembly_1.sol b/test/libsolidity/smtCheckerTests/unsupported/assembly_1.sol new file mode 100644 index 000000000000..4c7ded319892 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/unsupported/assembly_1.sol @@ -0,0 +1,18 @@ +contract C { + function f(uint x, uint y) public pure { + assembly {} + assert(x < y); + } + + function g(uint x, uint y) public pure { + assembly {} + assert(x < y); + } +} +// ==== +// SMTEngine: all +// SMTShowUnsupported: no +// ---- +// Warning 5724: SMTChecker: 2 unsupported language feature(s). Enable the model checker option "show unsupported" to see all of them. +// Warning 6328: (86-99): CHC: Assertion violation happens here. +// Warning 6328: (181-194): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/userTypes/constant.sol b/test/libsolidity/smtCheckerTests/userTypes/constant.sol index 9730d4b1c136..0d49dec4bc20 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/constant.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/constant.sol @@ -15,4 +15,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (531-555): CHC: Assertion violation happens here.\nCounterexample:\nu = 165521356710917456517261742455526507355687727119203895813322792776\n\nTransaction trace:\nC.constructor()\nState: u = 165521356710917456517261742455526507355687727119203895813322792776\nC.f() +// Warning 6328: (531-555): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/conversion_1.sol b/test/libsolidity/smtCheckerTests/userTypes/conversion_1.sol index fa56e11aba9b..8aa3d9aed3d8 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/conversion_1.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/conversion_1.sol @@ -32,4 +32,4 @@ contract C { // ---- // Warning 6328: (428-465): CHC: Assertion violation happens here. // Warning 6328: (665-700): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n(true || true || true || true || true)\nReentrancy property(ies) for :C:\n(true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true || true || true || true || true)\n(true || true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true || true || true || true)\n(true || true || true || true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true || true)\n(true || true || true || true || true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true)\n(true || true || true || true || true || true || true || (( = 0) && ((:var 0) = (:var 1))) || true)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(MyUInt8.unwrap(f(1)) == 1)\n = 2 -> Assertion failed at assert(MyUInt8.unwrap(f(2)) == 2)\n = 3 -> Assertion failed at assert(MyUInt8.unwrap(f(257)) == 1)\n = 4 -> Assertion failed at assert(MyUInt8.unwrap(f(257)) == 257)\n = 6 -> Assertion failed at assert(MyInt8.unwrap(g(1)) == 1)\n = 7 -> Assertion failed at assert(MyInt8.unwrap(g(2)) == 2)\n = 8 -> Assertion failed at assert(MyInt8.unwrap(g(255)) == -1)\n = 9 -> Assertion failed at assert(MyInt8.unwrap(g(257)) == 1)\n = 10 -> Assertion failed at assert(MyInt8.unwrap(g(257)) == -1)\n +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/conversion_2.sol b/test/libsolidity/smtCheckerTests/userTypes/conversion_2.sol index 9b4f72d336d4..cfc68b599316 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/conversion_2.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/conversion_2.sol @@ -27,6 +27,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (497-545): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.r()\n C.h(1) -- internal call\n C.h(2) -- internal call\n C.h(255) -- internal call\n C.h(255) -- internal call -// Warning 6328: (652-702): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.s()\n C.i(250) -- internal call\n C.i(250) -- internal call -// Info 1180: Contract invariant(s) for :C:\n(true || true || true || true || true)\nReentrancy property(ies) for :C:\n((( = 0) && ((:var 0) = (:var 1))) || true || true || true || true || true || true || true || true)\n(true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true || true || true || true || true)\n(true || true || true || true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true || true)\n(true || true || true || true || true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(MyInt8.unwrap(h(MyUInt8.wrap(1))) == 1)\n = 2 -> Assertion failed at assert(MyInt8.unwrap(h(MyUInt8.wrap(2))) == 2)\n = 3 -> Assertion failed at assert(MyInt8.unwrap(h(MyUInt8.wrap(255))) == -1)\n = 4 -> Assertion failed at assert(MyInt8.unwrap(h(MyUInt8.wrap(255))) == 1)\n = 6 -> Assertion failed at assert(MyUInt16.unwrap(i(MyUInt8.wrap(250))) == 250)\n = 7 -> Assertion failed at assert(MyUInt16.unwrap(i(MyUInt8.wrap(250))) == 0)\n +// Warning 6328: (497-545): CHC: Assertion violation happens here. +// Warning 6328: (652-702): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/conversion_3.sol b/test/libsolidity/smtCheckerTests/userTypes/conversion_3.sol index ea8e9804bc2a..ac70c80669a2 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/conversion_3.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/conversion_3.sol @@ -29,6 +29,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (434-467): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.t()\n C.j(1) -- internal call\n C.j(2) -- internal call\n C.j(255) -- internal call\n C.j(255) -- internal call -// Warning 6328: (679-729): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.v()\n C.k(1) -- internal call\n C.k(2) -- internal call\n C.k(255) -- internal call\n C.k(255) -- internal call -// Info 1180: Contract invariant(s) for :C:\n(true || true || true || true || true)\nReentrancy property(ies) for :C:\n((( = 0) && ((:var 0) = (:var 1))) || true || true || true || true || true || true || true || true)\n(true || true || true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true || true || true)\n(true || true || true || true || (( = 0) && ((:var 0) = (:var 1))) || true || true || true || true)\n(true || true || true || true || true || true || true || (( = 0) && ((:var 0) = (:var 1))) || true)\n(true || true || true || true || true || true || true || true || (( = 0) && ((:var 0) = (:var 1))))\n = 0 -> no errors\n = 1 -> Assertion failed at assert(j(MyUInt8.wrap(1)) == 1)\n = 2 -> Assertion failed at assert(j(MyUInt8.wrap(2)) == 2)\n = 3 -> Assertion failed at assert(j(MyUInt8.wrap(255)) == 0xff)\n = 4 -> Assertion failed at assert(j(MyUInt8.wrap(255)) == 1)\n = 6 -> Assertion failed at assert(MyUInt16.unwrap(k(MyUInt8.wrap(1))) == 1)\n = 7 -> Assertion failed at assert(MyUInt16.unwrap(k(MyUInt8.wrap(2))) == 2)\n = 8 -> Assertion failed at assert(MyUInt16.unwrap(k(MyUInt8.wrap(255))) == 0xff)\n = 9 -> Assertion failed at assert(MyUInt16.unwrap(k(MyUInt8.wrap(255))) == 1)\n +// Warning 6328: (434-467): CHC: Assertion violation happens here. +// Warning 6328: (679-729): CHC: Assertion violation happens here. +// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/conversion_4.sol b/test/libsolidity/smtCheckerTests/userTypes/conversion_4.sol index 699d220973fa..891148c681d0 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/conversion_4.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/conversion_4.sol @@ -21,4 +21,4 @@ contract C { // SMTIgnoreCex: yes // ---- // Warning 6328: (407-457): CHC: Assertion violation happens here. -// Info 1180: Contract invariant(s) for :C:\n(true || true || true)\nReentrancy property(ies) for :C:\n((( = 0) && ((:var 0) = (:var 1))) || true || true || true || true)\n(true || true || (( = 0) && ((:var 0) = (:var 1))) || true || true)\n = 0 -> no errors\n = 1 -> Assertion failed at assert(MyUInt8.unwrap(m(MyUInt16.wrap(1))) == 1)\n = 2 -> Assertion failed at assert(MyUInt8.unwrap(m(MyUInt16.wrap(2))) == 2)\n = 3 -> Assertion failed at assert(MyUInt8.unwrap(m(MyUInt16.wrap(255))) == 0xff)\n = 4 -> Assertion failed at assert(MyUInt8.unwrap(m(MyUInt16.wrap(255))) == 1)\n +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/fixedpoint.sol b/test/libsolidity/smtCheckerTests/userTypes/fixedpoint.sol index 4bff3a498453..763a1196287c 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/fixedpoint.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/fixedpoint.sol @@ -73,3 +73,4 @@ contract TestFixedMath { // Warning 6328: (2165-2266): CHC: Assertion violation happens here. // Warning 6328: (2675-2791): CHC: Assertion violation happens here. // Warning 6328: (3161-3212): CHC: Assertion violation happens here. +// Info 1391: CHC: 12 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/in_parenthesis.sol b/test/libsolidity/smtCheckerTests/userTypes/in_parenthesis.sol index 478b87dfe816..ad4063182ade 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/in_parenthesis.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/in_parenthesis.sol @@ -15,5 +15,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (133-161): CHC: Assertion violation happens here.\nCounterexample:\n\na = 5\n\nTransaction trace:\nC.constructor()\nC.f() -// Warning 6328: (261-289): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.g()\n C.f() -- internal call +// Warning 6328: (133-161): CHC: Assertion violation happens here. +// Warning 6328: (261-289): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/in_parenthesis_2.sol b/test/libsolidity/smtCheckerTests/userTypes/in_parenthesis_2.sol index e8da1dd564f4..713eb8ddbcec 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/in_parenthesis_2.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/in_parenthesis_2.sol @@ -24,3 +24,4 @@ contract C { // Warning 6133: (126-140): Statement has no effect. // Warning 6328: (274-302): CHC: Assertion violation happens here. // Warning 6328: (340-355): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/mapping_1.sol b/test/libsolidity/smtCheckerTests/userTypes/mapping_1.sol index 120348a046d5..100448cb06ed 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/mapping_1.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/mapping_1.sol @@ -10,4 +10,5 @@ contract C { // SMTEngine: all // SMTIgnoreInv: yes // ---- -// Warning 6328: (134-151): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\n\nTransaction trace:\nC.constructor()\nC.f(0) +// Warning 6328: (134-151): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/modifier_1.sol b/test/libsolidity/smtCheckerTests/userTypes/modifier_1.sol index 3dbcc3126eea..8ff82e5149e1 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/modifier_1.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/modifier_1.sol @@ -15,4 +15,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (212-226): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nC.f(0, 0) +// Warning 6328: (212-226): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/multisource.sol b/test/libsolidity/smtCheckerTests/userTypes/multisource.sol index 23fbef98ae6e..3e7ff133d167 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/multisource.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/multisource.sol @@ -17,5 +17,6 @@ contract A { // ==== // SMTEngine: all // ---- -// Warning 6328: (B:296-332): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nA.constructor()\nA.g()\n A.f(5) -- internal call\n A.f(5) -- internal call -// Warning 6328: (B:409-463): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nA.constructor()\nA.g()\n A.f(5) -- internal call\n A.f(5) -- internal call\n A.f(0x05) -- internal call\n A.f(0x05) -- internal call +// Warning 6328: (B:296-332): CHC: Assertion violation happens here. +// Warning 6328: (B:409-463): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/multisource_module.sol b/test/libsolidity/smtCheckerTests/userTypes/multisource_module.sol index 846f3ab755ea..f4300d252a07 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/multisource_module.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/multisource_module.sol @@ -15,8 +15,9 @@ contract C { } // ==== // SMTEngine: all -// SMTIgnoreOS: macos // SMTIgnoreCex: yes +// SMTIgnoreOS: macos // ---- // Warning 6328: (s2.sol:259-292): CHC: Assertion violation happens here. // Warning 6328: (s2.sol:346-377): CHC: Assertion violation happens here. +// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/simple.sol b/test/libsolidity/smtCheckerTests/userTypes/simple.sol index edfde6594b65..1b0f6e1fe459 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/simple.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/simple.sol @@ -19,5 +19,6 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (255-285): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.h()\n C.f() -- internal call\n C.f() -- internal call -// Warning 6328: (364-392): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.h()\n C.f() -- internal call\n C.f() -- internal call\n C.g() -- internal call +// Warning 6328: (255-285): CHC: Assertion violation happens here. +// Warning 6328: (364-392): CHC: Assertion violation happens here. +// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/user_abi_1.sol b/test/libsolidity/smtCheckerTests/userTypes/user_abi_1.sol index 1d31cbe3d202..3958436041c0 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/user_abi_1.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/user_abi_1.sol @@ -11,4 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (188-212): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 2437\n\nTransaction trace:\nC.constructor()\nC.f(data) +// Warning 6328: (188-212): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/user_abi_2.sol b/test/libsolidity/smtCheckerTests/userTypes/user_abi_2.sol index a4c4a3a29e75..e41c76539aeb 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/user_abi_2.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/user_abi_2.sol @@ -11,4 +11,5 @@ contract C { // ==== // SMTEngine: all // ---- -// Warning 6328: (192-226): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(data) +// Warning 6328: (192-226): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_array_elem_1.sol b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_array_elem_1.sol index 8856ebd43a28..5336f752ef19 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_array_elem_1.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_array_elem_1.sol @@ -15,4 +15,5 @@ contract C { // SMTIgnoreOS: macos // ---- // Warning 6328: (204-243): CHC: Assertion violation might happen here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. // Warning 4661: (204-243): BMC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_array_elem_2.sol b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_array_elem_2.sol index 8ac6493661c2..84202b69c561 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_array_elem_2.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_array_elem_2.sol @@ -13,4 +13,5 @@ contract C { } } // ---- -// Warning 6328: (200-238): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.p()\nC.inv2() +// Warning 6328: (200-238): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_library_constant_1.sol b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_library_constant_1.sol index 3088a894b691..64a89d1f01ff 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_library_constant_1.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_library_constant_1.sol @@ -23,3 +23,5 @@ contract C { assert(T.unwrap(C.b)); // should hold } } +// ---- +// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_mapping_index_1.sol b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_mapping_index_1.sol index f1b6a798610d..6761ca6f3ed9 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_mapping_index_1.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_mapping_index_1.sol @@ -17,4 +17,5 @@ contract C { } } // ---- -// Warning 6328: (325-342): CHC: Assertion violation happens here.\nCounterexample:\n\nb = true\n\nTransaction trace:\nC.constructor()\nC.g(true) +// Warning 6328: (325-342): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_mapping_index_2.sol b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_mapping_index_2.sol index 1e53a3547313..11e0212ce51b 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_mapping_index_2.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_mapping_index_2.sol @@ -17,4 +17,5 @@ contract C { } } // ---- -// Warning 6328: (352-370): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0x0\n\nTransaction trace:\nC.constructor()\nC.g(0x0) +// Warning 6328: (352-370): CHC: Assertion violation happens here. +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_struct_member_1.sol b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_struct_member_1.sol index 5cb307385b62..8d2b990dff44 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/user_type_as_struct_member_1.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/user_type_as_struct_member_1.sol @@ -24,3 +24,4 @@ contract C { } } // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/userTypes/wrap_unwrap_via_contract_name.sol b/test/libsolidity/smtCheckerTests/userTypes/wrap_unwrap_via_contract_name.sol index 065dae17abd7..1747c3529c01 100644 --- a/test/libsolidity/smtCheckerTests/userTypes/wrap_unwrap_via_contract_name.sol +++ b/test/libsolidity/smtCheckerTests/userTypes/wrap_unwrap_via_contract_name.sol @@ -34,3 +34,4 @@ contract D { // Warning 6328: (494-529): CHC: Assertion violation happens here. // Warning 6328: (575-598): CHC: Assertion violation happens here. // Warning 6328: (666-711): CHC: Assertion violation happens here. +// Info 1391: CHC: 4 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require.sol b/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require.sol index 2bc0143470ec..980cab8eb4e5 100644 --- a/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require.sol +++ b/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require.sol @@ -4,3 +4,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require_message.sol b/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require_message.sol index 2c0d0c6a78dc..b63801cfa8e7 100644 --- a/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require_message.sol +++ b/test/libsolidity/smtCheckerTests/verification_target/simple_assert_with_require_message.sol @@ -7,3 +7,4 @@ contract C { // ==== // SMTEngine: all // ---- +// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. diff --git a/test/libsolidity/syntaxTests/constants/constant_cyclic_via_user_operators.sol b/test/libsolidity/syntaxTests/constants/constant_cyclic_via_user_operators.sol new file mode 100644 index 000000000000..e0af337c735a --- /dev/null +++ b/test/libsolidity/syntaxTests/constants/constant_cyclic_via_user_operators.sol @@ -0,0 +1,10 @@ +type Type is uint; +using {f as +} for Type global; +function f(Type, Type) pure returns (Type) {} + +Type constant t = Type.wrap(1); +Type constant u = v + t; +Type constant v = u + t; +// ---- +// TypeError 8349: (148-153): Initial value for constant variable has to be compile-time constant. +// TypeError 8349: (173-178): Initial value for constant variable has to be compile-time constant. diff --git a/test/libsolidity/syntaxTests/constructor/abstract_creation_forward_reference.sol b/test/libsolidity/syntaxTests/constructor/abstract_creation_forward_reference.sol index 491c688cc855..144b3141a190 100644 --- a/test/libsolidity/syntaxTests/constructor/abstract_creation_forward_reference.sol +++ b/test/libsolidity/syntaxTests/constructor/abstract_creation_forward_reference.sol @@ -12,4 +12,4 @@ contract Parent { contract Child is Parent { } // ---- -// TypeError 3656: (226-254): Contract "Child" should be marked as abstract. +// TypeError 3415: (226-254): No arguments passed to the base constructor. Specify the arguments or mark "Child" as abstract. diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments.sol new file mode 100644 index 000000000000..5a005c160175 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments.sol @@ -0,0 +1,30 @@ +contract C { + constructor(uint, bool) {} +} + +contract D is C() {} +contract E is C() { constructor() {} } +contract F is C() { constructor() C {} } +contract G is C() { constructor() C() {} } + +contract H is C {} +contract I is C { constructor() {} } +contract J is C { constructor() C {} } +contract K is C { constructor() C() {} } +// ---- +// TypeError 3415: (47-67): No arguments passed to the base constructor. Specify the arguments or mark "D" as abstract. +// TypeError 3415: (68-106): No arguments passed to the base constructor. Specify the arguments or mark "E" as abstract. +// DeclarationError 1563: (141-142): Modifier-style base constructor call without arguments. +// TypeError 3415: (107-147): No arguments passed to the base constructor. Specify the arguments or mark "F" as abstract. +// TypeError 3415: (192-210): No arguments passed to the base constructor. Specify the arguments or mark "H" as abstract. +// TypeError 3415: (211-247): No arguments passed to the base constructor. Specify the arguments or mark "I" as abstract. +// DeclarationError 1563: (280-281): Modifier-style base constructor call without arguments. +// TypeError 3415: (248-286): No arguments passed to the base constructor. Specify the arguments or mark "J" as abstract. +// TypeError 7927: (61-64): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (82-85): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (121-124): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 2973: (141-142): Wrong argument count for modifier invocation: 0 arguments given but expected 2. +// TypeError 7927: (162-165): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 2973: (182-185): Wrong argument count for modifier invocation: 0 arguments given but expected 2. +// TypeError 2973: (280-281): Wrong argument count for modifier invocation: 0 arguments given but expected 2. +// TypeError 2973: (319-322): Wrong argument count for modifier invocation: 0 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_inheritance_list_empty_parens.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_inheritance_list_empty_parens.sol new file mode 100644 index 000000000000..42ba9886f318 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_inheritance_list_empty_parens.sol @@ -0,0 +1,16 @@ +abstract contract C { + constructor(uint, bool) {} +} + +abstract contract D is C() {} +abstract contract E is C() { constructor() {} } +abstract contract F is C() { constructor() C {} } +abstract contract G is C() { constructor() C() {} } +// ---- +// DeclarationError 1563: (177-178): Modifier-style base constructor call without arguments. +// TypeError 7927: (79-82): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (109-112): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (157-160): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 2973: (177-178): Wrong argument count for modifier invocation: 0 arguments given but expected 2. +// TypeError 7927: (207-210): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 2973: (227-230): Wrong argument count for modifier invocation: 0 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_lists_omitted.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_lists_omitted.sol new file mode 100644 index 000000000000..ad934d7e7bf9 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_lists_omitted.sol @@ -0,0 +1,6 @@ +abstract contract C { + constructor(uint, bool) {} +} + +abstract contract D is C {} +abstract contract E is C { constructor() {} } diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_modifier_init.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_modifier_init.sol new file mode 100644 index 000000000000..7cf33c0ecdb9 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_modifier_init.sol @@ -0,0 +1,8 @@ +abstract contract C { + constructor(uint, bool) {} +} + +abstract contract D is C { constructor() C {} } +// ---- +// DeclarationError 1563: (97-98): Modifier-style base constructor call without arguments. +// TypeError 2973: (97-98): Wrong argument count for modifier invocation: 0 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_modifier_init_empty_list.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_modifier_init_empty_list.sol new file mode 100644 index 000000000000..43c68a7eee30 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_missing_arguments_abstract_modifier_init_empty_list.sol @@ -0,0 +1,7 @@ +abstract contract C { + constructor(uint, bool) {} +} + +abstract contract D is C { constructor() C() {} } +// ---- +// TypeError 2973: (97-100): Wrong argument count for modifier invocation: 0 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_and_modifier_lists.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_and_modifier_lists.sol new file mode 100644 index 000000000000..08193b6dae6a --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_and_modifier_lists.sol @@ -0,0 +1,13 @@ +contract C { + constructor(uint, bool) {} +} + +contract D is C(1, true, "a") { constructor() C(1, true, "a") {} } +contract E is C(1) { constructor() C(1) {} } +// ---- +// DeclarationError 3364: (93-108): Base constructor arguments given twice. +// DeclarationError 3364: (149-153): Base constructor arguments given twice. +// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2 +// TypeError 2973: (93-108): Wrong argument count for modifier invocation: 3 arguments given but expected 2. +// TypeError 7927: (128-132): Wrong argument count for constructor call: 1 arguments given but expected 2 +// TypeError 2973: (149-153): Wrong argument count for modifier invocation: 1 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list.sol new file mode 100644 index 000000000000..f20462484b71 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list.sol @@ -0,0 +1,9 @@ +contract C { + constructor(uint, bool) {} +} + +contract D is C(1, true, "a") {} +contract E is C(1) {} +// ---- +// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2 +// TypeError 7927: (94-98): Wrong argument count for constructor call: 1 arguments given but expected 2 diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_abstract.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_abstract.sol new file mode 100644 index 000000000000..b7b619d84398 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_abstract.sol @@ -0,0 +1,9 @@ +abstract contract C { + constructor(uint, bool) {} +} + +abstract contract D is C(1, true, "a") {} +abstract contract E is C(1) {} +// ---- +// TypeError 7927: (79-94): Wrong argument count for constructor call: 3 arguments given but expected 2 +// TypeError 7927: (121-125): Wrong argument count for constructor call: 1 arguments given but expected 2 diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_empty_parens_and_modifier_list.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_empty_parens_and_modifier_list.sol new file mode 100644 index 000000000000..5bf9d1239486 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_empty_parens_and_modifier_list.sol @@ -0,0 +1,11 @@ +contract C { + constructor(uint, bool) {} +} + +contract D is C() { constructor() C(1, true, "a") {} } +contract E is C() { constructor() C(1) {} } +// ---- +// TypeError 7927: (61-64): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 2973: (81-96): Wrong argument count for modifier invocation: 3 arguments given but expected 2. +// TypeError 7927: (116-119): Wrong argument count for constructor call: 0 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 2973: (136-140): Wrong argument count for modifier invocation: 1 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_with_derived_constructor.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_with_derived_constructor.sol new file mode 100644 index 000000000000..ff8a0f93b7a8 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_inheritance_list_with_derived_constructor.sol @@ -0,0 +1,9 @@ +contract C { + constructor(uint, bool) {} +} + +contract D is C(1, true, "a") { constructor() {} } +contract E is C(1) { constructor() {} } +// ---- +// TypeError 7927: (61-76): Wrong argument count for constructor call: 3 arguments given but expected 2 +// TypeError 7927: (112-116): Wrong argument count for constructor call: 1 arguments given but expected 2 diff --git a/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_modifier_list.sol b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_modifier_list.sol new file mode 100644 index 000000000000..8fe486e16ce8 --- /dev/null +++ b/test/libsolidity/syntaxTests/constructor/base_constructor_wrong_arg_count_modifier_list.sol @@ -0,0 +1,9 @@ +contract C { + constructor(uint, bool) {} +} + +contract D is C { constructor() C(1, true, "a") {} } +contract E is C { constructor() C(1) {} } +// ---- +// TypeError 2973: (79-94): Wrong argument count for modifier invocation: 3 arguments given but expected 2. +// TypeError 2973: (132-136): Wrong argument count for modifier invocation: 1 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/constructor/constructor_visibility.sol b/test/libsolidity/syntaxTests/constructor/constructor_visibility.sol index 0175e22f7e91..5992dfa4c9ce 100644 --- a/test/libsolidity/syntaxTests/constructor/constructor_visibility.sol +++ b/test/libsolidity/syntaxTests/constructor/constructor_visibility.sol @@ -9,5 +9,5 @@ contract B is A { } } // ---- -// TypeError 3656: (124-303): Contract "B" should be marked as abstract. +// TypeError 3415: (124-303): No arguments passed to the base constructor. Specify the arguments or mark "B" as abstract. // TypeError 9640: (252-256): Explicit type conversion not allowed from "string memory" to "contract A". diff --git a/test/libsolidity/syntaxTests/controlFlow/userDefinedOperators/binary_operator_udvt.sol b/test/libsolidity/syntaxTests/controlFlow/userDefinedOperators/binary_operator_udvt.sol new file mode 100644 index 000000000000..d0a0b6ea6591 --- /dev/null +++ b/test/libsolidity/syntaxTests/controlFlow/userDefinedOperators/binary_operator_udvt.sol @@ -0,0 +1,17 @@ +type X is uint24; +type Y is uint16; + +using {addX as +} for X global; +using {addY as +} for Y global; + +function addX(X, X) pure returns (X) {} +function addY(Y, Y) pure returns (Y) { revert(); } + +contract C { + function f() public pure { + X.wrap(1) + X.wrap(Y.unwrap(Y.wrap(2) + Y.wrap(3))); + X.wrap(4) + X.wrap(5); // Unreachable + } +} +// ---- +// Warning 5740: (307-328): Unreachable code. diff --git a/test/libsolidity/syntaxTests/controlFlow/userDefinedOperators/unary_operator_udvt.sol b/test/libsolidity/syntaxTests/controlFlow/userDefinedOperators/unary_operator_udvt.sol new file mode 100644 index 000000000000..12b0f03b93a5 --- /dev/null +++ b/test/libsolidity/syntaxTests/controlFlow/userDefinedOperators/unary_operator_udvt.sol @@ -0,0 +1,17 @@ +type X is uint24; +type Y is uint16; + +using {unsubX as -} for X global; +using {unsubY as -} for Y global; + +function unsubX(X) pure returns (X) {} +function unsubY(Y) pure returns (Y) { revert(); } + +contract C { + function f() public pure { + -X.wrap(Y.unwrap(-Y.wrap(1))); + -X.wrap(Y.unwrap(Y.wrap(2))); // Unreachable + } +} +// ---- +// Warning 5740: (287-315): Unreachable code. diff --git a/test/libsolidity/syntaxTests/denominations/denominations_in_array_sizes.sol b/test/libsolidity/syntaxTests/denominations/denominations_in_array_sizes.sol new file mode 100644 index 000000000000..46c7a0d87df7 --- /dev/null +++ b/test/libsolidity/syntaxTests/denominations/denominations_in_array_sizes.sol @@ -0,0 +1,12 @@ +contract C { + uint[42 wei] a; + uint[42 gwei] b; + uint[42 ether] c; + uint[42 seconds] d; + uint[42 minutes] e; + uint[42 hours] f; + uint[42 days] g; + uint[42 weeks] h; +} +// ---- +// Warning 7325: (58-72): Type uint256[42000000000000000000] covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction. diff --git a/test/libsolidity/syntaxTests/denominations/finney_invalid.sol b/test/libsolidity/syntaxTests/denominations/finney_invalid.sol index b7bae7fa7049..0974cde13e4a 100644 --- a/test/libsolidity/syntaxTests/denominations/finney_invalid.sol +++ b/test/libsolidity/syntaxTests/denominations/finney_invalid.sol @@ -1,7 +1,7 @@ contract C { - function f() { - uint x = 1 finney; - } + function f() public { + uint x = 1 finney; + } } // ---- -// ParserError 2314: (45-51): Expected ';' but got identifier +// ParserError 2314: (58-64): Expected ';' but got identifier diff --git a/test/libsolidity/syntaxTests/denominations/invalid_denomination_address.sol b/test/libsolidity/syntaxTests/denominations/invalid_denomination_address.sol new file mode 100644 index 000000000000..8eec22dee3f0 --- /dev/null +++ b/test/libsolidity/syntaxTests/denominations/invalid_denomination_address.sol @@ -0,0 +1,5 @@ +contract C { + address a = 0x11111122222333334444455555666667777788888 wei; +} +// ---- +// TypeError 5145: (26-73): Hexadecimal numbers cannot be used with unit denominations. You can use an expression of the form "0x1234 * 1 day" instead. diff --git a/test/libsolidity/syntaxTests/denominations/invalid_denomination_no_whitespace.sol b/test/libsolidity/syntaxTests/denominations/invalid_denomination_no_whitespace.sol new file mode 100644 index 000000000000..f67fde89d7a8 --- /dev/null +++ b/test/libsolidity/syntaxTests/denominations/invalid_denomination_no_whitespace.sol @@ -0,0 +1,5 @@ +contract C { + uint constant y = 1wei; +} +// ---- +// ParserError 8936: (32-33): Identifier-start is not allowed at end of a number. diff --git a/test/libsolidity/syntaxTests/denominations/invalid_denomination_on_bool.sol b/test/libsolidity/syntaxTests/denominations/invalid_denomination_on_bool.sol new file mode 100644 index 000000000000..58d7d205e626 --- /dev/null +++ b/test/libsolidity/syntaxTests/denominations/invalid_denomination_on_bool.sol @@ -0,0 +1,5 @@ +contract C { + bool constant x = true ether; +} +// ---- +// ParserError 2314: (37-42): Expected ';' but got 'ether' diff --git a/test/libsolidity/syntaxTests/denominations/invalid_denomination_on_string.sol b/test/libsolidity/syntaxTests/denominations/invalid_denomination_on_string.sol new file mode 100644 index 000000000000..9d27c5d3de64 --- /dev/null +++ b/test/libsolidity/syntaxTests/denominations/invalid_denomination_on_string.sol @@ -0,0 +1,5 @@ +contract C { + string s = "abc" ether; +} +// ---- +// ParserError 2314: (31-36): Expected ';' but got 'ether' diff --git a/test/libsolidity/syntaxTests/denominations/szabo_invalid.sol b/test/libsolidity/syntaxTests/denominations/szabo_invalid.sol index d206830d5e3f..d0e3eb3ff734 100644 --- a/test/libsolidity/syntaxTests/denominations/szabo_invalid.sol +++ b/test/libsolidity/syntaxTests/denominations/szabo_invalid.sol @@ -1,7 +1,7 @@ contract C { - function f() { - uint x = 1 szabo; - } + function f() public { + uint x = 1 szabo; + } } // ---- -// ParserError 2314: (45-50): Expected ';' but got identifier +// ParserError 2314: (58-63): Expected ';' but got identifier diff --git a/test/libsolidity/syntaxTests/denominations/two_denominations_same_literal.sol b/test/libsolidity/syntaxTests/denominations/two_denominations_same_literal.sol new file mode 100644 index 000000000000..8583e1d42782 --- /dev/null +++ b/test/libsolidity/syntaxTests/denominations/two_denominations_same_literal.sol @@ -0,0 +1,5 @@ +contract C { + uint constant y = 8 gwei ether; +} +// ---- +// ParserError 2314: (39-44): Expected ';' but got 'ether' diff --git a/test/libsolidity/syntaxTests/freeFunctions/invalid_function_named_unicode.sol b/test/libsolidity/syntaxTests/freeFunctions/invalid_function_named_unicode.sol new file mode 100644 index 000000000000..889d7df2123d --- /dev/null +++ b/test/libsolidity/syntaxTests/freeFunctions/invalid_function_named_unicode.sol @@ -0,0 +1,4 @@ +function unicode() returns {} + +// ---- +// ParserError 2314: (9-16): Expected identifier but got 'ILLEGAL' diff --git a/test/libsolidity/syntaxTests/freeFunctions/named_fallback_warning.sol b/test/libsolidity/syntaxTests/freeFunctions/named_fallback_warning.sol new file mode 100644 index 000000000000..8f0c0ea3fce6 --- /dev/null +++ b/test/libsolidity/syntaxTests/freeFunctions/named_fallback_warning.sol @@ -0,0 +1,3 @@ +function fallback() {} +// ---- +// Warning 3445: (9-17): This function is named "fallback" but is not the fallback function of the contract. If you intend this to be a fallback function, use "fallback(...) { ... }" without the "function" keyword to define it. diff --git a/test/libsolidity/syntaxTests/freeFunctions/named_receive_warning.sol b/test/libsolidity/syntaxTests/freeFunctions/named_receive_warning.sol new file mode 100644 index 000000000000..25c860241665 --- /dev/null +++ b/test/libsolidity/syntaxTests/freeFunctions/named_receive_warning.sol @@ -0,0 +1,3 @@ +function receive() {} +// ---- +// Warning 3445: (9-16): This function is named "receive" but is not the receive function of the contract. If you intend this to be a receive function, use "receive(...) { ... }" without the "function" keyword to define it. diff --git a/test/libsolidity/syntaxTests/functionCalls/enum_value_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/enum_value_not_callable.sol new file mode 100644 index 000000000000..f2d7cd1b2b40 --- /dev/null +++ b/test/libsolidity/syntaxTests/functionCalls/enum_value_not_callable.sol @@ -0,0 +1,7 @@ +enum E { A, B, C } + +contract C { + uint a = E.B(1000); +} +// ---- +// TypeError 5704: (46-55): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/functionCalls/int_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/int_not_callable.sol index 5c7260f36fd0..e1ddbc7db764 100644 --- a/test/libsolidity/syntaxTests/functionCalls/int_not_callable.sol +++ b/test/libsolidity/syntaxTests/functionCalls/int_not_callable.sol @@ -5,4 +5,4 @@ contract C } } // ---- -// TypeError 5704: (53-60): Type is not callable +// TypeError 5704: (53-60): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/functionCalls/magic_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/magic_not_callable.sol new file mode 100644 index 000000000000..c93f0bb88b62 --- /dev/null +++ b/test/libsolidity/syntaxTests/functionCalls/magic_not_callable.sol @@ -0,0 +1,5 @@ +contract C { + uint a = msg(1000); +} +// ---- +// TypeError 5704: (26-35): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/functionCalls/mapping_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/mapping_not_callable.sol new file mode 100644 index 000000000000..e5258b62bea8 --- /dev/null +++ b/test/libsolidity/syntaxTests/functionCalls/mapping_not_callable.sol @@ -0,0 +1,6 @@ +contract C { + mapping (uint => uint) m; + uint a = m(1000); +} +// ---- +// TypeError 5704: (56-63): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/functionCalls/modifier_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/modifier_not_callable.sol new file mode 100644 index 000000000000..0f41072ec63b --- /dev/null +++ b/test/libsolidity/syntaxTests/functionCalls/modifier_not_callable.sol @@ -0,0 +1,7 @@ +contract C { + uint a = m(1000); + + modifier m(uint) { _; } +} +// ---- +// TypeError 5704: (26-33): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/functionCalls/module_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/module_not_callable.sol new file mode 100644 index 000000000000..1415810ae2c3 --- /dev/null +++ b/test/libsolidity/syntaxTests/functionCalls/module_not_callable.sol @@ -0,0 +1,9 @@ +==== Source: A.sol ==== +==== Source: B.sol ==== +import "A.sol" as A; + +contract C { + uint a = A(1000); +} +// ---- +// TypeError 5704: (B.sol:48-55): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/functionCalls/this_not_callable.sol b/test/libsolidity/syntaxTests/functionCalls/this_not_callable.sol index 52e6986bb0ac..8de5683bc808 100644 --- a/test/libsolidity/syntaxTests/functionCalls/this_not_callable.sol +++ b/test/libsolidity/syntaxTests/functionCalls/this_not_callable.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// TypeError 5704: (72-78): Type is not callable +// TypeError 5704: (72-78): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_plus_tuple.sol b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_plus_tuple.sol new file mode 100644 index 000000000000..a0621ebf04b1 --- /dev/null +++ b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_plus_tuple.sol @@ -0,0 +1,9 @@ +contract C +{ + function f() public + { + int x = +(0, 0); + } +} +// ---- +// ParserError 9636: (59-60): Use of unary + is disallowed. diff --git a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_tuple.sol b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_tuple.sol index b6b2ec2e2f38..a0ed75c9a416 100644 --- a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_tuple.sol +++ b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_tuple.sol @@ -2,19 +2,15 @@ contract C { function f() public { - int x = +(0, 0); int y = -(0, 0); (int z) = ~(0, 0); (int t) = !(0, 0); } } // ---- -// SyntaxError 9636: (59-66): Use of unary + is disallowed. -// TypeError 4907: (59-66): Built-in unary operator + cannot be applied to type tuple(int_const 0,int_const 0). +// TypeError 4907: (59-66): Built-in unary operator - cannot be applied to type tuple(int_const 0,int_const 0). // TypeError 7364: (51-66): Different number of components on the left hand side (1) than on the right hand side (2). -// TypeError 4907: (84-91): Built-in unary operator - cannot be applied to type tuple(int_const 0,int_const 0). -// TypeError 7364: (76-91): Different number of components on the left hand side (1) than on the right hand side (2). -// TypeError 4907: (111-118): Built-in unary operator ~ cannot be applied to type tuple(int_const 0,int_const 0). -// TypeError 7364: (101-118): Different number of components on the left hand side (1) than on the right hand side (2). -// TypeError 4907: (138-145): Built-in unary operator ! cannot be applied to type tuple(int_const 0,int_const 0). -// TypeError 7364: (128-145): Different number of components on the left hand side (1) than on the right hand side (2). +// TypeError 4907: (86-93): Built-in unary operator ~ cannot be applied to type tuple(int_const 0,int_const 0). +// TypeError 7364: (76-93): Different number of components on the left hand side (1) than on the right hand side (2). +// TypeError 4907: (113-120): Built-in unary operator ! cannot be applied to type tuple(int_const 0,int_const 0). +// TypeError 7364: (103-120): Different number of components on the left hand side (1) than on the right hand side (2). diff --git a/test/libsolidity/syntaxTests/immutable/try_catch_initialized.sol b/test/libsolidity/syntaxTests/immutable/try_catch_initialized.sol new file mode 100644 index 000000000000..2d901a020091 --- /dev/null +++ b/test/libsolidity/syntaxTests/immutable/try_catch_initialized.sol @@ -0,0 +1,42 @@ +contract A +{ + uint256 public immutable variable; + + constructor() + { + B b; + try b.foo(variable = 1) + { + variable = 2; + } + catch Panic(uint) + { + variable = 3; + } + catch Error(string memory) + { + variable = 4; + } + catch + { + variable = 5; + } + } +} + +contract B +{ + function foo(uint256) external pure + { + revert(); + } +} + +// ==== +// EVMVersion: >=byzantium +// ---- +// TypeError 4130: (108-116): Cannot write to immutable here: Immutable variables cannot be initialized inside a try/catch statement. +// TypeError 4130: (144-152): Cannot write to immutable here: Immutable variables cannot be initialized inside a try/catch statement. +// TypeError 4130: (216-224): Cannot write to immutable here: Immutable variables cannot be initialized inside a try/catch statement. +// TypeError 4130: (297-305): Cannot write to immutable here: Immutable variables cannot be initialized inside a try/catch statement. +// TypeError 4130: (357-365): Cannot write to immutable here: Immutable variables cannot be initialized inside a try/catch statement. diff --git a/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol b/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol index d3f33f6d69d1..4042e0089ac2 100644 --- a/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol +++ b/test/libsolidity/syntaxTests/inheritance/too_few_base_arguments.sol @@ -6,5 +6,5 @@ contract Derived2 is Base { constructor() Base(2) { } } // ---- -// TypeError 7927: (67-74): Wrong argument count for constructor call: 1 arguments given but expected 2. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (67-74): Wrong argument count for constructor call: 1 arguments given but expected 2 // TypeError 2973: (123-130): Wrong argument count for modifier invocation: 1 arguments given but expected 2. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/push0_disallowed.sol b/test/libsolidity/syntaxTests/inlineAssembly/push0_disallowed.sol new file mode 100644 index 000000000000..b1471ac55b2f --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/push0_disallowed.sol @@ -0,0 +1,19 @@ +// Ok +contract push0 {} + +contract A { + // Ok, warning about shadowing + function push0() external {} +} + +contract C { + function f() external { + assembly { + // Not okay + push0() + } + } +} +// ---- +// Warning 2519: (77-105): This declaration shadows an existing declaration. +// DeclarationError 4619: (205-210): Function "push0" not found. diff --git a/test/libsolidity/syntaxTests/literals/invalid_hex_number.sol b/test/libsolidity/syntaxTests/literals/invalid_hex_number.sol new file mode 100644 index 000000000000..1cc7e0eccb02 --- /dev/null +++ b/test/libsolidity/syntaxTests/literals/invalid_hex_number.sol @@ -0,0 +1,5 @@ +contract C { + uint x = 0x1000abcdefgh; +} +// ---- +// ParserError 8936: (26-38): Identifier-start is not allowed at end of a number. diff --git a/test/libsolidity/syntaxTests/literals/invalid_octal_denomination_no_whitespace.sol b/test/libsolidity/syntaxTests/literals/invalid_octal_denomination_no_whitespace.sol new file mode 100644 index 000000000000..a4ec101c30c0 --- /dev/null +++ b/test/libsolidity/syntaxTests/literals/invalid_octal_denomination_no_whitespace.sol @@ -0,0 +1,5 @@ +contract C { + uint y = 01gwei; +} +// ---- +// ParserError 8936: (26-27): Octal numbers not allowed. diff --git a/test/libsolidity/syntaxTests/literals/invalid_octal_digits.sol b/test/libsolidity/syntaxTests/literals/invalid_octal_digits.sol new file mode 100644 index 000000000000..8565377a096d --- /dev/null +++ b/test/libsolidity/syntaxTests/literals/invalid_octal_digits.sol @@ -0,0 +1,5 @@ +contract C { + uint y = 098; +} +// ---- +// ParserError 8936: (26-27): Octal numbers not allowed. diff --git a/test/libsolidity/syntaxTests/literals/invalid_octal_number.sol b/test/libsolidity/syntaxTests/literals/invalid_octal_number.sol new file mode 100644 index 000000000000..668913be61d4 --- /dev/null +++ b/test/libsolidity/syntaxTests/literals/invalid_octal_number.sol @@ -0,0 +1,5 @@ +contract C { + uint x = 0100; +} +// ---- +// ParserError 8936: (26-27): Octal numbers not allowed. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/061_missing_base_constructor_arguments.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/061_missing_base_constructor_arguments.sol index 0e123ae23a9c..83119653bb10 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/061_missing_base_constructor_arguments.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/061_missing_base_constructor_arguments.sol @@ -1,4 +1,4 @@ contract A { constructor(uint a) { } } contract B is A { } // ---- -// TypeError 3656: (39-58): Contract "B" should be marked as abstract. +// TypeError 3415: (39-58): No arguments passed to the base constructor. Specify the arguments or mark "B" as abstract. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/062_base_constructor_arguments_override.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/062_base_constructor_arguments_override.sol index 0e123ae23a9c..bdca8fdd3798 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/062_base_constructor_arguments_override.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/062_base_constructor_arguments_override.sol @@ -1,4 +1,4 @@ contract A { constructor(uint a) { } } -contract B is A { } +contract B is A { constructor(bytes4 a, bytes28 b) { } } // ---- -// TypeError 3656: (39-58): Contract "B" should be marked as abstract. +// TypeError 3415: (39-95): No arguments passed to the base constructor. Specify the arguments or mark "B" as abstract. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol index 930e79a3b7ba..1cf46ac837ed 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol @@ -7,4 +7,4 @@ contract test { } } // ---- -// TypeError 2271: (79-85): Built-in binary operator == cannot be applied to types struct test.s storage ref and struct test.s storage ref. +// TypeError 2271: (79-85): Built-in binary operator == cannot be applied to types struct test.s storage ref and struct test.s storage ref. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol index 0c579062bffd..29d29b46bd70 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol @@ -6,5 +6,4 @@ contract test { } } // ---- -// SyntaxError 9636: (70-75): Use of unary + is disallowed. -// TypeError 4907: (70-75): Built-in unary operator + cannot be applied to type rational_const 13 / 4. +// ParserError 9636: (70-71): Use of unary + is disallowed. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/462_callable_crash.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/462_callable_crash.sol index 05239fa1b75d..1f9e7a1a05e2 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/462_callable_crash.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/462_callable_crash.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// TypeError 5704: (90-108): Type is not callable +// TypeError 5704: (90-108): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol index 392d02e9f1b1..d46920d1dbdf 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/492_do_not_crash_on_not_lvalue.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// TypeError 5704: (153-157): Type is not callable +// TypeError 5704: (153-157): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol index f1ffa651f36b..88396f8c6e01 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/525_reject_interface_constructors.sol @@ -1,4 +1,4 @@ interface I {} contract C is I(2) {} // ---- -// TypeError 7927: (29-33): Wrong argument count for constructor call: 1 arguments given but expected 0. Remove parentheses if you do not want to provide arguments here. +// TypeError 7927: (29-33): Wrong argument count for constructor call: 1 arguments given but expected 0 diff --git a/test/libsolidity/syntaxTests/natspec/docstring_enum.sol b/test/libsolidity/syntaxTests/natspec/docstring_enum.sol new file mode 100644 index 000000000000..d80484446b1f --- /dev/null +++ b/test/libsolidity/syntaxTests/natspec/docstring_enum.sol @@ -0,0 +1,11 @@ +contract C { + /// @title example of title + /// @author example of author + /// @notice example of notice + /// @dev example of dev + enum Color { + Red, + Green + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/natspec/docstring_struct.sol b/test/libsolidity/syntaxTests/natspec/docstring_struct.sol new file mode 100644 index 000000000000..621a88a539d0 --- /dev/null +++ b/test/libsolidity/syntaxTests/natspec/docstring_struct.sol @@ -0,0 +1,12 @@ +contract C { + /// @title example of title + /// @author example of author + /// @notice example of notice + /// @dev example of dev + struct Example { + string text; + bool valid; + uint256 value; + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/operators/calling_operator_binary_user_defined_not_available.sol b/test/libsolidity/syntaxTests/operators/calling_operator_binary_user_defined_not_available.sol new file mode 100644 index 000000000000..ea0c8f9d8a69 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/calling_operator_binary_user_defined_not_available.sol @@ -0,0 +1,11 @@ +type Int is int256; + +function f() pure { + Int a = Int.wrap(0); + a + a; + a >>> a; +} + +// ---- +// TypeError 2271: (70-75): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 2271: (81-88): Built-in binary operator >>> cannot be applied to types Int and Int. diff --git a/test/libsolidity/syntaxTests/operators/calling_operator_unary_user_defined_not_available.sol b/test/libsolidity/syntaxTests/operators/calling_operator_unary_user_defined_not_available.sol new file mode 100644 index 000000000000..29273852e63a --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/calling_operator_unary_user_defined_not_available.sol @@ -0,0 +1,11 @@ +type Int is int256; + +function f() pure { + Int a = Int.wrap(0); + -a; + a++; +} + +// ---- +// TypeError 4907: (70-72): Built-in unary operator - cannot be applied to type Int. No matching user-defined operator found. +// TypeError 9767: (78-81): Built-in unary operator ++ cannot be applied to type Int. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator.sol new file mode 100644 index 000000000000..a00eb2ce5246 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator.sol @@ -0,0 +1,11 @@ +type Int is int; +using {add as +} for Int global; +using {unsub as -} for Int global; + +function add(Int, Int) pure returns (Int) {} +function unsub(Int) pure returns (Int) {} + +function f() pure { + Int.wrap(0) + Int.wrap(0); + -Int.wrap(0); +} diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_as_attached_function_via_function_name.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_as_attached_function_via_function_name.sol new file mode 100644 index 000000000000..6c1baa4b1a06 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_as_attached_function_via_function_name.sol @@ -0,0 +1,12 @@ +type Int is int16; + +using {add as +} for Int global; + +function add(Int, Int) pure returns (Int) {} + +function f() { + Int a; + a.add(a); +} +// ---- +// TypeError 9582: (130-135): Member "add" not found or not visible after argument-dependent lookup in Int. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_as_attached_function_via_operator_name.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_as_attached_function_via_operator_name.sol new file mode 100644 index 000000000000..62c53cb8e19a --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_as_attached_function_via_operator_name.sol @@ -0,0 +1,12 @@ +type Int is int16; + +using {add as +} for Int global; + +function add(Int, Int) pure returns (Int) {} + +function f() { + Int a; + a.+(a); +} +// ---- +// ParserError 2314: (132-133): Expected identifier but got '+' diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_defined_separately_from_type.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_defined_separately_from_type.sol new file mode 100644 index 000000000000..827853938ff0 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_defined_separately_from_type.sol @@ -0,0 +1,23 @@ +==== Source: definition.sol ==== +import "type-and-binding.sol"; + +function add(Int, Int) pure returns (Int) {} +function unsub(Int) pure returns (Int) {} + +==== Source: type-and-binding.sol ==== +import "definition.sol"; + +type Int is int; + +using {add as +} for Int global; +using {unsub as -} for Int global; + +==== Source: use.sol ==== +import "type-and-binding.sol"; + +contract C { + function f() pure public { + Int.wrap(0) + Int.wrap(0); + -Int.wrap(0); + } +} diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_defined_separately_from_type_and_binding.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_defined_separately_from_type_and_binding.sol new file mode 100644 index 000000000000..d7a9ed057790 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_defined_separately_from_type_and_binding.sol @@ -0,0 +1,30 @@ +==== Source: binding.sol ==== +import "definition.sol"; +import "type.sol"; + +using {add as +} for Int global; +using {unsub as -} for Int global; + +==== Source: definition.sol ==== +import "type.sol"; + +function add(Int, Int) pure returns (Int) {} +function unsub(Int) pure returns (Int) {} + +==== Source: type.sol ==== +type Int is int; + +==== Source: use.sol ==== +import "type.sol"; + +contract C { + function f() pure public { + Int.wrap(0) + Int.wrap(0); + -Int.wrap(0); + } +} +// ---- +// TypeError 4117: (binding.sol:45-77): Can only use "global" with types defined in the same source unit at file level. +// TypeError 4117: (binding.sol:78-112): Can only use "global" with types defined in the same source unit at file level. +// TypeError 2271: (use.sol:72-97): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 4907: (use.sol:107-119): Built-in unary operator - cannot be applied to type Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported.sol new file mode 100644 index 000000000000..7c56bd6d68d0 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported.sol @@ -0,0 +1,17 @@ +==== Source: s1.sol ==== +type Int is int; +using {add as +} for Int global; +using {unsub as -} for Int global; + +function add(Int, Int) pure returns (Int) {} +function unsub(Int) pure returns (Int) {} + +==== Source: s2.sol ==== +import "s1.sol"; + +contract C { + function f() pure public { + Int.wrap(0) + Int.wrap(0); + -Int.wrap(0); + } +} diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_non_global.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_non_global.sol new file mode 100644 index 000000000000..ab2a83797b2c --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_non_global.sol @@ -0,0 +1,22 @@ +==== Source: s1.sol ==== +type Int is int; +using {add as +} for Int; +using {unsub as -} for Int; + +function add(Int, Int) pure returns (Int) {} +function unsub(Int) pure returns (Int) {} + +==== Source: s2.sol ==== +import "s1.sol"; + +contract C { + function f() pure public { + Int.wrap(0) + Int.wrap(0); + -Int.wrap(0); + } +} +// ---- +// TypeError 3320: (s1.sol:24-27): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (s1.sol:50-55): Operators can only be defined in a global 'using for' directive. +// TypeError 2271: (s2.sol:70-95): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 4907: (s2.sol:105-117): Built-in unary operator - cannot be applied to type Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_transitively.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_transitively.sol new file mode 100644 index 000000000000..86e4c2f43fdb --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_transitively.sol @@ -0,0 +1,35 @@ +==== Source: s0.sol ==== +type Int is int; + +==== Source: s1.sol ==== +import "s0.sol"; +using {add1 as +} for Int global; +using {unsub1 as -} for Int global; + +function add1(Int, Int) pure returns (Int) {} +function unsub1(Int) pure returns (Int) {} + +==== Source: s2.sol ==== +import "s0.sol"; +using {add2 as +} for Int global; +using {unsub2 as -} for Int global; + +function add2(Int, Int) pure returns (Int) {} +function unsub2(Int) pure returns (Int) {} + +==== Source: s3.sol ==== +import "s1.sol"; +import "s2.sol"; +contract C { + function f() public { + Int.wrap(0) + Int.wrap(0); + -Int.wrap(0); + } +} +// ---- +// TypeError 4117: (s1.sol:17-50): Can only use "global" with types defined in the same source unit at file level. +// TypeError 4117: (s1.sol:51-86): Can only use "global" with types defined in the same source unit at file level. +// TypeError 4117: (s2.sol:17-50): Can only use "global" with types defined in the same source unit at file level. +// TypeError 4117: (s2.sol:51-86): Can only use "global" with types defined in the same source unit at file level. +// TypeError 2271: (s3.sol:81-106): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 4907: (s3.sol:116-128): Built-in unary operator - cannot be applied to type Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_transitively_non_global.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_transitively_non_global.sol new file mode 100644 index 000000000000..7bd3fa146b18 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_imported_transitively_non_global.sol @@ -0,0 +1,35 @@ +==== Source: s0.sol ==== +type Int is int; + +==== Source: s1.sol ==== +import "s0.sol"; +using {add1 as +} for Int; +using {unsub1 as -} for Int; + +function add1(Int, Int) pure returns (Int) {} +function unsub1(Int) pure returns (Int) {} + +==== Source: s2.sol ==== +import "s0.sol"; +using {add2 as +} for Int; +using {unsub2 as -} for Int; + +function add2(Int, Int) pure returns (Int) {} +function unsub2(Int) pure returns (Int) {} + +==== Source: s3.sol ==== +import "s1.sol"; +import "s2.sol"; +contract C { + function f() public { + Int.wrap(0) + Int.wrap(0); + -Int.wrap(0); + } +} +// ---- +// TypeError 3320: (s1.sol:24-28): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (s1.sol:51-57): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (s2.sol:24-28): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (s2.sol:51-57): Operators can only be defined in a global 'using for' directive. +// TypeError 2271: (s3.sol:81-106): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 4907: (s3.sol:116-128): Built-in unary operator - cannot be applied to type Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_in_constant_initialization.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_in_constant_initialization.sol new file mode 100644 index 000000000000..f05655b65217 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_in_constant_initialization.sol @@ -0,0 +1,24 @@ +type B4 is bytes4; +using {bitor as |, bitnot as ~} for B4 global; + +function bitor(B4, B4) pure returns (B4) {} +function bitnot(B4) pure returns (B4) {} + +B4 constant X = B4.wrap(0x12345678) | B4.wrap(0xaabbccdd); + +contract C { + B4 constant Y = B4.wrap(0x12345678) | B4.wrap(0xaabbccdd); +} + +library L { + B4 constant Z = ~B4.wrap(0x12345678); +} + +interface I { + B4 constant W = ~B4.wrap(0x12345678); +} +// ---- +// TypeError 8349: (169-210): Initial value for constant variable has to be compile-time constant. +// TypeError 8349: (246-287): Initial value for constant variable has to be compile-time constant. +// TypeError 8349: (324-344): Initial value for constant variable has to be compile-time constant. +// TypeError 8349: (383-403): Initial value for constant variable has to be compile-time constant. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_non_global.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_non_global.sol new file mode 100644 index 000000000000..5af79ad475e5 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_non_global.sol @@ -0,0 +1,14 @@ +type Int is int; +using {add as +} for Int; +using {unsub as -} for Int; + +function add(Int, Int) pure returns (Int) {} +function unsub(Int) pure returns (Int) {} + +function f() pure { + Int.wrap(0) + Int.wrap(0); + -Int.wrap(0); +} +// ---- +// TypeError 3320: (24-27): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (50-55): Operators can only be defined in a global 'using for' directive. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_deploys_contract.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_deploys_contract.sol new file mode 100644 index 000000000000..08e9e68d9ca7 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_deploys_contract.sol @@ -0,0 +1,24 @@ +type Int is int16; + +using {add as +} for Int global; + +function add(Int, Int) returns (Int) { + B b = new B(); + return b.f(); +} + +contract B { + Int s; + function f() external returns (Int) { + s = Int.wrap(3); + return s; + } +} + +contract C { + function test() public returns (Int) { + return Int.wrap(0) + Int.wrap(0); + } +} +// ---- +// TypeError 7775: (27-30): Only pure free functions can be used to define operators. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_external_call.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_external_call.sol new file mode 100644 index 000000000000..02c5d655f26b --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_external_call.sol @@ -0,0 +1,20 @@ +type Int is int16; +using {add as +, unsub as -} for Int global; + +IAdder constant ADDER = IAdder(address(0)); + +function add(Int x, Int y) pure returns (Int) { + return ADDER.mul(x, y); +} + +function unsub(Int x) pure returns (Int) { + return ADDER.inc(x); +} + +interface IAdder { + function mul(Int, Int) external returns (Int); + function inc(Int) external returns (Int); +} +// ---- +// TypeError 8961: (169-184): Function cannot be declared as pure because this expression (potentially) modifies the state. +// TypeError 8961: (243-255): Function cannot be declared as pure because this expression (potentially) modifies the state. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_pure_external_call.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_pure_external_call.sol new file mode 100644 index 000000000000..37a8add56cb8 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_pure_external_call.sol @@ -0,0 +1,17 @@ +type Int is int16; +using {add as +, unsub as -} for Int global; + +IAdder constant ADDER = IAdder(address(0)); + +function add(Int x, Int y) pure returns (Int) { + return ADDER.mul(x, y); +} + +function unsub(Int x) pure returns (Int) { + return ADDER.inc(x); +} + +interface IAdder { + function mul(Int, Int) external pure returns (Int); + function inc(Int) external pure returns (Int); +} diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_view_external_call.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_view_external_call.sol new file mode 100644 index 000000000000..f45f7a30f0f3 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_that_makes_view_external_call.sol @@ -0,0 +1,20 @@ +type Int is int16; +using {add as +, unsub as -} for Int global; + +IAdder constant ADDER = IAdder(address(0)); + +function add(Int x, Int y) pure returns (Int) { + return ADDER.mul(x, y); +} + +function unsub(Int x) pure returns (Int) { + return ADDER.inc(x); +} + +interface IAdder { + function mul(Int, Int) external view returns (Int); + function inc(Int) external view returns (Int); +} +// ---- +// TypeError 2527: (169-184): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view". +// TypeError 2527: (243-255): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view". diff --git a/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_with_implicit_conversion.sol b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_with_implicit_conversion.sol new file mode 100644 index 000000000000..afe4e46e8016 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/calling_operator_with_implicit_conversion.sol @@ -0,0 +1,32 @@ +using {add as +, unsub as -} for U global; + +type U is uint; + +function add(U, U) pure returns (U) {} +function unsub(U) pure returns (U) {} + +contract C { + function fromBool() public { + U u; + + u + true; + true + u; + -true; + } + + function fromUint() public { + U u; + uint32 u32; + + u + u32; + u32 + u; + -u32; + } +} +// ---- +// TypeError 5653: (207-215): The type of the second operand of this user-defined binary operator + does not match the type of the first operand, which is U. +// TypeError 2271: (225-233): Built-in binary operator + cannot be applied to types bool and U. +// TypeError 4907: (243-248): Built-in unary operator - cannot be applied to type bool. +// TypeError 5653: (332-339): The type of the second operand of this user-defined binary operator + does not match the type of the first operand, which is U. +// TypeError 2271: (349-356): Built-in binary operator + cannot be applied to types uint32 and U. +// TypeError 4907: (366-370): Built-in unary operator - cannot be applied to type uint32. Unary negation is only allowed for signed integers. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_builtin_types.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_builtin_types.sol new file mode 100644 index 000000000000..8bdcd510aa4a --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_builtin_types.sol @@ -0,0 +1,18 @@ +using {f as +} for uint global; +using {f as +} for uint[2] global; +using {f as +} for mapping(uint => uint) global; +using {f as +} for function (uint) pure returns (uint) global; +using {f as +} for string global; + +function f(uint, uint) pure returns (uint) {} +// ---- +// TypeError 8841: (0-31): Can only use "global" with user-defined types. +// TypeError 5332: (7-8): Operators can only be implemented for user-defined value types. +// TypeError 8841: (32-66): Can only use "global" with user-defined types. +// TypeError 5332: (39-40): Operators can only be implemented for user-defined value types. +// TypeError 8841: (67-115): Can only use "global" with user-defined types. +// TypeError 5332: (74-75): Operators can only be implemented for user-defined value types. +// TypeError 8841: (116-178): Can only use "global" with user-defined types. +// TypeError 5332: (123-124): Operators can only be implemented for user-defined value types. +// TypeError 8841: (179-212): Can only use "global" with user-defined types. +// TypeError 5332: (186-187): Operators can only be implemented for user-defined value types. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_contract.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_contract.sol new file mode 100644 index 000000000000..55418f579ebd --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_contract.sol @@ -0,0 +1,13 @@ +using {fc as +} for C global; +using {fa as +} for A global; + +function fc(C, C) pure returns (C) {} +function fa(A, A) pure returns (A) {} + +contract C {} +abstract contract A {} +// ---- +// TypeError 8841: (0-29): Can only use "global" with user-defined types. +// TypeError 5332: (7-9): Operators can only be implemented for user-defined value types. +// TypeError 8841: (30-59): Can only use "global" with user-defined types. +// TypeError 5332: (37-39): Operators can only be implemented for user-defined value types. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_enum.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_enum.sol new file mode 100644 index 000000000000..dce1009948de --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_enum.sol @@ -0,0 +1,10 @@ +using {add as +} for E global; + +enum E { + E1, + E2 +} + +function add(E, E) pure returns (E) {} +// ---- +// TypeError 5332: (7-10): Operators can only be implemented for user-defined value types. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_error.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_error.sol new file mode 100644 index 000000000000..0dcab966d582 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_error.sol @@ -0,0 +1,10 @@ +using {add as +} for E global; + +error E(); + +function add(E, E) pure returns (E) { + return E.E1; +} + +// ---- +// TypeError 5172: (21-22): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_event.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_event.sol new file mode 100644 index 000000000000..5dd5fbce9284 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_event.sol @@ -0,0 +1,10 @@ +using {add as +} for C.Event global; + +contract C { + event Event(); +} + +function add(C.Event, C.Event) pure returns (C.Event) {} + +// ---- +// TypeError 5172: (21-28): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_interface.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_interface.sol new file mode 100644 index 000000000000..9db33819c2f1 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_interface.sol @@ -0,0 +1,8 @@ +using {f as +} for I global; + +function f(I, I) pure returns (I) {} + +interface I {} +// ---- +// TypeError 8841: (0-28): Can only use "global" with user-defined types. +// TypeError 5332: (7-8): Operators can only be implemented for user-defined value types. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_library.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_library.sol new file mode 100644 index 000000000000..210cb30096cd --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_library.sol @@ -0,0 +1,6 @@ +using {f as +} for L global; + +function f() pure {} +library L {} +// ---- +// TypeError 1130: (19-20): Invalid use of a library name. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_struct.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_struct.sol new file mode 100644 index 000000000000..0244f731c93b --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_struct.sol @@ -0,0 +1,9 @@ +using {add as +} for S global; + +struct S { + uint x; +} + +function add(S memory, S memory) pure returns (S memory) {} +// ---- +// TypeError 5332: (7-10): Operators can only be implemented for user-defined value types. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_wildcard_type_at_contract_level.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_wildcard_type_at_contract_level.sol new file mode 100644 index 000000000000..1e3c9e7756e8 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_wildcard_type_at_contract_level.sol @@ -0,0 +1,16 @@ +type Int is int; + +function add(Int, Int) pure returns (Int) {} + +contract C { + using {add as +} for *; +} + +contract D { + using {add as +} for * global; +} +// ---- +// SyntaxError 3349: (81-104): The type has to be specified explicitly when attaching specific functions. +// SyntaxError 3349: (125-155): The type has to be specified explicitly when attaching specific functions. +// SyntaxError 2854: (125-155): Can only globally attach functions to specific types. +// SyntaxError 3367: (125-155): "global" can only be used at file level. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_wildcard_type_at_file_level.sol b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_wildcard_type_at_file_level.sol new file mode 100644 index 000000000000..25325f75624e --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/defining_operator_for_wildcard_type_at_file_level.sol @@ -0,0 +1,6 @@ +using {add as +} for * global; + +function add(int, int) returns (int) {} +// ---- +// SyntaxError 8118: (0-30): The type has to be specified explicitly at file level (cannot use '*'). +// SyntaxError 2854: (0-30): Can only globally attach functions to specific types. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_attached_free_function.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_attached_free_function.sol new file mode 100644 index 000000000000..a04e81c31d98 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_attached_free_function.sol @@ -0,0 +1,9 @@ +type Int is uint; +using {f} for Int; + +Int constant v; +using {v.f as +} for Int global; + +function f(Int) pure returns (Int) {} +// ---- +// DeclarationError 9589: (61-64): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_abi_encode.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_abi_encode.sol new file mode 100644 index 000000000000..00889bc0932f --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_abi_encode.sol @@ -0,0 +1,8 @@ +type Int is int16; + +using {abi.encode as +} for Int global; + +function f(Int, Int) pure returns (Int) {} + +// ---- +// DeclarationError 9589: (27-37): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_keccak256.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_keccak256.sol new file mode 100644 index 000000000000..ee088624cd56 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_keccak256.sol @@ -0,0 +1,5 @@ +type Int is int16; + +using {keccak256 as +} for Int global; +// ---- +// TypeError 8187: (27-36): Expected function name. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_revert.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_revert.sol new file mode 100644 index 000000000000..daf4cab6ba24 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_builtin_revert.sol @@ -0,0 +1,5 @@ +type Int is int16; + +using {revert as +} for Int global; +// ---- +// DeclarationError 9589: (27-33): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_contract_function_at_contract_level.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_contract_function_at_contract_level.sol new file mode 100644 index 000000000000..309ea9558422 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_contract_function_at_contract_level.sol @@ -0,0 +1,9 @@ +type Int is int; + +contract C { + using {add as +} for Int; + + function add(Int, Int) public pure returns (Int) {} +} +// ---- +// TypeError 4167: (42-45): Only file-level functions and library functions can be attached to a type in a "using" statement diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_contract_function_at_file_level.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_contract_function_at_file_level.sol new file mode 100644 index 000000000000..969dd8094c06 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_contract_function_at_file_level.sol @@ -0,0 +1,11 @@ +type Int is int; + +using {C.add as +} for Int global; + +contract C { + function add(Int, Int) public pure returns (Int) { + return 0; + } +} +// ---- +// TypeError 4167: (25-30): Only file-level functions and library functions can be attached to a type in a "using" statement diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_error.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_error.sol new file mode 100644 index 000000000000..1bec8b44dfdb --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_error.sol @@ -0,0 +1,7 @@ +type Int is int16; + +using {IntError as +} for Int global; + +error IntError(Int a, Int b); +// ---- +// TypeError 8187: (27-35): Expected function name. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_event.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_event.sol new file mode 100644 index 000000000000..3a7b6423a583 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_event.sol @@ -0,0 +1,9 @@ +type Int is int16; + +using {C.IntEvent as +} for Int global; + +contract C { + event IntEvent(Int a, Int b); +} +// ---- +// TypeError 8187: (27-37): Expected function name. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_function_pointer.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_function_pointer.sol new file mode 100644 index 000000000000..834fe2d7d1c9 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_function_pointer.sol @@ -0,0 +1,8 @@ +type Int is int8; + +contract C { + function(Int, Int) external pure returns (Int) ptr; + using {ptr as +} for Int; +} +// ---- +// TypeError 8187: (99-102): Expected function name. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_function_shadowing_builtin_keccak256.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_function_shadowing_builtin_keccak256.sol new file mode 100644 index 000000000000..52f4e362da8d --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_function_shadowing_builtin_keccak256.sol @@ -0,0 +1,9 @@ +type Int is int16; + +using {keccak256 as +} for Int global; + +function keccak256(Int, Int) pure returns (Int) { + return Int.wrap(0); +} +// ---- +// Warning 2319: (60-135): This declaration shadows a builtin symbol. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library.sol new file mode 100644 index 000000000000..a6460da133bc --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library.sol @@ -0,0 +1,7 @@ +type Int is int16; + +using {L as +} for Int global; + +library L {} +// ---- +// TypeError 8187: (27-28): Expected function name. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_at_contract_level.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_at_contract_level.sol new file mode 100644 index 000000000000..889fc0eb27c6 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_at_contract_level.sol @@ -0,0 +1,113 @@ +==== Source: external.sol ==== +type Int is int128; + +library L { + function binaryOperator(Int, Int) external pure returns (Int) {} + function unaryOperator(Int) external pure returns (Int) {} + + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +contract C { + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +library X { + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +==== Source: internal.sol ==== +type Int is int128; + +library L { + function binaryOperator(Int, Int) internal pure returns (Int) {} + function unaryOperator(Int) internal pure returns (Int) {} + + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +contract C { + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +library X { + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +==== Source: private.sol ==== +type Int is int128; + +library L { + function binaryOperator(Int, Int) private pure returns (Int) {} + function unaryOperator(Int) private pure returns (Int) {} + + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} +==== Source: public.sol ==== +type Int is int128; + +library L { + function binaryOperator(Int, Int) public pure returns (Int) {} + function unaryOperator(Int) public pure returns (Int) {} + + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +contract C { + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +library X { + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} +// ---- +// TypeError 3320: (external.sol:177-193): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (external.sol:177-193): Only pure free functions can be used to define operators. +// TypeError 3320: (external.sol:220-235): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (external.sol:220-235): Only pure free functions can be used to define operators. +// TypeError 3320: (external.sol:278-294): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (external.sol:278-294): Only pure free functions can be used to define operators. +// TypeError 3320: (external.sol:321-336): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (external.sol:321-336): Only pure free functions can be used to define operators. +// TypeError 3320: (external.sol:378-394): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (external.sol:378-394): Only pure free functions can be used to define operators. +// TypeError 3320: (external.sol:421-436): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (external.sol:421-436): Only pure free functions can be used to define operators. +// TypeError 3320: (internal.sol:177-193): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (internal.sol:177-193): Only pure free functions can be used to define operators. +// TypeError 3320: (internal.sol:220-235): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (internal.sol:220-235): Only pure free functions can be used to define operators. +// TypeError 3320: (internal.sol:278-294): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (internal.sol:278-294): Only pure free functions can be used to define operators. +// TypeError 3320: (internal.sol:321-336): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (internal.sol:321-336): Only pure free functions can be used to define operators. +// TypeError 3320: (internal.sol:378-394): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (internal.sol:378-394): Only pure free functions can be used to define operators. +// TypeError 3320: (internal.sol:421-436): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (internal.sol:421-436): Only pure free functions can be used to define operators. +// TypeError 3320: (private.sol:175-191): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (private.sol:175-191): Only pure free functions can be used to define operators. +// TypeError 3320: (private.sol:218-233): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (private.sol:218-233): Only pure free functions can be used to define operators. +// TypeError 3320: (public.sol:173-189): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (public.sol:173-189): Only pure free functions can be used to define operators. +// TypeError 3320: (public.sol:216-231): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (public.sol:216-231): Only pure free functions can be used to define operators. +// TypeError 3320: (public.sol:274-290): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (public.sol:274-290): Only pure free functions can be used to define operators. +// TypeError 3320: (public.sol:317-332): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (public.sol:317-332): Only pure free functions can be used to define operators. +// TypeError 3320: (public.sol:374-390): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (public.sol:374-390): Only pure free functions can be used to define operators. +// TypeError 3320: (public.sol:417-432): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (public.sol:417-432): Only pure free functions can be used to define operators. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_at_file_level.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_at_file_level.sol new file mode 100644 index 000000000000..1e3c13aec2f2 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_at_file_level.sol @@ -0,0 +1,39 @@ +==== Source: external.sol ==== +type Int is int128; + +library L { + function binaryOperator(Int, Int) external pure returns (Int) {} + function unaryOperator(Int) external pure returns (Int) {} +} + +using {L.binaryOperator as +} for Int global; +using {L.unaryOperator as -} for Int global; + +==== Source: internal.sol ==== +type Int is int128; + +library L { + function binaryOperator(Int, Int) internal pure returns (Int) {} + function unaryOperator(Int) internal pure returns (Int) {} +} + +using {L.binaryOperator as +} for Int global; +using {L.unaryOperator as -} for Int global; + +==== Source: public.sol ==== +type Int is int128; + +library L { + function binaryOperator(Int, Int) public pure returns (Int) {} + function unaryOperator(Int) public pure returns (Int) {} +} + +using {L.binaryOperator as +} for Int global; +using {L.unaryOperator as -} for Int global; +// ---- +// TypeError 7775: (external.sol:175-191): Only pure free functions can be used to define operators. +// TypeError 7775: (external.sol:221-236): Only pure free functions can be used to define operators. +// TypeError 7775: (internal.sol:175-191): Only pure free functions can be used to define operators. +// TypeError 7775: (internal.sol:221-236): Only pure free functions can be used to define operators. +// TypeError 7775: (public.sol:171-187): Only pure free functions can be used to define operators. +// TypeError 7775: (public.sol:217-232): Only pure free functions can be used to define operators. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_private_outside_of_library.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_private_outside_of_library.sol new file mode 100644 index 000000000000..077330baf645 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_library_function_private_outside_of_library.sol @@ -0,0 +1,36 @@ +type Int is int128; + +library L { + function binaryOperator(Int, Int) private pure returns (Int) {} + function unaryOperator(Int) private pure returns (Int) {} +} + +using {L.binaryOperator as +} for Int global; +using {L.unaryOperator as -} for Int global; + +contract C { + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} + +library X { + using {L.binaryOperator as *} for Int; + using {L.unaryOperator as ~} for Int; +} +// ---- +// TypeError 6772: (173-189): Function "L.binaryOperator" is private and therefore cannot be attached to a type outside of the library where it is defined. +// TypeError 7775: (173-189): Only pure free functions can be used to define operators. +// TypeError 6772: (219-234): Function "L.unaryOperator" is private and therefore cannot be attached to a type outside of the library where it is defined. +// TypeError 7775: (219-234): Only pure free functions can be used to define operators. +// TypeError 6772: (282-298): Function "L.binaryOperator" is private and therefore cannot be attached to a type outside of the library where it is defined. +// TypeError 3320: (282-298): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (282-298): Only pure free functions can be used to define operators. +// TypeError 6772: (325-340): Function "L.unaryOperator" is private and therefore cannot be attached to a type outside of the library where it is defined. +// TypeError 3320: (325-340): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (325-340): Only pure free functions can be used to define operators. +// TypeError 6772: (382-398): Function "L.binaryOperator" is private and therefore cannot be attached to a type outside of the library where it is defined. +// TypeError 3320: (382-398): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (382-398): Only pure free functions can be used to define operators. +// TypeError 6772: (425-440): Function "L.unaryOperator" is private and therefore cannot be attached to a type outside of the library where it is defined. +// TypeError 3320: (425-440): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (425-440): Only pure free functions can be used to define operators. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_non_pure_function.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_non_pure_function.sol new file mode 100644 index 000000000000..e009fa03d949 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_non_pure_function.sol @@ -0,0 +1,12 @@ +using {add as +, sub as -, mul as *} for A global; + +function add(A, A) view returns (A) {} +function sub(A, A) returns (A) {} +function mul(A, A) payable returns (A) {} + +type A is address payable; +// ---- +// TypeError 7775: (7-10): Only pure free functions can be used to define operators. +// TypeError 7775: (17-20): Only pure free functions can be used to define operators. +// TypeError 7775: (27-30): Only pure free functions can be used to define operators. +// TypeError 9559: (125-166): Free functions cannot be payable. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_non_pure_function_on_built_in_type_non_global.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_non_pure_function_on_built_in_type_non_global.sol new file mode 100644 index 000000000000..15581a1c19c4 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_non_pure_function_on_built_in_type_non_global.sol @@ -0,0 +1,8 @@ +// This should point out all 3 errors, rather than give up after the first one. +using {add as +} for address; + +function add(address, address) view returns (address) {} +// ---- +// TypeError 3320: (87-90): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (87-90): Only pure free functions can be used to define operators. +// TypeError 5332: (87-90): Operators can only be implemented for user-defined value types. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_overloaded_function.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_overloaded_function.sol new file mode 100644 index 000000000000..ccddd3fa7c13 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_overloaded_function.sol @@ -0,0 +1,10 @@ +using {add as +} for A global; +using {add as +} for AP global; + +function add(A, A) pure returns (A) {} +function add(AP, AP) pure returns (AP) {} + +type A is address; +type AP is address payable; +// ---- +// DeclarationError 9589: (7-10): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_privately_overloaded_function.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_privately_overloaded_function.sol new file mode 100644 index 000000000000..d41db77db65c --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_privately_overloaded_function.sol @@ -0,0 +1,12 @@ +using {L.add as +} for A global; +using {L.add as +} for AP global; + +library L { + function add(A, A) private pure returns (A) {} + function add(AP, AP) internal pure returns (AP) {} +} + +type A is address; +type AP is address payable; +// ---- +// DeclarationError 9589: (7-12): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_unqualified_library_function_at_file_level.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_unqualified_library_function_at_file_level.sol new file mode 100644 index 000000000000..80793f68dc18 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_unqualified_library_function_at_file_level.sol @@ -0,0 +1,9 @@ +type B32 is bytes32; + +library L { + function publicOperator(B32, B32) public pure returns (B32) {} +} + +using {publicOperator as +} for B32 global; +// ---- +// DeclarationError 9589: (111-125): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_unqualified_library_function_in_library.sol b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_unqualified_library_function_in_library.sol new file mode 100644 index 000000000000..565aa6dc9afc --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/implementing_operator_with_unqualified_library_function_in_library.sol @@ -0,0 +1,22 @@ +type B32 is bytes32; + +library L { + using {externalOperator as +} for B32; + using {publicOperator as -} for B32; + using {internalOperator as *} for B32; + using {privateOperator as /} for B32; + + function externalOperator(B32, B32) external pure returns (B32) {} + function publicOperator(B32, B32) public pure returns (B32) {} + function internalOperator(B32, B32) internal pure returns (B32) {} + function privateOperator(B32, B32) private pure returns (B32) {} +} +// ---- +// TypeError 3320: (45-61): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (45-61): Only pure free functions can be used to define operators. +// TypeError 3320: (88-102): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (88-102): Only pure free functions can be used to define operators. +// TypeError 3320: (129-145): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (129-145): Only pure free functions can be used to define operators. +// TypeError 3320: (172-187): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (172-187): Only pure free functions can be used to define operators. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_global_and_non_global_different_files.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_global_and_non_global_different_files.sol new file mode 100644 index 000000000000..94769ee17f79 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_global_and_non_global_different_files.sol @@ -0,0 +1,20 @@ +==== Source: Int.sol ==== +type Int is int; + +using {add as +} for Int global; + +function add(Int, Int) pure returns (Int) {} + +==== Source: test.sol ==== +import "Int.sol"; + +using {anotherAdd as +} for Int; + +function anotherAdd(Int, Int) pure returns (Int) {} + +function test() pure returns (Int) { + return Int.wrap(0) + Int.wrap(0); +} +// ---- +// TypeError 3320: (test.sol:26-36): Operators can only be defined in a global 'using for' directive. +// TypeError 4705: (test.sol:26-36): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_global_non_global.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_global_non_global.sol new file mode 100644 index 000000000000..0b30e06ba8ea --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_global_non_global.sol @@ -0,0 +1,26 @@ +type Int is int; + +using {add as +} for Int global; +using {add2 as +} for Int; +using {unsub as -} for Int global; +using {unsub2 as -} for Int; + +function add(Int, Int) pure returns (Int) {} +function add2(Int, Int) pure returns (Int) {} +function unsub(Int) pure returns (Int) {} +function unsub2(Int) pure returns (Int) {} + +function testBinary() pure returns (Int) { + return Int.wrap(1) + Int.wrap(2); +} + +function testUnary() pure returns (Int) { + return -Int.wrap(2); +} +// ---- +// TypeError 4705: (25-28): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. +// TypeError 3320: (58-62): Operators can only be defined in a global 'using for' directive. +// TypeError 4705: (58-62): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. +// TypeError 4705: (85-90): User-defined unary operator - has more than one definition matching the operand type visible in the current scope. +// TypeError 3320: (120-126): Operators can only be defined in a global 'using for' directive. +// TypeError 4705: (120-126): User-defined unary operator - has more than one definition matching the operand type visible in the current scope. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_non_global_and_global_different_files.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_non_global_and_global_different_files.sol new file mode 100644 index 000000000000..2d6e47a8fbc1 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_non_global_and_global_different_files.sol @@ -0,0 +1,20 @@ +==== Source: Int.sol ==== +type Int is int; + +using {add as +} for Int; + +function add(Int, Int) pure returns (Int) {} + +==== Source: test.sol ==== +import "Int.sol"; + +using {anotherAdd as +} for Int global; + +function anotherAdd(Int, Int) pure returns (Int) {} + +function test() pure returns (Int) { + return Int.wrap(0) + Int.wrap(0); +} +// ---- +// TypeError 3320: (Int.sol:25-28): Operators can only be defined in a global 'using for' directive. +// TypeError 4117: (test.sol:19-58): Can only use "global" with types defined in the same source unit at file level. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_same_directive.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_same_directive.sol new file mode 100644 index 000000000000..4972deef1f3c --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_same_directive.sol @@ -0,0 +1,13 @@ +type Int is uint128; + +using {add as +, sub as +} for Int global; + +function add(Int, Int) pure returns (Int) {} +function sub(Int, Int) pure returns (Int) {} + +function test() { + Int.wrap(0) + Int.wrap(1); +} +// ---- +// TypeError 4705: (29-32): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. +// TypeError 4705: (39-42): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_same_directive_operator_not_used.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_same_directive_operator_not_used.sol new file mode 100644 index 000000000000..ec4274c7b84a --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_different_functions_same_directive_operator_not_used.sol @@ -0,0 +1,15 @@ +type Int is uint128; + +// Still an error, even if the operator is not actually used +using {add1 as +, add2 as +} for Int global; +using {unsub1 as -, unsub2 as -} for Int global; + +function add1(Int, Int) pure returns (Int) {} +function add2(Int, Int) pure returns (Int) {} +function unsub1(Int) pure returns (Int) {} +function unsub2(Int) pure returns (Int) {} +// ---- +// TypeError 4705: (90-94): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. +// TypeError 4705: (101-105): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. +// TypeError 4705: (135-141): User-defined unary operator - has more than one definition matching the operand type visible in the current scope. +// TypeError 4705: (148-154): User-defined unary operator - has more than one definition matching the operand type visible in the current scope. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_on_file_and_contract_level.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_on_file_and_contract_level.sol new file mode 100644 index 000000000000..bb517ca7bf67 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_on_file_and_contract_level.sol @@ -0,0 +1,23 @@ +type Int is int; + +using {add as +} for Int global; + +function add(Int, Int) pure returns (Int) {} +function another_add(Int, Int) pure returns (Int) {} + +contract B { + using {another_add as +} for Int; + + function f() public { + Int.wrap(0) + Int.wrap(0); + } +} + +contract C is B { + function g() public { + Int.wrap(0) + Int.wrap(0); + } +} +// ---- +// TypeError 3320: (175-186): Operators can only be defined in a global 'using for' directive. +// TypeError 4705: (175-186): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_different_levels_free_function.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_different_levels_free_function.sol new file mode 100644 index 000000000000..4cd956ba3058 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_different_levels_free_function.sol @@ -0,0 +1,19 @@ +type Int is int; + +function add(Int, Int) pure returns (Int) {} +function unsub(Int) pure returns (Int) {} + +using {add as +, unsub as -} for Int global; + +contract C { + using {add as +, unsub as -} for Int; +} + +library X { + using {add as +, unsub as -} for Int; +} +// ---- +// TypeError 3320: (176-179): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (186-191): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (233-236): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (243-248): Operators can only be defined in a global 'using for' directive. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_different_levels_library_function.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_different_levels_library_function.sol new file mode 100644 index 000000000000..9fd4c73312fb --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_different_levels_library_function.sol @@ -0,0 +1,38 @@ +type Int is int; + +library L { + using {add as +, unsub as -} for Int; + using {L.add as +, L.unsub as -} for Int; + + function add(Int, Int) internal pure returns (Int) {} + function unsub(Int) internal pure returns (Int) {} +} + +using {L.add as +, L.unsub as -} for Int global; + +contract C { + using {L.add as +, L.unsub as -} for Int; +} + +library X { + using {L.add as +, L.unsub as -} for Int; +} +// ---- +// TypeError 3320: (41-44): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (41-44): Only pure free functions can be used to define operators. +// TypeError 3320: (51-56): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (51-56): Only pure free functions can be used to define operators. +// TypeError 3320: (83-88): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (83-88): Only pure free functions can be used to define operators. +// TypeError 3320: (95-102): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (95-102): Only pure free functions can be used to define operators. +// TypeError 7775: (242-247): Only pure free functions can be used to define operators. +// TypeError 7775: (254-261): Only pure free functions can be used to define operators. +// TypeError 3320: (309-314): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (309-314): Only pure free functions can be used to define operators. +// TypeError 3320: (321-328): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (321-328): Only pure free functions can be used to define operators. +// TypeError 3320: (370-375): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (370-375): Only pure free functions can be used to define operators. +// TypeError 3320: (382-389): Operators can only be defined in a global 'using for' directive. +// TypeError 7775: (382-389): Only pure free functions can be used to define operators. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_same_directive.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_same_directive.sol new file mode 100644 index 000000000000..9bb4d62362f3 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_same_directive.sol @@ -0,0 +1,9 @@ +type Int is int32; + +using {add as +, add as +} for Int global; + +function add(Int, Int) pure returns(Int) {} + +function f(int32 a, int32 b) pure { + Int.wrap(a) + Int.wrap(b); +} diff --git a/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_separate_directives.sol b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_separate_directives.sol new file mode 100644 index 000000000000..d2a648e78db9 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/multiple_operator_definitions_same_function_separate_directives.sol @@ -0,0 +1,10 @@ +type Int is int32; + +using {add as +} for Int global; +using {add as +} for Int global; + +function add(Int, Int) pure returns(Int) {} + +function f(int32 a, int32 b) pure { + Int.wrap(a) + Int.wrap(b); +} diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_overloading.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_overloading.sol new file mode 100644 index 000000000000..e7b0a76428ed --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_overloading.sol @@ -0,0 +1,14 @@ +type Int is uint128; + +using {add as +, add128 as +} for Int global; + +function add(Int, Int) pure returns (Int) {} +function add128(Int, int128) pure returns (Int) {} + +function test() { + Int.wrap(0) + Int.wrap(1); +} +// ---- +// TypeError 4705: (29-32): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. +// TypeError 1884: (129-142): Wrong parameters in operator definition. The function "add128" needs to have two parameters of type Int and the same data location to be used for the operator +. +// TypeError 4705: (39-45): User-defined binary operator + has more than one definition matching the operand type visible in the current scope. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_function_name_missing.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_function_name_missing.sol new file mode 100644 index 000000000000..5911fc6535fc --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_function_name_missing.sol @@ -0,0 +1,3 @@ +using {as -} for uint global; +// ---- +// ParserError 2314: (7-9): Expected identifier but got 'as' diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_no_brace.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_no_brace.sol new file mode 100644 index 000000000000..1a1be262a007 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_no_brace.sol @@ -0,0 +1,3 @@ +using f as - for uint global; +// ---- +// ParserError 2314: (8-10): Expected 'for' but got 'as' diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_non_user_definable.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_non_user_definable.sol new file mode 100644 index 000000000000..ed4fb13a48d3 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_non_user_definable.sol @@ -0,0 +1,45 @@ +using { + f as new, + f as delete, + f as **, + f as <<, + f as >>, + f as &&, + f as ||, + f as !, + f as =, + f as |=, + f as ^=, + f as &=, + f as <<=, + f as >>=, + f as +=, + f as -=, + f as *=, + f as /=, + f as %=, + f as ++, + f as -- +} for int256 global; +// ---- +// ParserError 4403: (17-20): Not a user-definable operator: new. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (31-37): Not a user-definable operator: delete. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (48-50): Not a user-definable operator: **. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (61-63): Not a user-definable operator: <<. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (74-76): Not a user-definable operator: >>. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (87-89): Not a user-definable operator: &&. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (100-102): Not a user-definable operator: ||. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (113-114): Not a user-definable operator: !. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (125-126): Not a user-definable operator: =. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (137-139): Not a user-definable operator: |=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (150-152): Not a user-definable operator: ^=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (163-165): Not a user-definable operator: &=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (176-179): Not a user-definable operator: <<=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (190-193): Not a user-definable operator: >>=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (204-206): Not a user-definable operator: +=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (217-219): Not a user-definable operator: -=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (230-232): Not a user-definable operator: *=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (243-245): Not a user-definable operator: /=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (256-258): Not a user-definable operator: %=. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (269-271): Not a user-definable operator: ++. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (282-284): Not a user-definable operator: --. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_not_an_operator.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_not_an_operator.sol new file mode 100644 index 000000000000..7fa8c5eeb141 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_not_an_operator.sol @@ -0,0 +1,14 @@ +using { + f as x, + f as operator, + f as as, + f as 123, + f as () +} for int256 global; +// ---- +// ParserError 4403: (17-18): Not a user-definable operator: x. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (29-37): Not a user-definable operator: operator. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (48-50): Not a user-definable operator: as. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (61-64): Not a user-definable operator: 123. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (75-76): Not a user-definable operator: (. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 2314: (76-77): Expected '}' but got ')' diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_name_empty_string.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_name_empty_string.sol new file mode 100644 index 000000000000..8435de6d9399 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_name_empty_string.sol @@ -0,0 +1,7 @@ +using {f as ''} for uint; +using {f as ""} for int; +using {f as hex""} for address; +// ---- +// ParserError 4403: (12-14): Not a user-definable operator: . Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (38-40): Not a user-definable operator: . Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 4403: (63-68): Not a user-definable operator: . Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_name_missing.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_name_missing.sol new file mode 100644 index 000000000000..a6970a9b82aa --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_name_missing.sol @@ -0,0 +1,4 @@ +using {f as} for uint global; +// ---- +// ParserError 4403: (11-12): Not a user-definable operator: }. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= +// ParserError 2314: (13-16): Expected '}' but got 'for' diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_named_as.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_named_as.sol new file mode 100644 index 000000000000..5266931894a4 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_parsing_operator_named_as.sol @@ -0,0 +1,3 @@ +using {f as as} for uint global; +// ---- +// ParserError 4403: (12-14): Not a user-definable operator: as. Only the following operators can be user-defined: |, &, ^, ~, +, -, *, /, %, ==, !=, <, >, <=, >= diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_returning_wrong_types.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_returning_wrong_types.sol new file mode 100644 index 000000000000..676f2c475ba4 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_returning_wrong_types.sol @@ -0,0 +1,33 @@ +type Int is int256; + +using { + add as +, + div as /, + unsub as -, + bitnot as ~, + gt as >, + lt as < +} for Int global; + +function add(Int x, Int y) pure returns (int256) {} +function div(Int x, Int y) pure {} +function unsub(Int) pure returns (Int, Int) {} +function bitnot(Int) pure returns (int256) {} +function gt(Int, Int) pure returns (Int) {} +function lt(Int, Int) pure returns (bool, Int) {} + +function f() pure { + Int.wrap(0) + Int.wrap(1); + Int.wrap(0) / Int.wrap(0); + -Int.wrap(0); + ~Int.wrap(0); + Int.wrap(0) < Int.wrap(0); + Int.wrap(0) > Int.wrap(0); +} +// ---- +// TypeError 7743: (174-182): Wrong return parameters in operator definition. The function "add" needs to return exactly one value of type Int to be used for the operator +. +// TypeError 7743: (218-218): Wrong return parameters in operator definition. The function "div" needs to return exactly one value of type Int to be used for the operator /. +// TypeError 7743: (254-264): Wrong return parameters in operator definition. The function "unsub" needs to return exactly one value of type Int to be used for the operator -. +// TypeError 7743: (302-310): Wrong return parameters in operator definition. The function "bitnot" needs to return exactly one value of type Int to be used for the operator ~. +// TypeError 7743: (349-354): Wrong return parameters in operator definition. The function "gt" needs to return exactly one value of type bool to be used for the operator >. +// TypeError 7743: (393-404): Wrong return parameters in operator definition. The function "lt" needs to return exactly one value of type bool to be used for the operator <. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_and_returning_types_not_matching_using_for.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_and_returning_types_not_matching_using_for.sol new file mode 100644 index 000000000000..1d034c8ec3af --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_and_returning_types_not_matching_using_for.sol @@ -0,0 +1,26 @@ +type Int is int256; + +using { + add as +, + sub as -, + div as / +} for Int global; + +function add(Int) pure returns (Int) {} +function sub(Int, Int, Int) pure returns (Int) {} +function div(int256, int256) pure returns (Int) {} + +function f() pure { + Int.wrap(0) + Int.wrap(1); + Int.wrap(0) - Int.wrap(0); + Int.wrap(0) / Int.wrap(0); +} + +// ---- +// TypeError 1884: (101-106): Wrong parameters in operator definition. The function "add" needs to have two parameters of type Int and the same data location to be used for the operator +. +// TypeError 1884: (141-156): Wrong parameters in operator definition. The function "sub" needs to have one or two parameters of type Int and the same data location to be used for the operator -. +// TypeError 1884: (191-207): Wrong parameters in operator definition. The function "div" needs to have one or two parameters of type Int and the same data location to be used for the operator /. +// TypeError 7743: (221-226): Wrong return parameters in operator definition. The function "div" needs to return a value of the same type and data location as its parameters to be used for the operator /. +// TypeError 2271: (255-280): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 2271: (286-311): Built-in binary operator - cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 2271: (317-342): Built-in binary operator / cannot be applied to types Int and Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_no_parameters_binary.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_no_parameters_binary.sol new file mode 100644 index 000000000000..ffd35cc1daed --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_no_parameters_binary.sol @@ -0,0 +1,11 @@ +type Int is int; + +using { + f as + +} for Int global; + +function f() returns (Int) { + return Int.wrap(0); +} +// ---- +// TypeError 4731: (30-31): The function "f" does not have any parameters, and therefore cannot be attached to the type "Int". diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_no_parameters_unary.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_no_parameters_unary.sol new file mode 100644 index 000000000000..323b564494cd --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_no_parameters_unary.sol @@ -0,0 +1,11 @@ +type Int is int; + +using { + f as ~ +} for Int global; + +function f() returns (Int) { + return Int.wrap(0); +} +// ---- +// TypeError 4731: (30-31): The function "f" does not have any parameters, and therefore cannot be attached to the type "Int". diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_or_returning_different_types.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_or_returning_different_types.sol new file mode 100644 index 000000000000..c254ad04a1d3 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_or_returning_different_types.sol @@ -0,0 +1,20 @@ +type Int is int128; + +using { + add as +, + sub as -, + mul as *, + div as / +} for Int global; + +function add(Int, int128) pure returns (Int) {} +function sub(int128, Int) pure returns (int128) {} +function mul(int128, int256) pure returns (Int) {} +function div(Int, Int) pure returns (int256) {} +// ---- +// TypeError 1884: (115-128): Wrong parameters in operator definition. The function "add" needs to have two parameters of type Int and the same data location to be used for the operator +. +// TypeError 1884: (163-176): Wrong parameters in operator definition. The function "sub" needs to have one or two parameters of type Int and the same data location to be used for the operator -. +// TypeError 7743: (190-198): Wrong return parameters in operator definition. The function "sub" needs to return exactly one value of type Int to be used for the operator -. +// TypeError 1884: (214-230): Wrong parameters in operator definition. The function "mul" needs to have two parameters of type Int and the same data location to be used for the operator *. +// TypeError 7743: (244-249): Wrong return parameters in operator definition. The function "mul" needs to return a value of the same type and data location as its parameters to be used for the operator *. +// TypeError 7743: (289-297): Wrong return parameters in operator definition. The function "div" needs to return exactly one value of type Int to be used for the operator /. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_two_parameters_unary.sol b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_two_parameters_unary.sol new file mode 100644 index 000000000000..81d4546239e1 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/operator_taking_two_parameters_unary.sol @@ -0,0 +1,14 @@ +type Int is int128; + +using {bitnot as ~} for Int global; + +function bitnot(Int, Int) pure returns (Int) {} + +contract C { + function test() public pure { + ~Int.wrap(1); + } +} +// ---- +// TypeError 1884: (73-83): Wrong parameters in operator definition. The function "bitnot" needs to have exactly one parameter of type Int to be used for the operator ~. +// TypeError 4907: (162-174): Built-in unary operator ~ cannot be applied to type Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_attaching_functions_and_defining_operators_same_directive.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_attaching_functions_and_defining_operators_same_directive.sol new file mode 100644 index 000000000000..612c377e9de7 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_attaching_functions_and_defining_operators_same_directive.sol @@ -0,0 +1,10 @@ +type AP is address payable; + +function sub(AP, AP) pure returns (AP) {} +function unsub(AP) pure returns (AP) {} + +function attachedPure(AP, uint, address) pure {} +function attachedView(AP) view {} +function attached(AP, function(AP)) {} + +using {sub as -, attachedPure, attachedView, unsub as -, attached} for AP global; diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_for_contract_level_type.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_for_contract_level_type.sol new file mode 100644 index 000000000000..9b7f80054f15 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_for_contract_level_type.sol @@ -0,0 +1,19 @@ +library L { + type FixedBytes is bytes10; +} + +function add(L.FixedBytes, L.FixedBytes) pure returns (L.FixedBytes) {} +function unsub(L.FixedBytes, L.FixedBytes) pure returns (L.FixedBytes) {} + +library LX { + using {add as +, unsub as -} for L.FixedBytes; +} + +contract CX { + using {add as +, unsub as -} for L.FixedBytes; +} +// ---- +// TypeError 3320: (218-221): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (228-233): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (286-289): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (296-301): Operators can only be defined in a global 'using for' directive. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_global.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_global.sol new file mode 100644 index 000000000000..c99fd0e684c1 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_global.sol @@ -0,0 +1,13 @@ +type Int is int16; + +function add(Int, Int) pure returns (Int) {} + +contract C { + using {add as +} for Int global; + + function test() pure public { + Int.wrap(0) + Int.wrap(0); + } +} +// ---- +// SyntaxError 3367: (83-115): "global" can only be used at file level. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_global_different_file.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_global_different_file.sol new file mode 100644 index 000000000000..d4f9d9ac1039 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_global_different_file.sol @@ -0,0 +1,13 @@ +==== Source: s1.sol ==== +type Int is int; + +==== Source: s2.sol ==== +import "s1.sol"; + +function bitnot(Int) pure returns (Int) {} + +contract C { + using {bitnot as ~} for Int global; +} +// ---- +// SyntaxError 3367: (s2.sol:79-114): "global" can only be used at file level. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_in_base_contract.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_in_base_contract.sol new file mode 100644 index 000000000000..17351599f9df --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_in_base_contract.sol @@ -0,0 +1,30 @@ +type Int is int128; + +function add(Int, Int) pure returns (Int) {} +function another_add(Int, Int) pure returns (Int) {} + +contract B { + using {add as +} for Int; + + function f() pure public returns (Int) { + return Int.wrap(0) + Int.wrap(0); + } +} + +contract C is B { + using {another_add as +} for Int; + + function g() pure public returns (Int) { + return Int.wrap(0) + Int.wrap(0); + } +} + +contract D is B { + function h() pure public returns (Int) { + return Int.wrap(0) + Int.wrap(0); + } +} +// ---- +// TypeError 3320: (144-147): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (289-300): Operators can only be defined in a global 'using for' directive. +// TypeError 2271: (491-516): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_in_interface.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_in_interface.sol new file mode 100644 index 000000000000..46dbee9708d6 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_contract_level_in_interface.sol @@ -0,0 +1,10 @@ +type Int is int; + +function add(Int, Int) pure returns (Int) {} + +interface I { + using {add as +} for Int; +} +// ---- +// SyntaxError 9088: (82-107): The "using for" directive is not allowed inside interfaces. +// TypeError 3320: (89-92): Operators can only be defined in a global 'using for' directive. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_for_contract_level_type.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_for_contract_level_type.sol new file mode 100644 index 000000000000..6efae72fe8d0 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_for_contract_level_type.sol @@ -0,0 +1,27 @@ +library L { + type FixedBytes is bytes1; +} + +contract C { + type FixedBytes is bytes2; +} + +interface I { + type FixedBytes is bytes3; +} + +function addL(L.FixedBytes, L.FixedBytes) pure returns (L.FixedBytes) {} +function addC(C.FixedBytes, C.FixedBytes) pure returns (C.FixedBytes) {} +function addI(I.FixedBytes, I.FixedBytes) pure returns (I.FixedBytes) {} + +function unsubL(L.FixedBytes) pure returns (L.FixedBytes) {} +function unsubC(C.FixedBytes) pure returns (C.FixedBytes) {} +function unsubI(I.FixedBytes) pure returns (I.FixedBytes) {} + +using {addL as +, unsubL as -} for L.FixedBytes global; +using {addC as +, unsubC as -} for C.FixedBytes global; +using {addI as +, unsubI as -} for I.FixedBytes global; +// ---- +// TypeError 4117: (545-600): Can only use "global" with types defined in the same source unit at file level. +// TypeError 4117: (601-656): Can only use "global" with types defined in the same source unit at file level. +// TypeError 4117: (657-712): Can only use "global" with types defined in the same source unit at file level. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_for_contract_level_type_non_global.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_for_contract_level_type_non_global.sol new file mode 100644 index 000000000000..fa0e467ebae6 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_for_contract_level_type_non_global.sol @@ -0,0 +1,30 @@ +library L { + type FixedBytes is bytes1; +} + +contract C { + type FixedBytes is bytes2; +} + +interface I { + type FixedBytes is bytes3; +} + +function addL(L.FixedBytes, L.FixedBytes) pure returns (L.FixedBytes) {} +function addC(C.FixedBytes, C.FixedBytes) pure returns (C.FixedBytes) {} +function addI(I.FixedBytes, I.FixedBytes) pure returns (I.FixedBytes) {} + +function unsubL(L.FixedBytes) pure returns (L.FixedBytes) {} +function unsubC(C.FixedBytes) pure returns (C.FixedBytes) {} +function unsubI(I.FixedBytes) pure returns (I.FixedBytes) {} + +using {addL as +, unsubL as -} for L.FixedBytes; +using {addC as +, unsubC as -} for C.FixedBytes; +using {addI as +, unsubI as -} for I.FixedBytes; +// ---- +// TypeError 3320: (552-556): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (563-569): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (601-605): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (612-618): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (650-654): Operators can only be defined in a global 'using for' directive. +// TypeError 3320: (661-667): Operators can only be defined in a global 'using for' directive. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_and_non_global.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_and_non_global.sol new file mode 100644 index 000000000000..b04934d96cb9 --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_and_non_global.sol @@ -0,0 +1,23 @@ +==== Source: s1.sol ==== +type Int is int; + +using {add as +} for Int global; +using {add as +} for Int; + +function add(Int a, Int b) pure returns (Int) {} +function test_add() pure returns (Int) {} + +==== Source: s2.sol ==== +import "s1.sol"; + +contract C2 { + function test1() pure public returns (Int) { + return test_add(); + } + + function test2() pure public returns (Int) { + return Int.wrap(3) + Int.wrap(4); + } +} +// ---- +// TypeError 3320: (s1.sol:58-61): Operators can only be defined in a global 'using for' directive. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_different_file.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_different_file.sol new file mode 100644 index 000000000000..7eda376e369c --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_different_file.sol @@ -0,0 +1,11 @@ +==== Source: s1.sol ==== +type Int is int; + +==== Source: s2.sol ==== +import "s1.sol"; + +function bitnot(Int) pure returns (Int) {} + +using {bitnot as ~} for Int global; +// ---- +// TypeError 4117: (s2.sol:62-97): Can only use "global" with types defined in the same source unit at file level. diff --git a/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_unary_and_non_global_binary_same_file.sol b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_unary_and_non_global_binary_same_file.sol new file mode 100644 index 000000000000..68f61988673f --- /dev/null +++ b/test/libsolidity/syntaxTests/operators/userDefined/using_for_with_operator_at_file_level_global_unary_and_non_global_binary_same_file.sol @@ -0,0 +1,20 @@ +type Int is int16; + +using {unsub as -} for Int global; +using {sub as -} for Int; + +function sub(Int a, Int b) pure returns (Int) {} + +function unsub(Int a) pure returns (Int) {} + +contract C { + function test_sub() public pure returns (Int) { + return Int.wrap(7) - Int.wrap(2); + } + + function test_unsub() public pure returns (Int) { + return -Int.wrap(4); + } +} +// ---- +// TypeError 3320: (62-65): Operators can only be defined in a global 'using for' directive. diff --git a/test/libsolidity/syntaxTests/parsing/invalid_variable_named_unicode.sol b/test/libsolidity/syntaxTests/parsing/invalid_variable_named_unicode.sol new file mode 100644 index 000000000000..0180ebf73ebc --- /dev/null +++ b/test/libsolidity/syntaxTests/parsing/invalid_variable_named_unicode.sol @@ -0,0 +1,6 @@ +contract C +{ + string unicode = "abc"; +} +// ---- +// ParserError 2314: (24-31): Expected identifier but got 'ILLEGAL' diff --git a/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol b/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol index 41384d98f6db..527c9450b121 100644 --- a/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol +++ b/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol @@ -5,5 +5,4 @@ contract test { } } // ---- -// SyntaxError 9636: (70-72): Use of unary + is disallowed. -// TypeError 4907: (70-72): Built-in unary operator + cannot be applied to type uint256. +// ParserError 9636: (70-71): Use of unary + is disallowed. diff --git a/test/libsolidity/syntaxTests/scoping/external_library_function_inside_scope.sol b/test/libsolidity/syntaxTests/scoping/external_library_function_inside_scope.sol new file mode 100644 index 000000000000..647e5b416e73 --- /dev/null +++ b/test/libsolidity/syntaxTests/scoping/external_library_function_inside_scope.sol @@ -0,0 +1,9 @@ +library L { + function externalFunction(uint) external pure {} + function f() public pure { + uint x; + externalFunction(x); + } +} +// ---- +// DeclarationError 7576: (120-136): Undeclared identifier. "externalFunction" is not (or not yet) visible at this point. diff --git a/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol b/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol index 049fca27416e..f44ca63fd1fb 100644 --- a/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol +++ b/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol @@ -11,4 +11,4 @@ contract SomeContract { } // ---- // DeclarationError 2333: (106-145): Identifier already declared. -// TypeError 5704: (185-195): Type is not callable +// TypeError 5704: (185-195): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/shifts/shift_singed_rvalue.sol b/test/libsolidity/syntaxTests/shifts/shift_signed_rvalue.sol similarity index 100% rename from test/libsolidity/syntaxTests/shifts/shift_singed_rvalue.sol rename to test/libsolidity/syntaxTests/shifts/shift_signed_rvalue.sol diff --git a/test/libsolidity/syntaxTests/bytecode_too_large.sol b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large.sol similarity index 99% rename from test/libsolidity/syntaxTests/bytecode_too_large.sol rename to test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large.sol index 1b4d02ecb9aa..36aa0c076022 100644 --- a/test/libsolidity/syntaxTests/bytecode_too_large.sol +++ b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large.sol @@ -7,6 +7,6 @@ contract test { } } // ==== -// EVMVersion: >byzantium +// EVMVersion: >=shanghai // ---- -// Warning 5574: (21-27154): Contract code size is 27192 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (21-27154): Contract code size is 27186 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libsolidity/syntaxTests/bytecode_too_large_abiencoder_v1.sol b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_abiencoder_v1.sol similarity index 99% rename from test/libsolidity/syntaxTests/bytecode_too_large_abiencoder_v1.sol rename to test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_abiencoder_v1.sol index df74ef7651e1..a0c7267d0d20 100644 --- a/test/libsolidity/syntaxTests/bytecode_too_large_abiencoder_v1.sol +++ b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_abiencoder_v1.sol @@ -7,6 +7,6 @@ contract test { } } // ==== -// EVMVersion: >byzantium +// EVMVersion: >=shanghai // ---- -// Warning 5574: (21-27154): Contract code size is 27209 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (21-27154): Contract code size is 27205 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libsolidity/syntaxTests/bytecode_too_large_byzantium.sol b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_byzantium.sol similarity index 100% rename from test/libsolidity/syntaxTests/bytecode_too_large_byzantium.sol rename to test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_byzantium.sol diff --git a/test/libsolidity/syntaxTests/bytecode_too_large_homestead.sol b/test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_homestead.sol similarity index 100% rename from test/libsolidity/syntaxTests/bytecode_too_large_homestead.sol rename to test/libsolidity/syntaxTests/sizeLimits/bytecode_too_large_homestead.sol diff --git a/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_paris.sol b/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_paris.sol new file mode 100644 index 000000000000..82a3415d0cbe --- /dev/null +++ b/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_paris.sol @@ -0,0 +1,31 @@ +contract A { + function f() public pure returns (string memory ret) { + // 27000 bytes long data + ret = "........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"; + } +} + +contract B is A { + function g() public pure returns (bool) { + return true; + } +} + +contract C is A { + function g() public pure returns (bool) { + return false; + } +} + +contract test { + constructor() { + new B(); + new C(); + } +} +// ==== +// EVMVersion: =paris +// ---- +// Warning 5574: (0-27130): Contract code size is 27192 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (27132-27224): Contract code size is 27218 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (27226-27319): Contract code size is 27218 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_shanghai.sol b/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_shanghai.sol new file mode 100644 index 000000000000..4854b0a64a5e --- /dev/null +++ b/test/libsolidity/syntaxTests/sizeLimits/combined_too_large_shanghai.sol @@ -0,0 +1,32 @@ +contract A { + function f() public pure returns (string memory ret) { + // 27000 bytes long data + ret = "........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"; + } +} + +contract B is A { + function g() public pure returns (bool) { + return true; + } +} + +contract C is A { + function g() public pure returns (bool) { + return false; + } +} + +contract test { + constructor() { + new B(); + new C(); + } +} +// ==== +// EVMVersion: =shanghai +// ---- +// Warning 5574: (0-27130): Contract code size is 27186 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (27132-27224): Contract code size is 27212 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 5574: (27226-27319): Contract code size is 27211 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. +// Warning 3860: (27321-27398): Contract initcode size is 54626 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_paris.sol b/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_paris.sol new file mode 100644 index 000000000000..cbfa944666fc --- /dev/null +++ b/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_paris.sol @@ -0,0 +1,29 @@ +contract A { + function f() public pure returns (string memory ret) { + // 20000 bytes long data + ret = "................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"; + } +} + +contract B is A { + function g() public pure returns (bool) { + return true; + } +} + +contract C is A { + function g() public pure returns (bool) { + return false; + } +} + +contract test { + constructor() { + new A(); + new B(); + new C(); + } +} +// ==== +// EVMVersion: =paris +// ---- diff --git a/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_shanghai.sol b/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_shanghai.sol new file mode 100644 index 000000000000..1f648c630ea2 --- /dev/null +++ b/test/libsolidity/syntaxTests/sizeLimits/initcode_too_large_shanghai.sol @@ -0,0 +1,30 @@ +contract A { + function f() public pure returns (string memory ret) { + // 20000 bytes long data + ret = "................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"; + } +} + +contract B is A { + function g() public pure returns (bool) { + return true; + } +} + +contract C is A { + function g() public pure returns (bool) { + return false; + } +} + +contract test { + constructor() { + new A(); + new B(); + new C(); + } +} +// ==== +// EVMVersion: =shanghai +// ---- +// Warning 3860: (20321-20415): Contract initcode size is 60893 bytes and exceeds 49152 bytes (a limit introduced in Shanghai). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries. diff --git a/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol b/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol index a251b3a9b337..b4bbb73675d8 100644 --- a/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol +++ b/test/libsolidity/syntaxTests/tupleAssignments/double_storage_crash.sol @@ -7,4 +7,4 @@ contract CrashContract { } } // ---- -// TypeError 5704: (170-177): Type is not callable +// TypeError 5704: (170-177): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/types/function_call_fail.sol b/test/libsolidity/syntaxTests/types/function_call_fail.sol index 7e2d0b2302ff..67631bc2bf7e 100644 --- a/test/libsolidity/syntaxTests/types/function_call_fail.sol +++ b/test/libsolidity/syntaxTests/types/function_call_fail.sol @@ -4,4 +4,4 @@ contract C { } } // ---- -// TypeError 5704: (59-63): Type is not callable +// TypeError 5704: (59-63): This expression is not callable. diff --git a/test/libsolidity/syntaxTests/userDefinedValueType/all_value_types.sol b/test/libsolidity/syntaxTests/userDefinedValueType/all_value_types.sol index 3388c19760cd..e1d453007ae8 100644 --- a/test/libsolidity/syntaxTests/userDefinedValueType/all_value_types.sol +++ b/test/libsolidity/syntaxTests/userDefinedValueType/all_value_types.sol @@ -4,7 +4,8 @@ type MyInt is int; type MyUInt is uint; type MyInt128 is int128; type MyUInt128 is uint128; -// TODO add fixed point type, when it's implemented +type MyFixed is fixed; +type MyUfixed is ufixed; type MyFixedBytes32 is bytes32; type MyFixedBytes1 is bytes1; type MyBool is bool; diff --git a/test/libsolidity/syntaxTests/userDefinedValueType/non_value_type_enum_err.sol b/test/libsolidity/syntaxTests/userDefinedValueType/non_value_type_enum_err.sol new file mode 100644 index 000000000000..f143bc509312 --- /dev/null +++ b/test/libsolidity/syntaxTests/userDefinedValueType/non_value_type_enum_err.sol @@ -0,0 +1,5 @@ +enum E {A, B, C} + +type MyType is E; +// ---- +// TypeError 8657: (33-34): The underlying type for a user defined value type has to be an elementary value type. diff --git a/test/libsolidity/syntaxTests/using/external_function_qualified_with_this.sol b/test/libsolidity/syntaxTests/using/external_function_qualified_with_this.sol new file mode 100644 index 000000000000..2f4007605b59 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/external_function_qualified_with_this.sol @@ -0,0 +1,7 @@ +contract C { + using {this.contractFunction} for uint; + + function contractFunction(uint) external view {} +} +// ---- +// DeclarationError 9589: (24-45): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/using/free_functions_non_unique_err.sol b/test/libsolidity/syntaxTests/using/free_functions_non_unique_err.sol index 7536dff07f76..7404b0d9beb8 100644 --- a/test/libsolidity/syntaxTests/using/free_functions_non_unique_err.sol +++ b/test/libsolidity/syntaxTests/using/free_functions_non_unique_err.sol @@ -9,4 +9,4 @@ contract C { using {id} for uint256; } // ---- -// DeclarationError 7920: (145-147): Identifier not found or not unique. +// DeclarationError 9589: (145-147): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/using/free_overloads.sol b/test/libsolidity/syntaxTests/using/free_overloads.sol index 28a8e69ed1ce..e05580d5fb1e 100644 --- a/test/libsolidity/syntaxTests/using/free_overloads.sol +++ b/test/libsolidity/syntaxTests/using/free_overloads.sol @@ -7,4 +7,4 @@ function f(int8 storage x) pure returns (int) { using {f} for uint8; using {f} for int; // ---- -// DeclarationError 7920: (132-133): Identifier not found or not unique. +// DeclarationError 9589: (132-133): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/using/free_overloads_array.sol b/test/libsolidity/syntaxTests/using/free_overloads_array.sol index 91b807397112..cab3eccf2467 100644 --- a/test/libsolidity/syntaxTests/using/free_overloads_array.sol +++ b/test/libsolidity/syntaxTests/using/free_overloads_array.sol @@ -6,4 +6,4 @@ function f(uint x, uint y) pure returns (int) { } using {f} for uint; // ---- -// DeclarationError 7920: (138-139): Identifier not found or not unique. +// DeclarationError 9589: (138-139): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/using/function_from_base_contract_qualified_with_super.sol b/test/libsolidity/syntaxTests/using/function_from_base_contract_qualified_with_super.sol new file mode 100644 index 000000000000..a162912cad20 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/function_from_base_contract_qualified_with_super.sol @@ -0,0 +1,9 @@ +contract C { + function baseFunction(uint) public pure {} +} + +contract D is C { + using {super.baseFunction} for uint; +} +// ---- +// DeclarationError 9589: (92-110): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/using/function_name_without_braces_at_file_level_err.sol b/test/libsolidity/syntaxTests/using/function_name_without_braces_at_file_level_err.sol new file mode 100644 index 000000000000..85d591fd47b4 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/function_name_without_braces_at_file_level_err.sol @@ -0,0 +1,11 @@ +function f(uint x) pure { } + +using f for uint; + +contract C { + function g(uint x) public pure { + x.f(); + } +} +// ---- +// TypeError 4357: (35-36): Library name expected. If you want to attach a function, use '{...}'. diff --git a/test/libsolidity/syntaxTests/using/function_name_without_braces_inside_contract_err.sol b/test/libsolidity/syntaxTests/using/function_name_without_braces_inside_contract_err.sol new file mode 100644 index 000000000000..003137381785 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/function_name_without_braces_inside_contract_err.sol @@ -0,0 +1,10 @@ +function f(uint x) pure { } + +contract C { + using f for uint; + function g(uint x) public pure { + x.f(); + } +} +// ---- +// TypeError 4357: (52-53): Library name expected. If you want to attach a function, use '{...}'. diff --git a/test/libsolidity/syntaxTests/using/interface_function_at_file_level.sol b/test/libsolidity/syntaxTests/using/interface_function_at_file_level.sol new file mode 100644 index 000000000000..9a9ee26f6111 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/interface_function_at_file_level.sol @@ -0,0 +1,7 @@ +interface I { + function g() external pure; +} + +using {I.g} for uint; +// ---- +// TypeError 4167: (56-59): Only file-level functions and library functions can be attached to a type in a "using" statement diff --git a/test/libsolidity/syntaxTests/using/interface_function_inside_contract.sol b/test/libsolidity/syntaxTests/using/interface_function_inside_contract.sol new file mode 100644 index 000000000000..f01788ff5170 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/interface_function_inside_contract.sol @@ -0,0 +1,9 @@ +interface I { + function g() external pure; +} + +contract C { + using {I.g} for uint; +} +// ---- +// TypeError 4167: (73-76): Only file-level functions and library functions can be attached to a type in a "using" statement diff --git a/test/libsolidity/syntaxTests/using/library_at_file_level.sol b/test/libsolidity/syntaxTests/using/library_at_file_level.sol new file mode 100644 index 000000000000..9cb1965a0864 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/library_at_file_level.sol @@ -0,0 +1,17 @@ +library L { + function externalFunction(uint) external pure {} + function publicFunction(uint) public pure {} + function internalFunction(uint) internal pure {} +} + +using L for uint; + +contract C { + function f() public pure { + uint x; + x.externalFunction(); + x.publicFunction(); + x.internalFunction(); + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/using/library_functions_at_file_level.sol b/test/libsolidity/syntaxTests/using/library_functions_at_file_level.sol new file mode 100644 index 000000000000..2876f591a09c --- /dev/null +++ b/test/libsolidity/syntaxTests/using/library_functions_at_file_level.sol @@ -0,0 +1,19 @@ +library L { + function externalFunction(uint) external pure {} + function publicFunction(uint) public pure {} + function internalFunction(uint) internal pure {} +} + +using {L.externalFunction} for uint; +using {L.publicFunction} for uint; +using {L.internalFunction} for uint; + +contract C { + function f() public pure { + uint x; + x.externalFunction(); + x.publicFunction(); + x.internalFunction(); + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/using/library_functions_attached_at_file_level_used_inside_library.sol b/test/libsolidity/syntaxTests/using/library_functions_attached_at_file_level_used_inside_library.sol new file mode 100644 index 000000000000..21d30f557294 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/library_functions_attached_at_file_level_used_inside_library.sol @@ -0,0 +1,17 @@ +using {L.externalFunction, L.publicFunction, L.internalFunction} for uint; + +library L { + function externalFunction(uint) external pure {} + function publicFunction(uint) public pure {} + function internalFunction(uint) internal pure {} + + function f() public pure { + uint x; + x.externalFunction(); + x.publicFunction(); + x.internalFunction(); + } +} +// ---- +// TypeError 6700: (299-319): Libraries cannot call their own functions externally. +// TypeError 6700: (329-347): Libraries cannot call their own functions externally. diff --git a/test/libsolidity/syntaxTests/using/library_functions_attached_in_single_directive_at_file_level.sol b/test/libsolidity/syntaxTests/using/library_functions_attached_in_single_directive_at_file_level.sol new file mode 100644 index 000000000000..bb191faa6449 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/library_functions_attached_in_single_directive_at_file_level.sol @@ -0,0 +1,17 @@ +library L { + function externalFunction(uint) external pure {} + function publicFunction(uint) public pure {} + function internalFunction(uint) internal pure {} +} + +using {L.externalFunction, L.publicFunction, L.internalFunction} for uint; + +contract C { + function f() public pure { + uint x; + x.externalFunction(); + x.publicFunction(); + x.internalFunction(); + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/using/library_functions_attached_in_single_directive_inside_contract.sol b/test/libsolidity/syntaxTests/using/library_functions_attached_in_single_directive_inside_contract.sol new file mode 100644 index 000000000000..300a3480d38c --- /dev/null +++ b/test/libsolidity/syntaxTests/using/library_functions_attached_in_single_directive_inside_contract.sol @@ -0,0 +1,17 @@ +library L { + function externalFunction(uint) external pure {} + function publicFunction(uint) public pure {} + function internalFunction(uint) internal pure {} +} + +contract C { + using {L.externalFunction, L.publicFunction, L.internalFunction} for uint; + + function f() public pure { + uint x; + x.externalFunction(); + x.publicFunction(); + x.internalFunction(); + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/using/library_functions_inside_contract.sol b/test/libsolidity/syntaxTests/using/library_functions_inside_contract.sol new file mode 100644 index 000000000000..46d4c571d6d4 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/library_functions_inside_contract.sol @@ -0,0 +1,19 @@ +library L { + function externalFunction(uint) external pure {} + function publicFunction(uint) public pure {} + function internalFunction(uint) internal pure {} +} + +contract C { + using {L.externalFunction} for uint; + using {L.publicFunction} for uint; + using {L.internalFunction} for uint; + + function f() public pure { + uint x; + x.externalFunction(); + x.publicFunction(); + x.internalFunction(); + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/using/library_inside_contract.sol b/test/libsolidity/syntaxTests/using/library_inside_contract.sol new file mode 100644 index 000000000000..cd7f8fd19386 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/library_inside_contract.sol @@ -0,0 +1,17 @@ +library L { + function externalFunction(uint) external pure {} + function publicFunction(uint) public pure {} + function internalFunction(uint) internal pure {} +} + +contract C { + using L for uint; + + function f() public pure { + uint x; + x.externalFunction(); + x.publicFunction(); + x.internalFunction(); + } +} +// ---- diff --git a/test/libsolidity/syntaxTests/using/library_non_free_external_function_err.sol b/test/libsolidity/syntaxTests/using/library_non_free_external_function_err.sol index 76d53cf90cf4..0a51043db2ad 100644 --- a/test/libsolidity/syntaxTests/using/library_non_free_external_function_err.sol +++ b/test/libsolidity/syntaxTests/using/library_non_free_external_function_err.sol @@ -11,4 +11,4 @@ contract C { } } // ---- -// DeclarationError 7920: (115-123): Identifier not found or not unique. +// TypeError 4357: (115-123): Library name expected. If you want to attach a function, use '{...}'. diff --git a/test/libsolidity/syntaxTests/using/module_identifier_not_found.sol b/test/libsolidity/syntaxTests/using/module_identifier_not_found.sol index ef1688b22915..2526d216f252 100644 --- a/test/libsolidity/syntaxTests/using/module_identifier_not_found.sol +++ b/test/libsolidity/syntaxTests/using/module_identifier_not_found.sol @@ -10,4 +10,4 @@ contract C { using { id } for uint; } // ---- -// DeclarationError 7920: (B:43-45): Identifier not found or not unique. +// DeclarationError 9589: (B:43-45): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/using/public_state_variable_getter.sol b/test/libsolidity/syntaxTests/using/public_state_variable_getter.sol new file mode 100644 index 000000000000..9223a92a5daa --- /dev/null +++ b/test/libsolidity/syntaxTests/using/public_state_variable_getter.sol @@ -0,0 +1,11 @@ +contract A { + uint public data; +} + +contract C { + A a = new A(); + + using {a.data} for uint; +} +// ---- +// DeclarationError 9589: (82-88): Identifier is not a function name or not unique. diff --git a/test/libsolidity/syntaxTests/using/undeclared_library.sol b/test/libsolidity/syntaxTests/using/undeclared_library.sol new file mode 100644 index 000000000000..c2174cc6c124 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/undeclared_library.sol @@ -0,0 +1,3 @@ +using L for uint; +// ---- +// DeclarationError 9589: (6-7): Identifier is not a library name. diff --git a/test/libsolidity/syntaxTests/using/unqualified_library_functions_attached_in_single_directive_inside_library.sol b/test/libsolidity/syntaxTests/using/unqualified_library_functions_attached_in_single_directive_inside_library.sol new file mode 100644 index 000000000000..7403dcf28247 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/unqualified_library_functions_attached_in_single_directive_inside_library.sol @@ -0,0 +1,19 @@ +library L { + function externalFunction(uint) external pure {} + function publicFunction(uint) public pure {} + function internalFunction(uint) internal pure {} + function privateFunction(uint) private pure {} + + using {externalFunction, publicFunction, internalFunction, privateFunction} for uint; + + function f() public pure { + uint x; + x.externalFunction(); + x.publicFunction(); + x.internalFunction(); + x.privateFunction(); + } +} +// ---- +// TypeError 6700: (365-385): Libraries cannot call their own functions externally. +// TypeError 6700: (395-413): Libraries cannot call their own functions externally. diff --git a/test/libsolidity/syntaxTests/using/using_for_enum.sol b/test/libsolidity/syntaxTests/using/using_for_enum.sol new file mode 100644 index 000000000000..e7c6b5c820f1 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/using_for_enum.sol @@ -0,0 +1,5 @@ +enum E {A, B, C} + +function f(E) {} + +using {f} for E; diff --git a/test/libsolidity/syntaxTests/viewPureChecker/user_operator_with_pure_modifier_can_be_restricted.sol b/test/libsolidity/syntaxTests/viewPureChecker/user_operator_with_pure_modifier_can_be_restricted.sol new file mode 100644 index 000000000000..eb7ce354dc6e --- /dev/null +++ b/test/libsolidity/syntaxTests/viewPureChecker/user_operator_with_pure_modifier_can_be_restricted.sol @@ -0,0 +1,20 @@ +type Int is uint8; + +using {add as +} for Int global; + +function add(Int, Int) pure returns (Int) {} + +function f() pure { + Int.wrap(0) + Int.wrap(1); +} + +function g() view { + Int.wrap(0) + Int.wrap(1); +} + +function h() { + Int.wrap(0) + Int.wrap(1); +} +// ---- +// Warning 2018: (154-206): Function state mutability can be restricted to pure +// Warning 2018: (208-255): Function state mutability can be restricted to pure diff --git a/test/libyul/EVMCodeTransformTest.cpp b/test/libyul/EVMCodeTransformTest.cpp index 73042b18b68a..257893ad5f70 100644 --- a/test/libyul/EVMCodeTransformTest.cpp +++ b/test/libyul/EVMCodeTransformTest.cpp @@ -41,7 +41,7 @@ using namespace solidity::frontend::test; using namespace std; EVMCodeTransformTest::EVMCodeTransformTest(string const& _filename): - TestCase(_filename) + EVMVersionRestrictedTestCase(_filename) { m_source = m_reader.source(); m_stackOpt = m_reader.boolSetting("stackOptimization", false); diff --git a/test/libyul/EVMCodeTransformTest.h b/test/libyul/EVMCodeTransformTest.h index f1ae73f7426b..9926d43a9023 100644 --- a/test/libyul/EVMCodeTransformTest.h +++ b/test/libyul/EVMCodeTransformTest.h @@ -23,7 +23,7 @@ namespace solidity::yul::test { -class EVMCodeTransformTest: public solidity::frontend::test::TestCase +class EVMCodeTransformTest: public solidity::frontend::test::EVMVersionRestrictedTestCase { public: static std::unique_ptr create(Config const& _config) diff --git a/test/libyul/KnowledgeBaseTest.cpp b/test/libyul/KnowledgeBaseTest.cpp index ec2f0313d18e..7cb5a8ae3c05 100644 --- a/test/libyul/KnowledgeBaseTest.cpp +++ b/test/libyul/KnowledgeBaseTest.cpp @@ -58,7 +58,7 @@ class KnowledgeBaseTest for (auto const& [name, expression]: m_ssaValues.values()) m_values[name].value = expression; - return KnowledgeBase(m_dialect, [this](YulString _var) { return util::valueOrNullptr(m_values, _var); }); + return KnowledgeBase([this](YulString _var) { return util::valueOrNullptr(m_values, _var); }); } EVMDialect m_dialect{EVMVersion{}, true}; @@ -83,9 +83,11 @@ BOOST_AUTO_TEST_CASE(basic) BOOST_CHECK(!kb.knownToBeDifferent("a"_yulstring, "b"_yulstring)); // This only works if the variable names are the same. // It assumes that SSA+CSE+Simplifier actually replaces the variables. - BOOST_CHECK(!kb.knownToBeEqual("a"_yulstring, "b"_yulstring)); BOOST_CHECK(!kb.valueIfKnownConstant("a"_yulstring)); BOOST_CHECK(kb.valueIfKnownConstant("zero"_yulstring) == u256(0)); + BOOST_CHECK(kb.differenceIfKnownConstant("a"_yulstring, "b"_yulstring) == u256(0)); + BOOST_CHECK(kb.differenceIfKnownConstant("a"_yulstring, "c"_yulstring) == u256(0)); + BOOST_CHECK(kb.valueIfKnownConstant("e"_yulstring) == u256(0)); } BOOST_AUTO_TEST_CASE(difference) @@ -94,7 +96,7 @@ BOOST_AUTO_TEST_CASE(difference) let a := calldataload(0) let b := add(a, 200) let c := add(a, 220) - let d := add(c, 12) + let d := add(12, c) let e := sub(c, 12) })"); diff --git a/test/libyul/StackShufflingTest.cpp b/test/libyul/StackShufflingTest.cpp index 2a2c2174900b..35130c11b122 100644 --- a/test/libyul/StackShufflingTest.cpp +++ b/test/libyul/StackShufflingTest.cpp @@ -14,41 +14,166 @@ You should have received a copy of the GNU General Public License along with solidity. If not, see . */ -/** - * Unit tests for stack shuffling. - */ + +#include + +#include +#include #include -#include -using namespace std; +using namespace solidity::util; using namespace solidity::langutil; +using namespace solidity::yul; +using namespace solidity::yul::test; +using namespace std; -namespace solidity::yul::test +bool StackShufflingTest::parse(string const& _source) { + CharStream stream(_source, ""); + Scanner scanner(stream); -BOOST_AUTO_TEST_SUITE(YulStackShuffling) + auto expectToken = [&](Token _token) + { + soltestAssert( + scanner.next() == _token, + "Invalid token. Expected: \"" + TokenTraits::friendlyName(_token) + "\"." + ); + }; -BOOST_AUTO_TEST_CASE(swap_cycle) -{ - std::vector scopeVariables; - Scope::Function function; - std::vector v; - for (size_t i = 0; i < 17; ++i) - scopeVariables.emplace_back(Scope::Variable{""_yulstring, YulString{"v" + to_string(i)}}); - for (size_t i = 0; i < 17; ++i) - v.emplace_back(VariableSlot{scopeVariables[i]}); - - Stack sourceStack{ - v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[9], v[10], v[11], v[12], v[13], v[14], v[15], v[16], - FunctionReturnLabelSlot{function}, FunctionReturnLabelSlot{function}, v[5]}; - Stack targetStack{ - v[1], v[0], v[2], v[3], v[4], v[5], v[6], v[7], v[9], v[10], v[11], v[12], v[13], v[14], v[15], v[16], - FunctionReturnLabelSlot{function}, JunkSlot{}, JunkSlot{} + auto parseStack = [&](Stack& stack) -> bool + { + if (scanner.currentToken() != Token::LBrack) + return false; + scanner.next(); + while (scanner.currentToken() != Token::RBrack && + scanner.currentToken() != Token::EOS) + { + string literal = scanner.currentLiteral(); + if (literal == "RET") + { + scanner.next(); + if (scanner.currentToken() == Token::LBrack) + { + scanner.next(); + string functionName = scanner.currentLiteral(); + auto call = yul::FunctionCall{ + {}, yul::Identifier{{}, YulString(functionName)}, {} + }; + stack.emplace_back(FunctionCallReturnLabelSlot{ + m_functions.insert( + make_pair(functionName, call) + ).first->second + }); + expectToken(Token::RBrack); + } + else + { + static Scope::Function function; + stack.emplace_back(FunctionReturnLabelSlot{function}); + continue; + } + } + else if (literal == "TMP") + { + expectToken(Token::LBrack); + scanner.next(); + string functionName = scanner.currentLiteral(); + auto call = yul::FunctionCall{ + {}, yul::Identifier{{}, YulString(functionName)}, {} + }; + expectToken(Token::Comma); + scanner.next(); + size_t index = size_t(atoi(scanner.currentLiteral().c_str())); + stack.emplace_back(TemporarySlot{ + m_functions.insert(make_pair(functionName, call)).first->second, + index + }); + expectToken(Token::RBrack); + } + else if (literal.find("0x") != string::npos || scanner.currentToken() == Token::Number) + { + stack.emplace_back(LiteralSlot{u256(literal)}); + } + else if (literal == "JUNK") + { + stack.emplace_back(JunkSlot()); + } + else if (literal == "GHOST") + { + expectToken(Token::LBrack); + scanner.next(); // read number of ghost variables as ghostVariableId + string ghostVariableId = scanner.currentLiteral(); + Scope::Variable ghostVar = Scope::Variable{""_yulstring, YulString(literal + "[" + ghostVariableId + "]")}; + stack.emplace_back(VariableSlot{ + m_variables.insert(make_pair(ghostVar.name, ghostVar)).first->second + }); + expectToken(Token::RBrack); + } + else + { + Scope::Variable var = Scope::Variable{""_yulstring, YulString(literal)}; + stack.emplace_back(VariableSlot{ + m_variables.insert( + make_pair(literal, var) + ).first->second + }); + } + scanner.next(); + } + return scanner.currentToken() == Token::RBrack; }; - // Used to hit a swapping cycle. - createStackLayout(sourceStack, targetStack, [](auto){}, [](auto){}, [](){}); + + if (!parseStack(m_sourceStack)) + return false; + scanner.next(); + return parseStack(m_targetStack); } -BOOST_AUTO_TEST_SUITE_END() +StackShufflingTest::StackShufflingTest(string const& _filename): + TestCase(_filename) +{ + m_source = m_reader.source(); + m_expectation = m_reader.simpleExpectations(); +} + +TestCase::TestResult StackShufflingTest::run(ostream& _stream, string const& _linePrefix, bool _formatted) +{ + if (!parse(m_source)) + { + AnsiColorized(_stream, _formatted, {formatting::BOLD, formatting::RED}) << _linePrefix << "Error parsing source." << endl; + return TestResult::FatalError; + } + + ostringstream output; + createStackLayout( + m_sourceStack, + m_targetStack, + [&](unsigned _swapDepth) // swap + { + output << stackToString(m_sourceStack) << endl; + output << "SWAP" << _swapDepth << endl; + }, + [&](StackSlot const& _slot) // dupOrPush + { + output << stackToString(m_sourceStack) << endl; + if (canBeFreelyGenerated(_slot)) + output << "PUSH " << stackSlotToString(_slot) << endl; + else + { + if (auto depth = util::findOffset(m_sourceStack | ranges::views::reverse, _slot)) + output << "DUP" << *depth + 1 << endl; + else + BOOST_THROW_EXCEPTION(runtime_error("Invalid DUP operation.")); + } + }, + [&](){ // pop + output << stackToString(m_sourceStack) << endl; + output << "POP" << endl; + } + ); + + output << stackToString(m_sourceStack) << endl; + m_obtainedResult = output.str(); + return checkResult(_stream, _linePrefix, _formatted); } diff --git a/test/libyul/StackShufflingTest.h b/test/libyul/StackShufflingTest.h new file mode 100644 index 000000000000..75715d25b90f --- /dev/null +++ b/test/libyul/StackShufflingTest.h @@ -0,0 +1,47 @@ +/* + This file is part of solidity. + + solidity is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + solidity is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with solidity. If not, see . +*/ +// SPDX-License-Identifier: GPL-3.0 + +#pragma once + +#include + +#include + +using namespace solidity::frontend::test; + +namespace solidity::yul::test +{ + +class StackShufflingTest: public TestCase +{ +public: + static std::unique_ptr create(Config const& _config) + { + return std::make_unique(_config.filename); + } + explicit StackShufflingTest(std::string const& _filename); + TestResult run(std::ostream& _stream, std::string const& _linePrefix = "", bool const _formatted = false) override; +private: + bool parse(std::string const& _source); + + Stack m_sourceStack; + Stack m_targetStack; + std::map m_functions; + std::map m_variables; +}; +} diff --git a/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse_without_retparams.yul b/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse_without_retparams.yul index 385c253df5f1..b5cc611879ec 100644 --- a/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse_without_retparams.yul +++ b/test/libyul/evmCodeTransform/stackReuse/function_argument_reuse_without_retparams.yul @@ -6,6 +6,7 @@ } // ==== // stackOptimization: true +// EVMVersion: >=shanghai // ---- // /* "":0:88 */ // stop @@ -33,5 +34,5 @@ // dup1 // sstore // /* "":66:82 */ -// codesize +// 0x00 // jump(tag_3) diff --git a/test/libyul/objectCompiler/datacopy.yul b/test/libyul/objectCompiler/datacopy.yul index b6ec642f0622..a5fbfb7b0bcb 100644 --- a/test/libyul/objectCompiler/datacopy.yul +++ b/test/libyul/objectCompiler/datacopy.yul @@ -45,6 +45,6 @@ object "a" { // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 600a600d600039600a6000f3fe60008055600d600052fe -// Opcodes: PUSH1 0xA PUSH1 0xD PUSH1 0x0 CODECOPY PUSH1 0xA PUSH1 0x0 RETURN INVALID PUSH1 0x0 DUP1 SSTORE PUSH1 0xD PUSH1 0x0 MSTORE INVALID +// Bytecode: 6008600b5f3960085ff3fe5f8055600d5f52fe +// Opcodes: PUSH1 0x8 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x8 PUSH0 RETURN INVALID PUSH0 DUP1 SSTORE PUSH1 0xD PUSH0 MSTORE INVALID // SourceMappings: 57:15:0:-:0;38:17;35:1;26:47;88:15;85:1;78:26 diff --git a/test/libyul/objectCompiler/dataoffset_code.yul b/test/libyul/objectCompiler/dataoffset_code.yul index 00184feab8d6..e363ec7c6129 100644 --- a/test/libyul/objectCompiler/dataoffset_code.yul +++ b/test/libyul/objectCompiler/dataoffset_code.yul @@ -25,6 +25,6 @@ object "a" { // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 6006600055fe6008600055fe -// Opcodes: PUSH1 0x6 PUSH1 0x0 SSTORE INVALID PUSH1 0x8 PUSH1 0x0 SSTORE INVALID +// Bytecode: 60055f55fe60085f55fe +// Opcodes: PUSH1 0x5 PUSH0 SSTORE INVALID PUSH1 0x8 PUSH0 SSTORE INVALID // SourceMappings: 32:17:0:-:0;29:1;22:28 diff --git a/test/libyul/objectCompiler/dataoffset_data.yul b/test/libyul/objectCompiler/dataoffset_data.yul index bc066c802c75..2bb68e8a8a90 100644 --- a/test/libyul/objectCompiler/dataoffset_data.yul +++ b/test/libyul/objectCompiler/dataoffset_data.yul @@ -12,6 +12,6 @@ object "a" { // sstore // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 6006600055fe48656c6c6f2c20576f726c6421 -// Opcodes: PUSH1 0x6 PUSH1 0x0 SSTORE INVALID BASEFEE PUSH6 0x6C6C6F2C2057 PUSH16 0x726C6421000000000000000000000000 +// Bytecode: 60055f55fe48656c6c6f2c20576f726c6421 +// Opcodes: PUSH1 0x5 PUSH0 SSTORE INVALID BASEFEE PUSH6 0x6C6C6F2C2057 PUSH16 0x726C6421000000000000000000000000 // SourceMappings: 32:19:0:-:0;29:1;22:30 diff --git a/test/libyul/objectCompiler/dataoffset_self.yul b/test/libyul/objectCompiler/dataoffset_self.yul index 163cd75742db..e56097ab573c 100644 --- a/test/libyul/objectCompiler/dataoffset_self.yul +++ b/test/libyul/objectCompiler/dataoffset_self.yul @@ -12,6 +12,6 @@ object "a" { // sstore // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 60008055fe -// Opcodes: PUSH1 0x0 DUP1 SSTORE INVALID +// Bytecode: 5f8055fe +// Opcodes: PUSH0 DUP1 SSTORE INVALID // SourceMappings: 32:15:0:-:0;29:1;22:26 diff --git a/test/libyul/objectCompiler/datasize_code.yul b/test/libyul/objectCompiler/datasize_code.yul index fc26e4eb99cc..0a379cb33aa8 100644 --- a/test/libyul/objectCompiler/datasize_code.yul +++ b/test/libyul/objectCompiler/datasize_code.yul @@ -25,6 +25,6 @@ object "a" { // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 6006600055fe -// Opcodes: PUSH1 0x6 PUSH1 0x0 SSTORE INVALID +// Bytecode: 60055f55fe +// Opcodes: PUSH1 0x5 PUSH0 SSTORE INVALID // SourceMappings: 32:15:0:-:0;29:1;22:26 diff --git a/test/libyul/objectCompiler/datasize_data.yul b/test/libyul/objectCompiler/datasize_data.yul index a9ba7b0271f8..815e78fe4fa4 100644 --- a/test/libyul/objectCompiler/datasize_data.yul +++ b/test/libyul/objectCompiler/datasize_data.yul @@ -12,6 +12,6 @@ object "a" { // sstore // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 600d600055fe -// Opcodes: PUSH1 0xD PUSH1 0x0 SSTORE INVALID +// Bytecode: 600d5f55fe +// Opcodes: PUSH1 0xD PUSH0 SSTORE INVALID // SourceMappings: 32:17:0:-:0;29:1;22:28 diff --git a/test/libyul/objectCompiler/datasize_self.yul b/test/libyul/objectCompiler/datasize_self.yul index d4a3c8d06116..178e3a948246 100644 --- a/test/libyul/objectCompiler/datasize_self.yul +++ b/test/libyul/objectCompiler/datasize_self.yul @@ -12,6 +12,6 @@ object "a" { // sstore // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 6006600055fe -// Opcodes: PUSH1 0x6 PUSH1 0x0 SSTORE INVALID +// Bytecode: 60055f55fe +// Opcodes: PUSH1 0x5 PUSH0 SSTORE INVALID // SourceMappings: 32:13:0:-:0;29:1;22:24 diff --git a/test/libyul/objectCompiler/function_series.yul b/test/libyul/objectCompiler/function_series.yul index f905c04b5831..10a018160a81 100644 --- a/test/libyul/objectCompiler/function_series.yul +++ b/test/libyul/objectCompiler/function_series.yul @@ -26,6 +26,6 @@ object "Contract" { // 0x00 // /* "source":73:85 */ // sstore -// Bytecode: 6009565b5b565b5b565b6001600055 -// Opcodes: PUSH1 0x9 JUMP JUMPDEST JUMPDEST JUMP JUMPDEST JUMPDEST JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SSTORE +// Bytecode: 6009565b5b565b5b565b60015f55 +// Opcodes: PUSH1 0x9 JUMP JUMPDEST JUMPDEST JUMP JUMPDEST JUMPDEST JUMP JUMPDEST PUSH1 0x1 PUSH0 SSTORE // SourceMappings: 33:15:0:-:0;;;;:::o;53:::-;;:::o;:::-;83:1;80;73:12 diff --git a/test/libyul/objectCompiler/immutable_long_name_does_not_end_up_in_bytecode.yul b/test/libyul/objectCompiler/immutable_long_name_does_not_end_up_in_bytecode.yul index dcc41e7a0c23..e991dc6b7bd1 100644 --- a/test/libyul/objectCompiler/immutable_long_name_does_not_end_up_in_bytecode.yul +++ b/test/libyul/objectCompiler/immutable_long_name_does_not_end_up_in_bytecode.yul @@ -15,6 +15,6 @@ object "a" { // 0x00 // /* "source":32:219 */ // assignImmutable("0x85a5b1db611c82c46f5fa18e39ae218397536256c451e5de155a86de843a9ad6") -// Bytecode: 73123456789012345678901234567890123456789060005050 -// Opcodes: PUSH20 0x1234567890123456789012345678901234567890 PUSH1 0x0 POP POP +// Bytecode: 7312345678901234567890123456789012345678905f5050 +// Opcodes: PUSH20 0x1234567890123456789012345678901234567890 PUSH0 POP POP // SourceMappings: 167:42:0:-:0;58:1;32:187; diff --git a/test/libyul/objectCompiler/linkersymbol.yul b/test/libyul/objectCompiler/linkersymbol.yul index 9dac37448718..a28ee23e23e0 100644 --- a/test/libyul/objectCompiler/linkersymbol.yul +++ b/test/libyul/objectCompiler/linkersymbol.yul @@ -38,6 +38,6 @@ object "a" { // /* "source":22:187 */ // pop // pop -// Bytecode: 7300000000000000000000000000000000000000006318530aaf60e31b60805260006080600460806000855af15050 -// Opcodes: PUSH20 0x0 PUSH4 0x18530AAF PUSH1 0xE3 SHL PUSH1 0x80 MSTORE PUSH1 0x0 PUSH1 0x80 PUSH1 0x4 PUSH1 0x80 PUSH1 0x0 DUP6 GAS CALL POP POP +// Bytecode: 7300000000000000000000000000000000000000006318530aaf60e31b6080525f6080600460805f855af15050 +// Opcodes: PUSH20 0x0 PUSH4 0x18530AAF PUSH1 0xE3 SHL PUSH1 0x80 MSTORE PUSH0 PUSH1 0x80 PUSH1 0x4 PUSH1 0x80 PUSH0 DUP6 GAS CALL POP POP // SourceMappings: 44:35:0:-:0;109:10;104:3;100:20;95:3;88:33;179:1;174:3;171:1;166:3;163:1;157:4;150:5;145:36;22:165; diff --git a/test/libyul/objectCompiler/long_object_name.yul b/test/libyul/objectCompiler/long_object_name.yul index 67ef5e4072eb..aa2dd1ac2eee 100644 --- a/test/libyul/objectCompiler/long_object_name.yul +++ b/test/libyul/objectCompiler/long_object_name.yul @@ -24,6 +24,6 @@ object "t" { // /* "source":272:274 */ // stop // } -// Bytecode: 600160005500fe -// Opcodes: PUSH1 0x1 PUSH1 0x0 SSTORE STOP INVALID +// Bytecode: 60015f5500fe +// Opcodes: PUSH1 0x1 PUSH0 SSTORE STOP INVALID // SourceMappings: 33:113:0:-:0;30:1;23:124;19:131 diff --git a/test/libyul/objectCompiler/metadata.yul b/test/libyul/objectCompiler/metadata.yul index ac66e4bdaaaa..5a75507ba129 100644 --- a/test/libyul/objectCompiler/metadata.yul +++ b/test/libyul/objectCompiler/metadata.yul @@ -62,6 +62,6 @@ object "A" { // } // // auxdata: 0x4d32 -// Bytecode: 600e600381600055806020555050fe4d32 -// Opcodes: PUSH1 0xE PUSH1 0x3 DUP2 PUSH1 0x0 SSTORE DUP1 PUSH1 0x20 SSTORE POP POP INVALID 0x4D ORIGIN +// Bytecode: 600e6003815f55806020555050fe4d32 +// Opcodes: PUSH1 0xE PUSH1 0x3 DUP2 PUSH0 SSTORE DUP1 PUSH1 0x20 SSTORE POP POP INVALID 0x4D ORIGIN // SourceMappings: 35:13:0:-:0;62;90:1;87;80:12;108:1;104:2;97:13;20:94; diff --git a/test/libyul/objectCompiler/namedObjectCode.yul b/test/libyul/objectCompiler/namedObjectCode.yul index b13bdae5e0fd..f9e97bec4af3 100644 --- a/test/libyul/objectCompiler/namedObjectCode.yul +++ b/test/libyul/objectCompiler/namedObjectCode.yul @@ -9,6 +9,6 @@ object "a" { // 0x00 // /* "source":22:34 */ // sstore -// Bytecode: 6001600055 -// Opcodes: PUSH1 0x1 PUSH1 0x0 SSTORE +// Bytecode: 60015f55 +// Opcodes: PUSH1 0x1 PUSH0 SSTORE // SourceMappings: 32:1:0:-:0;29;22:12 diff --git a/test/libyul/objectCompiler/nested_optimizer.yul b/test/libyul/objectCompiler/nested_optimizer.yul index 7b972286f42b..cde1210ff885 100644 --- a/test/libyul/objectCompiler/nested_optimizer.yul +++ b/test/libyul/objectCompiler/nested_optimizer.yul @@ -40,6 +40,6 @@ object "a" { // /* "source":158:279 */ // stop // } -// Bytecode: 600080355500fe -// Opcodes: PUSH1 0x0 DUP1 CALLDATALOAD SSTORE STOP INVALID +// Bytecode: 5f80355500fe +// Opcodes: PUSH0 DUP1 CALLDATALOAD SSTORE STOP INVALID // SourceMappings: 48:1:0:-:0;35:15;;107:20;20:111 diff --git a/test/libyul/objectCompiler/simple.yul b/test/libyul/objectCompiler/simple.yul index 3e7d1859f337..d94b53de9020 100644 --- a/test/libyul/objectCompiler/simple.yul +++ b/test/libyul/objectCompiler/simple.yul @@ -9,6 +9,6 @@ // 0x00 // /* "source":4:16 */ // sstore -// Bytecode: 6001600055 -// Opcodes: PUSH1 0x1 PUSH1 0x0 SSTORE +// Bytecode: 60015f55 +// Opcodes: PUSH1 0x1 PUSH0 SSTORE // SourceMappings: 14:1:0:-:0;11;4:12 diff --git a/test/libyul/objectCompiler/simple_optimizer.yul b/test/libyul/objectCompiler/simple_optimizer.yul index 47fa6553ab3f..3ce4b7a4bb41 100644 --- a/test/libyul/objectCompiler/simple_optimizer.yul +++ b/test/libyul/objectCompiler/simple_optimizer.yul @@ -17,6 +17,6 @@ // sstore // /* "source":0:101 */ // stop -// Bytecode: 600080355500 -// Opcodes: PUSH1 0x0 DUP1 CALLDATALOAD SSTORE STOP +// Bytecode: 5f80355500 +// Opcodes: PUSH0 DUP1 CALLDATALOAD SSTORE STOP // SourceMappings: 26:1:0:-:0;13:15;;79:20;0:101 diff --git a/test/libyul/objectCompiler/sourceLocations.yul b/test/libyul/objectCompiler/sourceLocations.yul index 4e75d05e7dc3..849d275fec2e 100644 --- a/test/libyul/objectCompiler/sourceLocations.yul +++ b/test/libyul/objectCompiler/sourceLocations.yul @@ -49,6 +49,6 @@ object "a" { // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 600a600d600039600a6000f3fe60008055600d600052fe -// Opcodes: PUSH1 0xA PUSH1 0xD PUSH1 0x0 CODECOPY PUSH1 0xA PUSH1 0x0 RETURN INVALID PUSH1 0x0 DUP1 SSTORE PUSH1 0xD PUSH1 0x0 MSTORE INVALID +// Bytecode: 6008600b5f3960085ff3fe5f8055600d5f52fe +// Opcodes: PUSH1 0x8 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x8 PUSH0 RETURN INVALID PUSH0 DUP1 SSTORE PUSH1 0xD PUSH0 MSTORE INVALID // SourceMappings: 0:2::-:0;;;;5:1;0:2; diff --git a/test/libyul/objectCompiler/subObjectAccess.yul b/test/libyul/objectCompiler/subObjectAccess.yul index 1e28ed5d5413..e8bf0bcafc2c 100644 --- a/test/libyul/objectCompiler/subObjectAccess.yul +++ b/test/libyul/objectCompiler/subObjectAccess.yul @@ -249,6 +249,6 @@ object "A" { // invalid // } // } -// Bytecode: 600060996045603f60866013608560016084600189600055886020558760405586606055856080558460a0558360c0558260e055816101005580610120556101406000f3fe602a6013603d6001603e600185600055846020558360405582606055816080558060a05560c06000f3fe60126001816000558060205560406000f3fefefefefefe60126001816000558060205560406000f3fefe -// Opcodes: PUSH1 0x0 PUSH1 0x99 PUSH1 0x45 PUSH1 0x3F PUSH1 0x86 PUSH1 0x13 PUSH1 0x85 PUSH1 0x1 PUSH1 0x84 PUSH1 0x1 DUP10 PUSH1 0x0 SSTORE DUP9 PUSH1 0x20 SSTORE DUP8 PUSH1 0x40 SSTORE DUP7 PUSH1 0x60 SSTORE DUP6 PUSH1 0x80 SSTORE DUP5 PUSH1 0xA0 SSTORE DUP4 PUSH1 0xC0 SSTORE DUP3 PUSH1 0xE0 SSTORE DUP2 PUSH2 0x100 SSTORE DUP1 PUSH2 0x120 SSTORE PUSH2 0x140 PUSH1 0x0 RETURN INVALID PUSH1 0x2A PUSH1 0x13 PUSH1 0x3D PUSH1 0x1 PUSH1 0x3E PUSH1 0x1 DUP6 PUSH1 0x0 SSTORE DUP5 PUSH1 0x20 SSTORE DUP4 PUSH1 0x40 SSTORE DUP3 PUSH1 0x60 SSTORE DUP2 PUSH1 0x80 SSTORE DUP1 PUSH1 0xA0 SSTORE PUSH1 0xC0 PUSH1 0x0 RETURN INVALID PUSH1 0x12 PUSH1 0x1 DUP2 PUSH1 0x0 SSTORE DUP1 PUSH1 0x20 SSTORE PUSH1 0x40 PUSH1 0x0 RETURN INVALID INVALID INVALID INVALID INVALID INVALID PUSH1 0x12 PUSH1 0x1 DUP2 PUSH1 0x0 SSTORE DUP1 PUSH1 0x20 SSTORE PUSH1 0x40 PUSH1 0x0 RETURN INVALID INVALID +// Bytecode: 5f608e6042603a607d6011607c6001607c6001895f55886020558760405586606055856080558460a0558360c0558260e055816101005580610120556101405ff3fe602860116039600160396001855f55846020558360405582606055816080558060a05560c05ff3fe60106001815f558060205560405ff3fefefefe60106001815f558060205560405ff3fefe +// Opcodes: PUSH0 PUSH1 0x8E PUSH1 0x42 PUSH1 0x3A PUSH1 0x7D PUSH1 0x11 PUSH1 0x7C PUSH1 0x1 PUSH1 0x7C PUSH1 0x1 DUP10 PUSH0 SSTORE DUP9 PUSH1 0x20 SSTORE DUP8 PUSH1 0x40 SSTORE DUP7 PUSH1 0x60 SSTORE DUP6 PUSH1 0x80 SSTORE DUP5 PUSH1 0xA0 SSTORE DUP4 PUSH1 0xC0 SSTORE DUP3 PUSH1 0xE0 SSTORE DUP2 PUSH2 0x100 SSTORE DUP1 PUSH2 0x120 SSTORE PUSH2 0x140 PUSH0 RETURN INVALID PUSH1 0x28 PUSH1 0x11 PUSH1 0x39 PUSH1 0x1 PUSH1 0x39 PUSH1 0x1 DUP6 PUSH0 SSTORE DUP5 PUSH1 0x20 SSTORE DUP4 PUSH1 0x40 SSTORE DUP3 PUSH1 0x60 SSTORE DUP2 PUSH1 0x80 SSTORE DUP1 PUSH1 0xA0 SSTORE PUSH1 0xC0 PUSH0 RETURN INVALID PUSH1 0x10 PUSH1 0x1 DUP2 PUSH0 SSTORE DUP1 PUSH1 0x20 SSTORE PUSH1 0x40 PUSH0 RETURN INVALID INVALID INVALID INVALID PUSH1 0x10 PUSH1 0x1 DUP2 PUSH0 SSTORE DUP1 PUSH1 0x20 SSTORE PUSH1 0x40 PUSH0 RETURN INVALID INVALID // SourceMappings: 37:15:0:-:0;68:13;97:15;128:13;158:17;192:15;224:17;258:15;291:19;328:17;361:3;358:1;351:14;381:3;377:2;370:15;401:3;397:2;390:15;421:3;417:2;410:15;442:4;437:3;430:17;464:4;459:3;452:17;486:4;481:3;474:17;508:4;503:3;496:17;530:5;525:3;518:18;553:5;548:3;541:18;574:3;571:1;564:14 diff --git a/test/libyul/yulInterpreterTests/and_create.yul b/test/libyul/yulInterpreterTests/and_create.yul index 8907081506bf..cf32c4658edb 100644 --- a/test/libyul/yulInterpreterTests/and_create.yul +++ b/test/libyul/yulInterpreterTests/and_create.yul @@ -6,8 +6,8 @@ } // ---- // Trace: -// CREATE(0, 0xffffffffffffffffffffffffffffffffffffffff, 0) -// CREATE(0, 0xffffffffffffffffffffffffffffffffffffffff, 0) +// CREATE(0, 0, 0) +// CREATE(0, 0, 0) // Memory dump: // 0: 0000000000000000000000000000000000000000000000000000000000000001 // Storage dump: diff --git a/test/libyul/yulInterpreterTests/and_create2.yul b/test/libyul/yulInterpreterTests/and_create2.yul index 46df2a9caece..5201b0188a76 100644 --- a/test/libyul/yulInterpreterTests/and_create2.yul +++ b/test/libyul/yulInterpreterTests/and_create2.yul @@ -8,8 +8,8 @@ // EVMVersion: >=constantinople // ---- // Trace: -// CREATE2(0, 0xffffffffffffffffffffffffffffffffffffffff, 0, 0) -// CREATE2(0, 0xffffffffffffffffffffffffffffffffffffffff, 0, 0) +// CREATE2(0, 0, 0, 0) +// CREATE2(0, 0, 0, 0) // Memory dump: // 0: 0000000000000000000000000000000000000000000000000000000000000001 // Storage dump: diff --git a/test/libyul/yulInterpreterTests/zero_length_reads.yul b/test/libyul/yulInterpreterTests/zero_length_reads.yul new file mode 100644 index 000000000000..6c1f38d1e9ff --- /dev/null +++ b/test/libyul/yulInterpreterTests/zero_length_reads.yul @@ -0,0 +1,40 @@ +{ + returndatacopy(1, 1, 0) + calldatacopy(1, 1, 0) + extcodecopy(1, 1, 1, 0) + codecopy(1, 1, 0) + log0(1, 0) + log1(1, 0, 1) + log2(1, 0, 1, 1) + log3(1, 0, 1, 1, 1) + log4(1, 0, 1, 1, 1, 1) + pop(create(1, 1, 0)) + pop(create2(1, 1, 0, 1)) + pop(call(1, 1, 1, 1, 0, 1, 0)) + pop(callcode(1, 1, 1, 1, 0, 1, 0)) + pop(delegatecall(1, 1, 1, 0, 1, 0)) + pop(staticcall(1, 1, 1, 0, 1, 0)) + return(1, 0) +} +// ==== +// EVMVersion: >=constantinople +// ---- +// Trace: +// RETURNDATACOPY(0, 1, 0) +// CALLDATACOPY(0, 1, 0) +// EXTCODECOPY(1, 0, 1, 0) +// CODECOPY(0, 1, 0) +// LOG0(0, 0) +// LOG1(0, 0, 1) +// LOG2(0, 0, 1, 1) +// LOG3(0, 0, 1, 1, 1) +// LOG4(0, 0, 1, 1, 1, 1) +// CREATE(1, 0, 0) +// CREATE2(1, 0, 0, 1) +// CALL(1, 1, 1, 0, 0, 1, 0) +// CALLCODE(1, 1, 1, 0, 0, 1, 0) +// DELEGATECALL(1, 1, 0, 0, 1, 0) +// STATICCALL(1, 1, 0, 0, 1, 0) +// RETURN(0, 0) +// Memory dump: +// Storage dump: diff --git a/test/libyul/yulInterpreterTests/zero_length_reads_and_revert.yul b/test/libyul/yulInterpreterTests/zero_length_reads_and_revert.yul new file mode 100644 index 000000000000..4be49eeb0977 --- /dev/null +++ b/test/libyul/yulInterpreterTests/zero_length_reads_and_revert.yul @@ -0,0 +1,40 @@ +{ + returndatacopy(1, 1, 0) + calldatacopy(1, 1, 0) + extcodecopy(1, 1, 1, 0) + codecopy(1, 1, 0) + log0(1, 0) + log1(1, 0, 1) + log2(1, 0, 1, 1) + log3(1, 0, 1, 1, 1) + log4(1, 0, 1, 1, 1, 1) + pop(create(1, 1, 0)) + pop(create2(1, 1, 0, 1)) + pop(call(1, 1, 1, 1, 0, 1, 0)) + pop(callcode(1, 1, 1, 1, 0, 1, 0)) + pop(delegatecall(1, 1, 1, 0, 1, 0)) + pop(staticcall(1, 1, 1, 0, 1, 0)) + revert(1, 0) +} +// ==== +// EVMVersion: >=constantinople +// ---- +// Trace: +// RETURNDATACOPY(0, 1, 0) +// CALLDATACOPY(0, 1, 0) +// EXTCODECOPY(1, 0, 1, 0) +// CODECOPY(0, 1, 0) +// LOG0(0, 0) +// LOG1(0, 0, 1) +// LOG2(0, 0, 1, 1) +// LOG3(0, 0, 1, 1, 1) +// LOG4(0, 0, 1, 1, 1, 1) +// CREATE(1, 0, 0) +// CREATE2(1, 0, 0, 1) +// CALL(1, 1, 1, 0, 0, 1, 0) +// CALLCODE(1, 1, 1, 0, 0, 1, 0) +// DELEGATECALL(1, 1, 0, 0, 1, 0) +// STATICCALL(1, 1, 0, 0, 1, 0) +// REVERT(0, 0) +// Memory dump: +// Storage dump: diff --git a/test/libyul/yulInterpreterTests/zero_range.yul b/test/libyul/yulInterpreterTests/zero_range.yul index b39a10feb370..1ad25ed37bca 100644 --- a/test/libyul/yulInterpreterTests/zero_range.yul +++ b/test/libyul/yulInterpreterTests/zero_range.yul @@ -5,6 +5,6 @@ } // ---- // Trace: -// CALLDATACOPY(32, 0, 0) +// CALLDATACOPY(0, 0, 0) // Memory dump: // Storage dump: diff --git a/test/libyul/yulOptimizerTests/loadResolver/zero_length_reads.yul b/test/libyul/yulOptimizerTests/loadResolver/zero_length_reads.yul new file mode 100644 index 000000000000..418221a93824 --- /dev/null +++ b/test/libyul/yulOptimizerTests/loadResolver/zero_length_reads.yul @@ -0,0 +1,45 @@ +{ + returndatacopy(1, 1, 0) + calldatacopy(1, 1, 0) + extcodecopy(1, 1, 1, 0) + codecopy(1, 1, 0) + log0(1, 0) + log1(1, 0, 1) + log2(1, 0, 1, 1) + log3(1, 0, 1, 1, 1) + log4(1, 0, 1, 1, 1, 1) + pop(create(1, 1, 0)) + pop(create2(1, 1, 0, 1)) + pop(call(1, 1, 1, 1, 0, 1, 0)) + pop(callcode(1, 1, 1, 1, 0, 1, 0)) + pop(delegatecall(1, 1, 1, 0, 1, 0)) + pop(staticcall(1, 1, 1, 0, 1, 0)) + return(1, 0) +} +// ==== +// EVMVersion: >=constantinople +// ---- +// step: loadResolver +// +// { +// { +// let _1 := 0 +// let _2 := 1 +// returndatacopy(0, _2, _1) +// calldatacopy(0, _2, _1) +// extcodecopy(_2, 0, _2, _1) +// codecopy(0, _2, _1) +// log0(0, _1) +// log1(0, _1, _2) +// log2(0, _1, _2, _2) +// log3(0, _1, _2, _2, _2) +// log4(0, _1, _2, _2, _2, _2) +// pop(create(_2, 0, _1)) +// pop(create2(_2, 0, _1, _2)) +// pop(call(_2, _2, _2, 0, _1, _2, _1)) +// pop(callcode(_2, _2, _2, 0, _1, _2, _1)) +// pop(delegatecall(_2, _2, 0, _1, _2, _1)) +// pop(staticcall(_2, _2, 0, _1, _2, _1)) +// return(0, _1) +// } +// } diff --git a/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_conditional_revert.yul b/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_conditional_revert.yul new file mode 100644 index 000000000000..3eeea6f4dd90 --- /dev/null +++ b/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_conditional_revert.yul @@ -0,0 +1,33 @@ +{ + function g() { + if calldataload(10) { revert(0, 0) } + } + function f() { + let a := calldataload(0) + if calldataload(1) { + // this can NOT be removed + a := 2 + g() + } + sstore(0, a) + } +} +// ---- +// step: unusedAssignEliminator +// +// { +// function g() +// { +// if calldataload(10) { revert(0, 0) } +// } +// function f() +// { +// let a := calldataload(0) +// if calldataload(1) +// { +// a := 2 +// g() +// } +// sstore(0, a) +// } +// } diff --git a/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_leave.yul b/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_leave.yul new file mode 100644 index 000000000000..4564f5d07524 --- /dev/null +++ b/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_leave.yul @@ -0,0 +1,22 @@ +{ + function f() { + let a := calldataload(0) + if calldataload(1) { + // this can be removed + a := 2 + leave + } + sstore(0, a) + } +} +// ---- +// step: unusedAssignEliminator +// +// { +// function f() +// { +// let a := calldataload(0) +// if calldataload(1) { leave } +// sstore(0, a) +// } +// } diff --git a/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_revert.yul b/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_revert.yul new file mode 100644 index 000000000000..469da01fc46f --- /dev/null +++ b/test/libyul/yulOptimizerTests/unusedAssignEliminator/conditionally_assign_before_revert.yul @@ -0,0 +1,17 @@ +{ + let a := calldataload(0) + if calldataload(1) { + // this can be removed + a := 2 + revert(0, 0) + } + sstore(0, a) +} +// ---- +// step: unusedAssignEliminator +// +// { +// let a := calldataload(0) +// if calldataload(1) { revert(0, 0) } +// sstore(0, a) +// } diff --git a/test/libyul/yulOptimizerTests/unusedAssignEliminator/for_deep_noremove.yul b/test/libyul/yulOptimizerTests/unusedAssignEliminator/for_deep_noremove.yul index 02a735f9e50f..c0a84c2450eb 100644 --- a/test/libyul/yulOptimizerTests/unusedAssignEliminator/for_deep_noremove.yul +++ b/test/libyul/yulOptimizerTests/unusedAssignEliminator/for_deep_noremove.yul @@ -46,10 +46,7 @@ // for { } 1 { } // { // for { } 1 { a := 10 } -// { -// b := 12 -// b := 11 -// } +// { b := 11 } // } // } // } diff --git a/test/libyul/yulOptimizerTests/unusedAssignEliminator/revert_after_assign_return.yul b/test/libyul/yulOptimizerTests/unusedAssignEliminator/revert_after_assign_return.yul new file mode 100644 index 000000000000..0a8a3582ff57 --- /dev/null +++ b/test/libyul/yulOptimizerTests/unusedAssignEliminator/revert_after_assign_return.yul @@ -0,0 +1,35 @@ +{ + function g() -> x { + x := 7 + if calldataload(0) { + x := 3 + reverting() + } + if calldataload(1) { + x := 3 + leave + } + x := 2 + reverting() + } + function reverting() { revert(0, 0) } + sstore(0, g()) +} +// ---- +// step: unusedAssignEliminator +// +// { +// function g() -> x +// { +// if calldataload(0) { reverting() } +// if calldataload(1) +// { +// x := 3 +// leave +// } +// reverting() +// } +// function reverting() +// { revert(0, 0) } +// sstore(0, g()) +// } diff --git a/test/libyul/yulStackShuffling/swap_cycle.stack b/test/libyul/yulStackShuffling/swap_cycle.stack new file mode 100644 index 000000000000..fbda89ebfd2a --- /dev/null +++ b/test/libyul/yulStackShuffling/swap_cycle.stack @@ -0,0 +1,22 @@ +[ v0 v1 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET RET v5 ] +[ v1 v0 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET JUNK JUNK ] +// ---- +// [ v0 v1 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET RET v5 ] +// POP +// [ v0 v1 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET RET ] +// SWAP16 +// [ v0 RET v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET v1 ] +// SWAP16 +// [ v0 v1 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET RET ] +// POP +// [ v0 v1 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET ] +// SWAP15 +// [ v0 RET v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 v1 ] +// SWAP16 +// [ v1 RET v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 v0 ] +// SWAP15 +// [ v1 v0 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET ] +// PUSH JUNK +// [ v1 v0 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET JUNK ] +// PUSH JUNK +// [ v1 v0 v2 v3 v4 v5 v6 v7 v9 v10 v11 v12 v13 v14 v15 v16 RET JUNK JUNK ] diff --git a/test/libyul/yulSyntaxTests/invalid/push0_disallowed.yul b/test/libyul/yulSyntaxTests/invalid/push0_disallowed.yul new file mode 100644 index 000000000000..00fe3c122381 --- /dev/null +++ b/test/libyul/yulSyntaxTests/invalid/push0_disallowed.yul @@ -0,0 +1,6 @@ +// Based on ./push_disallowed.yul (which already includes push0). +{ + push0() +} +// ---- +// DeclarationError 4619: (72-77): Function "push0" not found. diff --git a/test/lsp.py b/test/lsp.py index 669951ca4cdf..11007ae822ec 100755 --- a/test/lsp.py +++ b/test/lsp.py @@ -28,7 +28,8 @@ import tty # Turn off user input buffering so we get the input immediately, # not only after a line break - tty.setcbreak(sys.stdin.fileno()) + if os.isatty(sys.stdin.fileno()): + tty.setcbreak(sys.stdin.fileno()) # Type for the pure test name without .sol suffix or sub directory diff --git a/test/solc/CommandLineParser.cpp b/test/solc/CommandLineParser.cpp index e8206e48331c..6fdecd7faee3 100644 --- a/test/solc/CommandLineParser.cpp +++ b/test/solc/CommandLineParser.cpp @@ -145,8 +145,11 @@ BOOST_AUTO_TEST_CASE(cli_mode_options) "--model-checker-contracts=contract1.yul:A,contract2.yul:B", "--model-checker-div-mod-no-slacks", "--model-checker-engine=bmc", + "--model-checker-ext-calls=trusted", "--model-checker-invariants=contract,reentrancy", + "--model-checker-show-proved-safe", "--model-checker-show-unproved", + "--model-checker-show-unsupported", "--model-checker-solvers=z3,smtlib2", "--model-checker-targets=underflow,divByZero", "--model-checker-timeout=5", @@ -211,8 +214,11 @@ BOOST_AUTO_TEST_CASE(cli_mode_options) {{{"contract1.yul", {"A"}}, {"contract2.yul", {"B"}}}}, true, {true, false}, + {ModelCheckerExtCalls::Mode::TRUSTED}, {{InvariantType::Contract, InvariantType::Reentrancy}}, true, + true, + true, {false, false, true, true}, {{VerificationTargetType::Underflow, VerificationTargetType::DivByZero}}, 5, @@ -408,7 +414,9 @@ BOOST_AUTO_TEST_CASE(invalid_options_input_modes_combinations) {"--via-ir", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, {"--metadata-literal", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, {"--metadata-hash=swarm", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, + {"--model-checker-show-proved-safe", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, {"--model-checker-show-unproved", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, + {"--model-checker-show-unsupported", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, {"--model-checker-div-mod-no-slacks", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, {"--model-checker-engine=bmc", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, {"--model-checker-invariants=contract,reentrancy", {"--assemble", "--yul", "--strict-assembly", "--standard-json", "--link"}}, diff --git a/test/tools/CMakeLists.txt b/test/tools/CMakeLists.txt index 5971341ec90c..0bb8896cd8e0 100644 --- a/test/tools/CMakeLists.txt +++ b/test/tools/CMakeLists.txt @@ -40,6 +40,7 @@ add_executable(isoltest ../libyul/FunctionSideEffects.cpp ../libyul/ObjectCompilerTest.cpp ../libyul/SyntaxTest.cpp + ../libyul/StackShufflingTest.cpp ../libyul/StackLayoutGeneratorTest.cpp ../libyul/YulOptimizerTest.cpp ../libyul/YulOptimizerTestCommon.cpp diff --git a/test/tools/fuzzer_common.cpp b/test/tools/fuzzer_common.cpp index 895957f4d2de..60b871cf7935 100644 --- a/test/tools/fuzzer_common.cpp +++ b/test/tools/fuzzer_common.cpp @@ -108,8 +108,11 @@ void FuzzerUtil::testCompiler( frontend::ModelCheckerContracts::Default(), /*divModWithSlacks*/true, frontend::ModelCheckerEngine::All(), + frontend::ModelCheckerExtCalls{}, frontend::ModelCheckerInvariants::All(), + /*showProvedSafe=*/false, /*showUnproved=*/false, + /*showUnsupported=*/false, smtutil::SMTSolverChoice::All(), frontend::ModelCheckerTargets::Default(), /*timeout=*/1 @@ -118,7 +121,7 @@ void FuzzerUtil::testCompiler( compiler.setSources(_input); compiler.setEVMVersion(evmVersion); compiler.setOptimiserSettings(optimiserSettings); - compiler.enableIRGeneration(_compileViaYul); + compiler.setViaIR(_compileViaYul); try { compiler.compile(); @@ -134,6 +137,8 @@ void FuzzerUtil::testCompiler( } catch (StackTooDeepError const&) { + if (_optimize && _compileViaYul) + throw; } } diff --git a/test/tools/isoltest.cpp b/test/tools/isoltest.cpp index c2035ab185c2..4739a54e9c3b 100644 --- a/test/tools/isoltest.cpp +++ b/test/tools/isoltest.cpp @@ -76,7 +76,7 @@ class TestFilter boost::replace_all(filter, "/", "\\/"); boost::replace_all(filter, "*", ".*"); - m_filterExpression = regex{"(" + filter + "(\\.sol|\\.yul))"}; + m_filterExpression = regex{"(" + filter + "(\\.sol|\\.yul|\\.stack))"}; } bool matches(fs::path const& _path, string const& _name) const diff --git a/test/tools/ossfuzz/README.md b/test/tools/ossfuzz/README.md index 944595a3f70b..9343602d44d2 100644 --- a/test/tools/ossfuzz/README.md +++ b/test/tools/ossfuzz/README.md @@ -6,11 +6,11 @@ We have multiple fuzzers, some based on string input and others on protobuf input. To build them, please do the following: -- Create a local docker image from `Dockerfile.ubuntu1604.clang.ossfuzz` in the `.circleci/docker` sub-directory. Please note that this step is likely to take at least an hour to complete. Therefore, it is recommended to do it when you are away from the computer (and the computer is plugged to power since we do not want a battery drain). +- Create a local docker image from `Dockerfile.ubuntu.clang.ossfuzz` in the `.circleci/docker` sub-directory. Please note that this step is likely to take at least an hour to complete. Therefore, it is recommended to do it when you are away from the computer (and the computer is plugged to power since we do not want a battery drain). ``` $ cd .circleci/docker -$ docker build -t solidity-ossfuzz-local -f Dockerfile.ubuntu1604.clang.ossfuzz . +$ docker build -t solidity-ossfuzz-local -f Dockerfile.ubuntu.clang.ossfuzz . ``` - Login to the docker container sourced from the image built in the previous step from the solidity parent directory diff --git a/test/tools/ossfuzz/protoToYul.cpp b/test/tools/ossfuzz/protoToYul.cpp index 991b25e75259..25b5a977df84 100644 --- a/test/tools/ossfuzz/protoToYul.cpp +++ b/test/tools/ossfuzz/protoToYul.cpp @@ -351,9 +351,22 @@ void ProtoConverter::visit(BinaryOp const& _x) break; } m_output << "("; - visit(_x.left()); - m_output << ","; - visit(_x.right()); + if (op == BinaryOp::KECCAK) + { + m_output << "mod("; + visit(_x.left()); + m_output << ", " << to_string(s_maxMemory - s_maxSize) << ")"; + m_output << ","; + m_output << "mod("; + visit(_x.right()); + m_output << ", " << to_string(s_maxSize) << ")"; + } + else + { + visit(_x.left()); + m_output << ","; + visit(_x.right()); + } m_output << ")"; } @@ -623,7 +636,14 @@ void ProtoConverter::visit(UnaryOp const& _x) break; } m_output << "("; - visit(_x.operand()); + if (op == UnaryOp::MLOAD) + { + m_output << "mod("; + visit(_x.operand()); + m_output << ", " << to_string(s_maxMemory) << ")"; + } + else + visit(_x.operand()); m_output << ")"; } @@ -778,11 +798,15 @@ void ProtoConverter::visit(CopyFunc const& _x) break; } m_output << "("; + m_output << "mod("; visit(_x.target()); + m_output << ", " << to_string(s_maxMemory - s_maxSize) << ")"; m_output << ", "; visit(_x.source()); m_output << ", "; + m_output << "mod("; visit(_x.size()); + m_output << ", " << to_string(s_maxSize) << ")"; m_output << ")\n"; } @@ -792,32 +816,42 @@ void ProtoConverter::visit(ExtCodeCopy const& _x) m_output << "("; visit(_x.addr()); m_output << ", "; + m_output << "mod("; visit(_x.target()); + m_output << ", " << to_string(s_maxMemory - s_maxSize) << ")"; m_output << ", "; visit(_x.source()); m_output << ", "; + m_output << "mod("; visit(_x.size()); + m_output << ", " << to_string(s_maxSize) << ")"; m_output << ")\n"; } void ProtoConverter::visit(LogFunc const& _x) { + auto visitPosAndSize = [&](LogFunc const& _y) { + m_output << "mod("; + visit(_y.pos()); + m_output << ", " << to_string(s_maxMemory - s_maxSize) << ")"; + m_output << ", "; + m_output << "mod("; + visit(_y.size()); + m_output << ", " << to_string(s_maxSize) << ")"; + }; + switch (_x.num_topics()) { case LogFunc::ZERO: m_output << "log0"; m_output << "("; - visit(_x.pos()); - m_output << ", "; - visit(_x.size()); + visitPosAndSize(_x); m_output << ")\n"; break; case LogFunc::ONE: m_output << "log1"; m_output << "("; - visit(_x.pos()); - m_output << ", "; - visit(_x.size()); + visitPosAndSize(_x); m_output << ", "; visit(_x.t1()); m_output << ")\n"; @@ -825,9 +859,7 @@ void ProtoConverter::visit(LogFunc const& _x) case LogFunc::TWO: m_output << "log2"; m_output << "("; - visit(_x.pos()); - m_output << ", "; - visit(_x.size()); + visitPosAndSize(_x); m_output << ", "; visit(_x.t1()); m_output << ", "; @@ -837,9 +869,7 @@ void ProtoConverter::visit(LogFunc const& _x) case LogFunc::THREE: m_output << "log3"; m_output << "("; - visit(_x.pos()); - m_output << ", "; - visit(_x.size()); + visitPosAndSize(_x); m_output << ", "; visit(_x.t1()); m_output << ", "; @@ -851,9 +881,7 @@ void ProtoConverter::visit(LogFunc const& _x) case LogFunc::FOUR: m_output << "log4"; m_output << "("; - visit(_x.pos()); - m_output << ", "; - visit(_x.size()); + visitPosAndSize(_x); m_output << ", "; visit(_x.t1()); m_output << ", "; @@ -1015,13 +1043,21 @@ void ProtoConverter::visit(LowLevelCall const& _x) visit(_x.wei()); m_output << ", "; } + m_output << "mod("; visit(_x.in()); + m_output << ", " << to_string(s_maxMemory - s_maxSize) << ")"; m_output << ", "; + m_output << "mod("; visit(_x.insize()); + m_output << ", " << to_string(s_maxSize) << ")"; m_output << ", "; + m_output << "mod("; visit(_x.out()); + m_output << ", " << to_string(s_maxMemory - s_maxSize) << ")"; m_output << ", "; + m_output << "mod("; visit(_x.outsize()); + m_output << ", " << to_string(s_maxSize) << ")"; m_output << ")"; } @@ -1048,9 +1084,13 @@ void ProtoConverter::visit(Create const& _x) } visit(_x.wei()); m_output << ", "; + m_output << "mod("; visit(_x.position()); + m_output << ", " << to_string(s_maxMemory - s_maxSize) << ")"; m_output << ", "; + m_output << "mod("; visit(_x.size()); + m_output << ", " << to_string(s_maxSize) << ")"; if (type == Create::CREATE2) { m_output << ", "; @@ -1069,7 +1109,8 @@ void ProtoConverter::visit(IfStmt const& _x) void ProtoConverter::visit(StoreFunc const& _x) { - switch (_x.st()) + auto storeType = _x.st(); + switch (storeType) { case StoreFunc::MSTORE: m_output << "mstore("; @@ -1081,7 +1122,15 @@ void ProtoConverter::visit(StoreFunc const& _x) m_output << "mstore8("; break; } - visit(_x.loc()); + // Write to memory within bounds, storage is unbounded + if (storeType == StoreFunc::SSTORE) + visit(_x.loc()); + else + { + m_output << "mod("; + visit(_x.loc()); + m_output << ", " << to_string(s_maxMemory) << ")"; + } m_output << ", "; visit(_x.val()); m_output << ")\n"; @@ -1262,9 +1311,13 @@ void ProtoConverter::visit(RetRevStmt const& _x) break; } m_output << "("; + m_output << "mod("; visit(_x.pos()); + m_output << ", " << to_string(s_maxMemory - s_maxSize) << ")"; m_output << ", "; + m_output << "mod("; visit(_x.size()); + m_output << ", " << to_string(s_maxSize) << ")"; m_output << ")\n"; } @@ -1651,8 +1704,12 @@ void ProtoConverter::fillFunctionCallInput(unsigned _numInParams) m_output << "calldataload(" << slot << ")"; break; case 1: + { + // Access memory within stipulated bounds + slot = "mod(" + dictionaryToken() + ", " + to_string(s_maxMemory) + ")"; m_output << "mload(" << slot << ")"; break; + } case 2: m_output << "sload(" << slot << ")"; break; diff --git a/test/tools/ossfuzz/protoToYul.h b/test/tools/ossfuzz/protoToYul.h index 9100b490ce35..00559fa93aa6 100644 --- a/test/tools/ossfuzz/protoToYul.h +++ b/test/tools/ossfuzz/protoToYul.h @@ -344,6 +344,11 @@ class ProtoConverter static unsigned constexpr s_modOutputParams = 5; /// Hard-coded identifier for a Yul object's data block static auto constexpr s_dataIdentifier = "datablock"; + /// Upper bound on memory writes = 2**32 - 1 + /// See: https://eips.ethereum.org/EIPS/eip-1985#memory-size + static unsigned constexpr s_maxMemory = 4294967295; + /// Upper bound on size for range copy functions + static unsigned constexpr s_maxSize = 65536; /// Predicate to keep track of for body scope. If false, break/continue /// statements can not be created. bool m_inForBodyScope; diff --git a/test/tools/ossfuzz/strictasm_assembly_ossfuzz.cpp b/test/tools/ossfuzz/strictasm_assembly_ossfuzz.cpp index b9473f613ad1..c7ffd3d417a3 100644 --- a/test/tools/ossfuzz/strictasm_assembly_ossfuzz.cpp +++ b/test/tools/ossfuzz/strictasm_assembly_ossfuzz.cpp @@ -41,7 +41,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size) langutil::EVMVersion(), nullopt, YulStack::Language::StrictAssembly, - solidity::frontend::OptimiserSettings::full(), + solidity::frontend::OptimiserSettings::minimal(), langutil::DebugInfoSelection::All() ); diff --git a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp index 36517c975919..4db14d55dbf1 100644 --- a/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp +++ b/test/tools/yulInterpreter/EVMInstructionInterpreter.cpp @@ -211,22 +211,22 @@ u256 EVMInstructionInterpreter::eval( case Instruction::CALLDATASIZE: return m_state.calldata.size(); case Instruction::CALLDATACOPY: - logTrace(_instruction, arg); if (accessMemory(arg[0], arg[2])) copyZeroExtended( m_state.memory, m_state.calldata, size_t(arg[0]), size_t(arg[1]), size_t(arg[2]) ); + logTrace(_instruction, arg); return 0; case Instruction::CODESIZE: return m_state.code.size(); case Instruction::CODECOPY: - logTrace(_instruction, arg); if (accessMemory(arg[0], arg[2])) copyZeroExtended( m_state.memory, m_state.code, size_t(arg[0]), size_t(arg[1]), size_t(arg[2]) ); + logTrace(_instruction, arg); return 0; case Instruction::GASPRICE: return m_state.gasprice; @@ -239,23 +239,23 @@ u256 EVMInstructionInterpreter::eval( case Instruction::EXTCODEHASH: return u256(keccak256(h256(arg[0] + 1))); case Instruction::EXTCODECOPY: - logTrace(_instruction, arg); if (accessMemory(arg[1], arg[3])) // TODO this way extcodecopy and codecopy do the same thing. copyZeroExtended( m_state.memory, m_state.code, size_t(arg[1]), size_t(arg[2]), size_t(arg[3]) ); + logTrace(_instruction, arg); return 0; case Instruction::RETURNDATASIZE: return m_state.returndata.size(); case Instruction::RETURNDATACOPY: - logTrace(_instruction, arg); if (accessMemory(arg[0], arg[2])) copyZeroExtended( m_state.memory, m_state.returndata, size_t(arg[0]), size_t(arg[1]), size_t(arg[2]) ); + logTrace(_instruction, arg); return 0; case Instruction::BLOCKHASH: if (arg[0] >= m_state.blockNumber || arg[0] + 256 < m_state.blockNumber) @@ -319,11 +319,17 @@ u256 EVMInstructionInterpreter::eval( case Instruction::CREATE: accessMemory(arg[1], arg[2]); logTrace(_instruction, arg); - return (0xcccccc + arg[1]) & u256("0xffffffffffffffffffffffffffffffffffffffff"); + if (arg[2] != 0) + return (0xcccccc + arg[1]) & u256("0xffffffffffffffffffffffffffffffffffffffff"); + else + return 0xcccccc; case Instruction::CREATE2: accessMemory(arg[1], arg[2]); logTrace(_instruction, arg); - return (0xdddddd + arg[1]) & u256("0xffffffffffffffffffffffffffffffffffffffff"); + if (arg[2] != 0) + return (0xdddddd + arg[1]) & u256("0xffffffffffffffffffffffffffffffffffffffff"); + else + return 0xdddddd; case Instruction::CALL: case Instruction::CALLCODE: accessMemory(arg[3], arg[4]); @@ -340,7 +346,6 @@ u256 EVMInstructionInterpreter::eval( accessMemory(arg[2], arg[3]); accessMemory(arg[4], arg[5]); logTrace(_instruction, arg); - // Randomly fail based on the called address if it isn't a call to self. // Used for fuzzing. return ( @@ -359,7 +364,6 @@ u256 EVMInstructionInterpreter::eval( accessMemory(arg[0], arg[1]); logTrace(_instruction, arg); m_state.storage.clear(); - m_state.trace.clear(); BOOST_THROW_EXCEPTION(ExplicitlyTerminated()); case Instruction::INVALID: logTrace(_instruction); @@ -377,6 +381,7 @@ u256 EVMInstructionInterpreter::eval( case Instruction::JUMP: case Instruction::JUMPI: case Instruction::JUMPDEST: + case Instruction::PUSH0: case Instruction::PUSH1: case Instruction::PUSH2: case Instruction::PUSH3: @@ -496,7 +501,10 @@ u256 EVMInstructionInterpreter::evalBuiltin( else if (fun == "datacopy") { // This is identical to codecopy. - if (accessMemory(_evaluatedArguments.at(0), _evaluatedArguments.at(2))) + if ( + _evaluatedArguments.at(2) != 0 && + accessMemory(_evaluatedArguments.at(0), _evaluatedArguments.at(2)) + ) copyZeroExtended( m_state.memory, m_state.code, @@ -577,8 +585,13 @@ void EVMInstructionInterpreter::logTrace( if (!(_writesToMemory && memWriteTracingDisabled())) { string message = _pseudoInstruction + "("; + std::pair inputMemoryPtrModified = isInputMemoryPtrModified(_pseudoInstruction, _arguments); for (size_t i = 0; i < _arguments.size(); ++i) - message += (i > 0 ? ", " : "") + formatNumber(_arguments[i]); + { + bool printZero = inputMemoryPtrModified.first && inputMemoryPtrModified.second == i; + u256 arg = printZero ? 0 : _arguments[i]; + message += (i > 0 ? ", " : "") + formatNumber(arg); + } message += ")"; if (!_data.empty()) message += " [" + util::toHex(_data) + "]"; @@ -590,3 +603,65 @@ void EVMInstructionInterpreter::logTrace( } } } + +std::pair EVMInstructionInterpreter::isInputMemoryPtrModified( + std::string const& _pseudoInstruction, + std::vector const& _arguments +) +{ + if (_pseudoInstruction == "RETURN" || _pseudoInstruction == "REVERT") + { + if (_arguments[1] == 0) + return {true, 0}; + else + return {false, 0}; + } + else if ( + _pseudoInstruction == "RETURNDATACOPY" || _pseudoInstruction == "CALLDATACOPY" + || _pseudoInstruction == "CODECOPY") + { + if (_arguments[2] == 0) + return {true, 0}; + else + return {false, 0}; + } + else if (_pseudoInstruction == "EXTCODECOPY") + { + if (_arguments[3] == 0) + return {true, 1}; + else + return {false, 0}; + } + else if ( + _pseudoInstruction == "LOG0" || _pseudoInstruction == "LOG1" || _pseudoInstruction == "LOG2" + || _pseudoInstruction == "LOG3" || _pseudoInstruction == "LOG4") + { + if (_arguments[1] == 0) + return {true, 0}; + else + return {false, 0}; + } + if (_pseudoInstruction == "CREATE" || _pseudoInstruction == "CREATE2") + { + if (_arguments[2] == 0) + return {true, 1}; + else + return {false, 0}; + } + if (_pseudoInstruction == "CALL" || _pseudoInstruction == "CALLCODE") + { + if (_arguments[4] == 0) + return {true, 3}; + else + return {false, 0}; + } + else if (_pseudoInstruction == "DELEGATECALL" || _pseudoInstruction == "STATICCALL") + { + if (_arguments[3] == 0) + return {true, 2}; + else + return {false, 0}; + } + else + return {false, 0}; +} diff --git a/test/tools/yulInterpreter/EVMInstructionInterpreter.h b/test/tools/yulInterpreter/EVMInstructionInterpreter.h index 9f0f473f142b..d37cae542f9d 100644 --- a/test/tools/yulInterpreter/EVMInstructionInterpreter.h +++ b/test/tools/yulInterpreter/EVMInstructionInterpreter.h @@ -125,6 +125,19 @@ class EVMInstructionInterpreter std::vector const& _arguments = {}, bytes const& _data = {} ); + + /// @returns a pair of boolean and size_t whose first value is true if @param _pseudoInstruction + /// is a Yul instruction that the Yul optimizer's loadResolver step rewrites the input + /// memory pointer value to zero if that instruction's read length (contained within @param + // _arguments) is zero, and whose second value is the positional index of the input memory + // pointer argument. + /// If the Yul instruction is unaffected or affected but read length is non-zero, the first + /// value is false. + std::pair isInputMemoryPtrModified( + std::string const& _pseudoInstruction, + std::vector const& _arguments + ); + /// @returns disable trace flag. bool memWriteTracingDisabled() {