diff options
author | Björn Gustavsson <[email protected]> | 2015-02-05 09:34:10 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-02-05 09:34:10 +0100 |
commit | cb44555c44725afea836ed7b255c8bd45d8eec58 (patch) | |
tree | 24164e8557f9d62578bfe94be98fc084f17e6470 /lib/compiler/test/core_fold_SUITE.erl | |
parent | 42d6afe554e11813385dbf175fce58f995c2f9e5 (diff) | |
parent | f79afb23fbd469bed88616784f757707f9985a06 (diff) | |
download | otp-cb44555c44725afea836ed7b255c8bd45d8eec58.tar.gz otp-cb44555c44725afea836ed7b255c8bd45d8eec58.tar.bz2 otp-cb44555c44725afea836ed7b255c8bd45d8eec58.zip |
Merge branch 'bjorn/compiler/maps-comparison/OTP-12456' into maint
* bjorn/compiler/maps-comparison/OTP-12456:
Correct unsafe optimization of '==' and '/='
Diffstat (limited to 'lib/compiler/test/core_fold_SUITE.erl')
-rw-r--r-- | lib/compiler/test/core_fold_SUITE.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 9c7e97a1bf..2de17e7653 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -210,6 +210,16 @@ eq(Config) when is_list(Config) -> ?line ?CMP_DIFF(a, [a]), ?line ?CMP_DIFF(a, {1,2,3}), + ?CMP_SAME(#{a=>1.0,b=>2}, #{b=>2.0,a=>1}), + ?CMP_SAME(#{a=>[1.0],b=>[2]}, #{b=>[2.0],a=>[1]}), + + %% The rule for comparing keys are different in 17.x and 18.x. + %% Just test that the results are consistent. + Bool = id(#{1=>a}) == id(#{1.0=>a}), %Unoptimizable. + Bool = id(#{1=>a}) == #{1.0=>a}, %Optimizable. + Bool = #{1=>a} == #{1.0=>a}, %Optimizable. + io:format("Bool = ~p\n", [Bool]), + ok. %% OTP-7117. |