diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 4d5aea7..2a45195 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -125,7 +125,7 @@ test1.out: test1.in
 
 	# Check if the test.out file matches test.ok.
 	@/bin/sh -c "if test -f test.out; then \
-		  if diff test.out $*.ok; \
+		  if diff test.out test.ok; \
 		  then mv -f test.out $*.out; \
 		  else echo $* FAILED >>test.log; mv -f test.out $*.failed; \
 		  fi \
diff --git a/src/testdir/test_autocmd_option.in b/src/testdir/test_autocmd_option.in
index 4d71c50..c152d25 100644
--- a/src/testdir/test_autocmd_option.in
+++ b/src/testdir/test_autocmd_option.in
@@ -3,6 +3,7 @@ Test for option autocommand
 STARTTEST
 :so small.vim
 :if !has("eval") || !has("autocmd") | e! test.ok | w! test.out | qa! | endif
+:if !exists("+autochdir") | e! test.ok | /^8: Setting global acd/d 4 | w! test.ok | bd! test.ok | endif
 :fu! AutoCommand(match)
 :	let c=g:testcase
 :       let item=remove(g:options, 0)
@@ -38,9 +39,9 @@ STARTTEST
 :let g:options=[['list', 0, 1, 'global'], ['number', 0, 1, 'global']]
 :set list nu
 :noa set nolist nonu
-:let g:testcase="8: Setting global acd\n"
-:let g:options=[['autochdir', 0, 1, 'global']]
-:setlocal acd
+:if exists("+autochdir") | let g:testcase="8: Setting global acd\n" | endif
+:if exists("+autochdir") | let g:options=[['autochdir', 0, 1, 'global']] | endif
+:if exists("+autochdir") | setlocal acd | endif
 :let g:testcase="9: Setting global autoread\n"
 :let g:options=[['autoread', 0, 1, 'global']]
 :set ar
diff --git a/src/testdir/test_autocmd_option.ok b/src/testdir/test_autocmd_option.ok
index b66b8f6..b22f987 100644
--- a/src/testdir/test_autocmd_option.ok
+++ b/src/testdir/test_autocmd_option.ok
@@ -3,6 +3,7 @@ Test for option autocommand
 STARTTEST
 :so small.vim
 :if !has("eval") || !has("autocmd") | e! test.ok | w! test.out | qa! | endif
+:if !exists("+autochdir") | e! test.ok | /^8: Setting global acd/d 4 | w! test.ok | bd! test.ok | endif
 :fu! AutoCommand(match)
 :	let c=g:testcase
 :       let item=remove(g:options, 0)
@@ -38,9 +39,9 @@ STARTTEST
 :let g:options=[['list', 0, 1, 'global'], ['number', 0, 1, 'global']]
 :set list nu
 :noa set nolist nonu
-:let g:testcase="8: Setting global acd\n"
-:let g:options=[['autochdir', 0, 1, 'global']]
-:setlocal acd
+:if exists("+autochdir") | let g:testcase="8: Setting global acd\n" | endif
+:if exists("+autochdir") | let g:options=[['autochdir', 0, 1, 'global']] | endif
+:if exists("+autochdir") | setlocal acd | endif
 :let g:testcase="9: Setting global autoread\n"
 :let g:options=[['autoread', 0, 1, 'global']]
 :set ar
