File tree Expand file tree Collapse file tree 9 files changed +69
-0
lines changed
Expand file tree Collapse file tree 9 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -62,3 +62,6 @@ if(WITH_MEMORY_ANALYZER)
6262endif ()
6363
6464add_subdirectory (solver-hardness)
65+ if (NOT WIN32 )
66+ add_subdirectory (goto-ld)
67+ endif ()
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ DIRS = cbmc \
3131 linking-goto-binaries \
3232 symtab2gb \
3333 solver-hardness \
34+ goto-ld \
3435 # Empty last line
3536
3637ifeq ($(OS ) ,Windows_NT)
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ tests.log: ../test.pl ../../src/goto-cc/goto-gcc
1818../../src/goto-cc/goto-gcc : ../../src/goto-cc/goto-cc
1919 @ln -sf goto-cc ../../src/goto-cc/goto-gcc
2020
21+ ../../src/goto-cc/goto-ld : ../../src/goto-cc/goto-cc
22+ @ln -sf goto-cc ../../src/goto-cc/goto-ld
23+
2124test tests.log : archives/libour_archive.a
2225archives/libour_archive.a : archives/foo.c ../../src/goto-cc/goto-gcc
2326 @cd archives && \
Original file line number Diff line number Diff line change 1+ # TARGET_FILE (as used in other directories) can't be used with goto-gcc as it
2+ # isn't marked as an executable (target), which CMake requires. Thus construct a
3+ # path in the same way the symbolic link is created in the goto-cc directory.
4+ add_test_pl_tests("$<TARGET_FILE_DIR:goto-cc>/goto-ld" )
Original file line number Diff line number Diff line change 1+ default : tests.log
2+
3+ include ../../src/config.inc
4+ include ../../src/common
5+
6+ ifeq ($(BUILD_ENV_ ) ,MSVC)
7+ test :
8+
9+ tests.log : ../test.pl
10+
11+ else
12+ test : ../../src/goto-cc/goto-ld
13+ @../test.pl -e -p -c ../../../src/goto-cc/goto-ld
14+
15+ tests.log : ../test.pl ../../src/goto-cc/goto-ld
16+ @../test.pl -e -p -c ../../../src/goto-cc/goto-ld
17+
18+ ../../src/goto-cc/goto-ld : ../../src/goto-cc/goto-cc
19+ @ln -sf goto-cc ../../src/goto-cc/goto-ld
20+ endif
21+
22+ show :
23+ @for dir in * ; do \
24+ if [ -d " $$ dir" ]; then \
25+ vim -o " $$ dir/*.c" " $$ dir/*.out" ; \
26+ fi ; \
27+ done ;
28+
29+ clean :
30+ find -name ' *.out' -execdir $(RM ) ' {}' \;
31+ find -name ' *.gb' -execdir $(RM ) ' {}' \;
32+ find -name ' *.goto-cc-saved' -execdir $(RM ) ' {}' \;
Original file line number Diff line number Diff line change 1+ CORE
2+
3+ --native-linker=true -o dummy.gb
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ --
7+ --
8+ This is just to test that goto-ld exits without an error or a segmentation fault
9+ when processong command-line options, running the dummy-linker (/bin/)true.
Original file line number Diff line number Diff line change 3434 COMMAND "${CMAKE_COMMAND} " -E create_symlink
3535 goto-cc $<TARGET_FILE_DIR:goto-cc>/goto-gcc
3636 BYPRODUCTS ${CMAKE_BINARY_DIR} /bin/goto-gcc)
37+ add_custom_command (TARGET goto-cc
38+ POST_BUILD
39+ COMMAND "${CMAKE_COMMAND} " -E create_symlink
40+ goto-cc $<TARGET_FILE_DIR:goto-cc>/goto-ld
41+ BYPRODUCTS ${CMAKE_BINARY_DIR} /bin/goto-ld)
3742endif ()
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ class goto_cc_cmdlinet:public cmdlinet
3434 // never fails, will add if not found
3535 std::size_t get_optnr (const std::string &option);
3636
37+ // / Set option \p option to \p value.
38+ void set (const std::string &opt, const char *value) override
39+ {
40+ set (opt, std::string{value});
41+ }
42+
3743 void set (const std::string &opt, const std::string &value) override
3844 {
3945 std::size_t nr=get_optnr (opt);
Original file line number Diff line number Diff line change @@ -32,8 +32,14 @@ class cmdlinet
3232
3333 virtual bool isset (char option) const ;
3434 virtual bool isset (const char *option) const ;
35+ // / Set option \p option to \p value, or \c true if the value is omitted.
3536 virtual void set (const std::string &option, bool value = true );
3637 virtual void set (const std::string &option, const std::string &value);
38+ virtual void set (const std::string &option, const char *value)
39+ {
40+ set (option, std::string{value});
41+ }
42+
3743 virtual void clear ();
3844
3945 bool has_option (const std::string &option) const
You can’t perform that action at this time.
0 commit comments