Add support for 'package' in expressions. (#3445)

This creates a namespace for `package` scope.

It looks like names of class_decls in namespaces lead to an unexpected
instref. This is already true, as best as I can tell. I'm not sure if
there's a preferred approach to address that, so I've left a TODO for
now.
This commit is contained in:
Jon Ross-Perkins
2023-12-04 21:05:41 +00:00
committed by GitHub
parent 1c4a35c76b
commit 30155dbb72
262 changed files with 721 additions and 129 deletions
+12 -2
View File
@@ -13,6 +13,7 @@
#include "toolchain/parse/tree.h"
#include "toolchain/parse/tree_node_location_translator.h"
#include "toolchain/sem_ir/file.h"
#include "toolchain/sem_ir/typed_insts.h"
namespace Carbon::Check {
@@ -120,9 +121,18 @@ static auto CheckParseTree(const SemIR::File& builtin_ir, UnitInfo& unit_info,
PrettyStackTraceFunction context_dumper(
[&](llvm::raw_ostream& output) { context.PrintForStackDump(output); });
// Add a block for the Parse::Tree.
// Add a block for the file.
context.inst_block_stack().Push();
context.PushScope();
// Define the package scope, with an instruction for `package` expressions to
// reference.
auto package_scope = context.name_scopes().Add();
auto package_inst = context.AddInst(SemIR::Namespace{
Parse::NodeId::Invalid,
context.GetBuiltinType(SemIR::BuiltinKind::NamespaceType),
package_scope});
CARBON_CHECK(package_inst == SemIR::InstId::PackageNamespace);
context.PushScope(SemIR::InstId::Invalid, package_scope);
AddImports(context, unit_info);
+10
View File
@@ -7,6 +7,7 @@
#include "toolchain/check/convert.h"
#include "toolchain/lex/token_kind.h"
#include "toolchain/sem_ir/inst.h"
#include "toolchain/sem_ir/typed_insts.h"
namespace Carbon::Check {
@@ -272,6 +273,15 @@ auto HandleQualifiedDecl(Context& context, Parse::NodeId parse_node) -> bool {
return true;
}
auto HandlePackageExpr(Context& context, Parse::NodeId parse_node) -> bool {
context.AddInstAndPush(
parse_node,
SemIR::NameRef{
parse_node, context.GetBuiltinType(SemIR::BuiltinKind::NamespaceType),
SemIR::NameId::PackageNamespace, SemIR::InstId::PackageNamespace});
return true;
}
auto HandleSelfTypeNameExpr(Context& context, Parse::NodeId parse_node)
-> bool {
auto name_id = SemIR::NameId::SelfType;
+1
View File
@@ -303,6 +303,7 @@ class NodeStack {
case Parse::NodeKind::InfixOperator:
case Parse::NodeKind::MemberAccessExpr:
case Parse::NodeKind::NameExpr:
case Parse::NodeKind::PackageExpr:
case Parse::NodeKind::ParenExpr:
case Parse::NodeKind::PostfixOperator:
case Parse::NodeKind::PrefixOperator:
+1
View File
@@ -21,6 +21,7 @@ fn G() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.F = %F, .G = %G}
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: %G: <function> = fn_decl @G
// CHECK:STDOUT: }
@@ -19,6 +19,7 @@ fn Run() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.F = %F, .Run = %Run}
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
// CHECK:STDOUT: }
+1
View File
@@ -17,6 +17,7 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.a = %a, .b = %b}
// CHECK:STDOUT: %.loc7_22.1: (type, type, type) = tuple_literal (i32, i32, i32)
// CHECK:STDOUT: %.loc7_22.2: type = converted %.loc7_22.1, constants.%.loc7_22.2
// CHECK:STDOUT: %a.var: ref (i32, i32, i32) = var a
+1
View File
@@ -21,6 +21,7 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.a = %a, .b = %b, .c = %c}
// CHECK:STDOUT: %.loc7_14: i32 = int_literal 1
// CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32
// CHECK:STDOUT: %a.var: ref [i32; 1] = var a
@@ -12,6 +12,7 @@ var a: [1; 39999999999999999993];
// CHECK:STDOUT: --- fail_bound_overflow.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.a = %a}
// CHECK:STDOUT: %.loc10_9: i32 = int_literal 1
// CHECK:STDOUT: %.loc10_12: i32 = int_literal 39999999999999999993
// CHECK:STDOUT: %a.var: ref <error> = var a
@@ -26,6 +26,7 @@ var p: Incomplete* = &a[0];
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Incomplete = %Incomplete.decl, .a = %a, .p = %p}
// CHECK:STDOUT: %Incomplete.decl = class_decl @Incomplete, ()
// CHECK:STDOUT: %Incomplete: type = class_type @Incomplete
// CHECK:STDOUT: %Incomplete.ref.loc15: type = name_ref Incomplete, %Incomplete
@@ -16,6 +16,7 @@ var a: [1; 1];
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.a = %a}
// CHECK:STDOUT: %.loc10_9: i32 = int_literal 1
// CHECK:STDOUT: %.loc10_12: i32 = int_literal 1
// CHECK:STDOUT: %.loc10_13: type = array_type %.loc10_12, <error>
@@ -17,6 +17,7 @@ var a: [i32; 1] = (1, 2, 3);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.a = %a}
// CHECK:STDOUT: %.loc10_14: i32 = int_literal 1
// CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, i32
// CHECK:STDOUT: %a.var: ref [i32; 1] = var a
@@ -41,6 +41,7 @@ var d: [i32; 3] = t2;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.a = %a, .t1 = %t1, .b = %b, .c = %c, .t2 = %t2, .d = %d}
// CHECK:STDOUT: %.loc10_14: i32 = int_literal 3
// CHECK:STDOUT: %.loc10_15: type = array_type %.loc10_14, i32
// CHECK:STDOUT: %a.var: ref [i32; 3] = var a
+1
View File
@@ -20,6 +20,7 @@ fn G() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.F = %F, .G = %G}
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: %G: <function> = fn_decl @G
// CHECK:STDOUT: }
+1
View File
@@ -14,6 +14,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.a = %a}
// CHECK:STDOUT: %.loc7_14: i32 = int_literal 9
// CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32
// CHECK:STDOUT: %a.var: ref [i32; 9] = var a
+1
View File
@@ -14,6 +14,7 @@ let t: type = (i32, i32) as type;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {}
// CHECK:STDOUT: %.loc7_24: (type, type) = tuple_literal (i32, i32)
// CHECK:STDOUT: %.loc7_26: type = converted %.loc7_24, constants.%.loc7_26
// CHECK:STDOUT: %t: type = bind_name t, %.loc7_26
+1
View File
@@ -11,6 +11,7 @@ fn Main() -> i32 {
// CHECK:STDOUT: --- basic.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Main = %Main}
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -18,6 +18,7 @@ let n: (i32, i32) = 1 as (i32, i32);
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {}
// CHECK:STDOUT: %.loc10_17.1: (type, type) = tuple_literal (i32, i32)
// CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%.loc10_17.2
// CHECK:STDOUT: %.loc10_21: i32 = int_literal 1
+1
View File
@@ -12,6 +12,7 @@ let n: i32 = 1 as 2;
// CHECK:STDOUT: --- fail_not_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {}
// CHECK:STDOUT: %.loc10_14: i32 = int_literal 1
// CHECK:STDOUT: %.loc10_19: i32 = int_literal 2
// CHECK:STDOUT: %n: i32 = bind_name n, <error>
+1
View File
@@ -33,6 +33,7 @@ fn Initializing() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.X = %X.decl, .Value = %Value, .Reference = %Reference, .Make = %Make, .Initializing = %Initializing}
// CHECK:STDOUT: %X.decl = class_decl @X, ()
// CHECK:STDOUT: %X: type = class_type @X
// CHECK:STDOUT: %Value: <function> = fn_decl @Value
+1
View File
@@ -33,6 +33,7 @@ fn Var() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.X = %X.decl, .Make = %Make, .Let = %Let, .Var = %Var}
// CHECK:STDOUT: %X.decl = class_decl @X, ()
// CHECK:STDOUT: %X: type = class_type @X
// CHECK:STDOUT: %Make: <function> = fn_decl @Make
+5 -1
View File
@@ -12,7 +12,8 @@
// CHECK:STDOUT: cross_ref_irs_size: 1
// CHECK:STDOUT: functions: {}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {inst: instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type_blocks: {}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: instTypeType: {kind: CrossRef, arg0: ir0, arg1: instTypeType, type: typeTypeType}
@@ -24,6 +25,9 @@
// CHECK:STDOUT: instFunctionType: {kind: CrossRef, arg0: ir0, arg1: instFunctionType, type: typeTypeType}
// CHECK:STDOUT: instBoundMethodType: {kind: CrossRef, arg0: ir0, arg1: instBoundMethodType, type: typeTypeType}
// CHECK:STDOUT: instNamespaceType: {kind: CrossRef, arg0: ir0, arg1: instNamespaceType, type: typeTypeType}
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, type: type0}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: block0: {}
// CHECK:STDOUT: block1:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: ...
+1
View File
@@ -16,6 +16,7 @@ var test_type: type = i32;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.test_i32 = %test_i32, .test_f64 = %test_f64, .test_type = %test_type}
// CHECK:STDOUT: %test_i32.var: ref i32 = var test_i32
// CHECK:STDOUT: %test_i32: ref i32 = bind_name test_i32, %test_i32.var
// CHECK:STDOUT: %.loc7: i32 = int_literal 0
+1
View File
@@ -7,5 +7,6 @@
// CHECK:STDOUT: --- empty.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -9,5 +9,6 @@
// CHECK:STDOUT: --- empty_decl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -20,6 +20,7 @@ fn Run() -> String {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Run = %Run}
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -12,6 +12,7 @@ fn Run(n: i32) {}
// CHECK:STDOUT: --- fail_bad_run_2.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Run = %Run}
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -14,6 +14,7 @@ fn Main() {
// CHECK:STDOUT: --- fail_name_lookup.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Main = %Main}
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -12,6 +12,7 @@ var x: type = 42;
// CHECK:STDOUT: --- fail_non_type_as_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.x = %x}
// CHECK:STDOUT: %x.var: ref type = var x
// CHECK:STDOUT: %x: ref type = bind_name x, %x.var
// CHECK:STDOUT: %.loc10: i32 = int_literal 42
@@ -13,6 +13,7 @@ var y: i32 = x.b;
// CHECK:STDOUT: --- fail_qualifier_unsupported.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.x = %x, .y = %y}
// CHECK:STDOUT: %x.var: ref i32 = var x
// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var
// CHECK:STDOUT: %y.var: ref i32 = var y
+2
View File
@@ -17,6 +17,7 @@ fn B() {}
// CHECK:STDOUT: --- a.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A}
// CHECK:STDOUT: %A: <function> = fn_decl @A
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -28,6 +29,7 @@ fn B() {}
// CHECK:STDOUT: --- b.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.B = %B}
// CHECK:STDOUT: %B: <function> = fn_decl @B
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -26,22 +26,26 @@ fn B() {}
// CHECK:STDOUT: function0: {name: name0, param_refs: block0, body: [block1]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type0: {inst: instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {inst: instFunctionType, value_rep: {kind: copy, type: type1}}
// CHECK:STDOUT: type_blocks: {}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: inst+0: {kind: FunctionDecl, arg0: function0, type: type0}
// CHECK:STDOUT: inst+1: {kind: Return}
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, type: type0}
// CHECK:STDOUT: inst+1: {kind: FunctionDecl, arg0: function0, type: type1}
// CHECK:STDOUT: inst+2: {kind: Return}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: block0: {}
// CHECK:STDOUT: block1:
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: 0: inst+2
// CHECK:STDOUT: block2:
// 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 {.A = %A}
// CHECK:STDOUT: %A: <function> = fn_decl @A
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -58,22 +62,26 @@ fn B() {}
// CHECK:STDOUT: function0: {name: name0, param_refs: block0, body: [block1]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type0: {inst: instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {inst: instFunctionType, value_rep: {kind: copy, type: type1}}
// CHECK:STDOUT: type_blocks: {}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: inst+0: {kind: FunctionDecl, arg0: function0, type: type0}
// CHECK:STDOUT: inst+1: {kind: Return}
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, type: type0}
// CHECK:STDOUT: inst+1: {kind: FunctionDecl, arg0: function0, type: type1}
// CHECK:STDOUT: inst+2: {kind: Return}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: block0: {}
// CHECK:STDOUT: block1:
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: 0: inst+2
// CHECK:STDOUT: block2:
// 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 {.B = %B}
// CHECK:STDOUT: %B: <function> = fn_decl @B
// CHECK:STDOUT: }
// CHECK:STDOUT:
+14 -8
View File
@@ -26,17 +26,20 @@ fn B() {}
// CHECK:STDOUT: function0: {name: name0, param_refs: block0, body: [block1]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type0: {inst: instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {inst: instFunctionType, value_rep: {kind: copy, type: type1}}
// CHECK:STDOUT: type_blocks: {}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: inst+0: {kind: FunctionDecl, arg0: function0, type: type0}
// CHECK:STDOUT: inst+1: {kind: Return}
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, type: type0}
// CHECK:STDOUT: inst+1: {kind: FunctionDecl, arg0: function0, type: type1}
// CHECK:STDOUT: inst+2: {kind: Return}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: block0: {}
// CHECK:STDOUT: block1:
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: 0: inst+2
// CHECK:STDOUT: block2:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+1
// CHECK:STDOUT: ...
// CHECK:STDOUT: ---
// CHECK:STDOUT: filename: b.carbon
@@ -46,15 +49,18 @@ fn B() {}
// CHECK:STDOUT: function0: {name: name0, param_refs: block0, body: [block1]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type0: {inst: instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {inst: instFunctionType, value_rep: {kind: copy, type: type1}}
// CHECK:STDOUT: type_blocks: {}
// CHECK:STDOUT: insts:
// CHECK:STDOUT: inst+0: {kind: FunctionDecl, arg0: function0, type: type0}
// CHECK:STDOUT: inst+1: {kind: Return}
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, type: type0}
// CHECK:STDOUT: inst+1: {kind: FunctionDecl, arg0: function0, type: type1}
// CHECK:STDOUT: inst+2: {kind: Return}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: block0: {}
// CHECK:STDOUT: block1:
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: 0: inst+2
// CHECK:STDOUT: block2:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+1
// CHECK:STDOUT: ...
@@ -35,6 +35,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.F = %F}
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -9,6 +9,7 @@ var test_i32: i32 = ((1) + (2));
// CHECK:STDOUT: --- parens.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.test_i32 = %test_i32}
// CHECK:STDOUT: %test_i32.var: ref i32 = var test_i32
// CHECK:STDOUT: %test_i32: ref i32 = bind_name test_i32, %test_i32.var
// CHECK:STDOUT: %.loc7_23: i32 = int_literal 1
+55 -51
View File
@@ -17,76 +17,79 @@ fn Foo(n: i32) -> (i32, f64) {
// CHECK:STDOUT: sem_ir:
// CHECK:STDOUT: cross_ref_irs_size: 1
// CHECK:STDOUT: functions:
// CHECK:STDOUT: function0: {name: name0, param_refs: block1, return_type: type3, return_slot: inst+5, body: [block4]}
// CHECK:STDOUT: function0: {name: name0, param_refs: block1, return_type: type4, return_slot: inst+6, body: [block4]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {inst: instIntType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {inst: inst+1, value_rep: {kind: unknown, type: type<invalid>}}
// CHECK:STDOUT: type2: {inst: instFloatType, value_rep: {kind: copy, type: type2}}
// CHECK:STDOUT: type3: {inst: inst+3, value_rep: {kind: pointer, type: type4}}
// CHECK:STDOUT: type4: {inst: inst+6, value_rep: {kind: copy, type: type4}}
// CHECK:STDOUT: type5: {inst: instFunctionType, value_rep: {kind: copy, type: type5}}
// CHECK:STDOUT: type0: {inst: instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {inst: instIntType, value_rep: {kind: copy, type: type1}}
// CHECK:STDOUT: type2: {inst: inst+2, value_rep: {kind: unknown, type: type<invalid>}}
// CHECK:STDOUT: type3: {inst: instFloatType, value_rep: {kind: copy, type: type3}}
// CHECK:STDOUT: type4: {inst: inst+4, value_rep: {kind: pointer, type: type5}}
// CHECK:STDOUT: type5: {inst: inst+7, value_rep: {kind: copy, type: type5}}
// CHECK:STDOUT: type6: {inst: instFunctionType, value_rep: {kind: copy, type: type6}}
// CHECK:STDOUT: type_blocks:
// CHECK:STDOUT: typeBlock0:
// CHECK:STDOUT: 0: typeTypeType
// CHECK:STDOUT: 1: typeTypeType
// CHECK:STDOUT: typeBlock1:
// CHECK:STDOUT: 0: type0
// CHECK:STDOUT: 1: type2
// CHECK:STDOUT: 0: type1
// CHECK:STDOUT: 1: type3
// CHECK:STDOUT: insts:
// CHECK:STDOUT: inst+0: {kind: Param, arg0: name1, type: type0}
// CHECK:STDOUT: inst+1: {kind: TupleType, arg0: typeBlock0, type: typeTypeType}
// CHECK:STDOUT: inst+2: {kind: TupleLiteral, arg0: block2, type: type1}
// CHECK:STDOUT: inst+3: {kind: TupleType, arg0: typeBlock1, type: typeTypeType}
// CHECK:STDOUT: inst+4: {kind: Converted, arg0: inst+2, arg1: inst+3, type: typeTypeType}
// CHECK:STDOUT: inst+5: {kind: VarStorage, arg0: nameReturnSlot, type: type3}
// CHECK:STDOUT: inst+6: {kind: PointerType, arg0: type3, type: typeTypeType}
// CHECK:STDOUT: inst+7: {kind: FunctionDecl, arg0: function0, type: type5}
// CHECK:STDOUT: inst+8: {kind: NameRef, arg0: name1, arg1: inst+0, type: type0}
// CHECK:STDOUT: inst+9: {kind: IntLiteral, arg0: int3, type: type0}
// CHECK:STDOUT: inst+10: {kind: BinaryOperatorAdd, arg0: inst+8, arg1: inst+9, type: type0}
// CHECK:STDOUT: inst+11: {kind: RealLiteral, arg0: real0, type: type2}
// CHECK:STDOUT: inst+12: {kind: TupleLiteral, arg0: block5, type: type3}
// CHECK:STDOUT: inst+13: {kind: TupleAccess, arg0: inst+5, arg1: element0, type: type0}
// CHECK:STDOUT: inst+14: {kind: InitializeFrom, arg0: inst+10, arg1: inst+13, type: type0}
// CHECK:STDOUT: inst+15: {kind: TupleAccess, arg0: inst+5, arg1: element1, type: type2}
// CHECK:STDOUT: inst+16: {kind: InitializeFrom, arg0: inst+11, arg1: inst+15, type: type2}
// CHECK:STDOUT: inst+17: {kind: TupleInit, arg0: block6, arg1: inst+5, type: type3}
// CHECK:STDOUT: inst+18: {kind: Converted, arg0: inst+12, arg1: inst+17, type: type3}
// CHECK:STDOUT: inst+19: {kind: ReturnExpr, arg0: inst+18}
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, type: type0}
// CHECK:STDOUT: inst+1: {kind: Param, arg0: name1, type: type1}
// CHECK:STDOUT: inst+2: {kind: TupleType, arg0: typeBlock0, type: typeTypeType}
// CHECK:STDOUT: inst+3: {kind: TupleLiteral, arg0: block2, type: type2}
// CHECK:STDOUT: inst+4: {kind: TupleType, arg0: typeBlock1, type: typeTypeType}
// CHECK:STDOUT: inst+5: {kind: Converted, arg0: inst+3, arg1: inst+4, type: typeTypeType}
// CHECK:STDOUT: inst+6: {kind: VarStorage, arg0: nameReturnSlot, type: type4}
// CHECK:STDOUT: inst+7: {kind: PointerType, arg0: type4, type: typeTypeType}
// CHECK:STDOUT: inst+8: {kind: FunctionDecl, arg0: function0, type: type6}
// CHECK:STDOUT: inst+9: {kind: NameRef, arg0: name1, arg1: inst+1, type: type1}
// CHECK:STDOUT: inst+10: {kind: IntLiteral, arg0: int3, type: type1}
// CHECK:STDOUT: inst+11: {kind: BinaryOperatorAdd, arg0: inst+9, arg1: inst+10, type: type1}
// CHECK:STDOUT: inst+12: {kind: RealLiteral, arg0: real0, type: type3}
// CHECK:STDOUT: inst+13: {kind: TupleLiteral, arg0: block5, type: type4}
// CHECK:STDOUT: inst+14: {kind: TupleAccess, arg0: inst+6, arg1: element0, type: type1}
// CHECK:STDOUT: inst+15: {kind: InitializeFrom, arg0: inst+11, arg1: inst+14, type: type1}
// CHECK:STDOUT: inst+16: {kind: TupleAccess, arg0: inst+6, arg1: element1, type: type3}
// CHECK:STDOUT: inst+17: {kind: InitializeFrom, arg0: inst+12, arg1: inst+16, type: type3}
// CHECK:STDOUT: inst+18: {kind: TupleInit, arg0: block6, arg1: inst+6, type: type4}
// CHECK:STDOUT: inst+19: {kind: Converted, arg0: inst+13, arg1: inst+18, type: type4}
// CHECK:STDOUT: inst+20: {kind: ReturnExpr, arg0: inst+19}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: block0: {}
// CHECK:STDOUT: block1:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: block2:
// CHECK:STDOUT: 0: instIntType
// CHECK:STDOUT: 1: instFloatType
// CHECK:STDOUT: block3:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+2
// CHECK:STDOUT: 2: inst+4
// CHECK:STDOUT: 3: inst+5
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: 1: inst+3
// CHECK:STDOUT: 2: inst+5
// CHECK:STDOUT: 3: inst+6
// CHECK:STDOUT: block4:
// CHECK:STDOUT: 0: inst+8
// CHECK:STDOUT: 1: inst+9
// CHECK:STDOUT: 2: inst+10
// CHECK:STDOUT: 3: inst+11
// CHECK:STDOUT: 4: inst+12
// CHECK:STDOUT: 5: inst+13
// CHECK:STDOUT: 6: inst+14
// CHECK:STDOUT: 7: inst+15
// CHECK:STDOUT: 8: inst+16
// CHECK:STDOUT: 9: inst+17
// CHECK:STDOUT: 10: inst+18
// CHECK:STDOUT: 11: inst+19
// CHECK:STDOUT: 0: inst+9
// CHECK:STDOUT: 1: inst+10
// CHECK:STDOUT: 2: inst+11
// CHECK:STDOUT: 3: inst+12
// CHECK:STDOUT: 4: inst+13
// CHECK:STDOUT: 5: inst+14
// CHECK:STDOUT: 6: inst+15
// CHECK:STDOUT: 7: inst+16
// CHECK:STDOUT: 8: inst+17
// CHECK:STDOUT: 9: inst+18
// CHECK:STDOUT: 10: inst+19
// CHECK:STDOUT: 11: inst+20
// CHECK:STDOUT: block5:
// CHECK:STDOUT: 0: inst+10
// CHECK:STDOUT: 1: inst+11
// CHECK:STDOUT: 0: inst+11
// CHECK:STDOUT: 1: inst+12
// CHECK:STDOUT: block6:
// CHECK:STDOUT: 0: inst+14
// CHECK:STDOUT: 1: inst+16
// CHECK:STDOUT: 0: inst+15
// CHECK:STDOUT: 1: inst+17
// CHECK:STDOUT: block7:
// CHECK:STDOUT: 0: inst+7
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+8
// CHECK:STDOUT: ...
// CHECK:STDOUT:
// CHECK:STDOUT: --- raw_and_textual_ir.carbon
@@ -98,6 +101,7 @@ fn Foo(n: i32) -> (i32, f64) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -23,6 +23,7 @@ fn C(r#if: i32) -> i32 {
// CHECK:STDOUT: --- raw_identifier.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A, .B = %B, .C = %C}
// CHECK:STDOUT: %A: <function> = fn_decl @A
// CHECK:STDOUT: %B: <function> = fn_decl @B
// CHECK:STDOUT: %C: <function> = fn_decl @C
+54 -51
View File
@@ -17,74 +17,77 @@ fn Foo(n: i32) -> (i32, f64) {
// CHECK:STDOUT: sem_ir:
// CHECK:STDOUT: cross_ref_irs_size: 1
// CHECK:STDOUT: functions:
// CHECK:STDOUT: function0: {name: name0, param_refs: block1, return_type: type3, return_slot: inst+5, body: [block4]}
// CHECK:STDOUT: function0: {name: name0, param_refs: block1, return_type: type4, return_slot: inst+6, body: [block4]}
// CHECK:STDOUT: classes: {}
// CHECK:STDOUT: types:
// CHECK:STDOUT: type0: {inst: instIntType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {inst: inst+1, value_rep: {kind: unknown, type: type<invalid>}}
// CHECK:STDOUT: type2: {inst: instFloatType, value_rep: {kind: copy, type: type2}}
// CHECK:STDOUT: type3: {inst: inst+3, value_rep: {kind: pointer, type: type4}}
// CHECK:STDOUT: type4: {inst: inst+6, value_rep: {kind: copy, type: type4}}
// CHECK:STDOUT: type5: {inst: instFunctionType, value_rep: {kind: copy, type: type5}}
// CHECK:STDOUT: type0: {inst: instNamespaceType, value_rep: {kind: copy, type: type0}}
// CHECK:STDOUT: type1: {inst: instIntType, value_rep: {kind: copy, type: type1}}
// CHECK:STDOUT: type2: {inst: inst+2, value_rep: {kind: unknown, type: type<invalid>}}
// CHECK:STDOUT: type3: {inst: instFloatType, value_rep: {kind: copy, type: type3}}
// CHECK:STDOUT: type4: {inst: inst+4, value_rep: {kind: pointer, type: type5}}
// CHECK:STDOUT: type5: {inst: inst+7, value_rep: {kind: copy, type: type5}}
// CHECK:STDOUT: type6: {inst: instFunctionType, value_rep: {kind: copy, type: type6}}
// CHECK:STDOUT: type_blocks:
// CHECK:STDOUT: typeBlock0:
// CHECK:STDOUT: 0: typeTypeType
// CHECK:STDOUT: 1: typeTypeType
// CHECK:STDOUT: typeBlock1:
// CHECK:STDOUT: 0: type0
// CHECK:STDOUT: 1: type2
// CHECK:STDOUT: 0: type1
// CHECK:STDOUT: 1: type3
// CHECK:STDOUT: insts:
// CHECK:STDOUT: inst+0: {kind: Param, arg0: name1, type: type0}
// CHECK:STDOUT: inst+1: {kind: TupleType, arg0: typeBlock0, type: typeTypeType}
// CHECK:STDOUT: inst+2: {kind: TupleLiteral, arg0: block2, type: type1}
// CHECK:STDOUT: inst+3: {kind: TupleType, arg0: typeBlock1, type: typeTypeType}
// CHECK:STDOUT: inst+4: {kind: Converted, arg0: inst+2, arg1: inst+3, type: typeTypeType}
// CHECK:STDOUT: inst+5: {kind: VarStorage, arg0: nameReturnSlot, type: type3}
// CHECK:STDOUT: inst+6: {kind: PointerType, arg0: type3, type: typeTypeType}
// CHECK:STDOUT: inst+7: {kind: FunctionDecl, arg0: function0, type: type5}
// CHECK:STDOUT: inst+8: {kind: NameRef, arg0: name1, arg1: inst+0, type: type0}
// CHECK:STDOUT: inst+9: {kind: IntLiteral, arg0: int3, type: type0}
// CHECK:STDOUT: inst+10: {kind: BinaryOperatorAdd, arg0: inst+8, arg1: inst+9, type: type0}
// CHECK:STDOUT: inst+11: {kind: RealLiteral, arg0: real0, type: type2}
// CHECK:STDOUT: inst+12: {kind: TupleLiteral, arg0: block5, type: type3}
// CHECK:STDOUT: inst+13: {kind: TupleAccess, arg0: inst+5, arg1: element0, type: type0}
// CHECK:STDOUT: inst+14: {kind: InitializeFrom, arg0: inst+10, arg1: inst+13, type: type0}
// CHECK:STDOUT: inst+15: {kind: TupleAccess, arg0: inst+5, arg1: element1, type: type2}
// CHECK:STDOUT: inst+16: {kind: InitializeFrom, arg0: inst+11, arg1: inst+15, type: type2}
// CHECK:STDOUT: inst+17: {kind: TupleInit, arg0: block6, arg1: inst+5, type: type3}
// CHECK:STDOUT: inst+18: {kind: Converted, arg0: inst+12, arg1: inst+17, type: type3}
// CHECK:STDOUT: inst+19: {kind: ReturnExpr, arg0: inst+18}
// CHECK:STDOUT: inst+0: {kind: Namespace, arg0: name_scope0, type: type0}
// CHECK:STDOUT: inst+1: {kind: Param, arg0: name1, type: type1}
// CHECK:STDOUT: inst+2: {kind: TupleType, arg0: typeBlock0, type: typeTypeType}
// CHECK:STDOUT: inst+3: {kind: TupleLiteral, arg0: block2, type: type2}
// CHECK:STDOUT: inst+4: {kind: TupleType, arg0: typeBlock1, type: typeTypeType}
// CHECK:STDOUT: inst+5: {kind: Converted, arg0: inst+3, arg1: inst+4, type: typeTypeType}
// CHECK:STDOUT: inst+6: {kind: VarStorage, arg0: nameReturnSlot, type: type4}
// CHECK:STDOUT: inst+7: {kind: PointerType, arg0: type4, type: typeTypeType}
// CHECK:STDOUT: inst+8: {kind: FunctionDecl, arg0: function0, type: type6}
// CHECK:STDOUT: inst+9: {kind: NameRef, arg0: name1, arg1: inst+1, type: type1}
// CHECK:STDOUT: inst+10: {kind: IntLiteral, arg0: int3, type: type1}
// CHECK:STDOUT: inst+11: {kind: BinaryOperatorAdd, arg0: inst+9, arg1: inst+10, type: type1}
// CHECK:STDOUT: inst+12: {kind: RealLiteral, arg0: real0, type: type3}
// CHECK:STDOUT: inst+13: {kind: TupleLiteral, arg0: block5, type: type4}
// CHECK:STDOUT: inst+14: {kind: TupleAccess, arg0: inst+6, arg1: element0, type: type1}
// CHECK:STDOUT: inst+15: {kind: InitializeFrom, arg0: inst+11, arg1: inst+14, type: type1}
// CHECK:STDOUT: inst+16: {kind: TupleAccess, arg0: inst+6, arg1: element1, type: type3}
// CHECK:STDOUT: inst+17: {kind: InitializeFrom, arg0: inst+12, arg1: inst+16, type: type3}
// CHECK:STDOUT: inst+18: {kind: TupleInit, arg0: block6, arg1: inst+6, type: type4}
// CHECK:STDOUT: inst+19: {kind: Converted, arg0: inst+13, arg1: inst+18, type: type4}
// CHECK:STDOUT: inst+20: {kind: ReturnExpr, arg0: inst+19}
// CHECK:STDOUT: inst_blocks:
// CHECK:STDOUT: block0: {}
// CHECK:STDOUT: block1:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: block2:
// CHECK:STDOUT: 0: instIntType
// CHECK:STDOUT: 1: instFloatType
// CHECK:STDOUT: block3:
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+2
// CHECK:STDOUT: 2: inst+4
// CHECK:STDOUT: 3: inst+5
// CHECK:STDOUT: 0: inst+1
// CHECK:STDOUT: 1: inst+3
// CHECK:STDOUT: 2: inst+5
// CHECK:STDOUT: 3: inst+6
// CHECK:STDOUT: block4:
// CHECK:STDOUT: 0: inst+8
// CHECK:STDOUT: 1: inst+9
// CHECK:STDOUT: 2: inst+10
// CHECK:STDOUT: 3: inst+11
// CHECK:STDOUT: 4: inst+12
// CHECK:STDOUT: 5: inst+13
// CHECK:STDOUT: 6: inst+14
// CHECK:STDOUT: 7: inst+15
// CHECK:STDOUT: 8: inst+16
// CHECK:STDOUT: 9: inst+17
// CHECK:STDOUT: 10: inst+18
// CHECK:STDOUT: 11: inst+19
// CHECK:STDOUT: 0: inst+9
// CHECK:STDOUT: 1: inst+10
// CHECK:STDOUT: 2: inst+11
// CHECK:STDOUT: 3: inst+12
// CHECK:STDOUT: 4: inst+13
// CHECK:STDOUT: 5: inst+14
// CHECK:STDOUT: 6: inst+15
// CHECK:STDOUT: 7: inst+16
// CHECK:STDOUT: 8: inst+17
// CHECK:STDOUT: 9: inst+18
// CHECK:STDOUT: 10: inst+19
// CHECK:STDOUT: 11: inst+20
// CHECK:STDOUT: block5:
// CHECK:STDOUT: 0: inst+10
// CHECK:STDOUT: 1: inst+11
// CHECK:STDOUT: 0: inst+11
// CHECK:STDOUT: 1: inst+12
// CHECK:STDOUT: block6:
// CHECK:STDOUT: 0: inst+14
// CHECK:STDOUT: 1: inst+16
// CHECK:STDOUT: 0: inst+15
// CHECK:STDOUT: 1: inst+17
// CHECK:STDOUT: block7:
// CHECK:STDOUT: 0: inst+7
// CHECK:STDOUT: 0: inst+0
// CHECK:STDOUT: 1: inst+8
// CHECK:STDOUT: ...
+1
View File
@@ -9,6 +9,7 @@ fn Run() {}
// CHECK:STDOUT: --- run.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Run = %Run}
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -9,6 +9,7 @@ fn Run() -> i32 { return 0; }
// CHECK:STDOUT: --- run_i32.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Run = %Run}
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -21,6 +21,7 @@ fn Foo(n: i32) -> (i32, f64) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -29,6 +29,7 @@ fn Run() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Run = %Run}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %G: <function> = fn_decl @G
+1
View File
@@ -23,6 +23,7 @@ fn Make() -> Class {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Make = %Make}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %Make: <function> = fn_decl @Make
@@ -23,6 +23,7 @@ class Class {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: }
+1
View File
@@ -47,6 +47,7 @@ fn F(c: Class, p: Class*) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F.2
+1
View File
@@ -123,6 +123,7 @@ fn CallReturnIncomplete() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .CallClassFunction = %CallClassFunction, .global_var = %global_var, .ConvertFromStruct = %ConvertFromStruct, .MemberAccess = %MemberAccess, .Copy = %Copy, .Let = %Let, .TakeIncomplete = %TakeIncomplete, .ReturnIncomplete = %ReturnIncomplete, .CallTakeIncomplete = %CallTakeIncomplete, .CallReturnIncomplete = %CallReturnIncomplete}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %.loc15: <function> = fn_decl @.1
+1
View File
@@ -35,6 +35,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
@@ -31,6 +31,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .G = %G, .F = %F}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %G: <function> = fn_decl @G
@@ -45,6 +45,7 @@ fn F(s: {.a: A}, b: B) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl, .B = %B.decl, .F = %F}
// CHECK:STDOUT: %A.decl = class_decl @A, ()
// CHECK:STDOUT: %A: type = class_type @A
// CHECK:STDOUT: %B.decl = class_decl @B, ()
+3 -5
View File
@@ -13,10 +13,7 @@ let T: type = Class;
// The class name is required to be written in the same way as in the class
// declaration. An expression that evaluates to the class name is not accepted.
// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+6]]:6: ERROR: Declaration qualifiers are only allowed for entities that provide a scope.
// CHECK:STDERR: fn T.F() {}
// CHECK:STDERR: ^
// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+3]]:4: Non-scope entity referenced here.
// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+3]]:4: ERROR: Name `T` not found.
// CHECK:STDERR: fn T.F() {}
// CHECK:STDERR: ^
fn T.F() {}
@@ -28,11 +25,12 @@ fn T.F() {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class
// CHECK:STDOUT: %T: type = bind_name T, %Class.ref
// CHECK:STDOUT: %.loc22: <function> = fn_decl @.1
// CHECK:STDOUT: %.loc19: <function> = fn_decl @.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Class {
+1
View File
@@ -39,6 +39,7 @@ fn F(c: Class) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
@@ -81,6 +81,7 @@ base class G;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl.loc7, .B = %B.decl.loc16, .C = %C.decl.loc25, .D = %D.decl.loc34, .E = %E.decl.loc43, .F = %F.decl.loc52, .G = %G.decl.loc61}
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A, ()
// CHECK:STDOUT: %A: type = class_type @A
// CHECK:STDOUT: %A.decl.loc14 = class_decl @A, ()
@@ -28,6 +28,7 @@ class Y {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl.loc7, .X = %X.decl, .Y = %Y.decl}
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A.1, ()
// CHECK:STDOUT: %A: type = class_type @A.1
// CHECK:STDOUT: %X.decl = class_decl @X, ()
+3 -2
View File
@@ -31,6 +31,7 @@ fn Class.H() {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl.loc7}
// CHECK:STDOUT: %Class.decl.loc7 = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %Class.decl.loc18 = class_decl @Class, ()
@@ -44,8 +45,8 @@ fn Class.H() {}
// CHECK:STDOUT: %H: <function> = fn_decl @H
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .F = <unexpected instref inst+2>
// CHECK:STDOUT: .H = <unexpected instref inst+3>
// CHECK:STDOUT: .F = <unexpected instref inst+3>
// CHECK:STDOUT: .H = <unexpected instref inst+4>
// CHECK:STDOUT: .G = %G
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -32,6 +32,7 @@ class Class {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: }
+1
View File
@@ -24,6 +24,7 @@ fn G() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .G = %G}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %G: <function> = fn_decl @G
+1
View File
@@ -59,6 +59,7 @@ fn CallWrongSelf(ws: WrongSelf) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .WrongSelf = %WrongSelf.decl, .CallWrongSelf = %CallWrongSelf}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F.1
@@ -28,6 +28,7 @@ fn G() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .G = %G}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %G: <function> = fn_decl @G
@@ -24,6 +24,7 @@ fn G(c: Class) -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .G = %G}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %G: <function> = fn_decl @G
+1
View File
@@ -24,6 +24,7 @@ fn Run() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Run = %Run}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
@@ -25,6 +25,7 @@ fn Run() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Run = %Run}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
@@ -11,6 +11,7 @@ fn F(p: Class*) -> Class* { return p; }
// CHECK:STDOUT: --- forward_declared.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -26,6 +26,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Make = %Make, .MakeReorder = %MakeReorder}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %Make: <function> = fn_decl @Make
+1
View File
@@ -21,6 +21,7 @@ fn F() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -32,6 +32,7 @@ fn MakeOuter() -> Outer {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Inner = %Inner.decl, .MakeInner = %MakeInner, .Outer = %Outer.decl, .MakeOuter = %MakeOuter}
// CHECK:STDOUT: %Inner.decl = class_decl @Inner, ()
// CHECK:STDOUT: %Inner: type = class_type @Inner
// CHECK:STDOUT: %MakeInner: <function> = fn_decl @MakeInner
+1
View File
@@ -52,6 +52,7 @@ fn CallGOnInitializingExpr() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Call = %Call, .CallWithAddr = %CallWithAddr, .CallFThroughPointer = %CallFThroughPointer, .CallGThroughPointer = %CallGThroughPointer, .Make = %Make, .CallFOnInitializingExpr = %CallFOnInitializingExpr, .CallGOnInitializingExpr = %CallGOnInitializingExpr}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -38,6 +38,7 @@ fn F(a: Outer*) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Outer = %Outer.decl, .F = %F}
// CHECK:STDOUT: %Outer.decl = class_decl @Outer, ()
// CHECK:STDOUT: %Outer: type = class_type @Outer
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -29,6 +29,7 @@ fn G(o: Outer) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Outer = %Outer.decl, .F = %F, .G = %G}
// CHECK:STDOUT: %Outer.decl = class_decl @Outer, ()
// CHECK:STDOUT: %Outer: type = class_type @Outer
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -29,6 +29,7 @@ fn Class.G[self: Class](r#self: i32) -> (i32, i32) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -18,6 +18,7 @@ class Class {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: }
+1
View File
@@ -19,6 +19,7 @@ fn Class.F() {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl.loc7}
// CHECK:STDOUT: %Class.decl.loc7 = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %Class.decl.loc9 = class_decl @Class, ()
@@ -19,6 +19,7 @@ abstract class C {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A.decl.loc7, .B = %B.decl.loc8, .C = %C.decl.loc9}
// CHECK:STDOUT: %A.decl.loc7 = class_decl @A, ()
// CHECK:STDOUT: %A: type = class_type @A
// CHECK:STDOUT: %B.decl.loc8 = class_decl @B, ()
+1
View File
@@ -20,6 +20,7 @@ fn Class.F() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -29,6 +29,7 @@ fn Run() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .F = %F, .Run = %Run}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F.2
+1
View File
@@ -27,6 +27,7 @@ fn Class.G[addr self: Class*]() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -24,6 +24,7 @@ fn Class.F[self: Class]() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %F: <function> = fn_decl @F
+1
View File
@@ -22,6 +22,7 @@ fn Run() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Class = %Class.decl, .Run = %Run}
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
// CHECK:STDOUT: %Class: type = class_type @Class
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
+1
View File
@@ -15,6 +15,7 @@ fn F(p: const i32**) -> const (const i32)** {
// CHECK:STDOUT: --- collapse.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.F = %F}
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: }
// CHECK:STDOUT:
+1
View File
@@ -17,6 +17,7 @@ fn G(p: const (const i32)**) -> i32** {
// CHECK:STDOUT: --- fail_collapse.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.G = %G}
// CHECK:STDOUT: %G: <function> = fn_decl @G
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -25,6 +25,7 @@ fn H() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.F = %F, .G = %G, .H = %H}
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: %G: <function> = fn_decl @G
// CHECK:STDOUT: %H: <function> = fn_decl @H
@@ -20,6 +20,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Echo = %Echo, .Main = %Main}
// CHECK:STDOUT: %Echo: <function> = fn_decl @Echo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -19,6 +19,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Echo = %Echo, .Main = %Main}
// CHECK:STDOUT: %Echo: <function> = fn_decl @Echo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -18,6 +18,7 @@ fn Run() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Run = %Run}
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -62,6 +62,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Run0 = %Run0, .Run1 = %Run1, .Run2 = %Run2, .Main = %Main}
// CHECK:STDOUT: %Run0: <function> = fn_decl @Run0
// CHECK:STDOUT: %Run1: <function> = fn_decl @Run1
// CHECK:STDOUT: %Run2: <function> = fn_decl @Run2
@@ -23,6 +23,7 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.G = %G, .F = %F}
// CHECK:STDOUT: %G: <function> = fn_decl @G
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: }
@@ -16,6 +16,7 @@ fn Run() {
// CHECK:STDOUT: --- fail_return_type_mismatch.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo, .Run = %Run}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Run: <function> = fn_decl @Run
// CHECK:STDOUT: }
+1
View File
@@ -15,6 +15,7 @@ fn Main() {
// CHECK:STDOUT: --- i32.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Echo = %Echo, .Main = %Main}
// CHECK:STDOUT: %Echo: <function> = fn_decl @Echo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -18,6 +18,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo, .Main = %Main}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -17,6 +17,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo, .Main = %Main}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -18,6 +18,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo, .Main = %Main}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -17,6 +17,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo, .Main = %Main}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -18,6 +18,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo, .Main = %Main}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -17,6 +17,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo, .Main = %Main}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -18,6 +18,7 @@ fn Main() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.MakeImplicitEmptyTuple = %MakeImplicitEmptyTuple, .Main = %Main}
// CHECK:STDOUT: %MakeImplicitEmptyTuple: <function> = fn_decl @MakeImplicitEmptyTuple
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
// CHECK:STDOUT: }
@@ -15,6 +15,7 @@ fn G() { F(); }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.F = %F, .G = %G}
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: %G: <function> = fn_decl @G
// CHECK:STDOUT: }
@@ -15,6 +15,7 @@ fn Bar(a: i32, a: i32) {}
// CHECK:STDOUT: --- fail_param_name_conflict.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Bar = %Bar}
// CHECK:STDOUT: %Bar: <function> = fn_decl @Bar
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -11,6 +11,7 @@ fn Baz() {}
// CHECK:STDOUT: --- order.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo, .Bar = %Bar, .Baz = %Baz}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Bar: <function> = fn_decl @Bar
// CHECK:STDOUT: %Baz: <function> = fn_decl @Baz
@@ -9,6 +9,7 @@ fn Foo(a: i32) {}
// CHECK:STDOUT: --- params_one.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -9,6 +9,7 @@ fn Foo(a: i32,) {}
// CHECK:STDOUT: --- params_one_comma.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -9,6 +9,7 @@ fn Foo(a: i32, b: i32) {}
// CHECK:STDOUT: --- params_two.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -9,6 +9,7 @@ fn Foo(a: i32, b: i32,) {}
// CHECK:STDOUT: --- params_two_comma.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo}
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: }
// CHECK:STDOUT:

Some files were not shown because too many files have changed in this diff Show More