Skip to content

Commit bf70daa

Browse files
Merge pull request #6303 from thomasspriggs/tas/rust_mode
Enable usage of `--show-symbol-table` where the symbol table contains unrecognised modes.
2 parents 1268cc1 + 21ac550 commit bf70daa

File tree

12 files changed

+693
-49
lines changed

12 files changed

+693
-49
lines changed

regression/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ add_subdirectory(goto-cc-file-local)
6767
add_subdirectory(goto-cc-regression-gh-issue-5380)
6868
add_subdirectory(linking-goto-binaries)
6969
add_subdirectory(symtab2gb)
70+
add_subdirectory(symtab2gb-cbmc)
7071
add_subdirectory(solver-hardness)
7172
if(NOT WIN32)
7273
add_subdirectory(goto-ld)

regression/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ DIRS = cbmc \
4242
goto-cc-regression-gh-issue-5380 \
4343
linking-goto-binaries \
4444
symtab2gb \
45+
symtab2gb-cbmc \
4546
solver-hardness \
4647
goto-ld \
4748
validate-trace-xml-schema \
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_test_pl_tests(
2+
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:symtab2gb> $<TARGET_FILE:cbmc>"
3+
)

regression/symtab2gb-cbmc/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
default: tests.log
2+
3+
include ../../src/config.inc
4+
include ../../src/common
5+
6+
test:
7+
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/symtab2gb/symtab2gb ../../../src/cbmc/cbmc'
8+
9+
tests.log:
10+
@../test.pl -e -p -c '../chain.sh $(exe) ../../../src/symtab2gb/symtab2gb ../../../src/cbmc/cbmc'
11+
12+
clean:
13+
@for dir in *; do \
14+
$(RM) tests.log; \
15+
if [ -d "$$dir" ]; then \
16+
cd "$$dir"; \
17+
$(RM) *.out *.gb; \
18+
cd ..; \
19+
fi \
20+
done

regression/symtab2gb-cbmc/chain.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
symtab2gb_exe=$1
6+
cbmc_exe=$2
7+
source="${@: -1}"
8+
goto_binary="$source.gb"
9+
cbmc_desc_arguments="${@:3:$#-3}"
10+
11+
$symtab2gb_exe "$source" --out "$goto_binary"
12+
$cbmc_exe $cbmc_desc_arguments "$goto_binary"

regression/symtab2gb-cbmc/readme.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This directory contains tests based on converting json symtab files to goto
2+
binaries using the symtab2gb binary and then passing the generated goto binary
3+
to cbmc. Additional arguments specified in the `.desc` file will be passed to
4+
the cbmc binary.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
rust.json
3+
--json-ui --show-symbol-table
4+
"symbolTable":
5+
"mode": "rust",
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
symbol \w+ has unknown mode
10+
--
11+
Test that --show-symbol-table with --json-ui correctly shows the source language
12+
mode of a symbol, even if that language mode is unsupported.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
rust.json
3+
--show-symbol-table
4+
Symbols:
5+
Mode\.+: rust
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
symbol \w+ has unknown mode
10+
--
11+
Test that --show-symbol-table correctly shows the source language mode of a
12+
symbol, even if that language mode is unsupported.

0 commit comments

Comments
 (0)