aboutsummaryrefslogblamecommitdiffstats
path: root/lib/hipe/test/bs_SUITE_data/bs_add.erl
blob: af5a3b2f239be7d16445b24aa337a065bb0487cb (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                           
%% -*- erlang-indent-level: 2 -*-
%%-------------------------------------------------------------------------
%% The guard in f/3 revealed a problem in the translation of the 'bs_add'
%% BEAM instruction to Icode. The fail label was not properly translated.
%% Fixed 3/2/2011.
%%-------------------------------------------------------------------------
-module(bs_add).

-export([test/0]).

test() ->
  42 = f(<<12345:16>>, 4711, <<42>>),
  ok.

f(Bin, A, B) when <<A:9, B:7/binary>> == Bin ->
  gazonk;
f(Bin, _, _) when is_binary(Bin) ->
  42.