aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/beam_utils_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-04-28 10:27:58 +0200
committerBjörn Gustavsson <[email protected]>2016-04-28 10:27:58 +0200
commit85ccc38d59dd9751dfd7cead0e4ed0c1e6c169ad (patch)
tree9577c25d091144a7d18f1d8e02244a1e64411c83 /lib/compiler/test/beam_utils_SUITE.erl
parentffde713643a17efac285165e830809c797f3f202 (diff)
parenta4301978be3571a2caaf77da9e2d119750c8b894 (diff)
downloadotp-85ccc38d59dd9751dfd7cead0e4ed0c1e6c169ad.tar.gz
otp-85ccc38d59dd9751dfd7cead0e4ed0c1e6c169ad.tar.bz2
otp-85ccc38d59dd9751dfd7cead0e4ed0c1e6c169ad.zip
Merge branch 'bjorn/compiler/cuddle-with-tests'
* bjorn/compiler/cuddle-with-tests: compilation_SUITE: Use explicit exports Remove support for running tests on a separate Erlang node Move code from compilation_SUITE to beam_block_SUITE Move list comprehension tests to lc_SUITE Move catch tests to trycatch_SUITE Remove compilation_SUITE:long_string/1 Move pattern-matching tests to match_SUITE Remove toothless test compile_SUITE:missing_testheap/1 misc_SUITE: Add missing export of integer_encoding/0 Move test cases from compilation_SUITE to beam_utils_SUITE Move complex_guard/1 from compilation_SUITE to guard_SUITE Remove compilation_SUITE:guards/1 Move tests from compilation_SUITE to record_SUITE Move bit syntax test cases from compilation_SUITE to bs_match_SUITE Remove useless test case compilation_SUITE:otp_2141/1 compilation_SUITE: Run the Core linter for all compilations
Diffstat (limited to 'lib/compiler/test/beam_utils_SUITE.erl')
-rw-r--r--lib/compiler/test/beam_utils_SUITE.erl40
1 files changed, 38 insertions, 2 deletions
diff --git a/lib/compiler/test/beam_utils_SUITE.erl b/lib/compiler/test/beam_utils_SUITE.erl
index 70c00f163c..6353ed3242 100644
--- a/lib/compiler/test/beam_utils_SUITE.erl
+++ b/lib/compiler/test/beam_utils_SUITE.erl
@@ -23,7 +23,7 @@
init_per_group/2,end_per_group/2,
apply_fun/1,apply_mf/1,bs_init/1,bs_save/1,
is_not_killed/1,is_not_used_at/1,
- select/1,y_catch/1]).
+ select/1,y_catch/1,otp_8949_b/1,liveopt/1]).
-export([id/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
@@ -41,7 +41,9 @@ groups() ->
is_not_killed,
is_not_used_at,
select,
- y_catch
+ y_catch,
+ otp_8949_b,
+ liveopt
]}].
init_per_suite(Config) ->
@@ -232,6 +234,40 @@ do_y_catch_1(<<_,_/binary>>, _) ->
do_y_catch_2(_) -> {a,b,c}.
+otp_8949_b(_Config) ->
+ self() ! something,
+ value = otp_8949_b([], false),
+ {'EXIT',_} = (catch otp_8949_b([], true)),
+ ok.
+
+%% Would cause an endless loop in beam_utils.
+otp_8949_b(A, B) ->
+ Var = id(value),
+ if
+ A == [], B == false ->
+ ok
+ end,
+ receive
+ something ->
+ id(Var)
+ end.
+
+-record(alarmInfo, {type,cause,origin}).
+
+liveopt(_Config) ->
+ F = liveopt_fun(42, pebkac, user),
+ void = F(42, #alarmInfo{type=sctp,cause=pebkac,origin=user}),
+ ok.
+
+liveopt_fun(Peer, Cause, Origin) ->
+ fun(PeerNo, AlarmInfo)
+ when PeerNo == Peer andalso
+ AlarmInfo == #alarmInfo{type=sctp,
+ cause=Cause,
+ origin=Origin} ->
+ void
+ end.
+
%% The identity function.
id(I) -> I.