\documentclass[a4paper]{article}
\def\pgfsysdriver{pgfsys-xetex.def}
%\def\pgfsysdriver{pgfsys-dvipdfmx.def}
\usepackage{tikz}

\usetikzlibrary{patterns}

\begin{document}

%\tracingmacros=2 \tracingcommands=2

\begin{tikzpicture}
  \draw[pattern=dots] (0,0) circle (1cm);
  \draw[pattern=fivepointed stars] (0,0) rectangle (3,1);
\end{tikzpicture}


\tikz \shade (0,0) circle (1ex);
% it crashed even if we introduced \end{document} here
\tikz \shadedraw (0,0) circle (1ex);
\tikz \shadedraw [shading=axis] (0,0) rectangle (1,1);
\tikz \shadedraw [shading=radial] (0,0) rectangle (1,1);
\tikz \shadedraw [shading=ball] (0,0) circle (.5cm);
\tikz \shadedraw [left color=red,right color=blue]
    (0,0) rectangle (1,1);
\tikz \shadedraw [shading=axis,shading angle=90] (0,0) rectangle (1,1);
\end{document}

