diff --git a/src/Makefile b/src/Makefile
index 1af1e17aa..c006534c7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2184,6 +2184,7 @@ test_arglist \
 	test_pyx2 \
 	test_pyx3 \
 	test_quickfix \
+	test_quotestar \
 	test_recover \
 	test_regexp_latin \
 	test_regexp_utf8 \
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index 264295884..7f0a8fab2 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -192,6 +192,7 @@ NEW_TESTS = test_arabic.res \
 	    test_pyx2.res \
 	    test_pyx3.res \
 	    test_quickfix.res \
+	    test_quotestar.res \
 	    test_retab.res \
 	    test_ruby.res \
 	    test_search.res \
diff --git a/src/testdir/test_quotestar.vim b/src/testdir/test_quotestar.vim
new file mode 100644
index 000000000..87eb97288
--- /dev/null
+++ b/src/testdir/test_quotestar.vim
@@ -0,0 +1,78 @@
+" *-register tests (quotestar)
+
+if !has('clipboard')
+  finish
+endif
+
+let g:test_feasible_for_macunix = 0
+let g:test_feasible_for_x11 = 0
+
+if has('macunix')
+  let pbcopy_exe = exepath('pbcopy')
+  let pbpaste_exe = exepath('pbpaste')
+  let g:test_feasible_for_macunix = !empty(pbcopy_exe) && !empty(pbpaste_exe)
+elseif !empty("$DISPLAY")
+  let xsel_exe = exepath('xsel')
+  let test_feasible_for_x11 = !empty(xsel_exe)
+endif
+
+func Test_quotestar_clipboard2vim()
+  let skipped = ''
+
+  if !g:test_feasible_for_macunix && !g:test_feasible_for_x11
+    let skipped = "This test is not hosted by this platform."
+  else
+    let quotestar_saved = @*
+
+    let test_msg = 'text from clipboard to vim via quotestar'
+
+    new
+    " Write a piece of text to the clipboard.
+    let cmd = 'echo "' . test_msg . '" | '
+    if g:test_feasible_for_macunix
+      let cmd .= 'pbcopy'
+    elseif g:test_feasible_for_x11
+      let cmd .= 'xsel -p -i -l /dev/null'
+    endif
+    call system(cmd)
+    " See if the *-register is changed as expected.
+    call assert_equal(test_msg . "\n", @*)
+    bwipe!
+
+    let @* = quotestar_saved
+  endif
+
+  if !empty(skipped)
+    throw skipped
+  endif
+endfunc
+
+func Test_quotestar_vim2clipboard()
+  let skipped = ''
+
+  if !g:test_feasible_for_macunix && !g:test_feasible_for_x11
+    let skipped = "This test is not hosted by this platform."
+  else
+    let quotestar_saved = @*
+
+    let test_msg = 'text from vim to clipboard via quotestar'
+
+    new
+    " Write a piece of text to the *-register.
+    let @* = test_msg
+    if g:test_feasible_for_macunix
+      let cmd = 'pbpaste'
+    elseif g:test_feasible_for_x11
+      let cmd = 'xsel -p  -o -l /dev/null'
+    endif
+    " See if the clipboard is changed as expected.
+    call assert_equal(test_msg, system(cmd))
+    bwipe!
+
+    let @* = quotestar_saved
+  endif
+
+  if !empty(skipped)
+    throw skipped
+  endif
+endfunc
