summaryrefslogtreecommitdiff
path: root/lib/compiler/test/float_SUITE.erl
diff options
context:
space:
mode:
authorJohn Högberg <john@erlang.org>2021-01-28 13:34:16 +0100
committerJohn Högberg <john@erlang.org>2021-01-28 13:38:57 +0100
commit424167b36657b0546074b3d88c8511b370fa84ea (patch)
tree0189455327dda6153f0e0531cb4b5a4f03b4252f /lib/compiler/test/float_SUITE.erl
parent7d5fa20a463395045fef400445514e59db0a71ae (diff)
parent1dcc1a3c571b6927ccbac17189b86f3b2b3bf018 (diff)
downloaderlang-424167b36657b0546074b3d88c8511b370fa84ea.tar.gz
Merge branch 'maint'
* maint: beam_validator: Ignore 'fcheckerror' / 'fclearerror'
Diffstat (limited to 'lib/compiler/test/float_SUITE.erl')
-rw-r--r--lib/compiler/test/float_SUITE.erl22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl
index c9c0beb70f..44d54de84c 100644
--- a/lib/compiler/test/float_SUITE.erl
+++ b/lib/compiler/test/float_SUITE.erl
@@ -22,7 +22,7 @@
init_per_group/2,end_per_group/2,
pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1,
subtract_number_type/1,float_followed_by_guard/1,
- fconv_line_numbers/1,float_zero/1]).
+ fconv_line_numbers/1,float_zero/1,exception_signals/1]).
-include_lib("common_test/include/ct.hrl").
@@ -31,7 +31,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[pending, bif_calls, math_functions, float_zero,
mixed_float_and_int, subtract_number_type,
- float_followed_by_guard,fconv_line_numbers].
+ float_followed_by_guard,fconv_line_numbers,
+ exception_signals].
groups() ->
[].
@@ -226,5 +227,22 @@ fconv_line_numbers_1(A) ->
false
end, Stacktrace).
+%% ERL-1471: compiler generated invalid 'fclearerror' / 'fcheckerror'
+%% sequences.
+exception_signals(Config) when is_list(Config) ->
+ 2.0 = exception_signals_1(id(25), id(true), []),
+ 2.0 = exception_signals_1(id(25), id(false), []),
+ 2.0 = exception_signals_1(id(25.0), id(true), []),
+ 2.0 = exception_signals_1(id(25.0), id(false), []),
+ ok.
+
+exception_signals_1(Width, Value, _Opts) ->
+ Height = Width / 25.0,
+ _Middle = case Value of
+ true -> Width / 2.0;
+ false -> 0
+ end,
+ _More = Height + 1.
+
id(I) -> I.