mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Use FileCheck's `[[@LINE+n]]` mechanism to refer to the next line. This is made awkward by a couple of things: * We want to keep the `CHECK` lines in the original order. * Errors are sometimes more than one line long. The approach we use is to interleave the original lines and the check lines, putting each check line as early as possible subject to two rules: 1) Check lines never precede the 'AUTOUPDATE' line 2) Except when required by rule (1), a check line that refers to a source line by line number is never placed earlier than a source line that precedes that source line. The actual `[[@LINE+n]]` annotations are created in a second pass after we've interleaved the lines so that we can work out the correct offsets. Co-authored-by: Jon Meow <jperkins@google.com>