aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-04-26 10:37:48 +0200
committerGitHub <[email protected]>2018-04-26 10:37:48 +0200
commitb22051714857713e0f4f43f77ea02ec50532b2df (patch)
treefcf849cd78425c218c8022b941e5bc018d11c03a /lib/compiler/test
parenta36e197b53e7f4e67c2e47f3a4410e7e07af3900 (diff)
parentbf84118febaae7857f12625584f33a649f79aeed (diff)
downloadotp-b22051714857713e0f4f43f77ea02ec50532b2df.tar.gz
otp-b22051714857713e0f4f43f77ea02ec50532b2df.tar.bz2
otp-b22051714857713e0f4f43f77ea02ec50532b2df.zip
Merge pull request #1797 from bjorng/bjorn/compiler/fold-apply/ERL-614
Rewrite a call of a literal external fun to a direct call OTP-15044
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/fun_SUITE.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl
index 16474adf5b..3c272a35a6 100644
--- a/lib/compiler/test/fun_SUITE.erl
+++ b/lib/compiler/test/fun_SUITE.erl
@@ -194,6 +194,17 @@ external(Config) when is_list(Config) ->
?APPLY2(ListsMod, ListsMap, 2),
?APPLY2(ListsMod, ListsMap, ListsArity),
+ 42 = (fun erlang:abs/1)(-42),
+ 42 = (id(fun erlang:abs/1))(-42),
+ 42 = apply(fun erlang:abs/1, [-42]),
+ 42 = apply(id(fun erlang:abs/1), [-42]),
+ 6 = (fun lists:sum/1)([1,2,3]),
+ 6 = (id(fun lists:sum/1))([1,2,3]),
+
+ {'EXIT',{{badarity,_},_}} = (catch (fun lists:sum/1)(1, 2, 3)),
+ {'EXIT',{{badarity,_},_}} = (catch (id(fun lists:sum/1))(1, 2, 3)),
+ {'EXIT',{{badarity,_},_}} = (catch apply(fun lists:sum/1, [1,2,3])),
+
ok.
call_me(I) ->