aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/bs_SUITE_data/bs_bugs_R09.erl
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2014-02-25 13:40:48 +0100
committerHenrik Nord <[email protected]>2014-02-25 13:40:48 +0100
commitf90751b9f766a0155aaaa6fe22bc925f3a9874e2 (patch)
tree832940d8c290d35963285f9bc62b62eff460311b /lib/hipe/test/bs_SUITE_data/bs_bugs_R09.erl
parent7512dc06d2356c116475661693c1bc73d18434dd (diff)
parent9855233b06ff7ab0af4fabbc99a28907620550c9 (diff)
downloadotp-f90751b9f766a0155aaaa6fe22bc925f3a9874e2.tar.gz
otp-f90751b9f766a0155aaaa6fe22bc925f3a9874e2.tar.bz2
otp-f90751b9f766a0155aaaa6fe22bc925f3a9874e2.zip
Merge branch 'kostis/hipe-tests-bs/OTP-11748'
* kostis/hipe-tests-bs/OTP-11748: Up the time limit (globally) for some slow machines Add check so that tests are skipped if HiPE is not available Add a Makefile for the HiPE tests Add tests for the HiPE compiler (Part 1: binaries and bitstrings)
Diffstat (limited to 'lib/hipe/test/bs_SUITE_data/bs_bugs_R09.erl')
-rw-r--r--lib/hipe/test/bs_SUITE_data/bs_bugs_R09.erl35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/hipe/test/bs_SUITE_data/bs_bugs_R09.erl b/lib/hipe/test/bs_SUITE_data/bs_bugs_R09.erl
new file mode 100644
index 0000000000..670f2a08bb
--- /dev/null
+++ b/lib/hipe/test/bs_SUITE_data/bs_bugs_R09.erl
@@ -0,0 +1,35 @@
+%% -*- erlang-indent-level: 2 -*-
+%%--------------------------------------------------------------------
+%% Date: Mon, 7 Jun 2004 13:07:39 +0300
+%% From: Einar Karttunen
+%% To: Erlang ML <[email protected]>
+%% Subject: Apparent binary matching bug with native compilation
+%%
+%% It seems that there is a problem with binary matching when
+%% compiling native code. A length prefixed field matches one
+%% byte too short in the native case.
+%%
+%% The test module works when compiled with no options, but
+%% crashes with case_clause when compiled with [native].
+%% This has been confirmed with R9C-0 and hipe snapshot 5/4/2004.
+%%--------------------------------------------------------------------
+
+-module(bs_bugs_R09).
+
+-export([test/0]).
+
+test() ->
+ ["rei",".",[]] = pp(<<3,$r,$e,$i,0>>),
+ ok.
+
+pp(Bin) ->
+ %% io:format("PP with ~p~n", [Bin]),
+ case Bin of
+ <<>> ->
+ ["."];
+ <<_:2, Len:6, Part:Len/binary>> ->
+ [binary_to_list(Part)];
+ <<_:2, Len:6, Part:Len/binary, Rest/binary>> ->
+ %% io:format("Len ~p Part ~p Rest ~p~n", [Len,Part,Rest]),
+ [binary_to_list(Part), "." | pp(Rest)]
+ end.