diff options
author | Zandra <[email protected]> | 2016-01-27 11:44:59 +0100 |
---|---|---|
committer | Zandra <[email protected]> | 2016-01-27 11:44:59 +0100 |
commit | f0b7d4797b13a90b4dcee40468a5675a73feb1d4 (patch) | |
tree | 44e2832bbe7e7a0c1deaa6bd8685d3d03713a2b2 /lib/hipe/test/basic_SUITE_data/basic_module_info.erl | |
parent | 6b6828e51300e318b8a3a572b6a5d78ca3756d79 (diff) | |
parent | 9722388b2fcec9b7f7e5680335e1bd6392ef11fc (diff) | |
download | otp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.tar.gz otp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.tar.bz2 otp-f0b7d4797b13a90b4dcee40468a5675a73feb1d4.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/hipe/test/basic_SUITE_data/basic_module_info.erl')
-rw-r--r-- | lib/hipe/test/basic_SUITE_data/basic_module_info.erl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/hipe/test/basic_SUITE_data/basic_module_info.erl b/lib/hipe/test/basic_SUITE_data/basic_module_info.erl new file mode 100644 index 0000000000..cab48b10ba --- /dev/null +++ b/lib/hipe/test/basic_SUITE_data/basic_module_info.erl @@ -0,0 +1,32 @@ +%%% -*- erlang-indent-level: 2 -*- +%%%------------------------------------------------------------------- +%%% Author: Kostis Sagonas +%%% Date: Oct 25, 2003 +%%% +%%% Tests whether calling module_info from the same module works. +%%% This seems trivial, but the problem is that the module_info/[0,1] +%%% functions that the BEAM file contains used to be dummy functions +%%% containing crap. So, these functions could not be used for +%%% compilation to native code and the functions that the BEAM loader +%%% generates should have been used instead. This was a HiPE bug +%%% reported by Dan Wallin. +%%%------------------------------------------------------------------- +-module(basic_module_info). + +-export([test/0]). + +test() -> + L = test_local_mi0_call(), + E = test_remote_mi1_call(), + {3, 3} = {L, E}, + ok. + +test_local_mi0_call() -> + ModInfo = module_info(), + %% io:format("ok, ModInfo=~w\n", [ModInfo]), + {exports, FunList} = lists:keyfind(exports, 1, ModInfo), + length(FunList). + +test_remote_mi1_call() -> + FunList = ?MODULE:module_info(exports), + length(FunList). |