any trust—
(i)#
all of which was treated (under subpart E of part I of subchapter J of chapter 1) as owned by the decedent, and
(ii)#
to which the residue of the decedent’s estate will pass under his will (or, if no will is admitted to probate, which is the trust primarily responsible for paying debts, taxes, and expenses of administration).