aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl
diff options
context:
space:
mode:
authorZandra <[email protected]>2016-01-27 11:44:59 +0100
committerZandra <[email protected]>2016-01-27 11:44:59 +0100
commitf0b7d4797b13a90b4dcee40468a5675a73feb1d4 (patch)
tree44e2832bbe7e7a0c1deaa6bd8685d3d03713a2b2 /lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl
parent6b6828e51300e318b8a3a572b6a5d78ca3756d79 (diff)
parent9722388b2fcec9b7f7e5680335e1bd6392ef11fc (diff)
downloadotp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.tar.gz
otp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.tar.bz2
otp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.zip
Merge branch 'maint'
Diffstat (limited to 'lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl')
-rw-r--r--lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl b/lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl
new file mode 100644
index 0000000000..9f0830574f
--- /dev/null
+++ b/lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl
@@ -0,0 +1,28 @@
+%%% -*- erlang-indent-level: 2 -*-
+%%%----------------------------------------------------------------------
+%%% Author: Kostis Sagonas
+%%%
+%%% Tests that when the native code compilation times out or gets killed
+%%% for some other reason, the parent process does not also get killed.
+%%%
+%%% Problem discovered by Bjorn G. on 1/12/2003 and fixed by Kostis.
+%%%----------------------------------------------------------------------
+
+-module(sanity_comp_timeout).
+
+-export([test/0, to_llvm/0]).
+
+test() ->
+ ok = write_dummy_mod(),
+ error_logger:tty(false), % disable printouts of error reports
+ Self = self(), % get the parent process
+ c:c(dummy_mod, [native, {hipe, [{timeout, 1}]}]), % This will kill the process
+ Self = self(), % make sure the parent process stays the same
+ ok.
+
+to_llvm() -> false.
+
+write_dummy_mod() ->
+ Prog = <<"-module(dummy_mod).\n-export([test/0]).\ntest() -> ok.\n">>,
+ ok = file:write_file("dummy_mod.erl", Prog).
+