diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compiler/test/core_SUITE.erl | 6 | ||||
-rw-r--r-- | lib/compiler/test/core_SUITE_data/eval_is_boolean.core | 22 |
2 files changed, 26 insertions, 2 deletions
diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl index 0a144a3189..37d220518e 100644 --- a/lib/compiler/test/core_SUITE.erl +++ b/lib/compiler/test/core_SUITE.erl @@ -22,7 +22,7 @@ init_per_group/2,end_per_group/2, init_per_testcase/2,end_per_testcase/2, dehydrated_itracer/1,nested_tries/1, - make_effect_seq/1]). + make_effect_seq/1,eval_is_boolean/1]). -include_lib("test_server/include/test_server.hrl"). @@ -42,7 +42,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [dehydrated_itracer,nested_tries,make_effect_seq]. + [dehydrated_itracer,nested_tries,make_effect_seq, + eval_is_boolean]. groups() -> []. @@ -63,6 +64,7 @@ end_per_group(_GroupName, Config) -> ?comp(dehydrated_itracer). ?comp(nested_tries). ?comp(make_effect_seq). +?comp(eval_is_boolean). try_it(Mod, Conf) -> ?line Src = filename:join(?config(data_dir, Conf), atom_to_list(Mod)), diff --git a/lib/compiler/test/core_SUITE_data/eval_is_boolean.core b/lib/compiler/test/core_SUITE_data/eval_is_boolean.core new file mode 100644 index 0000000000..6a68b1414d --- /dev/null +++ b/lib/compiler/test/core_SUITE_data/eval_is_boolean.core @@ -0,0 +1,22 @@ +module 'eval_is_boolean' ['eval_is_boolean'/0] + attributes [] +'eval_is_boolean'/0 = + %% Line 4 + fun () -> + case <> of + <> when 'true' -> + case call 'erlang':'is_boolean'(call 'erlang':'make_ref'()) of + <'false'> when 'true' -> + 'ok' + ( <_cor1> when 'true' -> + primop 'match_fail' + ({'badmatch',_cor1}) + -| ['compiler_generated'] ) + end + ( <> when 'true' -> + ( primop 'match_fail' + ({'function_clause'}) + -| [{'function_name',{'eval_is_boolean',0}}] ) + -| ['compiler_generated'] ) + end +end |