Skip to content

Enable usage of --show-symbol-table where the symbol table contains unrecognised modes. #6303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ add_subdirectory(goto-cc-file-local)
add_subdirectory(goto-cc-regression-gh-issue-5380)
add_subdirectory(linking-goto-binaries)
add_subdirectory(symtab2gb)
add_subdirectory(symtab2gb-cbmc)
add_subdirectory(solver-hardness)
if(NOT WIN32)
add_subdirectory(goto-ld)
Expand Down
1 change: 1 addition & 0 deletions regression/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ DIRS = cbmc \
goto-cc-regression-gh-issue-5380 \
linking-goto-binaries \
symtab2gb \
symtab2gb-cbmc \
solver-hardness \
goto-ld \
validate-trace-xml-schema \
Expand Down
3 changes: 3 additions & 0 deletions regression/symtab2gb-cbmc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_test_pl_tests(
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:symtab2gb> $<TARGET_FILE:cbmc>"
)
20 changes: 20 additions & 0 deletions regression/symtab2gb-cbmc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
default: tests.log

include ../../src/config.inc
include ../../src/common

test:
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/symtab2gb/symtab2gb ../../../src/cbmc/cbmc'

tests.log:
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/symtab2gb/symtab2gb ../../../src/cbmc/cbmc'

clean:
@for dir in *; do \
$(RM) tests.log; \
if [ -d "$$dir" ]; then \
cd "$$dir"; \
$(RM) *.out *.gb; \
cd ..; \
fi \
done
12 changes: 12 additions & 0 deletions regression/symtab2gb-cbmc/chain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

symtab2gb_exe=$1
cbmc_exe=$2
source="${@: -1}"
goto_binary="$source.gb"
cbmc_desc_arguments="${@:3:$#-3}"

$symtab2gb_exe "$source" --out "$goto_binary"
$cbmc_exe $cbmc_desc_arguments "$goto_binary"
4 changes: 4 additions & 0 deletions regression/symtab2gb-cbmc/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This directory contains tests based on converting json symtab files to goto
binaries using the symtab2gb binary and then passing the generated goto binary
to cbmc. Additional arguments specified in the `.desc` file will be passed to
the cbmc binary.
12 changes: 12 additions & 0 deletions regression/symtab2gb-cbmc/show_foreign_symbol_table/json-ui.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CORE
rust.json
--json-ui --show-symbol-table
"symbolTable":
"mode": "rust",
^EXIT=0$
^SIGNAL=0$
--
symbol \w+ has unknown mode
--
Test that --show-symbol-table with --json-ui correctly shows the source language
mode of a symbol, even if that language mode is unsupported.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CORE
rust.json
--show-symbol-table
Symbols:
Mode\.+: rust
^EXIT=0$
^SIGNAL=0$
--
symbol \w+ has unknown mode
--
Test that --show-symbol-table correctly shows the source language mode of a
symbol, even if that language mode is unsupported.
Loading