| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- // 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:
|