updated for version 7.0175
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index e9e75e5..aee0894 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -24,7 +24,7 @@
 		test38.out test39.out test40.out test41.out test42.out \
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out test55.out \
-		test56.out test57.out test58.out test59.out
+		test56.out test57.out test58.out test59.out test60.out
 
 .SUFFIXES: .in .out
 
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 092b24a..1821cca 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -25,7 +25,7 @@
 		test15.out test17.out test18.out test21.out test26.out \
 		test30.out test31.out test32.out test33.out test34.out \
 		test37.out test38.out test39.out test40.out test41.out \
-		test42.out test52.out
+		test42.out test52.out test60.out
 
 SCRIPTS32 =	test50.out
 
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 5236922..d8b2f75 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -24,7 +24,7 @@
 		test38.out test39.out test40.out test41.out test42.out \
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out test55.out \
-		test56.out test57.out test58.out test59.out
+		test56.out test57.out test58.out test59.out test60.out
 
 .SUFFIXES: .in .out
 
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 6d08e50..767ab78 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -58,7 +58,7 @@
 	 test38.out test39.out test40.out test41.out test42.out \
 	 test43.out test44.out test45.out test46.out \
 	 test48.out test51.out test53.out test54.out test55.out \
-	 test56.out test57.out test58.out test59.out
+	 test56.out test57.out test58.out test59.out test60.out
 
 .IFDEF WANT_GUI
 SCRIPT_GUI = test16.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 06c4173..49f14f9 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -15,7 +15,7 @@
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test49.out test51.out test52.out test53.out \
 		test54.out test55.out test56.out test57.out test58.out \
-		test59.out
+		test59.out test60.out
 
 SCRIPTS_GUI = test16.out
 
diff --git a/src/testdir/test60.in b/src/testdir/test60.in
new file mode 100644
index 0000000..58a2c90
--- /dev/null
+++ b/src/testdir/test60.in
@@ -0,0 +1,71 @@
+Tests for the exists() function.  vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:function! RunTest(str, result)
+    if exists(a:str) == a:result
+	echo "OK"
+    else
+	echo "FAILED: Checking for " . a:str
+    endif
+endfunction
+:function! TestExists()
+    augroup myagroup
+	autocmd! BufEnter *.my echo 'myfile edited'
+    augroup END
+    redir! > test.out
+
+    " valid autocmd group
+    call RunTest('#myagroup', 1)
+
+    " Valid autocmd group and event
+    call RunTest('#myagroup#BufEnter', 1)
+
+    " Valid autocmd group, event and pattern
+    call RunTest('#myagroup#BufEnter#*.my', 1)
+
+    " Valid autocmd event
+    call RunTest('#BufEnter', 1)
+
+    " Valid autocmd event and pattern
+    call RunTest('#BufEnter#*.my', 1)
+
+    " Non-existing autocmd group or event
+    call RunTest('#xyzagroup', 0)
+
+    " Non-existing autocmd group and valid autocmd event
+    call RunTest('#xyzagroup#BufEnter', 0)
+
+    " Valid autocmd group and autocmd event with no matching pattern
+    call RunTest('#myagroup#CmdwinEnter', 0)
+
+    " Valid autocmd group and non-existing autocmd event
+    call RunTest('#myagroup#xyzacmd', 0)
+
+    " Valid autocmd group and event and non-matching pattern
+    call RunTest('#myagroup#BufEnter#xyzpat', 0)
+
+    " Valid autocmd event and non-matching pattern
+    call RunTest('#BufEnter#xyzpat', 0)
+
+    " Empty autocmd group, event and pattern
+    call RunTest('###', 0)
+
+    " Empty autocmd group and event or event and pattern
+    call RunTest('##', 0)
+
+    " Testing support for event name that exists.
+    call RunTest('##SwapExists', 1)
+
+    " Testing support for event name that doesn't exist.
+    call RunTest('##SwapNotExists', 0)
+
+    redir END
+endfunction
+:call TestExists()
+:edit! test.out
+:set ff=unix
+:w
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test60.ok b/src/testdir/test60.ok
new file mode 100644
index 0000000..004245f
--- /dev/null
+++ b/src/testdir/test60.ok
@@ -0,0 +1,16 @@
+
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK