How to call module function in template file?
Please try bellow code and use module_load_include() function. 

function non_login_preprocess_page(&amp;$vars) {

  module_load_include('module', 'module', 'test');   // **add this line**

  if(module_exists('test') &amp;&amp; function_exists('test_get_rnd_data')){
    $vars['rnd_data'] = test_get_rnd_data();
    print_r("callled"); exit;
  }
}