Files
carbon-lang/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon
T

115 lines
4.5 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-sem-ir --dump-raw-sem-ir %s
//
// Check that we can combine textual IR and raw IR dumping in one compile.
//
// 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: [block3]}
// 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, arg1: empty, 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: global_init: {}
// CHECK:STDOUT: block3:
// CHECK:STDOUT: 0: inst+2
// CHECK:STDOUT: block4:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+1
// CHECK:STDOUT: ...
// CHECK:STDOUT:
// CHECK:STDOUT: --- a.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: }
// CHECK:STDOUT: %A: <function> = fn_decl @A [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// 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: [block3]}
// 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, arg1: empty, 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: global_init: {}
// CHECK:STDOUT: block3:
// CHECK:STDOUT: 0: inst+2
// CHECK:STDOUT: block4:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+1
// CHECK:STDOUT: ...
// CHECK:STDOUT:
// CHECK:STDOUT: --- b.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: .B = %B
// CHECK:STDOUT: }
// CHECK:STDOUT: %B: <function> = fn_decl @B [template] {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @B() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: