aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-11-23 11:48:14 +0100
committerBjörn Gustavsson <[email protected]>2016-11-23 11:48:14 +0100
commitbfc187c11ca3e0fd0df250633201e578c5a1651a (patch)
treecb930299eb47176de5c9aefbcf0810e350f41298 /lib/compiler/test
parentd5f65731895c2ae00cc33343509290cbd81a1f64 (diff)
parentd8afbc245f28c37c2417c86c9a2d9d27266fe37f (diff)
downloadotp-bfc187c11ca3e0fd0df250633201e578c5a1651a.tar.gz
otp-bfc187c11ca3e0fd0df250633201e578c5a1651a.tar.bz2
otp-bfc187c11ca3e0fd0df250633201e578c5a1651a.zip
Merge branch 'bjorn/compiler/fix-unwanted-warning/ERL-301/OTP-14040' into maint
* bjorn/compiler/fix-unwanted-warning/ERL-301/OTP-14040: Suppress warnings from v3_kernel when inlining is turned on
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/warnings_SUITE.erl28
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl
index f884e6e7d6..ff9bddc1e2 100644
--- a/lib/compiler/test/warnings_SUITE.erl
+++ b/lib/compiler/test/warnings_SUITE.erl
@@ -42,7 +42,7 @@
comprehensions/1,maps/1,maps_bin_opt_info/1,
redundant_boolean_clauses/1,
latin1_fallback/1,underscore/1,no_warnings/1,
- bit_syntax/1]).
+ bit_syntax/1,inlining/1]).
init_per_testcase(_Case, Config) ->
Config.
@@ -65,7 +65,7 @@ groups() ->
bin_opt_info,bin_construction,comprehensions,maps,
maps_bin_opt_info,
redundant_boolean_clauses,latin1_fallback,
- underscore,no_warnings,bit_syntax]}].
+ underscore,no_warnings,bit_syntax,inlining]}].
init_per_suite(Config) ->
Config.
@@ -823,6 +823,30 @@ bit_syntax(Config) ->
run(Config, Ts),
ok.
+inlining(Config) ->
+ %% Make sure that no spurious warnings are generated
+ %% when inlining.
+ Ts = [{inlining_1,
+ <<"-compile(inline).
+ compute1(X) -> add(X, 0).
+ add(1, 0) -> 1;
+ add(1, Y) -> 1 + Y;
+ add(X, Y) -> X + Y.
+ ">>,
+ [],
+ []},
+ {inlining_2,
+ <<"-compile({inline,[add/2]}).
+ compute1(X) -> add(X, 0).
+ add(1, 0) -> 1;
+ add(1, Y) -> 1 + Y;
+ add(X, Y) -> X + Y.
+ ">>,
+ [],
+ []}
+ ],
+ run(Config, Ts),
+ ok.
%%%
%%% End of test cases.