aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/bs_SUITE_data/bs_catch_bug.erl
blob: 6125f8f87fc24e39e7ad843f8d27a6ccbfb2adf0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%%% -*- erlang-indent-level: 2 -*-
%%%-------------------------------------------------------------------
%%% File    : bs_catch_bug.erl
%%% Author  : Per Gustafsson <[email protected]>
%%% Purpose : Tests a catch-related bug which might destroy properties
%%%           of ICode CFGs which are assumed by the subsequent ICode
%%%           binary pass.
%%% Created : 22 Jan 2004
%%% -------------------------------------------------------------------
-module(bs_catch_bug).

-export([test/0]).

test() ->
  test(foo, <<>>).

%% Introduced auxiliary test/2 function so that constant propagation
%% does not destroy the properties of the test. - Kostis 26/1/2004
test(X, Bin) ->
  catch (<<_/binary>> = X),
  X = case Bin of
        <<42,_/binary>> -> weird_bs_match;
	_ -> X
      end,
  ok.