aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/code_SUITE_data/other.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-06-11 16:20:28 +0200
committerSverker Eriksson <[email protected]>2012-06-12 11:26:04 +0200
commit0128b0064470997430cf5cead012309a1bd2d63d (patch)
treebe4b0eac010781a95f63ed08fb7d875f30e6f30e /lib/kernel/test/code_SUITE_data/other.erl
parent1fc1233587a00b318ce15fd520b057dee726a7fc (diff)
downloadotp-0128b0064470997430cf5cead012309a1bd2d63d.tar.gz
otp-0128b0064470997430cf5cead012309a1bd2d63d.tar.bz2
otp-0128b0064470997430cf5cead012309a1bd2d63d.zip
Add kernel/test/code_SUITE:upgrade
For now we only test beam as hipe doesn't pass the test
Diffstat (limited to 'lib/kernel/test/code_SUITE_data/other.erl')
-rw-r--r--lib/kernel/test/code_SUITE_data/other.erl38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/kernel/test/code_SUITE_data/other.erl b/lib/kernel/test/code_SUITE_data/other.erl
new file mode 100644
index 0000000000..58ce87f222
--- /dev/null
+++ b/lib/kernel/test/code_SUITE_data/other.erl
@@ -0,0 +1,38 @@
+-module(other).
+
+-ifdef(VERSION_1).
+-define(VERSION,1).
+-export([exp1/0]).
+-export([exp1loc2/0]).
+-export([exp1exp2/0]).
+exp1() -> check([loc1(),exp1loc2(),exp1exp2(),loc1exp2(),loc1loc2()]).
+loc1() -> check([exp1loc2(),exp1exp2(),loc1exp2(),loc1loc2()]).
+exp1loc2() -> check([exp1exp2(),loc1exp2(),loc1loc2()]).
+exp1exp2() -> check([loc1exp2(),loc1loc2()]).
+loc1exp2() -> check([loc1loc2()]).
+-endif. % VERSION_1
+
+-ifdef(VERSION_2).
+-define(VERSION,2).
+-export([exp2/0]).
+-export([loc1exp2/0]).
+-export([exp1exp2/0]).
+loc1exp2() -> check([exp1exp2(),exp1loc2(),loc2(),exp2(),loc1loc2()]).
+exp1exp2() -> check([exp1loc2(),loc2(),exp2(),loc1loc2()]).
+exp1loc2() -> check([loc2(),exp2(),loc1loc2()]).
+loc2() -> check([exp2(),loc1loc2()]).
+exp2() -> check([loc1loc2()]).
+
+-endif. % VERSION_2
+
+loc1loc2() -> ?VERSION.
+
+
+check(VerList) ->
+ case lists:all(fun(?VERSION) -> true; (_) -> false end,
+ VerList) of
+ true ->
+ ?VERSION;
+ false ->
+ VerList
+ end.