@echo off

for %%i in (FileCheck.exe) do set FILE_CHECK=%%~$PATH:i
if not defined FILE_CHECK (echo     Error: FileCheck.exe not found in PATH. && exit /b 1)

set HIPIFY=%1
set IN_FILE=%2
set TMP_FILE=%3

set all_args=%*
call set clang_args=%%all_args:*%4=%%
set clang_args=%4%clang_args%

%HIPIFY% -o=%TMP_FILE% %IN_FILE% -- %clang_args%
if errorlevel 1 (echo      Error: hipify-clang.exe failed with exit code: %errorlevel% && exit /b %errorlevel%)
%FILE_CHECK% %IN_FILE% -input-file=%TMP_FILE%
if errorlevel 1 (echo      Error: FileCheck.exe failed with exit code: %errorlevel% && exit /b %errorlevel%)

@echo off
setlocal

for %%i in (FileCheck.exe) do set FILE_CHECK=%%~$PATH:i
if not defined FILE_CHECK (echo     Error: FileCheck.exe not found in PATH. && exit /b 1)

set HIPIFY=%1
set IN_FILE=%2
set TMP_FILE=%3

set all_args=%*
call set clang_args=%%all_args:*%4=%%
set clang_args=%4%clang_args%

%HIPIFY% -o=%TMP_FILE% %IN_FILE% -- %clang_args%
if errorlevel 1 (echo      Error: hipify-clang.exe failed with exit code: %errorlevel% && exit /b %errorlevel%)
%FILE_CHECK% %IN_FILE% -input-file=%TMP_FILE%
if errorlevel 1 (echo      Error: FileCheck.exe failed with exit code: %errorlevel% && exit /b %errorlevel%)

Add setlocal to batch script
[HIPIFY][tests] Add setlocal to batch script
