Files
carbon-lang/toolchain/check/testdata/basics/multifile_raw_ir.carbon
T
Jon Ross-Perkins 7f11012f58 CrossRefIRId -> ImportIRId (#3662)
One more (hopefully last) rename on the Import instruction renaming.

I was kind of tempted to rename to just "IRId", since the IRs aren't all
imports. However, this felt easier to read, and a better choice than
CrossRef because it's more consistent with the other ways imports exist
in code. (even if IRs aren't all imports, most use-cases are derived
from imports)

Note though that import_irs may include IRs not just from direct
imports. Beyond the builtin IR, I'm thinking that for indirect imports,
or the prelude, we may end up adding them. e.g., so that constants can
be generated for indirect imports and still correspond to a directly
known IR, and for a given IR that's indirectly imported multiple times
to be deduplicated locally. I'm not there yet, I'm just mentioning this
to help give background for naming thoughts.
2024-01-29 23:05:47 +00:00

83 lines
3.6 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
//
// ARGS: compile --phase=check --dump-raw-sem-ir %s
//
// Check that raw IR dumping works as expected.
//
// AUTOUPDATE
// --- a.carbon
package A api;
fn A() {}
// --- b.carbon
package B api;
fn B() {}
// CHECK:STDOUT: ---
// CHECK:STDOUT: filename: a.carbon
// CHECK:STDOUT: sem_ir:
// CHECK:STDOUT: import_irs_size: 1
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: inst+0, enclosing_scope: name_scope<invalid>, has_error: false, extended_scopes: [], names: {name0: inst+1}}
// CHECK:STDOUT: bind_names: {}
// CHECK:STDOUT: functions:
// CHECK:STDOUT: function0: {name: name0, enclosing_scope: name_scope0, param_refs: empty, body: [block2]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {constant: template instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {constant: template instFunctionType, value_rep: {kind: copy, type: type1}}
// CHECK:STDOUT: type_blocks: {}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, arg1: inst<invalid>, type: type0}
// CHECK:STDOUT: inst+1: {kind: FunctionDecl, arg0: function0, type: type1}
// CHECK:STDOUT: inst+2: {kind: Return}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: inst+0: template inst+0
// CHECK:STDOUT: inst+1: template inst+1
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: empty: {}
// CHECK:STDOUT: exports:
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: block2:
// CHECK:STDOUT: 0: inst+2
// CHECK:STDOUT: block3:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+1
// CHECK:STDOUT: ...
// CHECK:STDOUT: ---
// CHECK:STDOUT: filename: b.carbon
// CHECK:STDOUT: sem_ir:
// CHECK:STDOUT: import_irs_size: 1
// CHECK:STDOUT: name_scopes:
// CHECK:STDOUT: name_scope0: {inst: inst+0, enclosing_scope: name_scope<invalid>, has_error: false, extended_scopes: [], names: {name0: inst+1}}
// CHECK:STDOUT: bind_names: {}
// CHECK:STDOUT: functions:
// CHECK:STDOUT: function0: {name: name0, enclosing_scope: name_scope0, param_refs: empty, body: [block2]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {constant: template instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {constant: template instFunctionType, value_rep: {kind: copy, type: type1}}
// CHECK:STDOUT: type_blocks: {}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, arg1: inst<invalid>, type: type0}
// CHECK:STDOUT: inst+1: {kind: FunctionDecl, arg0: function0, type: type1}
// CHECK:STDOUT: inst+2: {kind: Return}
// CHECK:STDOUT: constant_values:
// CHECK:STDOUT: inst+0: template inst+0
// CHECK:STDOUT: inst+1: template inst+1
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: empty: {}
// CHECK:STDOUT: exports:
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: block2:
// CHECK:STDOUT: 0: inst+2
// CHECK:STDOUT: block3:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+1
// CHECK:STDOUT: ...