aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_SUITE_data/src/bin_compr.erl
blob: 8c2497ed214814d60823d73b0adab4c6904f7198 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
%%% -*- erlang-indent-level: 2 -*-
%%%------------------------------------------------------------------------
%%% File    : bin_compr.erl
%%% Purpose : Test case which crashes in dialyzer_dataflow:bind_bin_segs/5.
%%%------------------------------------------------------------------------

-module(bin_compr).

-export([bc/1]).

%% The binary comprehension below is stupid: it consumes the whole
%% bitstr in one go and produces a [666] result provided Bits is a
%% bitstr of at least 8 bits. Still, this is a valid Erlang program
%% and dialyzer's analysis should not crash on it.
bc(Bits) ->
  [666 || <<_:8/integer, _/bits>> <= Bits].