aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/basic_SUITE_data/basic_guards.erl
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2014-03-04 14:05:49 +0100
committerKostis Sagonas <[email protected]>2015-12-16 22:08:32 +0100
commit6a645e07a02f9adda9b9534214e699ad8f30a15f (patch)
tree204668b974388eeb551ec14a4e52c7ee535acb92 /lib/hipe/test/basic_SUITE_data/basic_guards.erl
parent9fd2f21c38944c8a605020d6662bb5935c5bbee2 (diff)
downloadotp-6a645e07a02f9adda9b9534214e699ad8f30a15f.tar.gz
otp-6a645e07a02f9adda9b9534214e699ad8f30a15f.tar.bz2
otp-6a645e07a02f9adda9b9534214e699ad8f30a15f.zip
More basic tests
and some tests that the HiPE compiler is not causing trouble
Diffstat (limited to 'lib/hipe/test/basic_SUITE_data/basic_guards.erl')
-rw-r--r--lib/hipe/test/basic_SUITE_data/basic_guards.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/hipe/test/basic_SUITE_data/basic_guards.erl b/lib/hipe/test/basic_SUITE_data/basic_guards.erl
index 50c0ddd972..a519944916 100644
--- a/lib/hipe/test/basic_SUITE_data/basic_guards.erl
+++ b/lib/hipe/test/basic_SUITE_data/basic_guards.erl
@@ -13,6 +13,7 @@ test() ->
ok = guard1([foo]),
ok = test_guard2(),
ok = test_guard3(),
+ ok = test_guard4(),
ok.
%%--------------------------------------------------------------------
@@ -56,3 +57,19 @@ test_guard3() ->
f(X) when ?is_foo(X) -> yes;
f(_) -> no.
+
+%%--------------------------------------------------------------------
+
+-define(EXT_REF, <<131,114,0,3,100,0,19,114,101,102,95,116,101,115,116,95,98,117,103,64,103,111,114,98,97,103,2,0,0,0,125,0,0,0,0,0,0,0,0>>).
+
+test_guard4() ->
+ yes = is_ref(make_ref()),
+ no = is_ref(gazonk),
+ yes = is_ref(an_external_ref(?EXT_REF)),
+ ok.
+
+is_ref(Ref) when is_reference(Ref) -> yes;
+is_ref(_Ref) -> no.
+
+an_external_ref(Bin) ->
+ binary_to_term(Bin).