aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/fun_SUITE.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2014-03-01 18:13:15 +0100
committerAnthony Ramine <[email protected]>2014-03-01 18:13:15 +0100
commit1b8ad68361db59477013bf96e485d5293723ff42 (patch)
treea427a18973d0a032e62cbb39d1f66317f6d7c45f /lib/compiler/test/fun_SUITE.erl
parentdb911c1f15372d2dadf06e8502506b0936a4fbb3 (diff)
downloadotp-1b8ad68361db59477013bf96e485d5293723ff42.tar.gz
otp-1b8ad68361db59477013bf96e485d5293723ff42.tar.bz2
otp-1b8ad68361db59477013bf96e485d5293723ff42.zip
Do not emit blatantly illformed Core Erlang apply expressions
(fun f/1)() should be compiled to let X = 'f'/1 in apply X () to let the compiler properly generate code that will fail with badarity at runtime. Reported-by: Ulf Norell
Diffstat (limited to 'lib/compiler/test/fun_SUITE.erl')
-rw-r--r--lib/compiler/test/fun_SUITE.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl
index e35692efd1..25b7f677b5 100644
--- a/lib/compiler/test/fun_SUITE.erl
+++ b/lib/compiler/test/fun_SUITE.erl
@@ -21,7 +21,7 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
test1/1,overwritten_fun/1,otp_7202/1,bif_fun/1,
- external/1,eep37/1]).
+ external/1,eep37/1,badarity/1]).
%% Internal export.
-export([call_me/1]).
@@ -32,7 +32,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
test_lib:recompile(?MODULE),
- [test1,overwritten_fun,otp_7202,bif_fun,external,eep37].
+ [test1,overwritten_fun,otp_7202,bif_fun,external,eep37,badarity].
groups() ->
[].
@@ -206,5 +206,9 @@ eep37(Config) when is_list(Config) ->
50 = UnusedName(8),
ok.
+badarity(Config) when is_list(Config) ->
+ {'EXIT',{{badarity,{_,[]}},_}} = (catch (fun badarity/1)()),
+ ok.
+
id(I) ->
I.