aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/core_SUITE_data
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-05-27 04:46:41 +0200
committerBjörn Gustavsson <[email protected]>2019-05-27 05:47:00 +0200
commit73c5ceba1185b0be7db9acac8593e5b913dba845 (patch)
treecf19a07b23134121eb39efe4643dfeb62f497bf9 /lib/compiler/test/core_SUITE_data
parentd32991afaf3fc5f9f73e3e2448672bb9a1b80101 (diff)
downloadotp-73c5ceba1185b0be7db9acac8593e5b913dba845.tar.gz
otp-73c5ceba1185b0be7db9acac8593e5b913dba845.tar.bz2
otp-73c5ceba1185b0be7db9acac8593e5b913dba845.zip
Fix loading of Core Erlang code for extracting a map element
The following Core Erlang code could not be loaded: 'f'/1 = fun (_1) -> case <_1> of <~{'foo':='foo'}~> when 'true' -> _1 end Loading would fail with the following message: beam/beam_load.c(2314): Error loading function example:f/1: op i_get_map_element_hash p x a u x: no specific operation found https://bugs.erlang.org/browse/ERL-955
Diffstat (limited to 'lib/compiler/test/core_SUITE_data')
-rw-r--r--lib/compiler/test/core_SUITE_data/get_map_element.core18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/compiler/test/core_SUITE_data/get_map_element.core b/lib/compiler/test/core_SUITE_data/get_map_element.core
new file mode 100644
index 0000000000..092b5e71eb
--- /dev/null
+++ b/lib/compiler/test/core_SUITE_data/get_map_element.core
@@ -0,0 +1,18 @@
+module 'get_map_element' ['get_map_element'/0]
+attributes []
+
+'get_map_element'/0 =
+ fun () ->
+ apply 'match_map'/1(~{'foo'=>'bar'}~)
+
+'match_map'/1 =
+ fun (_0) ->
+ case _0 of
+ <~{'foo':='bar'}~> when 'true' ->
+ 'ok'
+ %% It will be undefined behaviour at runtime if no
+ %% clause of the case can be selected. That can't
+ %% happen for this module, because match_map/1 is
+ %% always called with a matching map argument.
+ end
+end