Files
carbon-lang/explorer/testdata/trace/phase_execution.carbon
T
Richard Smith 212188a922 Prefer to put STDOUT CHECK at the end of the file. (#3073)
Allow interleaving of STDOUT and STDERR check lines. Put STDOUT lines
after the line they're attached to, and STDERR lines before. If no
STDOUT check line is attached to any line, then put them all at the end
of the file instead.

This is intended to better handle the case where stdout contains
unreplaced mentions of line numbers, and also reflects that stdout is
typically a consequence of the test rather than commentary on it, so
placing it after the test seems likely to read better.
2023-08-08 19:51:52 +00:00

73 lines
5.0 KiB
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
package ExplorerTest api;
interface TestInterface {}
fn Main() -> i32 {
return 0;
}
// Place checks after code so that line numbers are stable, reducing merge
// conflicts.
// ARGS: --trace_file=- --trace_phase=execution %s
// AUTOUPDATE
// CHECK:STDOUT: ********** starting execution **********
// CHECK:STDOUT: ********** initializing globals **********
// CHECK:STDOUT: (+) stack-push: DeclarationAction pos: 0 `interface TestInterface` (phase_execution.carbon:7)
// CHECK:STDOUT: --- step DeclarationAction pos: 0 `interface TestInterface` (phase_execution.carbon:7) --->
// CHECK:STDOUT: (-) stack-pop: DeclarationAction pos: 0 `interface TestInterface` (phase_execution.carbon:7)
// CHECK:STDOUT: (+) stack-push: DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:11)
// CHECK:STDOUT: --- step DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:11) --->
// CHECK:STDOUT: (-) stack-pop: DeclarationAction pos: 0 `fn Main` (phase_execution.carbon:11)
// CHECK:STDOUT: ********** calling main function **********
// CHECK:STDOUT: (+) stack-push: ValueExpressionAction pos: 0 `Main()` (<Main()>:0)
// CHECK:STDOUT: --- step ValueExpressionAction pos: 0 `Main()` (<Main()>:0) --->
// CHECK:STDOUT: (+) stack-push: ExpressionAction pos: 0 `Main()` (<Main()>:0)
// CHECK:STDOUT: --- step ExpressionAction pos: 0 `Main()` (<Main()>:0) --->
// CHECK:STDOUT: (+) stack-push: ValueExpressionAction pos: 0 `Main` (<Main()>:0)
// CHECK:STDOUT: --- step ValueExpressionAction pos: 0 `Main` (<Main()>:0) --->
// CHECK:STDOUT: (+) stack-push: ExpressionAction pos: 0 `Main` (<Main()>:0)
// CHECK:STDOUT: --- step ExpressionAction pos: 0 `Main` (<Main()>:0) --->
// CHECK:STDOUT: (-) stack-pop: ExpressionAction pos: 0 `Main` (<Main()>:0)
// CHECK:STDOUT: --- step ValueExpressionAction pos: 1 `Main` results: [`fun<Main>`] (<Main()>:0) --->
// CHECK:STDOUT: (-) stack-pop: ValueExpressionAction pos: 1 `Main` results: [`fun<Main>`] (<Main()>:0)
// CHECK:STDOUT: --- step ExpressionAction pos: 1 `Main()` results: [`fun<Main>`] scope: [] (<Main()>:0) --->
// CHECK:STDOUT: calling function: fun<Main>
// CHECK:STDOUT: match pattern ()
// CHECK:STDOUT: from value expression with value ()
// CHECK:STDOUT: (+) stack-push: ScopeAction pos: 0 scope: [] (None)
// CHECK:STDOUT: (+) stack-push: StatementAction pos: 0 `{return 0;}` (phase_execution.carbon:11)
// CHECK:STDOUT: --- step StatementAction pos: 0 `{return 0;}` (phase_execution.carbon:11) --->
// CHECK:STDOUT: (+) stack-push: StatementAction pos: 0 `return 0;` (phase_execution.carbon:10)
// CHECK:STDOUT: --- step StatementAction pos: 0 `return 0;` (phase_execution.carbon:10) --->
// CHECK:STDOUT: (+) stack-push: ValueExpressionAction pos: 0 `0` (phase_execution.carbon:10)
// CHECK:STDOUT: --- step ValueExpressionAction pos: 0 `0` (phase_execution.carbon:10) --->
// CHECK:STDOUT: (+) stack-push: ExpressionAction pos: 0 `0` (phase_execution.carbon:10)
// CHECK:STDOUT: --- step ExpressionAction pos: 0 `0` (phase_execution.carbon:10) --->
// CHECK:STDOUT: (-) stack-pop: ExpressionAction pos: 0 `0` (phase_execution.carbon:10)
// CHECK:STDOUT: --- step ValueExpressionAction pos: 1 `0` results: [`0`] (phase_execution.carbon:10) --->
// CHECK:STDOUT: (-) stack-pop: ValueExpressionAction pos: 1 `0` results: [`0`] (phase_execution.carbon:10)
// CHECK:STDOUT: --- step StatementAction pos: 1 `return 0;` results: [`0`] (phase_execution.carbon:10) --->
// CHECK:STDOUT: (-) stack-pop: StatementAction pos: 1 `return 0;` results: [`0`] (phase_execution.carbon:10)
// CHECK:STDOUT: (-) stack-pop: StatementAction pos: 1 `{return 0;}` scope: [] (phase_execution.carbon:11)
// CHECK:STDOUT: (-) stack-pop: ScopeAction pos: 0 scope: [] (None)
// CHECK:STDOUT: (+) stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
// CHECK:STDOUT: (+) stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
// CHECK:STDOUT: --- step CleanUpAction pos: 0 scope: [] (stack cleanup:1) --->
// CHECK:STDOUT: (-) stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
// CHECK:STDOUT: --- step CleanUpAction pos: 0 scope: [] (stack cleanup:1) --->
// CHECK:STDOUT: (-) stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
// CHECK:STDOUT: --- step ExpressionAction pos: 2 `Main()` results: [`fun<Main>`, `0`] scope: [] (<Main()>:0) --->
// CHECK:STDOUT: (-) stack-pop: ExpressionAction pos: 2 `Main()` results: [`fun<Main>`, `0`] scope: [] (<Main()>:0)
// CHECK:STDOUT: (+) stack-push: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
// CHECK:STDOUT: --- step CleanUpAction pos: 0 scope: [] (stack cleanup:1) --->
// CHECK:STDOUT: (-) stack-pop: CleanUpAction pos: 0 scope: [] (stack cleanup:1)
// CHECK:STDOUT: --- step ValueExpressionAction pos: 1 `Main()` results: [`0`] (<Main()>:0) --->
// CHECK:STDOUT: (-) stack-pop: ValueExpressionAction pos: 1 `Main()` results: [`0`] (<Main()>:0)
// CHECK:STDOUT: interpreter result: 0
// CHECK:STDOUT: result: 0