\documentclass[a4paper]{article}

\usepackage{pgfplots}

\usepgfplotslibrary{fillbetween}

\begin{document}

\begin{tikzpicture}
	\begin{axis}[samples=2]
	\addplot+[name path=A] {x};
	\addlegendentry{A}

	\addplot+[name path=B] {0};
	\addlegendentry{B}

	\addplot fill between[of=A and B];
	\addlegendentry{AB}
	
	\addplot+[ultra thick] {1};
	\addlegendentry{C}
	\end{axis}
\end{tikzpicture}
\end{document}

