diff options
author | Björn Gustavsson <[email protected]> | 2018-11-02 10:02:34 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-11-02 10:02:34 +0100 |
commit | 3e742b1d270069ede1aa8b6ae69c83fc6e71f814 (patch) | |
tree | cb57c0cf90b1c2c7726698eb761efb97ff8d3c49 /lib/compiler/test | |
parent | 7999ddad6121db7d1b7fe44b3c6a80a8d7ff70f3 (diff) | |
parent | 94517048c3dad66c6c6469088d174cefcbbdb552 (diff) | |
download | otp-3e742b1d270069ede1aa8b6ae69c83fc6e71f814.tar.gz otp-3e742b1d270069ede1aa8b6ae69c83fc6e71f814.tar.bz2 otp-3e742b1d270069ede1aa8b6ae69c83fc6e71f814.zip |
Merge branch 'bjorn/compiler/fix-beam_jump/ERL-759/OTP-15400' into maint
* bjorn/compiler/fix-beam_jump/ERL-759/OTP-15400:
Fix bug when beam_jump removes put_tuple instructions
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/beam_jump_SUITE.erl | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/compiler/test/beam_jump_SUITE.erl b/lib/compiler/test/beam_jump_SUITE.erl index c61e4ab65c..faedc0c1f1 100644 --- a/lib/compiler/test/beam_jump_SUITE.erl +++ b/lib/compiler/test/beam_jump_SUITE.erl @@ -21,7 +21,8 @@ -export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1, init_per_group/2,end_per_group/2, - undefined_label/1,ambiguous_catch_try_state/1]). + undefined_label/1,ambiguous_catch_try_state/1, + build_tuple/1]). suite() -> [{ct_hooks,[ts_install_cth]}]. @@ -32,7 +33,8 @@ all() -> groups() -> [{p,[parallel], [undefined_label, - ambiguous_catch_try_state + ambiguous_catch_try_state, + build_tuple ]}]. init_per_suite(Config) -> @@ -72,3 +74,16 @@ river() -> song. checks(Wanted) -> %% Must be one line to cause the unsafe optimization. {catch case river() of sheet -> begin +Wanted, if "da" -> Wanted end end end, catch case river() of sheet -> begin + Wanted, if "da" -> Wanted end end end}. + +-record(message2, {id, p1}). +-record(message3, {id, p1, p2}). + +build_tuple(_Config) -> + {'EXIT',{{badrecord,message3},_}} = (catch do_build_tuple(#message2{})), + ok. + +do_build_tuple(Message) -> + if is_record(Message, message2) -> + Res = {res, rand:uniform(100)}, + {Message#message3.id, Res} + end. |