diff options
Diffstat (limited to 'lib/compiler/test/record_SUITE.erl')
-rw-r--r-- | lib/compiler/test/record_SUITE.erl | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl index 4ed7f39780..3a2453dd4b 100644 --- a/lib/compiler/test/record_SUITE.erl +++ b/lib/compiler/test/record_SUITE.erl @@ -608,8 +608,9 @@ coverage(Config) when is_list(Config) -> -record(gb_nil, {}). -record(gb_foo, {hello=1}). -record(gb_bar, {hello=2,there=3}). +-record(gb_rh, {mod,mid}). -%% Taken from compilation_SUITE. +%% Taken from compilation_SUITE and other places. grab_bag(_Config) -> T1 = fun() -> X = #foo{}, @@ -653,6 +654,23 @@ grab_bag(_Config) -> end, T4(), + %% Used to crash beam_ssa_bool during its development. + T5 = fun(RH) -> + if + is_record(RH, gb_rh) andalso + is_atom(RH#gb_rh.mod) andalso + RH#gb_rh.mid /= 42 -> ok; + true -> error + end + end, + ok = T5(#gb_rh{}), + ok = T5(#gb_rh{mod=atom,mid=0}), + error = T5(#gb_rh{mod=100,mid=0}), + error = T5(#gb_rh{mod=atom,mid=42}), + error = T5(#gb_nil{}), + error = T5(#gb_bar{}), + error = T5(atom), + ok. first_arg(First, _) -> First. |