anchor.diff:  	 do_heavy_concurrent/1
   	]).
   
  +-export([t_select_reverse/1]).
  +
   -include("test_server.hrl").
   
   init_per_testcase(Case, Config) ->
  
positive.code:      match_heavy, fold, member,
       t_delete_object, t_init_table, t_whitebox, 
       t_delete_all_objects, t_insert_list, t_test_ms,
       t_select_delete, t_ets_dets, memory,
       t_bucket_disappears,
       select_fail,t_insert_new, t_repair_continuation, otp_5340, otp_6338,
       otp_6842_select_1000, otp_7665, otp_8732,
  
negative.code: 						   ['$$']}]),
      ?line true = (if is_list(String) -> true; true -> false end),
      ?line verify_etsmem(EtsMem).
  
  t_select_reverse(doc) ->
      ["Test the select reverse BIF's"];
  t_select_reverse(suite) ->
      [];
  t_select_reverse(Config) when is_list(Config) ->
      ?line Table = ets:new(xxx, [ordered_set]),
      ?line filltabint(Table,1000),
      ?line A = lists:reverse(ets:select(Table,[{{'$1', '_'},
  					 [{'>',
  					   {'rem',
  					    '$1', 5},
  					   2}],
  					 ['$_']}])),
      ?line A = ets:select_reverse(Table,[{{'$1', '_'},
  				   [{'>',
  				     {'rem',
  				      '$1', 5},
  				     2}],
  				   ['$_']}]),
      ?line A = reverse_chunked(Table,[{{'$1', '_'},
  				   [{'>',
  				     {'rem',
  				      '$1', 5},
  				     2}],
  				   ['$_']}],3),
      % A set/bag/duplicate_bag should get the same result regardless
      % of select or select_reverse
      ?line Table2 = ets:new(xxx, [set]),
      ?line filltabint(Table2,1000),
      ?line Table3 = ets:new(xxx, [bag]),
      ?line filltabint(Table3,1000),
      ?line Table4 = ets:new(xxx, [duplicate_bag]),
      ?line filltabint(Table4,1000),
      ?line lists:map(fun(Tab) ->
  		      B = ets:select(Tab,[{{'$1', '_'},
  					   [{'>',
  					     {'rem',
  					      '$1', 5},
  					     2}],
  					   ['$_']}]),
  		      B = ets:select_reverse(Tab,[{{'$1', '_'},
  						   [{'>',
  						     {'rem',
  						      '$1', 5},
  						     2}],
  						   ['$_']}])
  	      end,[Table2, Table3, Table4]),
      ok.
  
  
  
  reverse_chunked(T,MS,N) ->
      do_reverse_chunked(ets:select_reverse(T,MS,N),[]).
  
  do_reverse_chunked('$end_of_table',Acc) ->
      lists:reverse(Acc);
  do_reverse_chunked({L,C},Acc) ->
      NewAcc = lists:reverse(L)++Acc,
      do_reverse_chunked(ets:select_reverse(C), NewAcc).
  
  
  t_select_delete(doc) ->
      ["Test the ets:select_delete/2 and ets:select_count/2 BIF's"];
  