aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/receive_SUITE_data
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-08-29 13:07:27 +0200
committerBjörn Gustavsson <[email protected]>2012-10-09 15:24:40 +0200
commit83cfc8c8414edc956d7e8e3a1402c17bf35421a6 (patch)
treef9b5c44a289ff4c6afea23c4abe57e218baae6df /lib/compiler/test/receive_SUITE_data
parentdba5396cce0e94e5344ee910324c0e03d34dcaaa (diff)
downloadotp-83cfc8c8414edc956d7e8e3a1402c17bf35421a6.tar.gz
otp-83cfc8c8414edc956d7e8e3a1402c17bf35421a6.tar.bz2
otp-83cfc8c8414edc956d7e8e3a1402c17bf35421a6.zip
beam_receive: Optimize receives using refs created by spawn_monitor/{1,3}
Diffstat (limited to 'lib/compiler/test/receive_SUITE_data')
-rw-r--r--lib/compiler/test/receive_SUITE_data/ref_opt/no_4.erl12
-rw-r--r--lib/compiler/test/receive_SUITE_data/ref_opt/yes_12.erl12
-rw-r--r--lib/compiler/test/receive_SUITE_data/ref_opt/yes_13.erl12
3 files changed, 36 insertions, 0 deletions
diff --git a/lib/compiler/test/receive_SUITE_data/ref_opt/no_4.erl b/lib/compiler/test/receive_SUITE_data/ref_opt/no_4.erl
new file mode 100644
index 0000000000..3ce222176b
--- /dev/null
+++ b/lib/compiler/test/receive_SUITE_data/ref_opt/no_4.erl
@@ -0,0 +1,12 @@
+-module(no_4).
+-compile(export_all).
+
+?MODULE() ->
+ ok.
+
+f(X) ->
+ {Pid,Ref} = spawn_monitor(fun() -> ok end),
+ r(Pid, Ref).
+
+r(_, _) ->
+ ok.
diff --git a/lib/compiler/test/receive_SUITE_data/ref_opt/yes_12.erl b/lib/compiler/test/receive_SUITE_data/ref_opt/yes_12.erl
new file mode 100644
index 0000000000..efcfed6059
--- /dev/null
+++ b/lib/compiler/test/receive_SUITE_data/ref_opt/yes_12.erl
@@ -0,0 +1,12 @@
+-module(yes_12).
+-compile(export_all).
+
+?MODULE() ->
+ ok.
+
+f() ->
+ {_,Ref} = spawn_monitor(fun() -> ok end),
+ receive
+ {'DOWN',Ref,_,_,Reason} ->
+ Reason
+ end.
diff --git a/lib/compiler/test/receive_SUITE_data/ref_opt/yes_13.erl b/lib/compiler/test/receive_SUITE_data/ref_opt/yes_13.erl
new file mode 100644
index 0000000000..9e93d12ed6
--- /dev/null
+++ b/lib/compiler/test/receive_SUITE_data/ref_opt/yes_13.erl
@@ -0,0 +1,12 @@
+-module(yes_13).
+-compile(export_all).
+
+?MODULE() ->
+ ok.
+
+f() ->
+ {Pid,Ref} = spawn_monitor(fun() -> ok end),
+ receive
+ {'DOWN',Ref,process,Pid,Reason} ->
+ Reason
+ end.