patch 8.2.3780: ":cd" works differently on MS-Windows

Problem:    ":cd" works differently on MS-Windows.
Solution:   Add the 'cdhome' option. (closes #9324)
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 28e23c0..912bc20 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -77,6 +77,9 @@
   let s:start_time = reltime()
 endif
 
+" Always use forward slashes.
+set shellslash
+
 " Common with all tests on all systems.
 source setup.vim
 
@@ -128,9 +131,6 @@
   source $VIMRUNTIME/menu.vim
 endif
 
-" Always use forward slashes.
-set shellslash
-
 let s:srcdir = expand('%:p:h:h')
 
 if has('win32')
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index 6fc4564..2265894 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -1199,4 +1199,25 @@
   bw
 endfunc
 
+" Test for the 'cdhome' option
+func Test_opt_cdhome()
+  if has('unix') || has('vms')
+    throw 'Skipped: only works on non-Unix'
+  endif
+
+  set cdhome&
+  call assert_equal(0, &cdhome)
+  set cdhome
+
+  " This paragraph is copied from Test_cd_no_arg().
+  let path = getcwd()
+  cd
+  call assert_equal($HOME, getcwd())
+  call assert_notequal(path, getcwd())
+  exe 'cd ' .. fnameescape(path)
+  call assert_equal(path, getcwd())
+
+  set cdhome&
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab