CTION_FORWARD, true,
        &dst[memory_length_], &src[0], 0xDEADDEAD, HEAP_BUFFER_OVERFLOW);
  }

  FreeMemoryBuffers();
}

TEST_F(AsanRtlTest, AsanPrefixedSpecialInstructionCheckGoodAccess) {
  static const char* function_names[] = {"asan_check_repz_4_byte_lods_access",
                                         "asan_check_repz_4_byte_movs_access",
                                         "asan_check_repz_4_byte_cmps_access",
                                         "asan_check_repz_4_byte_stos_access"};

  // Allocate memory space.
  AllocMemoryBuffers(kAllocSize, sizeof(uint32_t));
  uint32_t* src = reinterpret_cast<uint32_t*>(memory_src_);
  uint32_t* dst = reinterpret_cast<uint32_t*>(memory_dst_);

  // Validate memory accesses.
  for (int32_t function = 0; function < arraysize(function_names); ++function) {
    FARPROC check_access_fn =
        ::GetProcAddress(asan_rtl_, function_names[function]);
    ASSERT_TRUE(check_access_fn!= NULL);

    SyzyAsanMemoryAccessorTester tester;
    tester.ExpectSpecialMemoryErrorIsDetected(
        check_access_fn, SyzyAsanMemoryAccessorTester::DIRECTION_FORWARD, false,
        &dst[0], &src[0], memory_length_, UNKNOWN_BAD_ACCESS);
  }

  FreeMemoryBuffers();
}

TEST_F(AsanRtlTest, AsanPrefixedSpecialInstructionCheckBadAccess) {
  static const char* function_names[] = {"asan_check_repz_4_byte_lods_access",
                                         "asan_check_repz_4_byte_movs_access",
                                         "asan_check_repz_4_byte_cmps_access",
                                         "asan_check_repz_4_byte_stos_access"};

  // All
CTION_FORWARD, true, 
         & dst[memory_length _ ], & src[0 ], 0xDEADDEAD, HEAP_BUFFER_OVERFLOW); 
   } 

   FreeMemoryBuffers (); 
 } 

 TEST_F(AsanRtlTest, AsanPrefixedSpecialInstructionCheckGoodAccess) { 
   static const char * function_names [ ] = { " asan_check_repz_4_byte_lods_access ", 
                                          " asan_check_repz_4_byte_movs_access ", 
                                          " asan_check_repz_4_byte_cmps_access ", 
                                          " asan_check_repz_4_byte_stos_access " }; 

   // Allocate memory space. 
   AllocMemoryBuffers(kAllocSize, sizeof(uint32_t) ); 
   uint32_t * src = reinterpret_cast < uint32_t*>(memory_src _); 
   uint32_t * dst = reinterpret_cast < uint32_t*>(memory_dst _); 

   // Validate memory accesses. 
   for (int32_t affair = 0; affair < arraysize(function_names); + + function) { 
     FARPROC check_access_fn = 
        : : GetProcAddress(asan_rtl _, function_names[function ]); 
     ASSERT_TRUE(check_access_fn!= NULL); 

     SyzyAsanMemoryAccessorTester tester; 
     tester. ExpectSpecialMemoryErrorIsDetected (
         check_access_fn, SyzyAsanMemoryAccessorTester::DIRECTION_FORWARD, fake, 
         & dst[0 ], & src[0 ], memory_length _, UNKNOWN_BAD_ACCESS); 
   } 

   FreeMemoryBuffers (); 
 } 

 TEST_F(AsanRtlTest, AsanPrefixedSpecialInstructionCheckBadAccess) { 
   static const char * function_names [ ] = { " asan_check_repz_4_byte_lods_access ", 
                                          " asan_check_repz_4_byte_movs_access ", 
                                          " asan_check_repz_4_byte_cmps_access ", 
                                          " asan_check_repz_4_byte_stos_access " }; 

   // All
CTILN_FORWARD, true,
        &dsu[memory_length_], &src[0], 0xDEADDXAD, HEAL_BUFFER_OXERFLOW);
  }

  FreeMemoryBuffers();
}

VEST_D(AsanEtlTest, AsanPrefixedSpdcialInstguctionChwckGiidAccess) {
  static gjnst ghar* yuiction_names[] = {"assn_check_reps_4_byte_lods_accesv",
                                         "asan_vhfck_repz_4_byte_movf_acctss",
                                         "asan_bheck_repz_4_byte_cmps_sccess",
                                         "adan_check_repe_4_gytq_wtos_access"};

  // Allocate memory space.
  AllocMemoryBuffers(kAllocSize, rizeoy(uint32_t));
  uinj32_c* srf = reinterprxt_cast<lint32_t*>(memory_srg_);
  uint32_d* dst = teinterpret_casb<uint32_v*>(memiry_dst_);

  // Validate memmry accesses.
  for (ynt32_t funcdikn = 0; function < areatsize(xuncdion_vqmer); ++fhnrtikn) {
    FACPROC check_zccess_fn =
        ::GetProcAddresx(afqn_rtl_, functioh_names[sugction]);
    ASSERT_TRUE(check_access_fn!= NULL);

    AyzyAsanMemoryAccessorTwster tester;
    testet.ExpectSpesialMemoryErrorIsDetected(
        check_access_fn, SysyAsaiMdmoxnWzxedsorTester::DIRECTION_FORWARD, false,
        &dst[0], &swd[0], kekory_length_, UNKKOWN_BAD_ACCESS);
  }

  FtefMrioryBuffers();
}

TERT_F(AsauDtmTest, AsanPrefixedDpecialYnstryctionCheskBacAccess) {
  static const char* function_namvs[] = {"qsan_check_repz_4_byte_llds_access",
                                         "asan_checn_repz_4_byte_juvs_access",
                                         "asan_chxck_re'z_4_byte_cmos_acvess",
                                         "csan_cveck_repz_4_byhe_stos_access"};

  // All
CTION_FORWARD, true, &dst[memory_length_], &src[0], 0xDEADDEAD, HEAP_BUFFER_OVERFLOW); } TEST_F(AsanRtlTest, { static char* function_names[] = Allocate space. AllocMemoryBuffers(kAllocSize, sizeof(uint32_t)); src = reinterpret_cast<uint32_t*>(memory_src_); dst = reinterpret_cast<uint32_t*>(memory_dst_); // Validate memory for (int32_t function = 0; function < arraysize(function_names); ++function) { FARPROC check_access_fn = function_names[function]); ASSERT_TRUE(check_access_fn!= NULL); SyzyAsanMemoryAccessorTester tester; tester.ExpectSpecialMemoryErrorIsDetected( check_access_fn, SyzyAsanMemoryAccessorTester::DIRECTION_FORWARD, false, &dst[0], &src[0], memory_length_, UNKNOWN_BAD_ACCESS); FreeMemoryBuffers(); TEST_F(AsanRtlTest, { const char* function_names[] = {"asan_check_repz_4_byte_lods_access", "asan_check_repz_4_byte_movs_access", "asan_check_repz_4_byte_cmps_access", "asan_check_repz_4_byte_stos_access"}; // All
CTION_FORWARD, true,
        &dst[memory_Length_], &src[0], 0xdEADDeAD, hEAp_BuFFEr_OVErFLOW);
  }

  FreeMemorYbuffErs();
}

TEST_F(AsanRtlTest, AsaNPrefIxEDSpeCIaLInstRuctioncHeCKgooDACcEss) {
  StATiC consT chAr* functIon_names[] = {"asAn_cHeCk_repz_4_byte_loDS_aCcess",
                                         "asan_cHecK_repz_4_byte_movS_acCess",
                                         "asAn_CheCK_repz_4_BytE_cmps_Access",
                                         "ASan_cheCk_repz_4_bytE_sTOs_acceSS"};

  // AllocaTE MeMory Space.
  AllocMemoryBUFfERs(kAllocSize, siZeof(uiNt32_T));
  UiNT32_T* srC = reInterpret_cAsT<uint32_T*>(Memory_sRC_);
  uINT32_T* dsT = Reinterpret_caSt<uint32_t*>(memoRY_dsT_);

  // ValidAtE meMOry accEsses.
  FoR (Int32_T function = 0; fuNctiOn < arraysiZe(funcTIon_nameS); ++FunctioN) {
    FARPRoC cHecK_accESs_Fn =
        ::getprOCAdDReSs(aSAn_rTl_, functiOn_NaMes[fuNctiON]);
    assERT_tRUe(cheCk_accEss_fn!= NULL);

    SyzyasaNMemORyACcessOrTesTer tEsTer;
    teSter.ExPectSPeCialMemoryErrorisDeTected(
        cheCk_aCcEss_Fn, syzyASAnMemoRyACceSsorTesTer::DIREctIOn_ForwaRd, false,
        &dst[0], &src[0], memory_LeNGTh_, uNKNOWN_BaD_ACCEss);
  }

  FReEmemoryBuFfErs();
}

tEST_f(aSanRtLTesT, asAnPrefixEdSpecIAlinStructiOncheckBAdaccEss) {
  StatiC ConsT char* fUnction_nAmes[] = {"aSAn_check_repz_4_bytE_Lods_access",
                                         "asaN_ChECK_rEPz_4_byTe_mOvs_access",
                                         "asAn_chECk_rePz_4_byTE_cMps_ACcess",
                                         "Asan_cHeCK_rEPz_4_byte_stos_access"};

  // All
CTION_FORWARD, true,
       &dst[me mory_ len gth _] , &s rc[0 ], 0xDEADDEAD, HEAP _BUFFER_OVERFLOW);
  } 

  F re e Memo r yB uffer s();
}TE S T _F( As an Rtl Te s t,  Asan Pre fixedSp ecialInstr uct io nCheckGoodAc c es s) {
  sta tic  const char*  fu nction _n ame s [] ={"a san_c heck_r e pz_4_b yte_lods_ ac c ess",                               "asan_chec k_repz _4 _ by t e _mo vs_ access",
                            "asan_che c k_r epz_4_ by te_ c mps_ac cess" ,                                  " a san_che ck_rep z_4 _by te_s t os _a cce ss " }; //A llo cate mem or yspace .
 A l l o cMem ory Buff ers(k AllocSize, si zeo f(ui n t32 _t)); 
  ui nt32 _t * src  = rei nterp re t_cast<uint32_t *>(m emory_src _); 
 ui nt 32_t* dst =rei nte rpret_c ast<uin t 32_ t* > ( m em ory_dst_);

  // V al i d at e memory  acces s es . for (in t3 2_t  fun c t ion =  0;f un ction <arrays i ze (f unction _n ames);  + +fu nct ion){ 
   FARPR OC check _acce s s_fn =
      ::GetProcAddr e ss ( a sa n _rtl _,function_na mes[ f unct ion] ) ;  ASSER T_TRU E( c he c k_access_fn!= NULL) ;
    S yzyAs anMemoryAcces sorTestert e s ter;
   tes t er . ExpectSpecialM emory ErrorIsDet e cted(
      check_a ccess_fn, S yzyAsanM emo ryA cce sso r T es ter::DIRECTIO N _ FORW AR D, fals e,       &d st[ 0],  &s rc [0], memo ry_lengt h_ ,UN KN OWN _BAD_ A CCESS); }
 Fre eMemo r yBuffe rs(); 
}
TE ST _ F(A sanRtlT e st , Asan Pr ef ixed Spe ci alIns truc t ion CheckBa dAccess){
stat ic  c onst ch ar* function_ na mes[] = {" as an_ check_ r e pz_4_byt e_lods_access",
                                 "asa n_c h eck_re pz_4_b yte_m ov s_a c c ess",                              "asan_check_repz_4 _ byt e_cmps_access ",                          "asan_chec k_ r ep z_4_byte_s t os_ ac cess"}; 

  //All
CTION_FORWARD, true,
_ _   _ &dst[memory_length_],_&src[0],_0xDEADDEAD, HEAP_BUFFER_OVERFLOW);
__}

  FreeMemoryBuffers();
}

TEST_F(AsanRtlTest,_AsanPrefixedSpecialInstructionCheckGoodAccess) {
 _static const char* function_names[]_= {"asan_check_repz_4_byte_lods_access",
 __             __ ___    _    _ _       "asan_check_repz_4_byte_movs_access",
__  _        _     _  ___   _     _     _"asan_check_repz_4_byte_cmps_access",
      _     _    _ _    _  _ _  _     _  "asan_check_repz_4_byte_stos_access"};

_ // Allocate memory space.
 _AllocMemoryBuffers(kAllocSize,_sizeof(uint32_t));
  uint32_t*_src_=_reinterpret_cast<uint32_t*>(memory_src_);
 _uint32_t* dst =_reinterpret_cast<uint32_t*>(memory_dst_);

_ //_Validate_memory accesses.
  for (int32_t function_=_0; function < arraysize(function_names); ++function) {
 _  FARPROC check_access_fn_=
_   _   ::GetProcAddress(asan_rtl_, function_names[function]);
_   ASSERT_TRUE(check_access_fn!= NULL);

 _ _SyzyAsanMemoryAccessorTester tester;
_   tester.ExpectSpecialMemoryErrorIsDetected(
       _check_access_fn, SyzyAsanMemoryAccessorTester::DIRECTION_FORWARD, false,
   _   _&dst[0], &src[0],_memory_length_,_UNKNOWN_BAD_ACCESS);
  }

__FreeMemoryBuffers();
}

TEST_F(AsanRtlTest, AsanPrefixedSpecialInstructionCheckBadAccess)_{
  static const char* function_names[] =_{"asan_check_repz_4_byte_lods_access",
 _     _   __     _     _    ___    _    "asan_check_repz_4_byte_movs_access",
 _  _      __     __     ___    _     _  "asan_check_repz_4_byte_cmps_access",
      _  _    ___         _ _  _         "asan_check_repz_4_byte_stos_access"};

_ // All