Files
carbon-lang/toolchain/semantics/testdata/function/basic.carbon
T
Jon Ross-Perkins 94cbb9d917 Make function definitions allocate the body more lazily. (#2557)
Lazy allocation means that we can use a single node block for _all_ empty node blocks. The change in timing for when the definition node is emitted shouldn't affect semantic correctness; the signature is already present for recursive calls.
2023-01-27 11:46:12 -08:00

36 lines
1.3 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
//
// AUTOUPDATE
// RUN: %{carbon-run-semantics}
// CHECK:STDOUT: cross_reference_irs_size: 1
// CHECK:STDOUT: callables: [
// CHECK:STDOUT: {param_ir: block0, param_refs: block0}
// CHECK:STDOUT: ]
// CHECK:STDOUT: integer_literals: [
// CHECK:STDOUT: ]
// CHECK:STDOUT: strings: [
// CHECK:STDOUT: Foo,
// CHECK:STDOUT: ]
// CHECK:STDOUT: nodes: [
// CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: block0, type: node0},
// CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: block1, type: node1},
// CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: block2, type: node0},
// CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: block3, type: node0},
// CHECK:STDOUT: {kind: FunctionDeclaration, arg0: callable0},
// CHECK:STDOUT: {kind: BindName, arg0: str0, arg1: node4},
// CHECK:STDOUT: {kind: FunctionDefinition, arg0: node4, arg1: block0},
// CHECK:STDOUT: ]
// CHECK:STDOUT: node_blocks: [
// CHECK:STDOUT: [
// CHECK:STDOUT: ],
// CHECK:STDOUT: [
// CHECK:STDOUT: node4,
// CHECK:STDOUT: node5,
// CHECK:STDOUT: node6,
// CHECK:STDOUT: ],
// CHECK:STDOUT: ]
fn Foo() {}