aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/maps_SUITE_data/maps_build_and_match_aliasing.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2014-03-26 18:58:46 +0100
committerKostis Sagonas <[email protected]>2014-04-29 11:40:29 +0200
commit5a43eb383bdeb604fd8a891ffe34610c3fe6208b (patch)
tree1a76c9a5bf0d8f32c06acb8266eaa52ce6e860d5 /lib/hipe/test/maps_SUITE_data/maps_build_and_match_aliasing.erl
parente486d8b0c6124f39db6fa600f348c7bd5c0c1a13 (diff)
downloadotp-5a43eb383bdeb604fd8a891ffe34610c3fe6208b.tar.gz
otp-5a43eb383bdeb604fd8a891ffe34610c3fe6208b.tar.bz2
otp-5a43eb383bdeb604fd8a891ffe34610c3fe6208b.zip
Copy the tests for maps from the compiler application to a new HiPE test suite
Change the maps_guard_fun test to accept the HiPE trace format.
Diffstat (limited to 'lib/hipe/test/maps_SUITE_data/maps_build_and_match_aliasing.erl')
-rw-r--r--lib/hipe/test/maps_SUITE_data/maps_build_and_match_aliasing.erl20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/hipe/test/maps_SUITE_data/maps_build_and_match_aliasing.erl b/lib/hipe/test/maps_SUITE_data/maps_build_and_match_aliasing.erl
new file mode 100644
index 0000000000..14d8320cdf
--- /dev/null
+++ b/lib/hipe/test/maps_SUITE_data/maps_build_and_match_aliasing.erl
@@ -0,0 +1,20 @@
+-module(maps_build_and_match_aliasing).
+-export([test/0]).
+
+test() ->
+ M1 = id(#{a=>1,b=>2,c=>3,d=>4}),
+ #{c:=C1=_=_=C2} = M1,
+ true = C1 =:= C2,
+ #{a:=A,a:=A,a:=A,b:=B,b:=B} = M1,
+ #{a:=A,a:=A,a:=A,b:=B,b:=B,b:=2} = M1,
+ #{a:=A=1,a:=A,a:=A,b:=B=2,b:=B,b:=2} = M1,
+ #{c:=C1, c:=_, c:=3, c:=_, c:=C2} = M1,
+ #{c:=C=_=3=_=C} = M1,
+
+ M2 = id(#{"a"=>1,"b"=>2,"c"=>3,"d"=>4}),
+ #{"a":=A2,"a":=A2,"a":=A2,"b":=B2,"b":=B2,"b":=2} = M2,
+ #{"a":=_,"a":=_,"a":=_,"b":=_,"b":=_,"b":=2} = M2,
+ ok.
+
+%% Use this function to avoid compile-time evaluation of an expression.
+id(I) -> I.