diff options
author | Kostis Sagonas <[email protected]> | 2014-03-04 14:05:49 +0100 |
---|---|---|
committer | Kostis Sagonas <[email protected]> | 2015-12-16 22:08:32 +0100 |
commit | 6a645e07a02f9adda9b9534214e699ad8f30a15f (patch) | |
tree | 204668b974388eeb551ec14a4e52c7ee535acb92 /lib/hipe/test/basic_SUITE_data/basic_beam_instrs.erl | |
parent | 9fd2f21c38944c8a605020d6662bb5935c5bbee2 (diff) | |
download | otp-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_beam_instrs.erl')
-rw-r--r-- | lib/hipe/test/basic_SUITE_data/basic_beam_instrs.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/hipe/test/basic_SUITE_data/basic_beam_instrs.erl b/lib/hipe/test/basic_SUITE_data/basic_beam_instrs.erl index 50c2180cbd..6fafea3b09 100644 --- a/lib/hipe/test/basic_SUITE_data/basic_beam_instrs.erl +++ b/lib/hipe/test/basic_SUITE_data/basic_beam_instrs.erl @@ -13,6 +13,7 @@ test() -> ok = test_switch_val(), ok = test_put_literal(), ok = test_set_tuple_element(), + ok = test_unguarded_unsafe_element(), ok. %%-------------------------------------------------------------------- @@ -88,3 +89,14 @@ simple_set(State, Val) -> %% f3 = Val is the one used in set_element; odd_set(State, Val) -> %% f3 = foo is the one used in set_element; State#rec{f1 = foo, f5 = Val*2.0}. %% this checks the case of constant + +%%-------------------------------------------------------------------- +%% Tests the handling of unguarded unsafe_element operations that BEAM +%% can sometimes construct on records (when it has enough context). + +test_unguarded_unsafe_element() -> + {badrecord, rec} = try unguarded_unsafe_element(42) catch error:E -> E end, + ok. + +unguarded_unsafe_element(X) -> + X#rec{f1 = X#rec.f3}. |