aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/bs_shadowed_size_var.core
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compiler/test/bs_shadowed_size_var.core')
-rw-r--r--lib/compiler/test/bs_shadowed_size_var.core25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/compiler/test/bs_shadowed_size_var.core b/lib/compiler/test/bs_shadowed_size_var.core
new file mode 100644
index 0000000000..d1d5ebba6d
--- /dev/null
+++ b/lib/compiler/test/bs_shadowed_size_var.core
@@ -0,0 +1,25 @@
+module 'bs_shadowed_size_var' ['filter_essentials'/1]
+ attributes []
+
+%% Reduced code from beam_asm inlined using the old inliner.
+
+'filter_essentials'/1 =
+ fun (_cor0) ->
+ case _cor0 of
+ <[#{#<Sz>(32,1,'integer',['unsigned','big']) }#|T]> when 'true' ->
+ let <_cor4> =
+ case T of
+ %% Variable 'Sz' repeated here. Should work.
+ <#{#<Sz>(32,1,'integer',['unsigned','big']),
+ #<Data>(Sz,8,'binary',['unsigned','big'])}#> when 'true' ->
+ Data
+ <_cor5> when 'true' ->
+ primop 'match_fail'
+ ({'case_clause',{_cor5}})
+ end
+ in [Sz|_cor4]
+ <_cor5> when 'true' ->
+ primop 'match_fail'
+ ({'function_clause',_cor5})
+ end
+end