diff options
author | Björn Gustavsson <[email protected]> | 2016-06-03 11:57:45 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-06-03 11:57:45 +0200 |
commit | b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d (patch) | |
tree | 92ed0d8617d36ae9248195044b10c096d59285bd /lib/compiler/test/map_SUITE.erl | |
parent | 7d51cf9c8ce2062ed89ea6f8f24f01f826abc90b (diff) | |
parent | 819d11e4a8f67cbe5c6fa60580e47a5b884040d7 (diff) | |
download | otp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.tar.gz otp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.tar.bz2 otp-b9f8fee6ab5088825f53bfa5dcfdca2ffa81288d.zip |
Merge branch 'bjorn/compiler/misc'
* bjorn/compiler/misc:
misc_SUITE: Cover the remaining lines in beam_peep
Avoid the dreaded "no_file" in warnings
Eliminate crash for map updates in guards
beam_block: Eliminate crash in beam_utils
Diffstat (limited to 'lib/compiler/test/map_SUITE.erl')
-rw-r--r-- | lib/compiler/test/map_SUITE.erl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl index c3c4862794..36e82c1459 100644 --- a/lib/compiler/test/map_SUITE.erl +++ b/lib/compiler/test/map_SUITE.erl @@ -1287,6 +1287,7 @@ t_guard_update(Config) when is_list(Config) -> first = map_guard_update(#{}, #{x=>first}), second = map_guard_update(#{y=>old}, #{x=>second,y=>old}), third = map_guard_update(#{x=>old,y=>old}, #{x=>third,y=>old}), + bad_map_guard_update(), ok. t_guard_update_large(Config) when is_list(Config) -> @@ -1353,6 +1354,29 @@ map_guard_update(M1, M2) when M1#{x=>second} =:= M2 -> second; map_guard_update(M1, M2) when M1#{x:=third} =:= M2 -> third; map_guard_update(_, _) -> error. +bad_map_guard_update() -> + do_bad_map_guard_update(fun burns/1), + do_bad_map_guard_update(fun turns/1), + ok. + +do_bad_map_guard_update(Fun) -> + do_bad_map_guard_update_1(Fun, #{}), + do_bad_map_guard_update_1(Fun, #{true=>1}), + ok. + +do_bad_map_guard_update_1(Fun, Value) -> + %% Note: The business with the seemingly redundant fun + %% disables inlining, which would otherwise change the + %% EXIT reason. + {'EXIT',{function_clause,_}} = (catch Fun(Value)), + ok. + +burns(Richmond) when not (Richmond#{true := 0}); [Richmond] -> + specification. + +turns(Richmond) when not (Richmond#{true => 0}); [Richmond] -> + specification. + t_guard_receive(Config) when is_list(Config) -> M0 = #{ id => 0 }, Pid = spawn_link(fun() -> guard_receive_loop() end), |