diff options
author | Zandra <[email protected]> | 2016-01-27 11:44:59 +0100 |
---|---|---|
committer | Zandra <[email protected]> | 2016-01-27 11:44:59 +0100 |
commit | f0b7d4797b13a90b4dcee40468a5675a73feb1d4 (patch) | |
tree | 44e2832bbe7e7a0c1deaa6bd8685d3d03713a2b2 /lib/hipe/test/basic_SUITE_data/basic_inline_module.erl | |
parent | 6b6828e51300e318b8a3a572b6a5d78ca3756d79 (diff) | |
parent | 9722388b2fcec9b7f7e5680335e1bd6392ef11fc (diff) | |
download | otp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.tar.gz otp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.tar.bz2 otp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/hipe/test/basic_SUITE_data/basic_inline_module.erl')
-rw-r--r-- | lib/hipe/test/basic_SUITE_data/basic_inline_module.erl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/hipe/test/basic_SUITE_data/basic_inline_module.erl b/lib/hipe/test/basic_SUITE_data/basic_inline_module.erl new file mode 100644 index 0000000000..306c6a39ce --- /dev/null +++ b/lib/hipe/test/basic_SUITE_data/basic_inline_module.erl @@ -0,0 +1,31 @@ +%%% -*- erlang-indent-level: 2 -*- +%%%------------------------------------------------------------------- +%%% Author: Kostis Sagonas +%%% +%%% Contains tests that depend on the compiler inliner being turned on. +%%%------------------------------------------------------------------- +-module(basic_inline_module). + +-export([test/0]). + +-compile([inline]). %% necessary for these tests + +test() -> + ok = test_case_end_atom(), + ok. + +%%-------------------------------------------------------------------- +%% Tests whether the translation of a case_end instruction works even +%% when an exception (no matching case pattern) is to be raised. + +test_case_end_atom() -> + {'EXIT',{{case_clause,some_atom},_Trace}} = (catch test_case_stm_inlining()), + ok. + +test_case_stm_inlining() -> + case some_atom() of + another_atom -> strange_result + end. + +some_atom() -> + some_atom. |