From 5a43eb383bdeb604fd8a891ffe34610c3fe6208b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Wed, 26 Mar 2014 18:58:46 +0100 Subject: 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. --- .../maps_SUITE_data/maps_build_and_match_over_alloc.erl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/hipe/test/maps_SUITE_data/maps_build_and_match_over_alloc.erl (limited to 'lib/hipe/test/maps_SUITE_data/maps_build_and_match_over_alloc.erl') diff --git a/lib/hipe/test/maps_SUITE_data/maps_build_and_match_over_alloc.erl b/lib/hipe/test/maps_SUITE_data/maps_build_and_match_over_alloc.erl new file mode 100644 index 0000000000..dae6f64e5f --- /dev/null +++ b/lib/hipe/test/maps_SUITE_data/maps_build_and_match_over_alloc.erl @@ -0,0 +1,16 @@ +-module(maps_build_and_match_over_alloc). +-export([test/0]). + +test() -> + Ls = id([1,2,3]), + V0 = [a|Ls], + M0 = id(#{ "a" => V0 }), + #{ "a" := V1 } = M0, + V2 = id([c|Ls]), + M2 = id(#{ "a" => V2 }), + #{ "a" := V3 } = M2, + {[a,1,2,3],[c,1,2,3]} = id({V1,V3}), + ok. + +%% Use this function to avoid compile-time evaluation of an expression. +id(I) -> I. -- cgit v1.2.3