diff options
author | Erlang/OTP <[email protected]> | 2019-05-29 13:24:41 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-05-29 13:24:41 +0200 |
commit | 787a7684b02a01818eb99abc0f6a168250e192a9 (patch) | |
tree | f4a81eb55f1df223696c7792c28ef2a4e2942108 /lib/compiler/test/beam_type_SUITE.erl | |
parent | b6d769e80f9b0be730896e0a7a655d7b7344368b (diff) | |
parent | cabdef3b97c077119fe6f43538dbdd5cffe9dd91 (diff) | |
download | otp-787a7684b02a01818eb99abc0f6a168250e192a9.tar.gz otp-787a7684b02a01818eb99abc0f6a168250e192a9.tar.bz2 otp-787a7684b02a01818eb99abc0f6a168250e192a9.zip |
Merge branch 'bjorn/compiler/fix-freeze/ERL-948/OTP-15828' into maint-22
* bjorn/compiler/fix-freeze/ERL-948/OTP-15828:
Fix non-terminating compilation
Diffstat (limited to 'lib/compiler/test/beam_type_SUITE.erl')
-rw-r--r-- | lib/compiler/test/beam_type_SUITE.erl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/compiler/test/beam_type_SUITE.erl b/lib/compiler/test/beam_type_SUITE.erl index 882e281a44..0d1680fb15 100644 --- a/lib/compiler/test/beam_type_SUITE.erl +++ b/lib/compiler/test/beam_type_SUITE.erl @@ -271,8 +271,22 @@ setelement(_Config) -> T0 = id({a,42}), {a,_} = T0, {b,_} = setelement(1, T0, b), + {z,b} = do_setelement_1(<<(id(1)):32>>, {a,b}, z), + {new,two} = do_setelement_2(<<(id(1)):1>>, {one,two}, new), ok. +do_setelement_1(<<N:32>>, Tuple, NewValue) -> + _ = element(N, Tuple), + %% While updating the type for Tuple, beam_ssa_type would do: + %% maps:without(lists:seq(0, 4294967295), Elements) + setelement(N, Tuple, NewValue). + +do_setelement_2(<<N:1>>, Tuple, NewValue) -> + %% Cover the second clause in remove_element_info/2. The + %% type for the second element will be kept. + two = element(2, Tuple), + setelement(N, Tuple, NewValue). + cons(_Config) -> [did] = cons(assigned, did), |