IRC § 338
Purchase of Target & Sale of Target’s Subsidiary
A purchaser makes a qualified stock purchase of a target that owns a subsidiary, the target sells the subsidiary before the election, and a later section 338 election still produces a qualified stock purchase of the subsidiary.
Treas. Reg. § 1.338-3(c)(1)(ii), Example 2 • Section 338 Elections