aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-04 15:26:29 +0100
committerBjörn Gustavsson <[email protected]>2012-01-04 16:14:18 +0100
commitd2c8975549f8496dd5e79c3862a25504c06fca9e (patch)
tree23070aeece91a414331159bfdcb320fd971024b7
parent98cb1565707047d768e439a4c8f112988ef36030 (diff)
downloadotp-d2c8975549f8496dd5e79c3862a25504c06fca9e.tar.gz
otp-d2c8975549f8496dd5e79c3862a25504c06fca9e.tar.bz2
otp-d2c8975549f8496dd5e79c3862a25504c06fca9e.zip
core_SUITE: Cover sys_core_fold:eval_is_boolean/2
-rw-r--r--lib/compiler/test/core_SUITE.erl6
-rw-r--r--lib/compiler/test/core_SUITE_data/eval_is_boolean.core22
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