mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 10:54:49 +01:00
Start adding var decls to semantics. (#2447)
This is just the declaration, without initialization. Partly breaking it out because I'm changing the placeholder builtin types. Might also need to separate out storage of the var from the name bind.
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
// 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 == 2,
|
||||
// CHECK:STDOUT: cross_references = {
|
||||
// CHECK:STDOUT: node_xref0 = xref(ir0, block0, node0);
|
||||
// CHECK:STDOUT: node_xref1 = xref(ir0, block0, node1);
|
||||
// CHECK:STDOUT: node_xref2 = xref(ir0, block0, node2);
|
||||
// CHECK:STDOUT: node_xref3 = xref(ir0, block0, node3);
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: identifiers = {
|
||||
// CHECK:STDOUT: ident0 = "x";
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: integer_literals = {
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: node_blocks = {
|
||||
// CHECK:STDOUT: block0 = {
|
||||
// CHECK:STDOUT: node0 = BindName(ident0, node_xref2);
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
var x: i32;
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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 == 2,
|
||||
// CHECK:STDOUT: cross_references = {
|
||||
// CHECK:STDOUT: node_xref0 = xref(ir0, block0, node0);
|
||||
// CHECK:STDOUT: node_xref1 = xref(ir0, block0, node1);
|
||||
// CHECK:STDOUT: node_xref2 = xref(ir0, block0, node2);
|
||||
// CHECK:STDOUT: node_xref3 = xref(ir0, block0, node3);
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: identifiers = {
|
||||
// CHECK:STDOUT: ident0 = "Main";
|
||||
// CHECK:STDOUT: ident1 = "x";
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: integer_literals = {
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: node_blocks = {
|
||||
// CHECK:STDOUT: block0 = {
|
||||
// CHECK:STDOUT: node0 = FunctionDeclaration();
|
||||
// CHECK:STDOUT: node1 = BindName(ident0, node0);
|
||||
// CHECK:STDOUT: node2 = FunctionDefinition(node0, block1);
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: block1 = {
|
||||
// CHECK:STDOUT: node0 = BindName(ident1, node_xref2);
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
fn Main() {
|
||||
var x: i32;
|
||||
}
|
||||
Reference in New Issue
Block a user