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>
18 lines
726 B
Plaintext
18 lines
726 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// RUN: %{not} %{explorer} %s 2>&1 | \
|
|
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
|
|
// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \
|
|
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
|
|
// AUTOUPDATE: %{explorer} %s
|
|
|
|
package ExplorerTest api;
|
|
|
|
fn Main() -> i32 {
|
|
// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/basic_syntax/fail_nested_binding.carbon:[[@LINE+1]]: The type of a binding pattern cannot contain bindings.
|
|
var x: (T: Type) = 1;
|
|
return 1;
|
|
}
|