in The Coverage and Nondiscrimination Answer Book (12:90.1) I wrote it up as follows There is no requirement that the ADP test be performed first, followed by forfeiture of related matching contributions if there were excess contributions (see Q 9:15). Both Treasury Regulations Sections 1.401(m)-2(b)(3)(v)(B) and 1.401(a)(4)-4(e)(3)(iii)(G) indicate that the rate of match is determined after any corrections are made. IRS officials also agreed with this conclusion. [Q and A #18, 2004 ASPPA Annual Conference] Thus, aside from any document restrictions, it is recommended to perform the ACP test first, make any corrections necessary, and then perform the ADP test. In this way the HCE might not forfeit any matching contributions.
of course, any comments made by IRS at such meetings do not necessarily reflect an actual Treasury Position, but the fact the regs specify related match is determined after any corrections seems to hold to this position