diff options
author | John Högberg <[email protected]> | 2019-02-06 10:31:08 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-02-06 10:31:08 +0100 |
commit | 9050bb9443006e94384875efd7036ad216e45530 (patch) | |
tree | 9c51db3a0e79af9b77b748f55b6da3f73d281d6d /lib/compiler/test | |
parent | c44caa428b65e85b034b01a7f6145e5fee60a863 (diff) | |
parent | 4f8026dabf5bd81f1dad085024e2b0623e5706f4 (diff) | |
download | otp-9050bb9443006e94384875efd7036ad216e45530.tar.gz otp-9050bb9443006e94384875efd7036ad216e45530.tar.bz2 otp-9050bb9443006e94384875efd7036ad216e45530.zip |
Merge pull request #2132 from jhogberg/john/compiler/tuple-element-types
Keep track of tuple elements in type optimization pass
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/match_SUITE.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index 60ab969929..94bfbb0efe 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -25,7 +25,7 @@ match_in_call/1,untuplify/1,shortcut_boolean/1,letify_guard/1, selectify/1,deselectify/1,underscore/1,match_map/1,map_vars_used/1, coverage/1,grab_bag/1,literal_binary/1, - unary_op/1,eq_types/1]). + unary_op/1,eq_types/1,match_after_return/1]). -include_lib("common_test/include/ct.hrl"). @@ -40,7 +40,8 @@ groups() -> match_in_call,untuplify, shortcut_boolean,letify_guard,selectify,deselectify, underscore,match_map,map_vars_used,coverage, - grab_bag,literal_binary,unary_op,eq_types]}]. + grab_bag,literal_binary,unary_op,eq_types, + match_after_return]}]. init_per_suite(Config) -> @@ -890,5 +891,15 @@ eq_types(A, B) -> Ref22. +match_after_return(Config) when is_list(Config) -> + %% The return type of the following call will never match the 'wont_happen' + %% clauses below, and the beam_ssa_type was clever enough to see that but + %% didn't remove the blocks, so it crashed when trying to extract A. + ok = case mar_test_tuple(erlang:unique_integer()) of + {gurka, never_matches, A} -> {wont_happen, A}; + _ -> ok + end. + +mar_test_tuple(I) -> {gurka, I}. id(I) -> I. |