aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/bs_SUITE_data/bs_native_float.erl
blob: 15fe0bf0c66b69a8b851d2867e233c514fd1b112 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%% -*- erlang-indent-level: 2 -*-
%%-------------------------------------------------------------------
%% File        : bs_native_float.erl
%% Author      : Kostis Sagonas
%% Description : Test sent by Bjorn Gustavsson to report a bug in the
%%               handling of the 'native' endian specifier.
%% Created     : 28 Nov 2004
%%-------------------------------------------------------------------
-module(bs_native_float).

-export([test/0]).

test() ->
  BeamRes = mk_bin(1.0, 2.0, 3.0),
  hipe:c(?MODULE),   %% Original was: hipe:c({?MODULE,vs_to_bin,1}, [o2]),
  HipeRes = mk_bin(1.0, 2.0, 3.0),
  %% io:format("Beam result = ~w\nHiPE result = ~w\n", [BeamRes,HipeRes]),
  BeamRes = HipeRes,
  ok.

mk_bin(X, Y, Z) ->
  <<X:64/native-float, Y:64/native-float, Z:64/native-float>>.