It is narrated from al-Hasan (may Allah have mercy on him) regarding a man who bequeaths Hajj or zakah that it is from all his wealth.
It has been narrated to us from Ibrahim al-Nakha'i that he said: If he bequeaths Hajj or zakah, it is from the third, whether he had performed Hajj or not; and the like of that is narrated from Ibn Sirin. We hold the view of al-Hasan, Tawus, Ata and al-Zuhri, since they said that it is like a debt.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوصايا / 12601