summaryrefslogtreecommitdiff
path: root/lib/compiler/test/float_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2022-07-25 10:42:51 +0200
committerBjörn Gustavsson <bjorn@erlang.org>2022-07-25 12:50:55 +0200
commitc8e684e051af6f8f439db68a21b04b5a03a1cd36 (patch)
treeb6bdebc193f840c0a692f8f2ca2d99b20ff23c8f /lib/compiler/test/float_SUITE.erl
parent0863bd30aabd035c83158c78046c5ffda16127e1 (diff)
downloaderlang-c8e684e051af6f8f439db68a21b04b5a03a1cd36.tar.gz
Fix internal consistency error
Fixes #6163
Diffstat (limited to 'lib/compiler/test/float_SUITE.erl')
-rw-r--r--lib/compiler/test/float_SUITE.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl
index e530a9f7de..328e8a1a79 100644
--- a/lib/compiler/test/float_SUITE.erl
+++ b/lib/compiler/test/float_SUITE.erl
@@ -181,11 +181,19 @@ math_functions(Config) when is_list(Config) ->
mixed_float_and_int(Config) when is_list(Config) ->
129.0 = pc(77, 23, 5),
+
+ {'EXIT',{badarith,_}} = catch mixed_1(id({a,b,c})),
+ {'EXIT',{{badarg,1/42},_}} = catch mixed_1(id(42)),
+
ok.
pc(Cov, NotCov, X) ->
round(Cov/(Cov+NotCov)*100) + 42 + 2.0*X.
+mixed_1(V) ->
+ {is_tuple(V) orelse 1 / V,
+ 1 / V andalso true}.
+
subtract_number_type(Config) when is_list(Config) ->
120 = fact(5).