diff --git a/programs/divzero/Makefile b/programs/divzero/Makefile new file mode 100644 index 00000000..1d65bd37 --- /dev/null +++ b/programs/divzero/Makefile @@ -0,0 +1,14 @@ +.PHONY: default clean + +EXEC_NAME=divzero + +default: link + +include ../../cpp.mk + +$(eval $(call program_compile_cpp_folder,src)) +$(eval $(call program_link_executable,$(EXEC_NAME))) + +clean: + @ echo -e "Remove compiled files" + @ rm -rf debug diff --git a/programs/divzero/src/main.cpp b/programs/divzero/src/main.cpp new file mode 100644 index 00000000..8575f315 --- /dev/null +++ b/programs/divzero/src/main.cpp @@ -0,0 +1,16 @@ +//======================================================================= +// Copyright Baptiste Wicht 2013-2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +//======================================================================= + +#include + +volatile int a = 0; + +int main(int /*argc*/, char* /*argv*/[]){ + a = 42 / a; + + exit(a); +}