diff --git a/regression/ansi-c/Makefile b/regression/ansi-c/Makefile index 29b7015a789..a3bc73d88a1 100644 --- a/regression/ansi-c/Makefile +++ b/regression/ansi-c/Makefile @@ -12,15 +12,14 @@ endif ifeq ($(BUILD_ENV_),MSVC) excluded_tests = -X gcc-only else +ifeq ($(BUILD_ENV_),OSX) # In MacOS, a change in the assert.h header file # is causing template errors when exercising the # C++ front end (because of a transitive include # of ) for files that include the # or headers. - OS := $(shell uname) - ifeq ($(OS),Darwin) - excluded_tests = -X macos-assert-broken - endif + excluded_tests = -X macos-assert-broken +endif endif test: diff --git a/regression/cbmc-cpp/Makefile b/regression/cbmc-cpp/Makefile index 6fe75e75119..790f788c5da 100644 --- a/regression/cbmc-cpp/Makefile +++ b/regression/cbmc-cpp/Makefile @@ -6,15 +6,14 @@ include ../../src/common ifeq ($(BUILD_ENV_),MSVC) excluded_tests = -X gcc-only -X winbug else +ifeq ($(BUILD_ENV_),OSX) # In MacOS, a change in the assert.h header file # is causing template errors when exercising the # C++ front end (because of a transitive include # of ) for files that include the # or headers. - OS := $(shell uname) - ifeq ($(OS),Darwin) - excluded_tests = -X macos-assert-broken - endif + excluded_tests = -X macos-assert-broken +endif endif test: diff --git a/regression/cpp/Makefile b/regression/cpp/Makefile index 8d14e00ce1b..ad98930bc22 100644 --- a/regression/cpp/Makefile +++ b/regression/cpp/Makefile @@ -12,15 +12,14 @@ endif ifeq ($(BUILD_ENV_),MSVC) excluded_tests = -X gcc-only -X winbug else +ifeq ($(BUILD_ENV_),OSX) # In MacOS, a change in the assert.h header file # is causing template errors when exercising the # C++ front end (because of a transitive include # of ) for files that include the # or headers. - OS := $(shell uname) - ifeq ($(OS),Darwin) - excluded_tests = -X macos-assert-broken - endif + excluded_tests = -X macos-assert-broken +endif endif test: diff --git a/regression/goto-gcc/CMakeLists.txt b/regression/goto-gcc/CMakeLists.txt index fe4828f81b6..6a5a6aa3462 100644 --- a/regression/goto-gcc/CMakeLists.txt +++ b/regression/goto-gcc/CMakeLists.txt @@ -1,7 +1,13 @@ +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + set(not_gnu_ld -X gnu-ld-only) +else() + set(not_gnu_ld "") +endif() + # TARGET_FILE (as used in other directories) can't be used with goto-gcc as it # isn't marked as an executable (target), which CMake requires. Thus construct a # path in the same way the symbolic link is created in the goto-cc directory. -add_test_pl_tests("$/goto-gcc") +add_test_pl_tests("$/goto-gcc" ${not_gnu_ld}) add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/archives/libour_archive.a" COMMAND "$/goto-gcc" -c foo.c @@ -15,3 +21,11 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/archives/libour_archive.a add_custom_target(libour_archive.a ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/archives/libour_archive.a" ) + +if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") + set_property( + TEST "goto-gcc-CORE" + PROPERTY ENVIRONMENT + "PATH=$ENV{PATH}:$" + ) +endif() diff --git a/regression/goto-gcc/Makefile b/regression/goto-gcc/Makefile index 412fd745f10..2c5b09e3bc4 100644 --- a/regression/goto-gcc/Makefile +++ b/regression/goto-gcc/Makefile @@ -9,11 +9,16 @@ test: tests.log: ../test.pl else +ifeq ($(BUILD_ENV_),OSX) + not_gnu_ld = -X gnu-ld-only +endif test: ../../src/goto-cc/goto-gcc - @../test.pl -e -p -c ../../../src/goto-cc/goto-gcc + @PATH=../../../scripts:$$PATH \ + ../test.pl -e -p -c ../../../src/goto-cc/goto-gcc $(not_gnu_ld) tests.log: ../test.pl ../../src/goto-cc/goto-gcc - @../test.pl -e -p -c ../../../src/goto-cc/goto-gcc + @PATH=../../../scripts:$$PATH \ + ../test.pl -e -p -c ../../../src/goto-cc/goto-gcc $(not_gnu_ld) ../../src/goto-cc/goto-gcc: ../../src/goto-cc/goto-cc @ln -sf goto-cc ../../src/goto-cc/goto-gcc diff --git a/regression/ansi-c/linker_script_start+end/main.c b/regression/goto-gcc/linker_script_start+end/main.c similarity index 74% rename from regression/ansi-c/linker_script_start+end/main.c rename to regression/goto-gcc/linker_script_start+end/main.c index 3a83adc35f2..a82c5d0945d 100644 --- a/regression/ansi-c/linker_script_start+end/main.c +++ b/regression/goto-gcc/linker_script_start+end/main.c @@ -2,11 +2,13 @@ extern char src_start[]; extern char src_end[]; extern char dst_start[]; -void *memcpy(void *dest, void *src, unsigned n){ +void *memcpy(void *dest, void *src, unsigned n) +{ return (void *)0; } -int main(){ +int main() +{ memcpy(dst_start, src_start, (unsigned)src_end - (unsigned)src_start); return 0; } diff --git a/regression/ansi-c/linker_script_start+end/script.ld b/regression/goto-gcc/linker_script_start+end/script.ld similarity index 100% rename from regression/ansi-c/linker_script_start+end/script.ld rename to regression/goto-gcc/linker_script_start+end/script.ld diff --git a/regression/ansi-c/linker_script_start+end/test.desc b/regression/goto-gcc/linker_script_start+end/test.desc similarity index 81% rename from regression/ansi-c/linker_script_start+end/test.desc rename to regression/goto-gcc/linker_script_start+end/test.desc index eb50eb8a5c4..95aeddcbf03 100644 --- a/regression/ansi-c/linker_script_start+end/test.desc +++ b/regression/goto-gcc/linker_script_start+end/test.desc @@ -1,9 +1,10 @@ -CORE +CORE gnu-ld-only main.c --o out.gb -T script.ld -nostdlib +-o out.gb -T script.ld -nostdlib -static -Wall ^EXIT=0$ ^SIGNAL=0$ -- +Problem parsing linker script ^warning: ignoring ^CONVERSION ERROR$ -- diff --git a/regression/ansi-c/linker_script_start+size/main.c b/regression/goto-gcc/linker_script_start+size/main.c similarity index 72% rename from regression/ansi-c/linker_script_start+size/main.c rename to regression/goto-gcc/linker_script_start+size/main.c index 1dcd7e9df42..9111695b128 100644 --- a/regression/ansi-c/linker_script_start+size/main.c +++ b/regression/goto-gcc/linker_script_start+size/main.c @@ -2,11 +2,13 @@ extern char src_start[]; extern char src_size[]; extern char dst_start[]; -void *memcpy(void *dest, void *src, unsigned n){ +void *memcpy(void *dest, void *src, unsigned n) +{ return (void *)0; } -int main(){ +int main() +{ memcpy(dst_start, src_start, (unsigned)src_size); return 0; } diff --git a/regression/ansi-c/linker_script_start+size/script.ld b/regression/goto-gcc/linker_script_start+size/script.ld similarity index 100% rename from regression/ansi-c/linker_script_start+size/script.ld rename to regression/goto-gcc/linker_script_start+size/script.ld diff --git a/regression/ansi-c/linker_script_start+size/test.desc b/regression/goto-gcc/linker_script_start+size/test.desc similarity index 84% rename from regression/ansi-c/linker_script_start+size/test.desc rename to regression/goto-gcc/linker_script_start+size/test.desc index 34b07f7bc8b..6f5d8c2a891 100644 --- a/regression/ansi-c/linker_script_start+size/test.desc +++ b/regression/goto-gcc/linker_script_start+size/test.desc @@ -1,9 +1,10 @@ -CORE +CORE gnu-ld-only main.c --o out.gb -T script.ld -nostdlib +-o out.gb -T script.ld -nostdlib -static -Wall ^EXIT=0$ ^SIGNAL=0$ -- +Problem parsing linker script ^warning: ignoring ^CONVERSION ERROR$ -- diff --git a/regression/ansi-c/linker_script_symbol-only/main.c b/regression/goto-gcc/linker_script_symbol-only/main.c similarity index 81% rename from regression/ansi-c/linker_script_symbol-only/main.c rename to regression/goto-gcc/linker_script_symbol-only/main.c index 62fc32c179c..cd985766478 100644 --- a/regression/ansi-c/linker_script_symbol-only/main.c +++ b/regression/goto-gcc/linker_script_symbol-only/main.c @@ -1,6 +1,7 @@ extern char sym[]; -int main(){ +int main() +{ int foo = (int)sym; return 0; } diff --git a/regression/ansi-c/linker_script_symbol-only/script.ld b/regression/goto-gcc/linker_script_symbol-only/script.ld similarity index 100% rename from regression/ansi-c/linker_script_symbol-only/script.ld rename to regression/goto-gcc/linker_script_symbol-only/script.ld diff --git a/regression/ansi-c/linker_script_symbol-only/test.desc b/regression/goto-gcc/linker_script_symbol-only/test.desc similarity index 78% rename from regression/ansi-c/linker_script_symbol-only/test.desc rename to regression/goto-gcc/linker_script_symbol-only/test.desc index f5d818e7cf6..9982229180e 100644 --- a/regression/ansi-c/linker_script_symbol-only/test.desc +++ b/regression/goto-gcc/linker_script_symbol-only/test.desc @@ -1,9 +1,10 @@ -CORE +CORE gnu-ld-only main.c --o out.gb -T script.ld -nostdlib +-o out.gb -T script.ld -nostdlib -static -Wall ^EXIT=0$ ^SIGNAL=0$ -- +Problem parsing linker script ^warning: ignoring ^CONVERSION ERROR$ -- diff --git a/regression/systemc/Makefile b/regression/systemc/Makefile index b578e6d9da9..588589d35a5 100644 --- a/regression/systemc/Makefile +++ b/regression/systemc/Makefile @@ -12,15 +12,14 @@ endif ifeq ($(BUILD_ENV_),MSVC) excluded_tests = -X gcc-only -X winbug else +ifeq ($(BUILD_ENV_),OSX) # In MacOS, a change in the assert.h header file # is causing template errors when exercising the # C++ front end (because of a transitive include # of ) for files that include the # or headers. - OS := $(shell uname) - ifeq ($(OS),Darwin) - excluded_tests = -X macos-assert-broken - endif + excluded_tests = -X macos-assert-broken +endif endif default: tests.log diff --git a/src/goto-cc/CMakeLists.txt b/src/goto-cc/CMakeLists.txt index 5cbb72c8951..9fdc14173b0 100644 --- a/src/goto-cc/CMakeLists.txt +++ b/src/goto-cc/CMakeLists.txt @@ -41,11 +41,18 @@ else() COMMAND "${CMAKE_COMMAND}" -E create_symlink goto-cc $/goto-ld BYPRODUCTS ${CMAKE_BINARY_DIR}/bin/goto-ld) + add_custom_command(TARGET goto-cc + POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/ls_parse.py + $/ls_parse.py + BYPRODUCTS ${CMAKE_BINARY_DIR}/bin/ls_parse.py) install( FILES ${CMAKE_BINARY_DIR}/bin/goto-ld ${CMAKE_BINARY_DIR}/bin/goto-gcc + ${CMAKE_BINARY_DIR}/bin/ls_parse.py DESTINATION ${CMAKE_INSTALL_BINDIR}) endif()