diff options
author | Kostis Sagonas <[email protected]> | 2014-01-12 20:10:49 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2014-02-24 16:57:30 +0100 |
commit | 7dae40dd0d595776eec7c0407a7849962650e762 (patch) | |
tree | ed38c5c773db2c8d55ea5662ee27cbe71ee65f2f /lib/hipe/test/bs_SUITE_data/bs_catch_bug.erl | |
parent | 4ce83eb728748787f8a2da6155112c6da42a0eba (diff) | |
download | otp-7dae40dd0d595776eec7c0407a7849962650e762.tar.gz otp-7dae40dd0d595776eec7c0407a7849962650e762.tar.bz2 otp-7dae40dd0d595776eec7c0407a7849962650e762.zip |
Add tests for the HiPE compiler (Part 1: binaries and bitstrings)
Create tests for the HiPE native code compiler. This is the first
part of the effort and contains tests that check that the native
code produced by the HiPE compiler for binaries and bitstrings is
OK and behaves similarly to the code produced by the BEAM compiler.
Diffstat (limited to 'lib/hipe/test/bs_SUITE_data/bs_catch_bug.erl')
-rw-r--r-- | lib/hipe/test/bs_SUITE_data/bs_catch_bug.erl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/hipe/test/bs_SUITE_data/bs_catch_bug.erl b/lib/hipe/test/bs_SUITE_data/bs_catch_bug.erl new file mode 100644 index 0000000000..6125f8f87f --- /dev/null +++ b/lib/hipe/test/bs_SUITE_data/bs_catch_bug.erl @@ -0,0 +1,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. |