Files
carbon-lang/explorer/testdata/basic_syntax/fail_invalid_integer.carbon
T
Richard SmithandJon Meow e85f45de10 Move CHECK lines in tests next to the line that caused the output. (#1224)
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>
2022-05-03 15:48:56 -07:00

17 lines
725 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_invalid_integer.carbon:[[@LINE+1]]: Invalid integer literal: 11111111111111111111111111
return 11111111111111111111111111;
}