\documentclass{article}
\usepackage{imakeidx}

\makeindex
 
\begin{document}

Wibble, wibble, foo\index{foo}, foo, bar\index{bar}.
 
\printindex

\end{document}

Add fixture for index test
Add fixture for index test
