diff --git a/.agents/skills/builtins/SKILL.md b/.agents/skills/builtins/SKILL.md index 07a4f1c526df..fa201cc425b0 100644 --- a/.agents/skills/builtins/SKILL.md +++ b/.agents/skills/builtins/SKILL.md @@ -98,8 +98,8 @@ Inside lowering of these is illegal (e.g. `IntConvertFloatChecked`). - **Runtime Primitives**: Return `AnyLiteralTypes(sem_ir, arg_ids, return_type_id)` to enforce that - expressions involving unsized literal values (like `IntLiteral()` or - `FloatLiteral()`) are evaluated exclusively at compile-time (as they lack + expressions involving unsized literal values (like `IntLiteral` or + `FloatLiteral`) are evaluated exclusively at compile-time (as they lack runtime representation). --- @@ -204,8 +204,8 @@ builtins under [core/prelude/](../../../core/prelude/): - **Strict Orphan Rule Compliance**: Carbon's orphan rules prohibit implementing interfaces where neither the type nor the interface is locally defined in the backing source module. - - **Literal Conversions**: Literal types (like `FloatLiteral()`, - `IntLiteral()`) do not have backing Carbon source files. Therefore, an + - **Literal Conversions**: Literal types (like `FloatLiteral`, + `IntLiteral`) do not have backing Carbon source files. Therefore, an `impl` of `UnsafeAs` (which is defined in `as.carbon`) between two literal types must reside inside `as.carbon` itself. - **Sized Conversions**: Implementations targeting sized primitives (e.g. diff --git a/.agents/skills/toolchain_development/SKILL.md b/.agents/skills/toolchain_development/SKILL.md index ea17f8a7b961..6c128657d8f6 100644 --- a/.agents/skills/toolchain_development/SKILL.md +++ b/.agents/skills/toolchain_development/SKILL.md @@ -100,9 +100,9 @@ When declaring and emitting errors, ensure semantic wording matches the exact context: - **Semantic Precision**: Do not reference "types" when raising errors for - unsized expressions like `IntLiteral()` or `FloatLiteral()`. For example, - use `RealLiteralTooLargeForUnsizedInt` instead of a diagnostic referencing - an "integer type". + unsized expressions like `IntLiteral` or `FloatLiteral`. For example, use + `RealLiteralTooLargeForUnsizedInt` instead of a diagnostic referencing an + "integer type". - **Wording Consistency**: Before declaring a new diagnostic in [kind.def](../../../toolchain/diagnostics/kind.def), search for existing diagnostics in the targeted implementation files (for example, other uses of diff --git a/core/prelude/copy.carbon b/core/prelude/copy.carbon index 30edee3a2fb1..b5f32290508e 100644 --- a/core/prelude/copy.carbon +++ b/core/prelude/copy.carbon @@ -10,28 +10,32 @@ interface Copy { fn Op[self: Self]() -> Self; } -private fn Bool() -> type = "bool.make_type"; -private fn CharLiteral() -> type = "char_literal.make_type"; -private fn FloatLiteral() -> type = "float_literal.make_type"; -private fn IntLiteral() -> type = "int_literal.make_type"; +private fn MakeBool() -> type = "bool.make_type"; +private alias Bool = MakeBool(); +private fn MakeCharLiteral() -> type = "char_literal.make_type"; +private alias CharLiteral = MakeCharLiteral(); +private fn MakeFloatLiteral() -> type = "float_literal.make_type"; +private alias FloatLiteral = MakeFloatLiteral(); +private fn MakeIntLiteral() -> type = "int_literal.make_type"; +private alias IntLiteral = MakeIntLiteral(); impl forall [T:! Copy] const T as Copy { fn Op[self: Self]() -> Self { return (self as T).(Copy.Op)() as const T; } } -impl Bool() as Copy { +impl Bool as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } -impl CharLiteral() as Copy { +impl CharLiteral as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } -impl FloatLiteral() as Copy { +impl FloatLiteral as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } -impl IntLiteral() as Copy { +impl IntLiteral as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } diff --git a/core/prelude/default.carbon b/core/prelude/default.carbon index 0cf333cca159..879b279df998 100644 --- a/core/prelude/default.carbon +++ b/core/prelude/default.carbon @@ -29,7 +29,7 @@ interface UnformedInit { // own. impl bool as UnformedInit {} impl forall [T:! type] T* as UnformedInit {} -impl forall [T:! UnformedInit, N:! IntLiteral()] array(T, N) as UnformedInit {} +impl forall [T:! UnformedInit, N:! IntLiteral] array(T, N) as UnformedInit {} // TODO: Generalize these to apply to tuples and structs containing only // `UnformedInit` types. impl () as UnformedInit {} diff --git a/core/prelude/iterate.carbon b/core/prelude/iterate.carbon index cbba742d747c..00279388e7ee 100644 --- a/core/prelude/iterate.carbon +++ b/core/prelude/iterate.carbon @@ -17,7 +17,7 @@ interface Iterate { fn Next[self: Self](cursor: CursorType*) -> Optional(ElementType); } -impl forall [T:! Copy & Destroy, N:! IntLiteral()] +impl forall [T:! Copy & Destroy, N:! IntLiteral] array(T, N) as Iterate where .ElementType = T and .CursorType = i32 { fn NewCursor[unused self: Self]() -> i32 { return 0; } diff --git a/core/prelude/operators/arithmetic.carbon b/core/prelude/operators/arithmetic.carbon index fff59c1fce45..b178186f9c61 100644 --- a/core/prelude/operators/arithmetic.carbon +++ b/core/prelude/operators/arithmetic.carbon @@ -92,26 +92,26 @@ interface ModAssignWith(Other:! type) { // Operations for IntLiteral. These need to be here because IntLiteral has no // associated library of its own. -impl IntLiteral() as AddWith(Self) where .Result = Self { +impl IntLiteral as AddWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.sadd"; } -impl IntLiteral() as DivWith(Self) where .Result = Self { +impl IntLiteral as DivWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.sdiv"; } -impl IntLiteral() as ModWith(Self) where .Result = Self { +impl IntLiteral as ModWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.smod"; } -impl IntLiteral() as MulWith(Self) where .Result = Self { +impl IntLiteral as MulWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.smul"; } -impl IntLiteral() as Negate where .Result = Self { +impl IntLiteral as Negate where .Result = Self { fn Op[self: Self]() -> Self = "int.snegate"; } -impl IntLiteral() as SubWith(Self) where .Result = Self { +impl IntLiteral as SubWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.ssub"; } diff --git a/core/prelude/operators/as.carbon b/core/prelude/operators/as.carbon index 1e3a90f4ec95..7ee9f1335e4c 100644 --- a/core/prelude/operators/as.carbon +++ b/core/prelude/operators/as.carbon @@ -64,13 +64,13 @@ impl forall [T:! type, U:! type] T* as UnsafeAs(U*) { } // Integer literals can be implicitly converted to floating-point literals. -impl IntLiteral() as ImplicitAs(FloatLiteral()) { - fn Convert[self: Self]() -> FloatLiteral() = "int.convert_float_checked"; +impl IntLiteral as ImplicitAs(FloatLiteral) { + fn Convert[self: Self]() -> FloatLiteral = "int.convert_float_checked"; } // Floating-point literals can be explicitly cast to integer literals. -impl FloatLiteral() as UnsafeAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "float.convert_int"; +impl FloatLiteral as UnsafeAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "float.convert_int"; } interface IntFitsIn(Dest:! type) {} diff --git a/core/prelude/operators/bitwise.carbon b/core/prelude/operators/bitwise.carbon index 7323ce6281a3..52050e9605ed 100644 --- a/core/prelude/operators/bitwise.carbon +++ b/core/prelude/operators/bitwise.carbon @@ -82,27 +82,27 @@ interface RightShiftAssignWith(Other:! type) { // Operations for IntLiteral. These need to be here because IntLiteral has no // associated library of its own. -impl IntLiteral() as BitAndWith(Self) where .Result = Self { +impl IntLiteral as BitAndWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.and"; } -impl IntLiteral() as BitComplement where .Result = Self { +impl IntLiteral as BitComplement where .Result = Self { fn Op[self: Self]() -> Self = "int.complement"; } -impl IntLiteral() as BitOrWith(Self) where .Result = Self { +impl IntLiteral as BitOrWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.or"; } -impl IntLiteral() as BitXorWith(Self) where .Result = Self { +impl IntLiteral as BitXorWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.xor"; } -impl IntLiteral() as LeftShiftWith(Self) where .Result = Self { +impl IntLiteral as LeftShiftWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.left_shift"; } -impl IntLiteral() as RightShiftWith(Self) where .Result = Self { +impl IntLiteral as RightShiftWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.right_shift"; } diff --git a/core/prelude/operators/comparison.carbon b/core/prelude/operators/comparison.carbon index cfd8b7e7e78e..2ba4b8d539ef 100644 --- a/core/prelude/operators/comparison.carbon +++ b/core/prelude/operators/comparison.carbon @@ -40,12 +40,12 @@ impl bool as EqWith(Self) { // Operations for IntLiteral. These need to be here because IntLiteral has no // associated library of its own. -impl IntLiteral() as EqWith(Self) { +impl IntLiteral as EqWith(Self) { fn Equal[self: Self](other: Self) -> bool = "int.eq"; fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; } -impl IntLiteral() as OrderedWith(Self) { +impl IntLiteral as OrderedWith(Self) { // TODO: fn Compare fn Less[self: Self](other: Self) -> bool = "int.less"; fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; diff --git a/core/prelude/types/bool.carbon b/core/prelude/types/bool.carbon index 212086e256e6..c0e6f685bcbb 100644 --- a/core/prelude/types/bool.carbon +++ b/core/prelude/types/bool.carbon @@ -4,4 +4,5 @@ package Core library "prelude/types/bool"; -fn Bool() -> type = "bool.make_type"; +private fn MakeBool() -> type = "bool.make_type"; +alias Bool = MakeBool(); diff --git a/core/prelude/types/char.carbon b/core/prelude/types/char.carbon index f1fb97cfd089..40394e93ea36 100644 --- a/core/prelude/types/char.carbon +++ b/core/prelude/types/char.carbon @@ -12,7 +12,8 @@ import library "prelude/types/uint"; import library "prelude/types/int"; import library "prelude/types/int_literal"; -fn CharLiteral() -> type = "char_literal.make_type"; +private fn MakeCharLiteral() -> type = "char_literal.make_type"; +alias CharLiteral = MakeCharLiteral(); // TODO: Provide operations for `CharLiteral`. @@ -28,16 +29,16 @@ impl Char as Copy { // Conversions. -impl CharLiteral() as ImplicitAs(Char) { +impl CharLiteral as ImplicitAs(Char) { fn Convert[self: Self]() -> Char = "char.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. -impl CharLiteral() as As(Char) { +impl CharLiteral as As(Char) { fn Convert[self: Self]() -> Char = "char.convert_checked"; } -impl forall [From:! IntLiteral()] UInt(From) as As(Char) { +impl forall [From:! IntLiteral] UInt(From) as As(Char) { fn Convert[self: Self]() -> Char = "int.convert_char"; } @@ -90,8 +91,8 @@ impl forall [T:! ImplicitAs(Char)] T as OrderedWith(Char) { private interface AnyInt {} -impl forall [N:! IntLiteral()] Int(N) as AnyInt {} -impl forall [N:! IntLiteral()] UInt(N) as AnyInt {} +impl forall [N:! IntLiteral] Int(N) as AnyInt {} +impl forall [N:! IntLiteral] UInt(N) as AnyInt {} impl forall [T:! AnyInt & As(u8)] Char as AddWith(T) where .Result = Char { diff --git a/core/prelude/types/cpp/int.carbon b/core/prelude/types/cpp/int.carbon index b11c73a957fd..d69ca4a9d96d 100644 --- a/core/prelude/types/cpp/int.carbon +++ b/core/prelude/types/cpp/int.carbon @@ -54,17 +54,17 @@ impl CppCompat.ULongLong64 as Copy { // Conversions. -impl IntLiteral() as ImplicitAs(CppCompat.Long32) { +impl IntLiteral as ImplicitAs(CppCompat.Long32) { fn Convert[self: Self]() -> CppCompat.Long32 = "int.convert_checked"; } // TODO: Remove this once `ImplicitAs` extends `As`. -impl IntLiteral() as As(CppCompat.Long32) { +impl IntLiteral as As(CppCompat.Long32) { fn Convert[self: Self]() -> CppCompat.Long32 = "int.convert_checked"; } -final impl CppCompat.Long32 as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl CppCompat.Long32 as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // TODO: ImplicitAs from Int(N) to Long32 if N < 32. @@ -84,17 +84,17 @@ final impl CppCompat.Long32 as ImplicitAs(i64) { fn Convert[self: Self]() -> i64 = "int.convert"; } -impl IntLiteral() as ImplicitAs(CppCompat.ULong32) { +impl IntLiteral as ImplicitAs(CppCompat.ULong32) { fn Convert[self: Self]() -> CppCompat.ULong32 = "int.convert_checked"; } // TODO: Remove this once `ImplicitAs` extends `As`. -impl IntLiteral() as As(CppCompat.ULong32) { +impl IntLiteral as As(CppCompat.ULong32) { fn Convert[self: Self]() -> CppCompat.ULong32 = "int.convert_checked"; } -final impl CppCompat.ULong32 as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl CppCompat.ULong32 as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // TODO: ImplicitAs from UInt(N) to ULong32 if N < 32. @@ -107,17 +107,17 @@ final impl CppCompat.ULong32 as ImplicitAs(u64) { fn Convert[self: Self]() -> u64 = "int.convert"; } -impl IntLiteral() as ImplicitAs(CppCompat.LongLong64) { +impl IntLiteral as ImplicitAs(CppCompat.LongLong64) { fn Convert[self: Self]() -> CppCompat.LongLong64 = "int.convert_checked"; } // TODO: Remove this once `ImplicitAs` extends `As`. -impl IntLiteral() as As(CppCompat.LongLong64) { +impl IntLiteral as As(CppCompat.LongLong64) { fn Convert[self: Self]() -> CppCompat.LongLong64 = "int.convert_checked"; } -final impl CppCompat.LongLong64 as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl CppCompat.LongLong64 as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // TODO: ImplicitAs from Int(N) to LongLong64 if N < 64. @@ -133,17 +133,17 @@ final impl CppCompat.LongLong64 as ImplicitAs(i128) { fn Convert[self: Self]() -> i128 = "int.convert"; } -impl IntLiteral() as ImplicitAs(CppCompat.ULongLong64) { +impl IntLiteral as ImplicitAs(CppCompat.ULongLong64) { fn Convert[self: Self]() -> CppCompat.ULongLong64 = "int.convert_checked"; } // TODO: Remove this once `ImplicitAs` extends `As`. -impl IntLiteral() as As(CppCompat.ULongLong64) { +impl IntLiteral as As(CppCompat.ULongLong64) { fn Convert[self: Self]() -> CppCompat.ULongLong64 = "int.convert_checked"; } -final impl CppCompat.ULongLong64 as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl CppCompat.ULongLong64 as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // TODO: ImplicitAs from UInt(N) to ULongLong64 if N < 64. diff --git a/core/prelude/types/float.carbon b/core/prelude/types/float.carbon index b8c3a199f846..56a3c8790ef1 100644 --- a/core/prelude/types/float.carbon +++ b/core/prelude/types/float.carbon @@ -13,32 +13,32 @@ import library "prelude/types/int"; import library "prelude/types/uint"; import library "prelude/types/int_literal"; -private fn MakeFloat(size: IntLiteral()) -> type = "float.make_type"; +private fn MakeFloat(size: IntLiteral) -> type = "float.make_type"; -class Float(N:! IntLiteral()) { +class Float(N:! IntLiteral) { adapt MakeFloat(N); } -impl forall [N:! IntLiteral()] Float(N) as UnformedInit {} +impl forall [N:! IntLiteral] Float(N) as UnformedInit {} // Copy. -impl forall [N:! IntLiteral()] Float(N) as Copy { +impl forall [N:! IntLiteral] Float(N) as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } // Conversions between floating-point types. Implicit if all the source values // can be represented exactly in the target type, otherwise explicit. -impl forall [N:! IntLiteral()] FloatLiteral() as ImplicitAs(Float(N)) { +impl forall [N:! IntLiteral] FloatLiteral as ImplicitAs(Float(N)) { fn Convert[self: Self]() -> Float(N) = "float.convert_checked"; } // TODO: Remove this once ImplicitAs extends As. -impl forall [N:! IntLiteral()] FloatLiteral() as As(Float(N)) { +impl forall [N:! IntLiteral] FloatLiteral as As(Float(N)) { fn Convert[self: Self]() -> Float(N) = "float.convert_checked"; } -final impl forall [From:! IntLiteral(), To:! IntLiteral()] +final impl forall [From:! IntLiteral, To:! IntLiteral] Float(From) as As(Float(To)) { fn Convert[self: Self]() -> Float(To) = "float.convert"; } @@ -47,12 +47,12 @@ final impl forall [From:! IntLiteral(), To:! IntLiteral()] // that is only parameterized by integers. // TODO: Remove these once possible. private interface AnyFloat { - let Width:! IntLiteral(); + let Width:! IntLiteral; fn AsFloat[self: Self]() -> Float(Width); fn Make(src: Float(Width)) -> Self; } -impl forall [N:! IntLiteral()] Float(N) as AnyFloat where .Width = N { +impl forall [N:! IntLiteral] Float(N) as AnyFloat where .Width = N { fn AsFloat[self: Self]() -> Self { return self; } fn Make(src: Self) -> Self { return src; } } @@ -60,7 +60,7 @@ impl forall [N:! IntLiteral()] Float(N) as AnyFloat where .Width = N { // Use `Float(?) as ImplicitAs(?)` to avoid a collision with the // `? as ImplicitAs(Float(?))` type structure used by int -> float conversion. // TODO: Use `match_first` to resolve this instead once it is available. -impl forall [From:! IntLiteral(), To:! AnyFloat where Float(From) impls FloatFitsIn(.Self)] +impl forall [From:! IntLiteral, To:! AnyFloat where Float(From) impls FloatFitsIn(.Self)] Float(From) as ImplicitAs(To) { fn Convert[self: Self]() -> To { fn Impl(src: Float(From)) -> Float(To.Width) = "float.convert"; @@ -69,7 +69,7 @@ impl forall [From:! IntLiteral(), To:! AnyFloat where Float(From) impls FloatFit } // Desired workaround-free version of the above: -// impl forall [From:! IntLiteral(), To:! IntLiteral() +// impl forall [From:! IntLiteral, To:! IntLiteral // where Float(From) impls FloatFitsIn(Float(To))] // Float(From) as ImplicitAs(Float(To)) { // fn Convert[self: Self]() -> Float(To) = "float.convert"; @@ -77,35 +77,35 @@ impl forall [From:! IntLiteral(), To:! AnyFloat where Float(From) impls FloatFit // Conversions from floating-point to integer type. Always unsafe: not all // source values fit in the target type. -final impl forall [From:! IntLiteral(), To:! IntLiteral()] +final impl forall [From:! IntLiteral, To:! IntLiteral] Float(From) as UnsafeAs(Int(To)) { fn Convert[self: Self]() -> Int(To) = "float.convert_int"; } -final impl forall [From:! IntLiteral(), To:! IntLiteral()] +final impl forall [From:! IntLiteral, To:! IntLiteral] Float(From) as UnsafeAs(UInt(To)) { fn Convert[self: Self]() -> UInt(To) = "float.convert_int"; } -final impl forall [From:! IntLiteral()] - Float(From) as UnsafeAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "float.convert_int"; +final impl forall [From:! IntLiteral] + Float(From) as UnsafeAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "float.convert_int"; } // Conversions from integer to floating-point type. Implicit if all source // values can be represented exactly in the target type, otherwise explicit. -impl forall [From:! IntLiteral(), To:! IntLiteral()] +impl forall [From:! IntLiteral, To:! IntLiteral] Int(From) as As(Float(To)) { fn Convert[self: Self]() -> Float(To) = "int.convert_float"; } -impl forall [From:! IntLiteral(), To:! IntLiteral()] +impl forall [From:! IntLiteral, To:! IntLiteral] UInt(From) as As(Float(To)) { fn Convert[self: Self]() -> Float(To) = "int.convert_float"; } -impl forall [To:! IntLiteral()] - IntLiteral() as As(Float(To)) { +impl forall [To:! IntLiteral] + IntLiteral as As(Float(To)) { fn Convert[self: Self]() -> Float(To) = "int.convert_float"; } @@ -114,28 +114,28 @@ impl forall [To:! IntLiteral()] // lack of support for `match_first`. // TODO: Remove these once possible. private interface AnyInt { - let Width:! IntLiteral(); + let Width:! IntLiteral; fn AsInt[self: Self]() -> Int(Width); } -impl forall [N:! IntLiteral()] Int(N) as AnyInt where .Width = N { +impl forall [N:! IntLiteral] Int(N) as AnyInt where .Width = N { fn AsInt[self: Self]() -> Self { return self; } } private interface AnyUInt { - let Width:! IntLiteral(); + let Width:! IntLiteral; fn AsUInt[self: Self]() -> UInt(Width); } -impl forall [N:! IntLiteral()] UInt(N) as AnyUInt where .Width = N { +impl forall [N:! IntLiteral] UInt(N) as AnyUInt where .Width = N { fn AsUInt[self: Self]() -> Self { return self; } } -private interface IntImplicitAsFloat(To:! IntLiteral()) { +private interface IntImplicitAsFloat(To:! IntLiteral) { fn Convert[self: Self]() -> Float(To); } -final impl forall [To:! IntLiteral(), From:! AnyInt & IntFitsIn(Float(To))] +final impl forall [To:! IntLiteral, From:! AnyInt & IntFitsIn(Float(To))] From as IntImplicitAsFloat(To) { fn Convert[self: Self]() -> Float(To) { fn Impl(src: Int(From.Width)) -> Float(To) = "int.convert_float"; @@ -143,7 +143,7 @@ final impl forall [To:! IntLiteral(), From:! AnyInt & IntFitsIn(Float(To))] } } -impl forall [To:! IntLiteral(), From:! AnyUInt & IntFitsIn(Float(To))] +impl forall [To:! IntLiteral, From:! AnyUInt & IntFitsIn(Float(To))] From as IntImplicitAsFloat(To) { fn Convert[self: Self]() -> Float(To) { fn Impl(src: UInt(From.Width)) -> Float(To) = "int.convert_float"; @@ -151,7 +151,7 @@ impl forall [To:! IntLiteral(), From:! AnyUInt & IntFitsIn(Float(To))] } } -impl forall [To:! IntLiteral(), From:! IntImplicitAsFloat(To)] +impl forall [To:! IntLiteral, From:! IntImplicitAsFloat(To)] From as ImplicitAs(Float(To)) { fn Convert[self: Self]() -> Float(To) { return self.Convert(); @@ -160,31 +160,31 @@ impl forall [To:! IntLiteral(), From:! IntImplicitAsFloat(To)] // Desired workaround-free version of the above: // -// impl forall [From:! IntLiteral(), To:! IntLiteral() +// impl forall [From:! IntLiteral, To:! IntLiteral // where Int(From) impls ImplicitAs(Float(To))] // Int(From) as ImplicitAs(Float(To)) { // fn Convert[self: Self]() -> Float(To) = "int.convert_float"; // } // -// impl forall [From:! IntLiteral(), To:! IntLiteral() +// impl forall [From:! IntLiteral, To:! IntLiteral // where UInt(From) impls ImplicitAs(Float(To))] // UInt(From) as ImplicitAs(Float(To)) { // fn Convert[self: Self]() -> Float(To) = "int.convert_float"; // } -impl forall [To:! IntLiteral()] - IntLiteral() as ImplicitAs(Float(To)) { +impl forall [To:! IntLiteral] + IntLiteral as ImplicitAs(Float(To)) { fn Convert[self: Self]() -> Float(To) = "int.convert_float_checked"; } // Comparisons. // TODO: Support mixed-type comparisons. -final impl forall [N:! IntLiteral()] Float(N) as EqWith(Float(N)) { +final impl forall [N:! IntLiteral] Float(N) as EqWith(Float(N)) { fn Equal[self: Self](other: Float(N)) -> bool = "float.eq"; fn NotEqual[self: Self](other: Float(N)) -> bool = "float.neq"; } -final impl forall [N:! IntLiteral()] Float(N) as OrderedWith(Float(N)) { +final impl forall [N:! IntLiteral] Float(N) as OrderedWith(Float(N)) { fn Less[self: Self](other: Float(N)) -> bool = "float.less"; fn LessOrEquivalent[self: Self](other: Float(N)) -> bool = "float.less_eq"; fn Greater[self: Self](other: Float(N)) -> bool = "float.greater"; @@ -192,48 +192,48 @@ final impl forall [N:! IntLiteral()] Float(N) as OrderedWith(Float(N)) { } // Arithmetic. -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as AddWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "float.add"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as DivWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "float.div"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as MulWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "float.mul"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as Negate where .Result = Self { fn Op[self: Self]() -> Self = "float.negate"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as SubWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "float.sub"; } // Compound assignments. -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as AddAssignWith(Self) { fn Op[ref self: Self](other: Self) = "float.add_assign"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as DivAssignWith(Self) { fn Op[ref self: Self](other: Self) = "float.div_assign"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as MulAssignWith(Self) { fn Op[ref self: Self](other: Self) = "float.mul_assign"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Float(N) as SubAssignWith(Self) { fn Op[ref self: Self](other: Self) = "float.sub_assign"; } diff --git a/core/prelude/types/float_literal.carbon b/core/prelude/types/float_literal.carbon index 1f9dfb569a28..d24b7361da20 100644 --- a/core/prelude/types/float_literal.carbon +++ b/core/prelude/types/float_literal.carbon @@ -4,4 +4,5 @@ package Core library "prelude/types/float_literal"; -fn FloatLiteral() -> type = "float_literal.make_type"; +private fn MakeFloatLiteral() -> type = "float_literal.make_type"; +alias FloatLiteral = MakeFloatLiteral(); diff --git a/core/prelude/types/form.carbon b/core/prelude/types/form.carbon index 977085bb12a6..7ab8aa90d5d2 100644 --- a/core/prelude/types/form.carbon +++ b/core/prelude/types/form.carbon @@ -4,5 +4,5 @@ package Core library "prelude/types/form"; -// TODO: this should be a concrete constant, not a function. -fn Form() -> type = "form.make_type"; +private fn MakeForm() -> type = "form.make_type"; +alias Form = MakeForm(); diff --git a/core/prelude/types/int.carbon b/core/prelude/types/int.carbon index 1bfe01e1d977..6e534d2ccbbe 100644 --- a/core/prelude/types/int.carbon +++ b/core/prelude/types/int.carbon @@ -11,54 +11,54 @@ import library "prelude/operators"; import library "prelude/types/int_literal"; import library "prelude/types/float_literal"; -private fn MakeInt(size: IntLiteral()) -> type = "int.make_type_signed"; +private fn MakeInt(size: IntLiteral) -> type = "int.make_type_signed"; -class Int(N:! IntLiteral()) { +class Int(N:! IntLiteral) { adapt MakeInt(N); } -impl forall [N:! IntLiteral()] Int(N) as UnformedInit {} +impl forall [N:! IntLiteral] Int(N) as UnformedInit {} // Copy. -impl forall [N:! IntLiteral()] Int(N) as Copy { +impl forall [N:! IntLiteral] Int(N) as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } // Conversions. -impl forall [To:! IntLiteral()] IntLiteral() as ImplicitAs(Int(To)) { +impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(Int(To)) { fn Convert[self: Self]() -> Int(To) = "int.convert_checked"; } -final impl forall [From:! IntLiteral()] Int(From) as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl forall [From:! IntLiteral] Int(From) as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. For now we need them because // the forwarding impl of As in terms of ImplicitAs is not usable at compile // time. -impl forall [To:! IntLiteral()] IntLiteral() as As(Int(To)) { +impl forall [To:! IntLiteral] IntLiteral as As(Int(To)) { fn Convert[self: Self]() -> Int(To) = "int.convert_checked"; } -final impl forall [From:! IntLiteral()] Int(From) as As(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl forall [From:! IntLiteral] Int(From) as As(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // Work around the inability to put a `where` clause on a generic parameter of // type `IntLiteral`. // TODO: Remove this once possible. private interface AnyInt { - let Width:! IntLiteral(); + let Width:! IntLiteral; fn AsInt[self: Self]() -> Int(Width); } -impl forall [N:! IntLiteral()] Int(N) as AnyInt where .Width = N { +impl forall [N:! IntLiteral] Int(N) as AnyInt where .Width = N { fn AsInt[self: Self]() -> Self { return self; } } -impl forall [To:! IntLiteral(), From:! AnyInt & IntFitsIn(Int(To))] +impl forall [To:! IntLiteral, From:! AnyInt & IntFitsIn(Int(To))] From as ImplicitAs(Int(To)) { fn Convert[self: Self]() -> Int(To) { fn Impl(src: Int(From.Width)) -> Int(To) = "int.convert"; @@ -66,13 +66,13 @@ impl forall [To:! IntLiteral(), From:! AnyInt & IntFitsIn(Int(To))] } } -final impl forall [From:! IntLiteral(), To:! IntLiteral()] Int(From) as As(Int(To)) { +final impl forall [From:! IntLiteral, To:! IntLiteral] Int(From) as As(Int(To)) { fn Convert[self: Self]() -> Int(To) = "int.convert"; } // Explicit conversion from floating-point literals. -impl forall [To:! IntLiteral()] - FloatLiteral() as UnsafeAs(Int(To)) { +impl forall [To:! IntLiteral] + FloatLiteral as UnsafeAs(Int(To)) { fn Convert[self: Self]() -> Int(To) = "float.convert_int"; } @@ -80,12 +80,12 @@ impl forall [To:! IntLiteral()] // - Int(N) vs Int(M). -final impl forall [N:! IntLiteral(), M:! IntLiteral()] Int(N) as EqWith(Int(M)) { +final impl forall [N:! IntLiteral, M:! IntLiteral] Int(N) as EqWith(Int(M)) { fn Equal[self: Self](other: Int(M)) -> bool = "int.eq"; fn NotEqual[self: Self](other: Int(M)) -> bool = "int.neq"; } -final impl forall [N:! IntLiteral(), M:! IntLiteral()] Int(N) as OrderedWith(Int(M)) { +final impl forall [N:! IntLiteral, M:! IntLiteral] Int(N) as OrderedWith(Int(M)) { // TODO: fn Compare fn Less[self: Self](other: Int(M)) -> bool = "int.less"; fn LessOrEquivalent[self: Self](other: Int(M)) -> bool = "int.less_eq"; @@ -95,12 +95,12 @@ final impl forall [N:! IntLiteral(), M:! IntLiteral()] Int(N) as OrderedWith(Int // - Int(N) on left-hand side. -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] Int(N) as EqWith(T) { +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] Int(N) as EqWith(T) { fn Equal[self: Self](other: Self) -> bool = "int.eq"; fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] Int(N) as OrderedWith(T) { +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] Int(N) as OrderedWith(T) { // TODO: fn Compare fn Less[self: Self](other: Self) -> bool = "int.less"; fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; @@ -110,12 +110,12 @@ impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] Int(N) as OrderedWith(T) // - Int(N) on right-hand side. -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] T as EqWith(Int(N)) { +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as EqWith(Int(N)) { fn Equal[self: Int(N)](other: Int(N)) -> bool = "int.eq"; fn NotEqual[self: Int(N)](other: Int(N)) -> bool = "int.neq"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] T as OrderedWith(Int(N)) { +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as OrderedWith(Int(N)) { // TODO: fn Compare fn Less[self: Int(N)](other: Int(N)) -> bool = "int.less"; fn LessOrEquivalent[self: Int(N)](other: Int(N)) -> bool = "int.less_eq"; @@ -127,86 +127,86 @@ impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] T as OrderedWith(Int(N)) // - Homogeneous. -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as AddWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.sadd"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as DivWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.sdiv"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as ModWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.smod"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as MulWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.smul"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as Negate where .Result = Self { fn Op[self: Self]() -> Self = "int.snegate"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as SubWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.ssub"; } // - Int(N) on left-hand side. -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as AddWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.sadd"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as DivWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.sdiv"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as ModWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.smod"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as MulWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.smul"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as SubWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.ssub"; } // - Int(N) on right-hand side. -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as AddWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.sadd"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as DivWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.sdiv"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as ModWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.smod"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as MulWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.smul"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as SubWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.ssub"; } @@ -215,138 +215,138 @@ impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] // - Homogeneous. -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as BitAndWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.and"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as BitComplement where .Result = Self { fn Op[self: Self]() -> Self = "int.complement"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as BitOrWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.or"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as BitXorWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.xor"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as LeftShiftWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.left_shift"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as RightShiftWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.right_shift"; } // - Int(N) on left-hand side. -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitAndWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.and"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitOrWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.or"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitXorWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.xor"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as LeftShiftWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.left_shift"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as RightShiftWith(U) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.right_shift"; } // - Int(N) on right-hand side. -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as BitAndWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.and"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as BitOrWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.or"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as BitXorWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.xor"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as LeftShiftWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.left_shift"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(Int(N))] T as RightShiftWith(Int(N)) where .Result = Int(N) { fn Op[self: Int(N)](other: Int(N)) -> Int(N) = "int.right_shift"; } // Compound assignments. -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as AddAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.sadd_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitAndAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.and_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitOrAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.or_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as BitXorAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.xor_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as DivAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.sdiv_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as LeftShiftAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.left_shift_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as ModAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.smod_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as MulAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.smul_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as RightShiftAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.right_shift_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(Int(N))] Int(N) as SubAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.ssub_assign"; } @@ -355,20 +355,20 @@ impl forall [N:! IntLiteral(), U:! ImplicitAs(Int(N))] // TODO: Add builtins for these to avoid emitting a call. -impl forall [N:! IntLiteral()] Int(N) as Dec { +impl forall [N:! IntLiteral] Int(N) as Dec { fn Op[ref self: Self]() { // TODO: `self -= 1;` should work, but fails because the `impl IntLiteral // as ImplicitAs(Int(N))` is not final, which causes us to not attempt the // conversion from `1` to `Int(N)` until runtime, when we've lost the // constant value. - fn AsInt(n: IntLiteral()) -> Int(N) = "int.convert_checked"; + fn AsInt(n: IntLiteral) -> Int(N) = "int.convert_checked"; self -= AsInt(1); } } -impl forall [N:! IntLiteral()] Int(N) as Inc { +impl forall [N:! IntLiteral] Int(N) as Inc { fn Op[ref self: Self]() { - fn AsInt(n: IntLiteral()) -> Int(N) = "int.convert_checked"; + fn AsInt(n: IntLiteral) -> Int(N) = "int.convert_checked"; self += AsInt(1); } } diff --git a/core/prelude/types/int_literal.carbon b/core/prelude/types/int_literal.carbon index 5391b3faba51..98e5503b2443 100644 --- a/core/prelude/types/int_literal.carbon +++ b/core/prelude/types/int_literal.carbon @@ -4,4 +4,5 @@ package Core library "prelude/types/int_literal"; -fn IntLiteral() -> type = "int_literal.make_type"; +private fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); diff --git a/core/prelude/types/uint.carbon b/core/prelude/types/uint.carbon index 055fee9033ce..f58febeba536 100644 --- a/core/prelude/types/uint.carbon +++ b/core/prelude/types/uint.carbon @@ -12,50 +12,50 @@ import library "prelude/types/int"; import library "prelude/types/int_literal"; import library "prelude/types/float_literal"; -private fn MakeUInt(size: IntLiteral()) -> type = "int.make_type_unsigned"; +private fn MakeUInt(size: IntLiteral) -> type = "int.make_type_unsigned"; -class UInt(N:! IntLiteral()) { +class UInt(N:! IntLiteral) { adapt MakeUInt(N); } -impl forall [N:! IntLiteral()] UInt(N) as UnformedInit {} +impl forall [N:! IntLiteral] UInt(N) as UnformedInit {} // Copy. -impl forall [N:! IntLiteral()] UInt(N) as Copy { +impl forall [N:! IntLiteral] UInt(N) as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } // Conversions. -impl forall [To:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(To)) { +impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(UInt(To)) { fn Convert[self: Self]() -> UInt(To) = "int.convert_checked"; } -final impl forall [From:! IntLiteral()] UInt(From) as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl forall [From:! IntLiteral] UInt(From) as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. For now we need them because // the forwarding impl of As in terms of ImplicitAs is not usable at compile // time. -impl forall [To:! IntLiteral()] IntLiteral() as As(UInt(To)) { +impl forall [To:! IntLiteral] IntLiteral as As(UInt(To)) { fn Convert[self: Self]() -> UInt(To) = "int.convert_checked"; } -final impl forall [From:! IntLiteral()] UInt(From) as As(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl forall [From:! IntLiteral] UInt(From) as As(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // Work around the inability to put a `where` clause on a generic parameter of // type `IntLiteral`. // TODO: Remove this once possible. private interface AnyUInt { - let Width:! IntLiteral(); + let Width:! IntLiteral; fn AsUInt[self: Self]() -> UInt(Width); } -impl forall [N:! IntLiteral()] UInt(N) as AnyUInt where .Width = N { +impl forall [N:! IntLiteral] UInt(N) as AnyUInt where .Width = N { fn AsUInt[self: Self]() -> Self { return self; } } @@ -66,7 +66,7 @@ private interface FromUInt(From:! type) { fn Convert(from: From) -> Self; } -impl forall [To:! IntLiteral(), From:! AnyUInt & IntFitsIn(UInt(To))] +impl forall [To:! IntLiteral, From:! AnyUInt & IntFitsIn(UInt(To))] UInt(To) as FromUInt(From) { fn Convert(from: From) -> Self { fn Impl(src: UInt(From.Width)) -> Self = "int.convert"; @@ -74,7 +74,7 @@ impl forall [To:! IntLiteral(), From:! AnyUInt & IntFitsIn(UInt(To))] } } -impl forall [To:! IntLiteral(), From:! AnyUInt & IntFitsIn(Int(To))] +impl forall [To:! IntLiteral, From:! AnyUInt & IntFitsIn(Int(To))] Int(To) as FromUInt(From) { fn Convert(from: From) -> Self { fn Impl(src: UInt(From.Width)) -> Self = "int.convert"; @@ -82,29 +82,29 @@ impl forall [To:! IntLiteral(), From:! AnyUInt & IntFitsIn(Int(To))] } } -impl forall [From:! IntLiteral(), To:! FromUInt(UInt(From))] +impl forall [From:! IntLiteral, To:! FromUInt(UInt(From))] UInt(From) as ImplicitAs(To) { fn Convert[self: Self]() -> To { return To.Convert(self); } } -final impl forall [From:! IntLiteral(), To:! IntLiteral()] UInt(From) as As(UInt(To)) { +final impl forall [From:! IntLiteral, To:! IntLiteral] UInt(From) as As(UInt(To)) { fn Convert[self: Self]() -> UInt(To) = "int.convert"; } -final impl forall [From:! IntLiteral(), To:! IntLiteral()] UInt(From) as As(Int(To)) { +final impl forall [From:! IntLiteral, To:! IntLiteral] UInt(From) as As(Int(To)) { fn Convert[self: Self]() -> Int(To) = "int.convert"; } // Never implicit. -impl forall [From:! IntLiteral(), To:! IntLiteral()] Int(From) as As(UInt(To)) { +impl forall [From:! IntLiteral, To:! IntLiteral] Int(From) as As(UInt(To)) { fn Convert[self: Self]() -> UInt(To) = "int.convert"; } // Explicit conversion from floating-point literals. -impl forall [To:! IntLiteral()] - FloatLiteral() as UnsafeAs(UInt(To)) { +impl forall [To:! IntLiteral] + FloatLiteral as UnsafeAs(UInt(To)) { fn Convert[self: Self]() -> UInt(To) = "float.convert_int"; } @@ -112,12 +112,12 @@ impl forall [To:! IntLiteral()] // - UInt(N) vs UInt(M). -final impl forall [N:! IntLiteral(), M:! IntLiteral()] UInt(N) as EqWith(UInt(M)) { +final impl forall [N:! IntLiteral, M:! IntLiteral] UInt(N) as EqWith(UInt(M)) { fn Equal[self: Self](other: UInt(M)) -> bool = "int.eq"; fn NotEqual[self: Self](other: UInt(M)) -> bool = "int.neq"; } -final impl forall [N:! IntLiteral(), M:! IntLiteral()] UInt(N) as OrderedWith(UInt(M)) { +final impl forall [N:! IntLiteral, M:! IntLiteral] UInt(N) as OrderedWith(UInt(M)) { // TODO: fn Compare fn Less[self: Self](other: UInt(M)) -> bool = "int.less"; fn LessOrEquivalent[self: Self](other: UInt(M)) -> bool = "int.less_eq"; @@ -127,12 +127,12 @@ final impl forall [N:! IntLiteral(), M:! IntLiteral()] UInt(N) as OrderedWith(UI // - UInt(N) vs Int(M). -final impl forall [N:! IntLiteral(), M:! IntLiteral()] UInt(N) as EqWith(Int(M)) { +final impl forall [N:! IntLiteral, M:! IntLiteral] UInt(N) as EqWith(Int(M)) { fn Equal[self: Self](other: Int(M)) -> bool = "int.eq"; fn NotEqual[self: Self](other: Int(M)) -> bool = "int.neq"; } -final impl forall [N:! IntLiteral(), M:! IntLiteral()] UInt(N) as OrderedWith(Int(M)) { +final impl forall [N:! IntLiteral, M:! IntLiteral] UInt(N) as OrderedWith(Int(M)) { // TODO: fn Compare fn Less[self: Self](other: Int(M)) -> bool = "int.less"; fn LessOrEquivalent[self: Self](other: Int(M)) -> bool = "int.less_eq"; @@ -142,12 +142,12 @@ final impl forall [N:! IntLiteral(), M:! IntLiteral()] UInt(N) as OrderedWith(In // - Int(N) vs UInt(M). -impl forall [N:! IntLiteral(), M:! IntLiteral()] Int(N) as EqWith(UInt(M)) { +impl forall [N:! IntLiteral, M:! IntLiteral] Int(N) as EqWith(UInt(M)) { fn Equal[self: Self](other: UInt(M)) -> bool = "int.eq"; fn NotEqual[self: Self](other: UInt(M)) -> bool = "int.neq"; } -impl forall [N:! IntLiteral(), M:! IntLiteral()] Int(N) as OrderedWith(UInt(M)) { +impl forall [N:! IntLiteral, M:! IntLiteral] Int(N) as OrderedWith(UInt(M)) { // TODO: fn Compare fn Less[self: Self](other: UInt(M)) -> bool = "int.less"; fn LessOrEquivalent[self: Self](other: UInt(M)) -> bool = "int.less_eq"; @@ -157,12 +157,12 @@ impl forall [N:! IntLiteral(), M:! IntLiteral()] Int(N) as OrderedWith(UInt(M)) // - UInt(N) on left-hand side. -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] UInt(N) as EqWith(T) { +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] UInt(N) as EqWith(T) { fn Equal[self: Self](other: Self) -> bool = "int.eq"; fn NotEqual[self: Self](other: Self) -> bool = "int.neq"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] UInt(N) as OrderedWith(T) { +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] UInt(N) as OrderedWith(T) { // TODO: fn Compare fn Less[self: Self](other: Self) -> bool = "int.less"; fn LessOrEquivalent[self: Self](other: Self) -> bool = "int.less_eq"; @@ -172,12 +172,12 @@ impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] UInt(N) as OrderedWith(T // - UInt(N) on right-hand side. -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] T as EqWith(UInt(N)) { +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as EqWith(UInt(N)) { fn Equal[self: UInt(N)](other: UInt(N)) -> bool = "int.eq"; fn NotEqual[self: UInt(N)](other: UInt(N)) -> bool = "int.neq"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] T as OrderedWith(UInt(N)) { +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as OrderedWith(UInt(N)) { // TODO: fn Compare fn Less[self: UInt(N)](other: UInt(N)) -> bool = "int.less"; fn LessOrEquivalent[self: UInt(N)](other: UInt(N)) -> bool = "int.less_eq"; @@ -189,86 +189,86 @@ impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] T as OrderedWith(UInt(N) // - Homogeneous. -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as AddWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.uadd"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as DivWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.udiv"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as ModWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.umod"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as MulWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.umul"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as Negate where .Result = Self { fn Op[self: Self]() -> Self = "int.unegate"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as SubWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.usub"; } // - UInt(N) on left-hand side. -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as AddWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.uadd"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as DivWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.udiv"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as ModWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.umod"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as MulWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.umul"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as SubWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.usub"; } // - UInt(N) on right-hand side. -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as AddWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.uadd"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as DivWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.udiv"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as ModWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.umod"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as MulWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.umul"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as SubWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.usub"; } @@ -277,138 +277,138 @@ impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] // - Homogeneous. -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as BitAndWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.and"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as BitComplement where .Result = Self { fn Op[self: Self]() -> Self = "int.complement"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as BitOrWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.or"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as BitXorWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.xor"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as LeftShiftWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.left_shift"; } -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as RightShiftWith(Self) where .Result = Self { fn Op[self: Self](other: Self) -> Self = "int.right_shift"; } // - UInt(N) on left-hand side. -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitAndWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.and"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitOrWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.or"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitXorWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.xor"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as LeftShiftWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.left_shift"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as RightShiftWith(U) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.right_shift"; } // - UInt(N) on right-hand side. -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as BitAndWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.and"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as BitOrWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.or"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as BitXorWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.xor"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as LeftShiftWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.left_shift"; } -impl forall [N:! IntLiteral(), T:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, T:! ImplicitAs(UInt(N))] T as RightShiftWith(UInt(N)) where .Result = UInt(N) { fn Op[self: UInt(N)](other: UInt(N)) -> UInt(N) = "int.right_shift"; } // Compound assignments. -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as AddAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.uadd_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitAndAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.and_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitOrAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.or_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as BitXorAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.xor_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as DivAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.udiv_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as LeftShiftAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.left_shift_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as ModAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.umod_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as MulAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.umul_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as RightShiftAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.right_shift_assign"; } -impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] +impl forall [N:! IntLiteral, U:! ImplicitAs(UInt(N))] UInt(N) as SubAssignWith(U) { fn Op[ref self: Self](other: Self) = "int.usub_assign"; } @@ -417,20 +417,20 @@ impl forall [N:! IntLiteral(), U:! ImplicitAs(UInt(N))] // TODO: Add builtins for these to avoid emitting a call. -impl forall [N:! IntLiteral()] UInt(N) as Dec { +impl forall [N:! IntLiteral] UInt(N) as Dec { fn Op[ref self: Self]() { // TODO: `self -= 1;` should work, but fails because the `impl IntLiteral // as ImplicitAs(Int(N))` is not final, which causes us to not attempt the // conversion from `1` to `Int(N)` until runtime, when we've lost the // constant value. - fn AsUInt(n: IntLiteral()) -> UInt(N) = "int.convert_checked"; + fn AsUInt(n: IntLiteral) -> UInt(N) = "int.convert_checked"; self -= AsUInt(1); } } -impl forall [N:! IntLiteral()] UInt(N) as Inc { +impl forall [N:! IntLiteral] UInt(N) as Inc { fn Op[ref self: Self]() { - fn AsUInt(n: IntLiteral()) -> UInt(N) = "int.convert_checked"; + fn AsUInt(n: IntLiteral) -> UInt(N) = "int.convert_checked"; self += AsUInt(1); } } diff --git a/core/range.carbon b/core/range.carbon index 4e653122c192..a5a3e3c05627 100644 --- a/core/range.carbon +++ b/core/range.carbon @@ -16,7 +16,7 @@ import library "prelude/types/int"; import library "prelude/types/int_literal"; import library "prelude/types/optional"; -class IntRange(N:! IntLiteral()) { +class IntRange(N:! IntLiteral) { fn Make(start: Int(N), end: Int(N)) -> Self { return {.start = start, .end = end}; } diff --git a/examples/advent2024/day1_common.carbon b/examples/advent2024/day1_common.carbon index ebd7b904092a..6a14253a050a 100644 --- a/examples/advent2024/day1_common.carbon +++ b/examples/advent2024/day1_common.carbon @@ -12,7 +12,7 @@ import library "io_utils"; // Read a sequence of lines each containing a pair of numbers into two arrays. // Returns the number of lines read. -fn ReadInputs[N:! Core.IntLiteral()](ref a: array(i32, N), ref b: array(i32, N)) -> i32 { +fn ReadInputs[N:! Core.IntLiteral](ref a: array(i32, N), ref b: array(i32, N)) -> i32 { for (i: i32 in Core.Range(N)) { var av: i32; var bv: i32; diff --git a/examples/advent2024/io_utils.carbon b/examples/advent2024/io_utils.carbon index 57d91aa6b5fd..5b4fa0e0fbf8 100644 --- a/examples/advent2024/io_utils.carbon +++ b/examples/advent2024/io_utils.carbon @@ -105,7 +105,7 @@ fn ConsumeChar(c: char) -> bool { return true; } -fn ReadInt[N:! Core.IntLiteral()](ref p: Core.Int(N)) -> bool { +fn ReadInt[N:! Core.IntLiteral](ref p: Core.Int(N)) -> bool { var read_any_digits: bool = false; let negative: bool = ConsumeChar('-'); // TODO: `p = 0;` crashes the toolchain, see @@ -133,7 +133,7 @@ fn ReadInt[N:! Core.IntLiteral()](ref p: Core.Int(N)) -> bool { return read_any_digits; } -fn PrintIntNoNewline[N:! Core.IntLiteral()](n_val: Core.Int(N)) { +fn PrintIntNoNewline[N:! Core.IntLiteral](n_val: Core.Int(N)) { // TODO: var pow10: Core.Int(N) = 1; crashes the toolchain. var pow10: Core.Int(N) = (1 as i32) as Core.Int(N); var n: Core.Int(N) = n_val; @@ -152,7 +152,7 @@ fn PrintIntNoNewline[N:! Core.IntLiteral()](n_val: Core.Int(N)) { } } -fn PrintInt[N:! Core.IntLiteral()](n_val: Core.Int(N)) { +fn PrintInt[N:! Core.IntLiteral](n_val: Core.Int(N)) { PrintIntNoNewline(n_val); Core.PrintChar('\n'); } diff --git a/examples/advent2024/sort.carbon b/examples/advent2024/sort.carbon index 985639eb8649..25a34cd5974d 100644 --- a/examples/advent2024/sort.carbon +++ b/examples/advent2024/sort.carbon @@ -26,7 +26,7 @@ fn Swap[T:! Core.Copy & Core.Destroy](ref from: T, ref to: T) { } fn Partition - [T:! Core.Copy & Core.Destroy & Ordered, N:! Core.IntLiteral()] + [T:! Core.Copy & Core.Destroy & Ordered, N:! Core.IntLiteral] (ref a: array(T, N), from_in: i32, to_in: i32) -> i32 { var pivot_index: i32 = from_in; let pivot: T = a[pivot_index]; @@ -52,7 +52,7 @@ fn Partition } fn Quicksort - [T:! Core.Copy & Core.Destroy & Ordered, N:! Core.IntLiteral()] + [T:! Core.Copy & Core.Destroy & Ordered, N:! Core.IntLiteral] (ref a: array(T, N), from: i32, to: i32) { if (from + 1 >= to) { return; } var pivot: i32 = Partition(ref a, from, to); diff --git a/toolchain/check/handle_alias.cpp b/toolchain/check/handle_alias.cpp index f07da27793fe..4338345d4e02 100644 --- a/toolchain/check/handle_alias.cpp +++ b/toolchain/check/handle_alias.cpp @@ -3,12 +3,14 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "toolchain/check/context.h" +#include "toolchain/check/convert.h" #include "toolchain/check/generic.h" #include "toolchain/check/handle.h" #include "toolchain/check/inst.h" #include "toolchain/check/modifiers.h" #include "toolchain/check/name_component.h" #include "toolchain/parse/node_ids.h" +#include "toolchain/sem_ir/expr_info.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/typed_insts.h" @@ -46,6 +48,27 @@ auto HandleParseNode(Context& context, Parse::AliasId /*node_id*/) -> bool { {.name_id = name_context.name_id_for_new_inst(), .parent_scope_id = name_context.parent_scope_id}); + switch (SemIR::GetExprCategory(context.sem_ir(), expr_id)) { + case SemIR::ExprCategory::Value: + case SemIR::ExprCategory::EphemeralRef: + case SemIR::ExprCategory::DurableRef: + case SemIR::ExprCategory::NotExpr: + case SemIR::ExprCategory::Error: + // An alias can refer to a value, a reference, or a non-expression name + // such as a function or namespace. + break; + case SemIR::ExprCategory::ReprInitializing: + case SemIR::ExprCategory::InPlaceInitializing: + case SemIR::ExprCategory::Mixed: + case SemIR::ExprCategory::Dependent: + case SemIR::ExprCategory::RefTagged: + case SemIR::ExprCategory::Pattern: + // For any other kind of expression, convert to a value or reference. + // TODO: Should we allow or require `ref` tagging for reference aliases? + expr_id = ConvertToValueOrRefExpr(context, expr_id); + break; + } + if (!context.constant_values().Get(expr_id).is_constant()) { CARBON_DIAGNOSTIC(AliasRequiresConstantValue, Error, "alias refers to a runtime value"); diff --git a/toolchain/check/literal.cpp b/toolchain/check/literal.cpp index 6b43e7d1bec4..9b0a6fe9f1d4 100644 --- a/toolchain/check/literal.cpp +++ b/toolchain/check/literal.cpp @@ -37,7 +37,6 @@ auto MakeBoolTypeLiteral(Context& context, Parse::NodeId node_id) auto desugared_loc_id = SemIR::LocId(node_id).AsDesugared(); auto inst_id = LookupNameInCore(context, desugared_loc_id, CoreIdentifier::Bool); - inst_id = PerformCall(context, desugared_loc_id, inst_id, {}); return MakeTypeLiteral(context, node_id, inst_id); } diff --git a/toolchain/check/testdata/alias/builtins.carbon b/toolchain/check/testdata/alias/builtins.carbon index e9e4c93844b4..74555a8ab38b 100644 --- a/toolchain/check/testdata/alias/builtins.carbon +++ b/toolchain/check/testdata/alias/builtins.carbon @@ -59,14 +59,14 @@ let a_test: bool = a; // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %false: bool = bool_literal false [concrete] -// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type bool [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] // CHECK:STDOUT: %a: bool = alias_binding a, %false [concrete = constants.%false] // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %a_test.patt: %pattern_type.831 = value_binding_pattern a_test [concrete] +// CHECK:STDOUT: %a_test.patt: %pattern_type = value_binding_pattern a_test [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc7: type = type_literal bool [concrete = bool] // CHECK:STDOUT: %a_test: bool = value_binding a_test, @__global_init.%a.ref diff --git a/toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon b/toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon index 5416385f5933..2eadcac1ee02 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon @@ -13,7 +13,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/raw_sem_ir/bundle.carbon -fn F(Form:! Core.Form()) ->? Form; +fn F(Form:! Core.Form) ->? Form; // CHECK:STDOUT: --- // CHECK:STDOUT: filename: bundle.carbon @@ -27,32 +27,26 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: import_ir70000002: {decl_id: inst70000010, is_export: false} // CHECK:STDOUT: import_ir70000003: {decl_id: inst70000010, is_export: false} // CHECK:STDOUT: import_ir_insts: -// CHECK:STDOUT: import_ir_inst0: {ir_id: import_ir70000003, inst_id: inst50000018} -// CHECK:STDOUT: import_ir_inst1: {ir_id: import_ir70000003, inst_id: inst50000018} -// CHECK:STDOUT: import_ir_inst2: {ir_id: import_ir70000003, inst_id: inst50000014} -// CHECK:STDOUT: import_ir_inst3: {ir_id: import_ir70000003, inst_id: inst50000015} -// CHECK:STDOUT: import_ir_inst4: {ir_id: import_ir70000003, inst_id: inst50000010} -// CHECK:STDOUT: import_ir_inst5: {ir_id: import_ir70000003, inst_id: inst50000011} +// CHECK:STDOUT: import_ir_inst0: {ir_id: import_ir70000003, inst_id: inst50000020} // CHECK:STDOUT: clang_decls: {} // CHECK:STDOUT: clang_decl_signatures: {} // CHECK:STDOUT: name_scopes: -// CHECK:STDOUT: name_scope0: {inst: instF, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name(Core): inst70000011, name0: inst7000003B}} +// CHECK:STDOUT: name_scope0: {inst: instF, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name(Core): inst70000011, name0: inst7000002F}} // CHECK:STDOUT: name_scope70000001: {inst: inst70000011, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst70000016}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name70000000: {name: name(PeriodSelf), parent_scope: name_scope, index: -1, is_template: 0, is_unused: 0, form: inst} // CHECK:STDOUT: entity_name70000001: {name: name1, parent_scope: name_scope70000001, index: -1, is_template: 0, is_unused: 0, form: inst} // CHECK:STDOUT: entity_name70000002: {name: name1, parent_scope: name_scope, index: 0, is_template: 0, is_unused: 0, form: inst} // CHECK:STDOUT: functions: -// CHECK:STDOUT: function70000000: {name: name1, parent_scope: name_scope70000001, call_param_patterns_id: inst_block70000006, return_type_inst_id: inst7000001E, return_form_inst_id: inst7000001F, return_pattern_id: inst7000001C} -// CHECK:STDOUT: function70000001: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block70000008, call_params_id: inst_block70000009, return_type_inst_id: inst7000002E, return_form_inst_id: inst7000002B, return_pattern_id: inst70000035} +// CHECK:STDOUT: function70000000: {name: name0, parent_scope: name_scope0, call_param_patterns_id: inst_block70000007, call_params_id: inst_block70000008, return_type_inst_id: inst70000022, return_form_inst_id: inst7000001F, return_pattern_id: inst70000029} // CHECK:STDOUT: classes: {} // CHECK:STDOUT: interfaces: {} // CHECK:STDOUT: associated_constants: {} // CHECK:STDOUT: impls: {} // CHECK:STDOUT: generics: -// CHECK:STDOUT: generic70000000: {decl: inst7000003B, bindings: inst_block7000000C, self_specific_id: specific70000000, decl_block_id: inst_block7000000E, definition_block_id: inst_block} +// CHECK:STDOUT: generic70000000: {decl: inst7000002F, bindings: inst_block7000000B, self_specific_id: specific70000000, decl_block_id: inst_block7000000D, definition_block_id: inst_block} // CHECK:STDOUT: specifics: -// CHECK:STDOUT: specific70000000: {generic: generic70000000, args: inst_block7000000D, decl_block_id: inst_block7000000F, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} +// CHECK:STDOUT: specific70000000: {generic: generic70000000, args: inst_block7000000C, decl_block_id: inst_block7000000E, decl_has_error: 0, definition_block_id: inst_block, definition_has_error: 0} // CHECK:STDOUT: specific_interfaces: {} // CHECK:STDOUT: struct_type_fields: // CHECK:STDOUT: struct_type_fields_empty: {} @@ -82,13 +76,13 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: object_layout: // CHECK:STDOUT: size: 0 // CHECK:STDOUT: alignment: 1 -// CHECK:STDOUT: 'type(inst70000043)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst70000044)} +// CHECK:STDOUT: 'type(inst70000037)': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst70000038)} // CHECK:STDOUT: object_layout: // CHECK:STDOUT: size: 0 // CHECK:STDOUT: alignment: 1 -// CHECK:STDOUT: 'type(inst70000044)': -// CHECK:STDOUT: value_repr: {kind: none, type: type(inst70000044)} +// CHECK:STDOUT: 'type(inst70000038)': +// CHECK:STDOUT: value_repr: {kind: none, type: type(inst70000038)} // CHECK:STDOUT: object_layout: // CHECK:STDOUT: size: 0 // CHECK:STDOUT: alignment: 1 @@ -102,57 +96,45 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: inst70000013: {kind: SymbolicBinding, arg0: entity_name70000000, arg1: inst, type: type(inst70000012)} // CHECK:STDOUT: inst70000014: {kind: SymbolicBinding, arg0: entity_name70000000, arg1: inst, type: type(inst70000012)} // CHECK:STDOUT: inst70000015: {kind: NameRef, arg0: name(Core), arg1: inst70000011, type: type(inst(NamespaceType))} -// CHECK:STDOUT: inst70000016: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name70000001, type: type(inst70000018)} -// CHECK:STDOUT: inst70000017: {kind: FunctionDecl, arg0: function70000000, arg1: inst_block_empty, type: type(inst70000018)} -// CHECK:STDOUT: inst70000018: {kind: FunctionType, arg0: function70000000, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: inst70000019: {kind: StructValue, arg0: inst_block_empty, type: type(inst70000018)} -// CHECK:STDOUT: inst7000001A: {kind: PatternType, arg0: inst(TypeType), type: type(TypeType)} -// CHECK:STDOUT: inst7000001B: {kind: OutParamPattern, arg0: name(ReturnSlot), type: type(inst7000001A)} -// CHECK:STDOUT: inst7000001C: {kind: ReturnSlotPattern, arg0: inst7000001B, arg1: inst, type: type(inst7000001A)} -// CHECK:STDOUT: inst7000001D: {kind: InitForm, arg0: inst(TypeType), type: type(inst(FormType))} -// CHECK:STDOUT: inst7000001E: {kind: ImportRefLoaded, arg0: import_ir_inst4, arg1: entity_name, type: type(TypeType)} -// CHECK:STDOUT: inst7000001F: {kind: ImportRefLoaded, arg0: import_ir_inst5, arg1: entity_name, type: type(inst(FormType))} -// CHECK:STDOUT: inst70000020: {kind: NameRef, arg0: name1, arg1: inst70000016, type: type(inst70000018)} -// CHECK:STDOUT: inst70000021: {kind: Call, arg0: inst70000020, arg1: inst_block_empty, type: type(TypeType)} -// CHECK:STDOUT: inst70000022: {kind: ValueOfInitializer, arg0: inst70000021, type: type(TypeType)} -// CHECK:STDOUT: inst70000023: {kind: Converted, arg0: inst70000021, arg1: inst70000022, type: type(TypeType)} -// CHECK:STDOUT: inst70000024: {kind: PatternType, arg0: inst(FormType), type: type(TypeType)} -// CHECK:STDOUT: inst70000025: {kind: SymbolicBinding, arg0: entity_name70000002, arg1: inst, type: type(inst(FormType))} -// CHECK:STDOUT: inst70000026: {kind: SymbolicBinding, arg0: entity_name70000002, arg1: inst, type: type(inst(FormType))} -// CHECK:STDOUT: inst70000027: {kind: SymbolicBinding, arg0: entity_name70000002, arg1: inst, type: type(inst(FormType))} -// CHECK:STDOUT: inst70000028: {kind: SymbolicBindingPattern, arg0: entity_name70000002, type: type(inst70000024)} -// CHECK:STDOUT: inst70000029: {kind: NameRef, arg0: name1, arg1: inst70000025, type: type(inst(FormType))} -// CHECK:STDOUT: inst7000002A: {kind: RefineFormAction, arg0: inst70000029, type: type(inst(InstType))} -// CHECK:STDOUT: inst7000002B: {kind: SpliceInst, arg0: inst7000002A, type: type(inst(FormType))} -// CHECK:STDOUT: inst7000002C: {kind: SpliceInst, arg0: inst7000002A, type: type(inst(FormType))} -// CHECK:STDOUT: inst7000002D: {kind: SpliceInst, arg0: inst7000002A, type: type(inst(FormType))} -// CHECK:STDOUT: inst7000002E: {kind: TypeComponentOf, arg0: inst7000002C, type: type(TypeType)} -// CHECK:STDOUT: inst7000002F: {kind: PatternType, arg0: inst7000002E, type: type(TypeType)} -// CHECK:STDOUT: inst70000030: {kind: OutFormParamPatternAction, arg0: inst7000002B, type: type(inst(InstType))} -// CHECK:STDOUT: inst70000031: {kind: SpliceInst, arg0: inst70000030, type: type(symbolic_constant7000000A)} -// CHECK:STDOUT: inst70000032: {kind: SpliceInst, arg0: inst70000030, type: type(symbolic_constant70000006)} -// CHECK:STDOUT: inst70000033: {kind: TypeComponentOf, arg0: inst7000002D, type: type(TypeType)} -// CHECK:STDOUT: inst70000034: {kind: SpliceInst, arg0: inst70000030, type: type(symbolic_constant7000000A)} -// CHECK:STDOUT: inst70000035: {kind: ReturnSlotPattern, arg0: inst70000031, arg1: inst7000002E, type: type(symbolic_constant7000000C)} -// CHECK:STDOUT: inst70000036: {kind: PatternType, arg0: inst70000033, type: type(TypeType)} -// CHECK:STDOUT: inst70000037: {kind: SpliceBlock, arg0: inst_block70000005, arg1: inst70000023, type: type(TypeType)} -// CHECK:STDOUT: inst70000038: {kind: CalleePatternMatchAction, arg0: bundle70000000, type: type(inst(InstType))} -// CHECK:STDOUT: inst70000039: {kind: SpliceInst, arg0: inst70000038, type: type(symbolic_constant7000000A)} -// CHECK:STDOUT: inst7000003A: {kind: ReturnSlot, arg0: inst7000002E, arg1: inst70000039, type: type(symbolic_constant7000000A)} -// CHECK:STDOUT: inst7000003B: {kind: FunctionDecl, arg0: function70000001, arg1: inst_block7000000B, type: type(inst70000043)} -// CHECK:STDOUT: inst7000003C: {kind: RefineFormAction, arg0: inst70000026, type: type(inst(InstType))} -// CHECK:STDOUT: inst7000003D: {kind: SpliceInst, arg0: inst7000003C, type: type(inst(FormType))} -// CHECK:STDOUT: inst7000003E: {kind: OutFormParamPatternAction, arg0: inst7000003D, type: type(inst(InstType))} -// CHECK:STDOUT: inst7000003F: {kind: TypeComponentOf, arg0: inst7000003D, type: type(TypeType)} -// CHECK:STDOUT: inst70000040: {kind: SpliceInst, arg0: inst7000003E, type: type(symbolic_constant70000011)} -// CHECK:STDOUT: inst70000041: {kind: PatternType, arg0: inst7000003F, type: type(TypeType)} -// CHECK:STDOUT: inst70000042: {kind: CalleePatternMatchAction, arg0: bundle70000001, type: type(inst(InstType))} -// CHECK:STDOUT: inst70000043: {kind: FunctionType, arg0: function70000001, arg1: specific, type: type(TypeType)} -// CHECK:STDOUT: inst70000044: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} -// CHECK:STDOUT: inst70000045: {kind: StructValue, arg0: inst_block_empty, type: type(inst70000043)} +// CHECK:STDOUT: inst70000016: {kind: ImportRefLoaded, arg0: import_ir_inst0, arg1: entity_name70000001, type: type(TypeType)} +// CHECK:STDOUT: inst70000017: {kind: NameRef, arg0: name1, arg1: inst70000016, type: type(TypeType)} +// CHECK:STDOUT: inst70000018: {kind: PatternType, arg0: inst(FormType), type: type(TypeType)} +// CHECK:STDOUT: inst70000019: {kind: SymbolicBinding, arg0: entity_name70000002, arg1: inst, type: type(inst(FormType))} +// CHECK:STDOUT: inst7000001A: {kind: SymbolicBinding, arg0: entity_name70000002, arg1: inst, type: type(inst(FormType))} +// CHECK:STDOUT: inst7000001B: {kind: SymbolicBinding, arg0: entity_name70000002, arg1: inst, type: type(inst(FormType))} +// CHECK:STDOUT: inst7000001C: {kind: SymbolicBindingPattern, arg0: entity_name70000002, type: type(inst70000018)} +// CHECK:STDOUT: inst7000001D: {kind: NameRef, arg0: name1, arg1: inst70000019, type: type(inst(FormType))} +// CHECK:STDOUT: inst7000001E: {kind: RefineFormAction, arg0: inst7000001D, type: type(inst(InstType))} +// CHECK:STDOUT: inst7000001F: {kind: SpliceInst, arg0: inst7000001E, type: type(inst(FormType))} +// CHECK:STDOUT: inst70000020: {kind: SpliceInst, arg0: inst7000001E, type: type(inst(FormType))} +// CHECK:STDOUT: inst70000021: {kind: SpliceInst, arg0: inst7000001E, type: type(inst(FormType))} +// CHECK:STDOUT: inst70000022: {kind: TypeComponentOf, arg0: inst70000020, type: type(TypeType)} +// CHECK:STDOUT: inst70000023: {kind: PatternType, arg0: inst70000022, type: type(TypeType)} +// CHECK:STDOUT: inst70000024: {kind: OutFormParamPatternAction, arg0: inst7000001F, type: type(inst(InstType))} +// CHECK:STDOUT: inst70000025: {kind: SpliceInst, arg0: inst70000024, type: type(symbolic_constant7000000A)} +// CHECK:STDOUT: inst70000026: {kind: SpliceInst, arg0: inst70000024, type: type(symbolic_constant70000006)} +// CHECK:STDOUT: inst70000027: {kind: TypeComponentOf, arg0: inst70000021, type: type(TypeType)} +// CHECK:STDOUT: inst70000028: {kind: SpliceInst, arg0: inst70000024, type: type(symbolic_constant7000000A)} +// CHECK:STDOUT: inst70000029: {kind: ReturnSlotPattern, arg0: inst70000025, arg1: inst70000022, type: type(symbolic_constant7000000C)} +// CHECK:STDOUT: inst7000002A: {kind: PatternType, arg0: inst70000027, type: type(TypeType)} +// CHECK:STDOUT: inst7000002B: {kind: SpliceBlock, arg0: inst_block70000005, arg1: inst70000017, type: type(TypeType)} +// CHECK:STDOUT: inst7000002C: {kind: CalleePatternMatchAction, arg0: bundle70000000, type: type(inst(InstType))} +// CHECK:STDOUT: inst7000002D: {kind: SpliceInst, arg0: inst7000002C, type: type(symbolic_constant7000000A)} +// CHECK:STDOUT: inst7000002E: {kind: ReturnSlot, arg0: inst70000022, arg1: inst7000002D, type: type(symbolic_constant7000000A)} +// CHECK:STDOUT: inst7000002F: {kind: FunctionDecl, arg0: function70000000, arg1: inst_block7000000A, type: type(inst70000037)} +// CHECK:STDOUT: inst70000030: {kind: RefineFormAction, arg0: inst7000001A, type: type(inst(InstType))} +// CHECK:STDOUT: inst70000031: {kind: SpliceInst, arg0: inst70000030, type: type(inst(FormType))} +// CHECK:STDOUT: inst70000032: {kind: OutFormParamPatternAction, arg0: inst70000031, type: type(inst(InstType))} +// CHECK:STDOUT: inst70000033: {kind: TypeComponentOf, arg0: inst70000031, type: type(TypeType)} +// CHECK:STDOUT: inst70000034: {kind: SpliceInst, arg0: inst70000032, type: type(symbolic_constant70000011)} +// CHECK:STDOUT: inst70000035: {kind: PatternType, arg0: inst70000033, type: type(TypeType)} +// CHECK:STDOUT: inst70000036: {kind: CalleePatternMatchAction, arg0: bundle70000001, type: type(inst(InstType))} +// CHECK:STDOUT: inst70000037: {kind: FunctionType, arg0: function70000000, arg1: specific, type: type(TypeType)} +// CHECK:STDOUT: inst70000038: {kind: TupleType, arg0: inst_block_empty, type: type(TypeType)} +// CHECK:STDOUT: inst70000039: {kind: StructValue, arg0: inst_block_empty, type: type(inst70000037)} // CHECK:STDOUT: bundles: -// CHECK:STDOUT: bundle70000000: {arg0: inst70000031, arg1: call_param0} -// CHECK:STDOUT: bundle70000001: {arg0: inst70000040, arg1: call_param0} +// CHECK:STDOUT: bundle70000000: {arg0: inst70000025, arg1: call_param0} +// CHECK:STDOUT: bundle70000001: {arg0: inst70000034, arg1: call_param0} // CHECK:STDOUT: constant_values: // CHECK:STDOUT: values: // CHECK:STDOUT: instF: concrete_constant(instF) @@ -161,140 +143,118 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: inst70000013: symbolic_constant70000000 // CHECK:STDOUT: inst70000014: symbolic_constant70000000 // CHECK:STDOUT: inst70000015: concrete_constant(inst70000011) -// CHECK:STDOUT: inst70000016: concrete_constant(inst70000019) -// CHECK:STDOUT: inst70000017: concrete_constant(inst70000019) +// CHECK:STDOUT: inst70000016: concrete_constant(inst(FormType)) +// CHECK:STDOUT: inst70000017: concrete_constant(inst(FormType)) // CHECK:STDOUT: inst70000018: concrete_constant(inst70000018) -// CHECK:STDOUT: inst70000019: concrete_constant(inst70000019) -// CHECK:STDOUT: inst7000001A: concrete_constant(inst7000001A) -// CHECK:STDOUT: inst7000001B: concrete_constant(inst7000001B) +// CHECK:STDOUT: inst70000019: symbolic_constant70000002 +// CHECK:STDOUT: inst7000001A: symbolic_constant70000001 +// CHECK:STDOUT: inst7000001B: symbolic_constant70000002 // CHECK:STDOUT: inst7000001C: concrete_constant(inst7000001C) -// CHECK:STDOUT: inst7000001D: concrete_constant(inst7000001D) -// CHECK:STDOUT: inst7000001E: concrete_constant(inst(TypeType)) -// CHECK:STDOUT: inst7000001F: concrete_constant(inst7000001D) -// CHECK:STDOUT: inst70000020: concrete_constant(inst70000019) -// CHECK:STDOUT: inst70000021: concrete_constant(inst(FormType)) -// CHECK:STDOUT: inst70000022: concrete_constant(inst(FormType)) -// CHECK:STDOUT: inst70000023: concrete_constant(inst(FormType)) -// CHECK:STDOUT: inst70000024: concrete_constant(inst70000024) -// CHECK:STDOUT: inst70000025: symbolic_constant70000002 -// CHECK:STDOUT: inst70000026: symbolic_constant70000001 -// CHECK:STDOUT: inst70000027: symbolic_constant70000002 -// CHECK:STDOUT: inst70000028: concrete_constant(inst70000028) -// CHECK:STDOUT: inst70000029: symbolic_constant70000002 -// CHECK:STDOUT: inst7000002A: symbolic_constant70000003 -// CHECK:STDOUT: inst7000002B: symbolic_constant70000005 -// CHECK:STDOUT: inst7000002C: symbolic_constant70000004 -// CHECK:STDOUT: inst7000002D: symbolic_constant70000005 -// CHECK:STDOUT: inst7000002E: symbolic_constant70000006 -// CHECK:STDOUT: inst7000002F: symbolic_constant70000007 -// CHECK:STDOUT: inst70000030: symbolic_constant70000008 -// CHECK:STDOUT: inst70000031: symbolic_constant7000000B -// CHECK:STDOUT: inst70000032: symbolic_constant70000009 -// CHECK:STDOUT: inst70000033: symbolic_constant7000000A -// CHECK:STDOUT: inst70000034: symbolic_constant7000000B -// CHECK:STDOUT: inst70000035: concrete_constant(inst70000035) -// CHECK:STDOUT: inst70000036: symbolic_constant7000000C -// CHECK:STDOUT: inst70000037: concrete_constant(inst(FormType)) -// CHECK:STDOUT: inst70000038: symbolic_constant7000000D -// CHECK:STDOUT: inst7000003B: concrete_constant(inst70000045) -// CHECK:STDOUT: inst7000003C: symbolic_constant7000000E -// CHECK:STDOUT: inst7000003D: symbolic_constant7000000F -// CHECK:STDOUT: inst7000003E: symbolic_constant70000010 -// CHECK:STDOUT: inst7000003F: symbolic_constant70000011 -// CHECK:STDOUT: inst70000040: symbolic_constant70000012 -// CHECK:STDOUT: inst70000041: symbolic_constant70000013 -// CHECK:STDOUT: inst70000042: symbolic_constant70000014 -// CHECK:STDOUT: inst70000043: concrete_constant(inst70000043) -// CHECK:STDOUT: inst70000044: concrete_constant(inst70000044) -// CHECK:STDOUT: inst70000045: concrete_constant(inst70000045) +// CHECK:STDOUT: inst7000001D: symbolic_constant70000002 +// CHECK:STDOUT: inst7000001E: symbolic_constant70000003 +// CHECK:STDOUT: inst7000001F: symbolic_constant70000005 +// CHECK:STDOUT: inst70000020: symbolic_constant70000004 +// CHECK:STDOUT: inst70000021: symbolic_constant70000005 +// CHECK:STDOUT: inst70000022: symbolic_constant70000006 +// CHECK:STDOUT: inst70000023: symbolic_constant70000007 +// CHECK:STDOUT: inst70000024: symbolic_constant70000008 +// CHECK:STDOUT: inst70000025: symbolic_constant7000000B +// CHECK:STDOUT: inst70000026: symbolic_constant70000009 +// CHECK:STDOUT: inst70000027: symbolic_constant7000000A +// CHECK:STDOUT: inst70000028: symbolic_constant7000000B +// CHECK:STDOUT: inst70000029: concrete_constant(inst70000029) +// CHECK:STDOUT: inst7000002A: symbolic_constant7000000C +// CHECK:STDOUT: inst7000002B: concrete_constant(inst(FormType)) +// CHECK:STDOUT: inst7000002C: symbolic_constant7000000D +// CHECK:STDOUT: inst7000002F: concrete_constant(inst70000039) +// CHECK:STDOUT: inst70000030: symbolic_constant7000000E +// CHECK:STDOUT: inst70000031: symbolic_constant7000000F +// CHECK:STDOUT: inst70000032: symbolic_constant70000010 +// CHECK:STDOUT: inst70000033: symbolic_constant70000011 +// CHECK:STDOUT: inst70000034: symbolic_constant70000012 +// CHECK:STDOUT: inst70000035: symbolic_constant70000013 +// CHECK:STDOUT: inst70000036: symbolic_constant70000014 +// CHECK:STDOUT: inst70000037: concrete_constant(inst70000037) +// CHECK:STDOUT: inst70000038: concrete_constant(inst70000038) +// CHECK:STDOUT: inst70000039: concrete_constant(inst70000039) // CHECK:STDOUT: symbolic_constants: // CHECK:STDOUT: symbolic_constant70000000: {inst: inst70000014, kind: self, attached: null} -// CHECK:STDOUT: symbolic_constant70000001: {inst: inst70000026, kind: checked, attached: null} -// CHECK:STDOUT: symbolic_constant70000002: {inst: inst70000026, kind: checked, attached: {generic: generic70000000, index: generic_inst_in_decl0}} -// CHECK:STDOUT: symbolic_constant70000003: {inst: inst7000002A, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl1}} -// CHECK:STDOUT: symbolic_constant70000004: {inst: inst7000002C, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant70000005: {inst: inst7000002C, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl2}} -// CHECK:STDOUT: symbolic_constant70000006: {inst: inst7000002E, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant70000007: {inst: inst7000002F, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant70000008: {inst: inst70000030, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl3}} -// CHECK:STDOUT: symbolic_constant70000009: {inst: inst70000032, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant7000000A: {inst: inst7000002E, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl4}} -// CHECK:STDOUT: symbolic_constant7000000B: {inst: inst70000032, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl5}} -// CHECK:STDOUT: symbolic_constant7000000C: {inst: inst7000002F, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl6}} -// CHECK:STDOUT: symbolic_constant7000000D: {inst: inst70000038, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl7}} -// CHECK:STDOUT: symbolic_constant7000000E: {inst: inst7000003C, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant7000000F: {inst: inst7000003D, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant70000010: {inst: inst7000003E, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant70000011: {inst: inst7000003F, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant70000012: {inst: inst70000040, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant70000013: {inst: inst70000041, kind: template, attached: null} -// CHECK:STDOUT: symbolic_constant70000014: {inst: inst70000042, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000001: {inst: inst7000001A, kind: checked, attached: null} +// CHECK:STDOUT: symbolic_constant70000002: {inst: inst7000001A, kind: checked, attached: {generic: generic70000000, index: generic_inst_in_decl0}} +// CHECK:STDOUT: symbolic_constant70000003: {inst: inst7000001E, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl1}} +// CHECK:STDOUT: symbolic_constant70000004: {inst: inst70000020, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000005: {inst: inst70000020, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl2}} +// CHECK:STDOUT: symbolic_constant70000006: {inst: inst70000022, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000007: {inst: inst70000023, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000008: {inst: inst70000024, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl3}} +// CHECK:STDOUT: symbolic_constant70000009: {inst: inst70000026, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant7000000A: {inst: inst70000022, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl4}} +// CHECK:STDOUT: symbolic_constant7000000B: {inst: inst70000026, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl5}} +// CHECK:STDOUT: symbolic_constant7000000C: {inst: inst70000023, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl6}} +// CHECK:STDOUT: symbolic_constant7000000D: {inst: inst7000002C, kind: template, attached: {generic: generic70000000, index: generic_inst_in_decl7}} +// CHECK:STDOUT: symbolic_constant7000000E: {inst: inst70000030, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant7000000F: {inst: inst70000031, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000010: {inst: inst70000032, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000011: {inst: inst70000033, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000012: {inst: inst70000034, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000013: {inst: inst70000035, kind: template, attached: null} +// CHECK:STDOUT: symbolic_constant70000014: {inst: inst70000036, kind: template, attached: null} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: inst_block_empty: {} // CHECK:STDOUT: exports: -// CHECK:STDOUT: 0: inst7000003B +// CHECK:STDOUT: 0: inst7000002F // CHECK:STDOUT: generated: {} // CHECK:STDOUT: imports: // CHECK:STDOUT: 0: inst70000011 // CHECK:STDOUT: 1: inst70000016 -// CHECK:STDOUT: 2: inst70000017 -// CHECK:STDOUT: 3: inst7000001B -// CHECK:STDOUT: 4: inst7000001C -// CHECK:STDOUT: 5: inst7000001E -// CHECK:STDOUT: 6: inst7000001F // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: inst_block70000005: // CHECK:STDOUT: 0: inst70000013 // CHECK:STDOUT: 1: inst70000015 -// CHECK:STDOUT: 2: inst70000020 -// CHECK:STDOUT: 3: inst70000021 -// CHECK:STDOUT: 4: inst70000022 -// CHECK:STDOUT: 5: inst70000023 +// CHECK:STDOUT: 2: inst70000017 // CHECK:STDOUT: inst_block70000006: -// CHECK:STDOUT: 0: inst7000001B +// CHECK:STDOUT: 0: inst7000001C // CHECK:STDOUT: inst_block70000007: -// CHECK:STDOUT: 0: inst70000028 -// CHECK:STDOUT: inst_block70000008: -// CHECK:STDOUT: 0: inst70000031 -// CHECK:STDOUT: inst_block70000009: -// CHECK:STDOUT: 0: inst70000039 -// CHECK:STDOUT: inst_block7000000A: -// CHECK:STDOUT: 0: inst70000028 -// CHECK:STDOUT: 1: inst70000035 -// CHECK:STDOUT: inst_block7000000B: -// CHECK:STDOUT: 0: inst70000029 -// CHECK:STDOUT: 1: inst7000002B -// CHECK:STDOUT: 2: inst70000031 -// CHECK:STDOUT: 3: inst70000037 -// CHECK:STDOUT: 4: inst70000025 -// CHECK:STDOUT: 5: inst70000039 -// CHECK:STDOUT: 6: inst7000003A -// CHECK:STDOUT: inst_block7000000C: // CHECK:STDOUT: 0: inst70000025 +// CHECK:STDOUT: inst_block70000008: +// CHECK:STDOUT: 0: inst7000002D +// CHECK:STDOUT: inst_block70000009: +// CHECK:STDOUT: 0: inst7000001C +// CHECK:STDOUT: 1: inst70000029 +// CHECK:STDOUT: inst_block7000000A: +// CHECK:STDOUT: 0: inst7000001D +// CHECK:STDOUT: 1: inst7000001F +// CHECK:STDOUT: 2: inst70000025 +// CHECK:STDOUT: 3: inst7000002B +// CHECK:STDOUT: 4: inst70000019 +// CHECK:STDOUT: 5: inst7000002D +// CHECK:STDOUT: 6: inst7000002E +// CHECK:STDOUT: inst_block7000000B: +// CHECK:STDOUT: 0: inst70000019 +// CHECK:STDOUT: inst_block7000000C: +// CHECK:STDOUT: 0: inst7000001A // CHECK:STDOUT: inst_block7000000D: -// CHECK:STDOUT: 0: inst70000026 +// CHECK:STDOUT: 0: inst7000001B +// CHECK:STDOUT: 1: inst7000001E +// CHECK:STDOUT: 2: inst70000021 +// CHECK:STDOUT: 3: inst70000024 +// CHECK:STDOUT: 4: inst70000027 +// CHECK:STDOUT: 5: inst70000028 +// CHECK:STDOUT: 6: inst7000002A +// CHECK:STDOUT: 7: inst7000002C // CHECK:STDOUT: inst_block7000000E: -// CHECK:STDOUT: 0: inst70000027 -// CHECK:STDOUT: 1: inst7000002A -// CHECK:STDOUT: 2: inst7000002D -// CHECK:STDOUT: 3: inst70000030 +// CHECK:STDOUT: 0: inst7000001A +// CHECK:STDOUT: 1: inst70000030 +// CHECK:STDOUT: 2: inst70000031 +// CHECK:STDOUT: 3: inst70000032 // CHECK:STDOUT: 4: inst70000033 // CHECK:STDOUT: 5: inst70000034 -// CHECK:STDOUT: 6: inst70000036 -// CHECK:STDOUT: 7: inst70000038 +// CHECK:STDOUT: 6: inst70000035 +// CHECK:STDOUT: 7: inst70000036 // CHECK:STDOUT: inst_block7000000F: -// CHECK:STDOUT: 0: inst70000026 -// CHECK:STDOUT: 1: inst7000003C -// CHECK:STDOUT: 2: inst7000003D -// CHECK:STDOUT: 3: inst7000003E -// CHECK:STDOUT: 4: inst7000003F -// CHECK:STDOUT: 5: inst70000040 -// CHECK:STDOUT: 6: inst70000041 -// CHECK:STDOUT: 7: inst70000042 -// CHECK:STDOUT: inst_block70000010: // CHECK:STDOUT: 0: instF // CHECK:STDOUT: 1: inst70000010 -// CHECK:STDOUT: 2: inst7000003B +// CHECK:STDOUT: 2: inst7000002F // CHECK:STDOUT: value_stores: // CHECK:STDOUT: shared_values: // CHECK:STDOUT: ints: {} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index a920855f7bbd..f7508bb3c9e6 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -61,199 +61,199 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: import_ir_inst14: {ir_id: import_ir78000004, inst_id: inst70000033} // CHECK:STDOUT: import_ir_inst15: {ir_id: import_ir78000004, inst_id: inst70000012} // CHECK:STDOUT: import_ir_inst16: {ir_id: import_ir78000004, inst_id: inst7000002D} -// CHECK:STDOUT: import_ir_inst17: {ir_id: import_ir78000004, inst_id: inst70000072} -// CHECK:STDOUT: import_ir_inst18: {ir_id: import_ir78000004, inst_id: inst70000070} -// CHECK:STDOUT: import_ir_inst19: {ir_id: import_ir78000004, inst_id: inst70000089} -// CHECK:STDOUT: import_ir_inst1A: {ir_id: import_ir78000004, inst_id: inst70000071} -// CHECK:STDOUT: import_ir_inst1B: {ir_id: import_ir78000004, inst_id: inst70000089} -// CHECK:STDOUT: import_ir_inst1C: {ir_id: import_ir78000004, inst_id: inst70000084} -// CHECK:STDOUT: import_ir_inst1D: {ir_id: import_ir78000004, inst_id: inst70000085} -// CHECK:STDOUT: import_ir_inst1E: {ir_id: import_ir78000004, inst_id: inst7000007C} -// CHECK:STDOUT: import_ir_inst1F: {ir_id: import_ir78000004, inst_id: inst7000007F} -// CHECK:STDOUT: import_ir_inst20: {ir_id: import_ir78000004, inst_id: inst70000080} -// CHECK:STDOUT: import_ir_inst21: {ir_id: import_ir78000004, inst_id: inst70000081} -// CHECK:STDOUT: import_ir_inst22: {ir_id: import_ir78000004, inst_id: inst70000062} -// CHECK:STDOUT: import_ir_inst23: {ir_id: import_ir78000004, inst_id: inst70000078} -// CHECK:STDOUT: import_ir_inst24: {ir_id: import_ir78000004, inst_id: inst70000079} -// CHECK:STDOUT: import_ir_inst25: {ir_id: import_ir78000004, inst_id: inst7000007A} -// CHECK:STDOUT: import_ir_inst26: {ir_id: import_ir78000004, inst_id: inst7000007D} -// CHECK:STDOUT: import_ir_inst27: {ir_id: import_ir78000004, inst_id: inst70000083} -// CHECK:STDOUT: import_ir_inst28: {ir_id: import_ir78000004, inst_id: inst70000093} -// CHECK:STDOUT: import_ir_inst29: {ir_id: import_ir78000004, inst_id: inst7000009A} -// CHECK:STDOUT: import_ir_inst2A: {ir_id: import_ir78000004, inst_id: inst700000A6} -// CHECK:STDOUT: import_ir_inst2B: {ir_id: import_ir78000004, inst_id: inst700000A7} -// CHECK:STDOUT: import_ir_inst2C: {ir_id: import_ir78000004, inst_id: inst700000A8} -// CHECK:STDOUT: import_ir_inst2D: {ir_id: import_ir78000004, inst_id: inst700000A9} -// CHECK:STDOUT: import_ir_inst2E: {ir_id: import_ir78000004, inst_id: inst700000AF} -// CHECK:STDOUT: import_ir_inst2F: {ir_id: import_ir78000004, inst_id: inst70000065} -// CHECK:STDOUT: import_ir_inst30: {ir_id: import_ir78000004, inst_id: inst7000006B} -// CHECK:STDOUT: import_ir_inst31: {ir_id: import_ir78000004, inst_id: inst7000006E} -// CHECK:STDOUT: import_ir_inst32: {ir_id: import_ir78000004, inst_id: inst70000062} -// CHECK:STDOUT: import_ir_inst33: {ir_id: import_ir78000004, inst_id: inst70000064} -// CHECK:STDOUT: import_ir_inst34: {ir_id: import_ir78000004, inst_id: inst70000069} -// CHECK:STDOUT: import_ir_inst35: {ir_id: import_ir78000004, inst_id: inst7000006D} -// CHECK:STDOUT: import_ir_inst36: {ir_id: import_ir78000004, inst_id: inst70000074} -// CHECK:STDOUT: import_ir_inst37: {ir_id: import_ir78000004, inst_id: inst7000008C} -// CHECK:STDOUT: import_ir_inst38: {ir_id: import_ir78000004, inst_id: inst7000008D} -// CHECK:STDOUT: import_ir_inst39: {ir_id: import_ir78000004, inst_id: inst700000C2} -// CHECK:STDOUT: import_ir_inst3A: {ir_id: import_ir78000004, inst_id: inst700000C0} -// CHECK:STDOUT: import_ir_inst3B: {ir_id: import_ir78000004, inst_id: inst700000BE} -// CHECK:STDOUT: import_ir_inst3C: {ir_id: import_ir78000004, inst_id: inst700000BF} -// CHECK:STDOUT: import_ir_inst3D: {ir_id: import_ir78000004, inst_id: inst700000DE} -// CHECK:STDOUT: import_ir_inst3E: {ir_id: import_ir78000004, inst_id: inst700000DC} -// CHECK:STDOUT: import_ir_inst3F: {ir_id: import_ir78000004, inst_id: inst700000DA} -// CHECK:STDOUT: import_ir_inst40: {ir_id: import_ir78000004, inst_id: inst700000DB} -// CHECK:STDOUT: import_ir_inst41: {ir_id: import_ir78000004, inst_id: inst700000FA} -// CHECK:STDOUT: import_ir_inst42: {ir_id: import_ir78000004, inst_id: inst700000F8} -// CHECK:STDOUT: import_ir_inst43: {ir_id: import_ir78000004, inst_id: inst700000F6} -// CHECK:STDOUT: import_ir_inst44: {ir_id: import_ir78000004, inst_id: inst700000F7} -// CHECK:STDOUT: import_ir_inst45: {ir_id: import_ir78000004, inst_id: inst70000116} -// CHECK:STDOUT: import_ir_inst46: {ir_id: import_ir78000004, inst_id: inst70000114} -// CHECK:STDOUT: import_ir_inst47: {ir_id: import_ir78000004, inst_id: inst70000112} -// CHECK:STDOUT: import_ir_inst48: {ir_id: import_ir78000004, inst_id: inst70000113} -// CHECK:STDOUT: import_ir_inst49: {ir_id: import_ir78000004, inst_id: inst70000139} -// CHECK:STDOUT: import_ir_inst4A: {ir_id: import_ir78000004, inst_id: inst70000137} -// CHECK:STDOUT: import_ir_inst4B: {ir_id: import_ir78000004, inst_id: inst7000014D} -// CHECK:STDOUT: import_ir_inst4C: {ir_id: import_ir78000004, inst_id: inst70000138} -// CHECK:STDOUT: import_ir_inst4D: {ir_id: import_ir78000004, inst_id: inst70000130} -// CHECK:STDOUT: import_ir_inst4E: {ir_id: import_ir78000004, inst_id: inst70000132} -// CHECK:STDOUT: import_ir_inst4F: {ir_id: import_ir78000004, inst_id: inst70000135} -// CHECK:STDOUT: import_ir_inst50: {ir_id: import_ir78000004, inst_id: inst7000012D} -// CHECK:STDOUT: import_ir_inst51: {ir_id: import_ir78000004, inst_id: inst7000012F} -// CHECK:STDOUT: import_ir_inst52: {ir_id: import_ir78000004, inst_id: inst70000134} -// CHECK:STDOUT: import_ir_inst53: {ir_id: import_ir78000004, inst_id: inst7000013B} -// CHECK:STDOUT: import_ir_inst54: {ir_id: import_ir78000004, inst_id: inst7000014D} -// CHECK:STDOUT: import_ir_inst55: {ir_id: import_ir78000004, inst_id: inst70000148} -// CHECK:STDOUT: import_ir_inst56: {ir_id: import_ir78000004, inst_id: inst70000149} -// CHECK:STDOUT: import_ir_inst57: {ir_id: import_ir78000004, inst_id: inst70000140} -// CHECK:STDOUT: import_ir_inst58: {ir_id: import_ir78000004, inst_id: inst70000143} -// CHECK:STDOUT: import_ir_inst59: {ir_id: import_ir78000004, inst_id: inst70000144} -// CHECK:STDOUT: import_ir_inst5A: {ir_id: import_ir78000004, inst_id: inst70000145} -// CHECK:STDOUT: import_ir_inst5B: {ir_id: import_ir78000004, inst_id: inst7000012D} -// CHECK:STDOUT: import_ir_inst5C: {ir_id: import_ir78000004, inst_id: inst7000013D} -// CHECK:STDOUT: import_ir_inst5D: {ir_id: import_ir78000004, inst_id: inst7000013E} -// CHECK:STDOUT: import_ir_inst5E: {ir_id: import_ir78000004, inst_id: inst70000141} -// CHECK:STDOUT: import_ir_inst5F: {ir_id: import_ir78000004, inst_id: inst70000147} -// CHECK:STDOUT: import_ir_inst60: {ir_id: import_ir78000004, inst_id: inst70000150} -// CHECK:STDOUT: import_ir_inst61: {ir_id: import_ir78000004, inst_id: inst70000151} -// CHECK:STDOUT: import_ir_inst62: {ir_id: import_ir78000004, inst_id: inst70000154} -// CHECK:STDOUT: import_ir_inst63: {ir_id: import_ir78000004, inst_id: inst7000015C} -// CHECK:STDOUT: import_ir_inst64: {ir_id: import_ir78000004, inst_id: inst7000015A} -// CHECK:STDOUT: import_ir_inst65: {ir_id: import_ir78000004, inst_id: inst70000158} -// CHECK:STDOUT: import_ir_inst66: {ir_id: import_ir78000004, inst_id: inst70000159} -// CHECK:STDOUT: import_ir_inst67: {ir_id: import_ir78000004, inst_id: inst70000175} -// CHECK:STDOUT: import_ir_inst68: {ir_id: import_ir78000004, inst_id: inst70000173} -// CHECK:STDOUT: import_ir_inst69: {ir_id: import_ir78000004, inst_id: inst70000171} -// CHECK:STDOUT: import_ir_inst6A: {ir_id: import_ir78000004, inst_id: inst70000172} -// CHECK:STDOUT: import_ir_inst6B: {ir_id: import_ir78000004, inst_id: inst700001AB} -// CHECK:STDOUT: import_ir_inst6C: {ir_id: import_ir78000004, inst_id: inst700001A9} -// CHECK:STDOUT: import_ir_inst6D: {ir_id: import_ir78000004, inst_id: inst700001C6} -// CHECK:STDOUT: import_ir_inst6E: {ir_id: import_ir78000004, inst_id: inst700001AA} -// CHECK:STDOUT: import_ir_inst6F: {ir_id: import_ir78000004, inst_id: inst700001C6} -// CHECK:STDOUT: import_ir_inst70: {ir_id: import_ir78000004, inst_id: inst700001C1} -// CHECK:STDOUT: import_ir_inst71: {ir_id: import_ir78000004, inst_id: inst700001C2} -// CHECK:STDOUT: import_ir_inst72: {ir_id: import_ir78000004, inst_id: inst700001B9} -// CHECK:STDOUT: import_ir_inst73: {ir_id: import_ir78000004, inst_id: inst700001BC} -// CHECK:STDOUT: import_ir_inst74: {ir_id: import_ir78000004, inst_id: inst700001BD} -// CHECK:STDOUT: import_ir_inst75: {ir_id: import_ir78000004, inst_id: inst700001BE} -// CHECK:STDOUT: import_ir_inst76: {ir_id: import_ir78000004, inst_id: inst7000018C} -// CHECK:STDOUT: import_ir_inst77: {ir_id: import_ir78000004, inst_id: inst70000191} -// CHECK:STDOUT: import_ir_inst78: {ir_id: import_ir78000004, inst_id: inst700001B3} -// CHECK:STDOUT: import_ir_inst79: {ir_id: import_ir78000004, inst_id: inst700001B4} -// CHECK:STDOUT: import_ir_inst7A: {ir_id: import_ir78000004, inst_id: inst700001B5} -// CHECK:STDOUT: import_ir_inst7B: {ir_id: import_ir78000004, inst_id: inst700001B6} -// CHECK:STDOUT: import_ir_inst7C: {ir_id: import_ir78000004, inst_id: inst700001B7} -// CHECK:STDOUT: import_ir_inst7D: {ir_id: import_ir78000004, inst_id: inst700001BA} -// CHECK:STDOUT: import_ir_inst7E: {ir_id: import_ir78000004, inst_id: inst700001C0} -// CHECK:STDOUT: import_ir_inst7F: {ir_id: import_ir78000004, inst_id: inst700001D1} -// CHECK:STDOUT: import_ir_inst80: {ir_id: import_ir78000004, inst_id: inst700001D7} -// CHECK:STDOUT: import_ir_inst81: {ir_id: import_ir78000004, inst_id: inst700001DB} -// CHECK:STDOUT: import_ir_inst82: {ir_id: import_ir78000004, inst_id: inst700001DC} -// CHECK:STDOUT: import_ir_inst83: {ir_id: import_ir78000004, inst_id: inst700001DD} -// CHECK:STDOUT: import_ir_inst84: {ir_id: import_ir78000004, inst_id: inst700001DE} -// CHECK:STDOUT: import_ir_inst85: {ir_id: import_ir78000004, inst_id: inst700001E1} -// CHECK:STDOUT: import_ir_inst86: {ir_id: import_ir78000004, inst_id: inst700001EB} -// CHECK:STDOUT: import_ir_inst87: {ir_id: import_ir78000004, inst_id: inst700001F4} -// CHECK:STDOUT: import_ir_inst88: {ir_id: import_ir78000004, inst_id: inst700001F5} -// CHECK:STDOUT: import_ir_inst89: {ir_id: import_ir78000004, inst_id: inst700001F6} -// CHECK:STDOUT: import_ir_inst8A: {ir_id: import_ir78000004, inst_id: inst700001F7} -// CHECK:STDOUT: import_ir_inst8B: {ir_id: import_ir78000004, inst_id: inst700001FD} -// CHECK:STDOUT: import_ir_inst8C: {ir_id: import_ir78000004, inst_id: inst70000194} -// CHECK:STDOUT: import_ir_inst8D: {ir_id: import_ir78000004, inst_id: inst7000018E} -// CHECK:STDOUT: import_ir_inst8E: {ir_id: import_ir78000004, inst_id: inst700001A4} -// CHECK:STDOUT: import_ir_inst8F: {ir_id: import_ir78000004, inst_id: inst700001A6} -// CHECK:STDOUT: import_ir_inst90: {ir_id: import_ir78000004, inst_id: inst7000018C} -// CHECK:STDOUT: import_ir_inst91: {ir_id: import_ir78000004, inst_id: inst70000191} -// CHECK:STDOUT: import_ir_inst92: {ir_id: import_ir78000004, inst_id: inst7000018D} -// CHECK:STDOUT: import_ir_inst93: {ir_id: import_ir78000004, inst_id: inst70000193} -// CHECK:STDOUT: import_ir_inst94: {ir_id: import_ir78000004, inst_id: inst7000019A} -// CHECK:STDOUT: import_ir_inst95: {ir_id: import_ir78000004, inst_id: inst7000019D} -// CHECK:STDOUT: import_ir_inst96: {ir_id: import_ir78000004, inst_id: inst700001A1} -// CHECK:STDOUT: import_ir_inst97: {ir_id: import_ir78000004, inst_id: inst700001A5} -// CHECK:STDOUT: import_ir_inst98: {ir_id: import_ir78000004, inst_id: inst700001AD} -// CHECK:STDOUT: import_ir_inst99: {ir_id: import_ir78000004, inst_id: inst700001C9} -// CHECK:STDOUT: import_ir_inst9A: {ir_id: import_ir78000004, inst_id: inst700001CA} -// CHECK:STDOUT: import_ir_inst9B: {ir_id: import_ir78000004, inst_id: inst70000237} -// CHECK:STDOUT: import_ir_inst9C: {ir_id: import_ir78000004, inst_id: inst70000235} -// CHECK:STDOUT: import_ir_inst9D: {ir_id: import_ir78000004, inst_id: inst70000256} -// CHECK:STDOUT: import_ir_inst9E: {ir_id: import_ir78000004, inst_id: inst70000236} -// CHECK:STDOUT: import_ir_inst9F: {ir_id: import_ir78000004, inst_id: inst70000256} -// CHECK:STDOUT: import_ir_instA0: {ir_id: import_ir78000004, inst_id: inst70000251} -// CHECK:STDOUT: import_ir_instA1: {ir_id: import_ir78000004, inst_id: inst70000252} -// CHECK:STDOUT: import_ir_instA2: {ir_id: import_ir78000004, inst_id: inst70000249} -// CHECK:STDOUT: import_ir_instA3: {ir_id: import_ir78000004, inst_id: inst7000024C} -// CHECK:STDOUT: import_ir_instA4: {ir_id: import_ir78000004, inst_id: inst7000024D} -// CHECK:STDOUT: import_ir_instA5: {ir_id: import_ir78000004, inst_id: inst7000024E} -// CHECK:STDOUT: import_ir_instA6: {ir_id: import_ir78000004, inst_id: inst7000020E} -// CHECK:STDOUT: import_ir_instA7: {ir_id: import_ir78000004, inst_id: inst70000213} -// CHECK:STDOUT: import_ir_instA8: {ir_id: import_ir78000004, inst_id: inst70000218} -// CHECK:STDOUT: import_ir_instA9: {ir_id: import_ir78000004, inst_id: inst70000241} -// CHECK:STDOUT: import_ir_instAA: {ir_id: import_ir78000004, inst_id: inst70000242} -// CHECK:STDOUT: import_ir_instAB: {ir_id: import_ir78000004, inst_id: inst70000243} -// CHECK:STDOUT: import_ir_instAC: {ir_id: import_ir78000004, inst_id: inst70000244} -// CHECK:STDOUT: import_ir_instAD: {ir_id: import_ir78000004, inst_id: inst70000245} -// CHECK:STDOUT: import_ir_instAE: {ir_id: import_ir78000004, inst_id: inst70000246} -// CHECK:STDOUT: import_ir_instAF: {ir_id: import_ir78000004, inst_id: inst70000247} -// CHECK:STDOUT: import_ir_instB0: {ir_id: import_ir78000004, inst_id: inst7000024A} -// CHECK:STDOUT: import_ir_instB1: {ir_id: import_ir78000004, inst_id: inst70000250} -// CHECK:STDOUT: import_ir_instB2: {ir_id: import_ir78000004, inst_id: inst70000261} -// CHECK:STDOUT: import_ir_instB3: {ir_id: import_ir78000004, inst_id: inst70000266} -// CHECK:STDOUT: import_ir_instB4: {ir_id: import_ir78000004, inst_id: inst7000026A} -// CHECK:STDOUT: import_ir_instB5: {ir_id: import_ir78000004, inst_id: inst7000026B} -// CHECK:STDOUT: import_ir_instB6: {ir_id: import_ir78000004, inst_id: inst7000026C} -// CHECK:STDOUT: import_ir_instB7: {ir_id: import_ir78000004, inst_id: inst7000026D} -// CHECK:STDOUT: import_ir_instB8: {ir_id: import_ir78000004, inst_id: inst70000270} -// CHECK:STDOUT: import_ir_instB9: {ir_id: import_ir78000004, inst_id: inst70000278} -// CHECK:STDOUT: import_ir_instBA: {ir_id: import_ir78000004, inst_id: inst7000027C} -// CHECK:STDOUT: import_ir_instBB: {ir_id: import_ir78000004, inst_id: inst7000027D} -// CHECK:STDOUT: import_ir_instBC: {ir_id: import_ir78000004, inst_id: inst7000027E} -// CHECK:STDOUT: import_ir_instBD: {ir_id: import_ir78000004, inst_id: inst7000027F} -// CHECK:STDOUT: import_ir_instBE: {ir_id: import_ir78000004, inst_id: inst70000282} -// CHECK:STDOUT: import_ir_instBF: {ir_id: import_ir78000004, inst_id: inst7000028C} -// CHECK:STDOUT: import_ir_instC0: {ir_id: import_ir78000004, inst_id: inst70000295} -// CHECK:STDOUT: import_ir_instC1: {ir_id: import_ir78000004, inst_id: inst70000296} -// CHECK:STDOUT: import_ir_instC2: {ir_id: import_ir78000004, inst_id: inst70000297} -// CHECK:STDOUT: import_ir_instC3: {ir_id: import_ir78000004, inst_id: inst70000298} -// CHECK:STDOUT: import_ir_instC4: {ir_id: import_ir78000004, inst_id: inst7000029E} -// CHECK:STDOUT: import_ir_instC5: {ir_id: import_ir78000004, inst_id: inst7000021B} -// CHECK:STDOUT: import_ir_instC6: {ir_id: import_ir78000004, inst_id: inst70000215} -// CHECK:STDOUT: import_ir_instC7: {ir_id: import_ir78000004, inst_id: inst70000210} -// CHECK:STDOUT: import_ir_instC8: {ir_id: import_ir78000004, inst_id: inst7000022F} -// CHECK:STDOUT: import_ir_instC9: {ir_id: import_ir78000004, inst_id: inst70000231} -// CHECK:STDOUT: import_ir_instCA: {ir_id: import_ir78000004, inst_id: inst7000020E} -// CHECK:STDOUT: import_ir_instCB: {ir_id: import_ir78000004, inst_id: inst70000213} -// CHECK:STDOUT: import_ir_instCC: {ir_id: import_ir78000004, inst_id: inst70000218} -// CHECK:STDOUT: import_ir_instCD: {ir_id: import_ir78000004, inst_id: inst7000020F} -// CHECK:STDOUT: import_ir_instCE: {ir_id: import_ir78000004, inst_id: inst70000214} -// CHECK:STDOUT: import_ir_instCF: {ir_id: import_ir78000004, inst_id: inst7000021A} -// CHECK:STDOUT: import_ir_instD0: {ir_id: import_ir78000004, inst_id: inst70000222} -// CHECK:STDOUT: import_ir_instD1: {ir_id: import_ir78000004, inst_id: inst70000225} -// CHECK:STDOUT: import_ir_instD2: {ir_id: import_ir78000004, inst_id: inst70000228} -// CHECK:STDOUT: import_ir_instD3: {ir_id: import_ir78000004, inst_id: inst7000022C} -// CHECK:STDOUT: import_ir_instD4: {ir_id: import_ir78000004, inst_id: inst70000230} -// CHECK:STDOUT: import_ir_instD5: {ir_id: import_ir78000004, inst_id: inst70000239} -// CHECK:STDOUT: import_ir_instD6: {ir_id: import_ir78000004, inst_id: inst70000259} -// CHECK:STDOUT: import_ir_instD7: {ir_id: import_ir78000004, inst_id: inst7000025A} +// CHECK:STDOUT: import_ir_inst17: {ir_id: import_ir78000004, inst_id: inst70000086} +// CHECK:STDOUT: import_ir_inst18: {ir_id: import_ir78000004, inst_id: inst70000084} +// CHECK:STDOUT: import_ir_inst19: {ir_id: import_ir78000004, inst_id: inst7000009D} +// CHECK:STDOUT: import_ir_inst1A: {ir_id: import_ir78000004, inst_id: inst70000085} +// CHECK:STDOUT: import_ir_inst1B: {ir_id: import_ir78000004, inst_id: inst7000009D} +// CHECK:STDOUT: import_ir_inst1C: {ir_id: import_ir78000004, inst_id: inst70000098} +// CHECK:STDOUT: import_ir_inst1D: {ir_id: import_ir78000004, inst_id: inst70000099} +// CHECK:STDOUT: import_ir_inst1E: {ir_id: import_ir78000004, inst_id: inst70000090} +// CHECK:STDOUT: import_ir_inst1F: {ir_id: import_ir78000004, inst_id: inst70000093} +// CHECK:STDOUT: import_ir_inst20: {ir_id: import_ir78000004, inst_id: inst70000094} +// CHECK:STDOUT: import_ir_inst21: {ir_id: import_ir78000004, inst_id: inst70000095} +// CHECK:STDOUT: import_ir_inst22: {ir_id: import_ir78000004, inst_id: inst70000076} +// CHECK:STDOUT: import_ir_inst23: {ir_id: import_ir78000004, inst_id: inst7000008C} +// CHECK:STDOUT: import_ir_inst24: {ir_id: import_ir78000004, inst_id: inst7000008D} +// CHECK:STDOUT: import_ir_inst25: {ir_id: import_ir78000004, inst_id: inst7000008E} +// CHECK:STDOUT: import_ir_inst26: {ir_id: import_ir78000004, inst_id: inst70000091} +// CHECK:STDOUT: import_ir_inst27: {ir_id: import_ir78000004, inst_id: inst70000097} +// CHECK:STDOUT: import_ir_inst28: {ir_id: import_ir78000004, inst_id: inst700000A7} +// CHECK:STDOUT: import_ir_inst29: {ir_id: import_ir78000004, inst_id: inst700000AE} +// CHECK:STDOUT: import_ir_inst2A: {ir_id: import_ir78000004, inst_id: inst700000BA} +// CHECK:STDOUT: import_ir_inst2B: {ir_id: import_ir78000004, inst_id: inst700000BB} +// CHECK:STDOUT: import_ir_inst2C: {ir_id: import_ir78000004, inst_id: inst700000BC} +// CHECK:STDOUT: import_ir_inst2D: {ir_id: import_ir78000004, inst_id: inst700000BD} +// CHECK:STDOUT: import_ir_inst2E: {ir_id: import_ir78000004, inst_id: inst700000C3} +// CHECK:STDOUT: import_ir_inst2F: {ir_id: import_ir78000004, inst_id: inst70000079} +// CHECK:STDOUT: import_ir_inst30: {ir_id: import_ir78000004, inst_id: inst7000007F} +// CHECK:STDOUT: import_ir_inst31: {ir_id: import_ir78000004, inst_id: inst70000082} +// CHECK:STDOUT: import_ir_inst32: {ir_id: import_ir78000004, inst_id: inst70000076} +// CHECK:STDOUT: import_ir_inst33: {ir_id: import_ir78000004, inst_id: inst70000078} +// CHECK:STDOUT: import_ir_inst34: {ir_id: import_ir78000004, inst_id: inst7000007D} +// CHECK:STDOUT: import_ir_inst35: {ir_id: import_ir78000004, inst_id: inst70000081} +// CHECK:STDOUT: import_ir_inst36: {ir_id: import_ir78000004, inst_id: inst70000088} +// CHECK:STDOUT: import_ir_inst37: {ir_id: import_ir78000004, inst_id: inst700000A0} +// CHECK:STDOUT: import_ir_inst38: {ir_id: import_ir78000004, inst_id: inst700000A1} +// CHECK:STDOUT: import_ir_inst39: {ir_id: import_ir78000004, inst_id: inst700000D3} +// CHECK:STDOUT: import_ir_inst3A: {ir_id: import_ir78000004, inst_id: inst700000D1} +// CHECK:STDOUT: import_ir_inst3B: {ir_id: import_ir78000004, inst_id: inst700000CF} +// CHECK:STDOUT: import_ir_inst3C: {ir_id: import_ir78000004, inst_id: inst700000D0} +// CHECK:STDOUT: import_ir_inst3D: {ir_id: import_ir78000004, inst_id: inst700000EC} +// CHECK:STDOUT: import_ir_inst3E: {ir_id: import_ir78000004, inst_id: inst700000EA} +// CHECK:STDOUT: import_ir_inst3F: {ir_id: import_ir78000004, inst_id: inst700000E8} +// CHECK:STDOUT: import_ir_inst40: {ir_id: import_ir78000004, inst_id: inst700000E9} +// CHECK:STDOUT: import_ir_inst41: {ir_id: import_ir78000004, inst_id: inst70000105} +// CHECK:STDOUT: import_ir_inst42: {ir_id: import_ir78000004, inst_id: inst70000103} +// CHECK:STDOUT: import_ir_inst43: {ir_id: import_ir78000004, inst_id: inst70000101} +// CHECK:STDOUT: import_ir_inst44: {ir_id: import_ir78000004, inst_id: inst70000102} +// CHECK:STDOUT: import_ir_inst45: {ir_id: import_ir78000004, inst_id: inst7000011E} +// CHECK:STDOUT: import_ir_inst46: {ir_id: import_ir78000004, inst_id: inst7000011C} +// CHECK:STDOUT: import_ir_inst47: {ir_id: import_ir78000004, inst_id: inst7000011A} +// CHECK:STDOUT: import_ir_inst48: {ir_id: import_ir78000004, inst_id: inst7000011B} +// CHECK:STDOUT: import_ir_inst49: {ir_id: import_ir78000004, inst_id: inst70000141} +// CHECK:STDOUT: import_ir_inst4A: {ir_id: import_ir78000004, inst_id: inst7000013F} +// CHECK:STDOUT: import_ir_inst4B: {ir_id: import_ir78000004, inst_id: inst70000155} +// CHECK:STDOUT: import_ir_inst4C: {ir_id: import_ir78000004, inst_id: inst70000140} +// CHECK:STDOUT: import_ir_inst4D: {ir_id: import_ir78000004, inst_id: inst70000138} +// CHECK:STDOUT: import_ir_inst4E: {ir_id: import_ir78000004, inst_id: inst7000013A} +// CHECK:STDOUT: import_ir_inst4F: {ir_id: import_ir78000004, inst_id: inst7000013D} +// CHECK:STDOUT: import_ir_inst50: {ir_id: import_ir78000004, inst_id: inst70000135} +// CHECK:STDOUT: import_ir_inst51: {ir_id: import_ir78000004, inst_id: inst70000137} +// CHECK:STDOUT: import_ir_inst52: {ir_id: import_ir78000004, inst_id: inst7000013C} +// CHECK:STDOUT: import_ir_inst53: {ir_id: import_ir78000004, inst_id: inst70000143} +// CHECK:STDOUT: import_ir_inst54: {ir_id: import_ir78000004, inst_id: inst70000155} +// CHECK:STDOUT: import_ir_inst55: {ir_id: import_ir78000004, inst_id: inst70000150} +// CHECK:STDOUT: import_ir_inst56: {ir_id: import_ir78000004, inst_id: inst70000151} +// CHECK:STDOUT: import_ir_inst57: {ir_id: import_ir78000004, inst_id: inst70000148} +// CHECK:STDOUT: import_ir_inst58: {ir_id: import_ir78000004, inst_id: inst7000014B} +// CHECK:STDOUT: import_ir_inst59: {ir_id: import_ir78000004, inst_id: inst7000014C} +// CHECK:STDOUT: import_ir_inst5A: {ir_id: import_ir78000004, inst_id: inst7000014D} +// CHECK:STDOUT: import_ir_inst5B: {ir_id: import_ir78000004, inst_id: inst70000135} +// CHECK:STDOUT: import_ir_inst5C: {ir_id: import_ir78000004, inst_id: inst70000145} +// CHECK:STDOUT: import_ir_inst5D: {ir_id: import_ir78000004, inst_id: inst70000146} +// CHECK:STDOUT: import_ir_inst5E: {ir_id: import_ir78000004, inst_id: inst70000149} +// CHECK:STDOUT: import_ir_inst5F: {ir_id: import_ir78000004, inst_id: inst7000014F} +// CHECK:STDOUT: import_ir_inst60: {ir_id: import_ir78000004, inst_id: inst70000158} +// CHECK:STDOUT: import_ir_inst61: {ir_id: import_ir78000004, inst_id: inst70000159} +// CHECK:STDOUT: import_ir_inst62: {ir_id: import_ir78000004, inst_id: inst7000015C} +// CHECK:STDOUT: import_ir_inst63: {ir_id: import_ir78000004, inst_id: inst70000164} +// CHECK:STDOUT: import_ir_inst64: {ir_id: import_ir78000004, inst_id: inst70000162} +// CHECK:STDOUT: import_ir_inst65: {ir_id: import_ir78000004, inst_id: inst70000160} +// CHECK:STDOUT: import_ir_inst66: {ir_id: import_ir78000004, inst_id: inst70000161} +// CHECK:STDOUT: import_ir_inst67: {ir_id: import_ir78000004, inst_id: inst7000017D} +// CHECK:STDOUT: import_ir_inst68: {ir_id: import_ir78000004, inst_id: inst7000017B} +// CHECK:STDOUT: import_ir_inst69: {ir_id: import_ir78000004, inst_id: inst70000179} +// CHECK:STDOUT: import_ir_inst6A: {ir_id: import_ir78000004, inst_id: inst7000017A} +// CHECK:STDOUT: import_ir_inst6B: {ir_id: import_ir78000004, inst_id: inst700001B3} +// CHECK:STDOUT: import_ir_inst6C: {ir_id: import_ir78000004, inst_id: inst700001B1} +// CHECK:STDOUT: import_ir_inst6D: {ir_id: import_ir78000004, inst_id: inst700001CE} +// CHECK:STDOUT: import_ir_inst6E: {ir_id: import_ir78000004, inst_id: inst700001B2} +// CHECK:STDOUT: import_ir_inst6F: {ir_id: import_ir78000004, inst_id: inst700001CE} +// CHECK:STDOUT: import_ir_inst70: {ir_id: import_ir78000004, inst_id: inst700001C9} +// CHECK:STDOUT: import_ir_inst71: {ir_id: import_ir78000004, inst_id: inst700001CA} +// CHECK:STDOUT: import_ir_inst72: {ir_id: import_ir78000004, inst_id: inst700001C1} +// CHECK:STDOUT: import_ir_inst73: {ir_id: import_ir78000004, inst_id: inst700001C4} +// CHECK:STDOUT: import_ir_inst74: {ir_id: import_ir78000004, inst_id: inst700001C5} +// CHECK:STDOUT: import_ir_inst75: {ir_id: import_ir78000004, inst_id: inst700001C6} +// CHECK:STDOUT: import_ir_inst76: {ir_id: import_ir78000004, inst_id: inst70000194} +// CHECK:STDOUT: import_ir_inst77: {ir_id: import_ir78000004, inst_id: inst70000199} +// CHECK:STDOUT: import_ir_inst78: {ir_id: import_ir78000004, inst_id: inst700001BB} +// CHECK:STDOUT: import_ir_inst79: {ir_id: import_ir78000004, inst_id: inst700001BC} +// CHECK:STDOUT: import_ir_inst7A: {ir_id: import_ir78000004, inst_id: inst700001BD} +// CHECK:STDOUT: import_ir_inst7B: {ir_id: import_ir78000004, inst_id: inst700001BE} +// CHECK:STDOUT: import_ir_inst7C: {ir_id: import_ir78000004, inst_id: inst700001BF} +// CHECK:STDOUT: import_ir_inst7D: {ir_id: import_ir78000004, inst_id: inst700001C2} +// CHECK:STDOUT: import_ir_inst7E: {ir_id: import_ir78000004, inst_id: inst700001C8} +// CHECK:STDOUT: import_ir_inst7F: {ir_id: import_ir78000004, inst_id: inst700001D9} +// CHECK:STDOUT: import_ir_inst80: {ir_id: import_ir78000004, inst_id: inst700001DF} +// CHECK:STDOUT: import_ir_inst81: {ir_id: import_ir78000004, inst_id: inst700001E3} +// CHECK:STDOUT: import_ir_inst82: {ir_id: import_ir78000004, inst_id: inst700001E4} +// CHECK:STDOUT: import_ir_inst83: {ir_id: import_ir78000004, inst_id: inst700001E5} +// CHECK:STDOUT: import_ir_inst84: {ir_id: import_ir78000004, inst_id: inst700001E6} +// CHECK:STDOUT: import_ir_inst85: {ir_id: import_ir78000004, inst_id: inst700001E9} +// CHECK:STDOUT: import_ir_inst86: {ir_id: import_ir78000004, inst_id: inst700001F3} +// CHECK:STDOUT: import_ir_inst87: {ir_id: import_ir78000004, inst_id: inst700001FC} +// CHECK:STDOUT: import_ir_inst88: {ir_id: import_ir78000004, inst_id: inst700001FD} +// CHECK:STDOUT: import_ir_inst89: {ir_id: import_ir78000004, inst_id: inst700001FE} +// CHECK:STDOUT: import_ir_inst8A: {ir_id: import_ir78000004, inst_id: inst700001FF} +// CHECK:STDOUT: import_ir_inst8B: {ir_id: import_ir78000004, inst_id: inst70000205} +// CHECK:STDOUT: import_ir_inst8C: {ir_id: import_ir78000004, inst_id: inst7000019C} +// CHECK:STDOUT: import_ir_inst8D: {ir_id: import_ir78000004, inst_id: inst70000196} +// CHECK:STDOUT: import_ir_inst8E: {ir_id: import_ir78000004, inst_id: inst700001AC} +// CHECK:STDOUT: import_ir_inst8F: {ir_id: import_ir78000004, inst_id: inst700001AE} +// CHECK:STDOUT: import_ir_inst90: {ir_id: import_ir78000004, inst_id: inst70000194} +// CHECK:STDOUT: import_ir_inst91: {ir_id: import_ir78000004, inst_id: inst70000199} +// CHECK:STDOUT: import_ir_inst92: {ir_id: import_ir78000004, inst_id: inst70000195} +// CHECK:STDOUT: import_ir_inst93: {ir_id: import_ir78000004, inst_id: inst7000019B} +// CHECK:STDOUT: import_ir_inst94: {ir_id: import_ir78000004, inst_id: inst700001A2} +// CHECK:STDOUT: import_ir_inst95: {ir_id: import_ir78000004, inst_id: inst700001A5} +// CHECK:STDOUT: import_ir_inst96: {ir_id: import_ir78000004, inst_id: inst700001A9} +// CHECK:STDOUT: import_ir_inst97: {ir_id: import_ir78000004, inst_id: inst700001AD} +// CHECK:STDOUT: import_ir_inst98: {ir_id: import_ir78000004, inst_id: inst700001B5} +// CHECK:STDOUT: import_ir_inst99: {ir_id: import_ir78000004, inst_id: inst700001D1} +// CHECK:STDOUT: import_ir_inst9A: {ir_id: import_ir78000004, inst_id: inst700001D2} +// CHECK:STDOUT: import_ir_inst9B: {ir_id: import_ir78000004, inst_id: inst7000023F} +// CHECK:STDOUT: import_ir_inst9C: {ir_id: import_ir78000004, inst_id: inst7000023D} +// CHECK:STDOUT: import_ir_inst9D: {ir_id: import_ir78000004, inst_id: inst7000025E} +// CHECK:STDOUT: import_ir_inst9E: {ir_id: import_ir78000004, inst_id: inst7000023E} +// CHECK:STDOUT: import_ir_inst9F: {ir_id: import_ir78000004, inst_id: inst7000025E} +// CHECK:STDOUT: import_ir_instA0: {ir_id: import_ir78000004, inst_id: inst70000259} +// CHECK:STDOUT: import_ir_instA1: {ir_id: import_ir78000004, inst_id: inst7000025A} +// CHECK:STDOUT: import_ir_instA2: {ir_id: import_ir78000004, inst_id: inst70000251} +// CHECK:STDOUT: import_ir_instA3: {ir_id: import_ir78000004, inst_id: inst70000254} +// CHECK:STDOUT: import_ir_instA4: {ir_id: import_ir78000004, inst_id: inst70000255} +// CHECK:STDOUT: import_ir_instA5: {ir_id: import_ir78000004, inst_id: inst70000256} +// CHECK:STDOUT: import_ir_instA6: {ir_id: import_ir78000004, inst_id: inst70000216} +// CHECK:STDOUT: import_ir_instA7: {ir_id: import_ir78000004, inst_id: inst7000021B} +// CHECK:STDOUT: import_ir_instA8: {ir_id: import_ir78000004, inst_id: inst70000220} +// CHECK:STDOUT: import_ir_instA9: {ir_id: import_ir78000004, inst_id: inst70000249} +// CHECK:STDOUT: import_ir_instAA: {ir_id: import_ir78000004, inst_id: inst7000024A} +// CHECK:STDOUT: import_ir_instAB: {ir_id: import_ir78000004, inst_id: inst7000024B} +// CHECK:STDOUT: import_ir_instAC: {ir_id: import_ir78000004, inst_id: inst7000024C} +// CHECK:STDOUT: import_ir_instAD: {ir_id: import_ir78000004, inst_id: inst7000024D} +// CHECK:STDOUT: import_ir_instAE: {ir_id: import_ir78000004, inst_id: inst7000024E} +// CHECK:STDOUT: import_ir_instAF: {ir_id: import_ir78000004, inst_id: inst7000024F} +// CHECK:STDOUT: import_ir_instB0: {ir_id: import_ir78000004, inst_id: inst70000252} +// CHECK:STDOUT: import_ir_instB1: {ir_id: import_ir78000004, inst_id: inst70000258} +// CHECK:STDOUT: import_ir_instB2: {ir_id: import_ir78000004, inst_id: inst70000269} +// CHECK:STDOUT: import_ir_instB3: {ir_id: import_ir78000004, inst_id: inst7000026E} +// CHECK:STDOUT: import_ir_instB4: {ir_id: import_ir78000004, inst_id: inst70000272} +// CHECK:STDOUT: import_ir_instB5: {ir_id: import_ir78000004, inst_id: inst70000273} +// CHECK:STDOUT: import_ir_instB6: {ir_id: import_ir78000004, inst_id: inst70000274} +// CHECK:STDOUT: import_ir_instB7: {ir_id: import_ir78000004, inst_id: inst70000275} +// CHECK:STDOUT: import_ir_instB8: {ir_id: import_ir78000004, inst_id: inst70000278} +// CHECK:STDOUT: import_ir_instB9: {ir_id: import_ir78000004, inst_id: inst70000280} +// CHECK:STDOUT: import_ir_instBA: {ir_id: import_ir78000004, inst_id: inst70000284} +// CHECK:STDOUT: import_ir_instBB: {ir_id: import_ir78000004, inst_id: inst70000285} +// CHECK:STDOUT: import_ir_instBC: {ir_id: import_ir78000004, inst_id: inst70000286} +// CHECK:STDOUT: import_ir_instBD: {ir_id: import_ir78000004, inst_id: inst70000287} +// CHECK:STDOUT: import_ir_instBE: {ir_id: import_ir78000004, inst_id: inst7000028A} +// CHECK:STDOUT: import_ir_instBF: {ir_id: import_ir78000004, inst_id: inst70000294} +// CHECK:STDOUT: import_ir_instC0: {ir_id: import_ir78000004, inst_id: inst7000029D} +// CHECK:STDOUT: import_ir_instC1: {ir_id: import_ir78000004, inst_id: inst7000029E} +// CHECK:STDOUT: import_ir_instC2: {ir_id: import_ir78000004, inst_id: inst7000029F} +// CHECK:STDOUT: import_ir_instC3: {ir_id: import_ir78000004, inst_id: inst700002A0} +// CHECK:STDOUT: import_ir_instC4: {ir_id: import_ir78000004, inst_id: inst700002A6} +// CHECK:STDOUT: import_ir_instC5: {ir_id: import_ir78000004, inst_id: inst70000223} +// CHECK:STDOUT: import_ir_instC6: {ir_id: import_ir78000004, inst_id: inst7000021D} +// CHECK:STDOUT: import_ir_instC7: {ir_id: import_ir78000004, inst_id: inst70000218} +// CHECK:STDOUT: import_ir_instC8: {ir_id: import_ir78000004, inst_id: inst70000237} +// CHECK:STDOUT: import_ir_instC9: {ir_id: import_ir78000004, inst_id: inst70000239} +// CHECK:STDOUT: import_ir_instCA: {ir_id: import_ir78000004, inst_id: inst70000216} +// CHECK:STDOUT: import_ir_instCB: {ir_id: import_ir78000004, inst_id: inst7000021B} +// CHECK:STDOUT: import_ir_instCC: {ir_id: import_ir78000004, inst_id: inst70000220} +// CHECK:STDOUT: import_ir_instCD: {ir_id: import_ir78000004, inst_id: inst70000217} +// CHECK:STDOUT: import_ir_instCE: {ir_id: import_ir78000004, inst_id: inst7000021C} +// CHECK:STDOUT: import_ir_instCF: {ir_id: import_ir78000004, inst_id: inst70000222} +// CHECK:STDOUT: import_ir_instD0: {ir_id: import_ir78000004, inst_id: inst7000022A} +// CHECK:STDOUT: import_ir_instD1: {ir_id: import_ir78000004, inst_id: inst7000022D} +// CHECK:STDOUT: import_ir_instD2: {ir_id: import_ir78000004, inst_id: inst70000230} +// CHECK:STDOUT: import_ir_instD3: {ir_id: import_ir78000004, inst_id: inst70000234} +// CHECK:STDOUT: import_ir_instD4: {ir_id: import_ir78000004, inst_id: inst70000238} +// CHECK:STDOUT: import_ir_instD5: {ir_id: import_ir78000004, inst_id: inst70000241} +// CHECK:STDOUT: import_ir_instD6: {ir_id: import_ir78000004, inst_id: inst70000261} +// CHECK:STDOUT: import_ir_instD7: {ir_id: import_ir78000004, inst_id: inst70000262} // CHECK:STDOUT: clang_decls: {} // CHECK:STDOUT: clang_decl_signatures: {} // CHECK:STDOUT: name_scopes: diff --git a/toolchain/check/testdata/builtins/char/convert_checked.carbon b/toolchain/check/testdata/builtins/char/convert_checked.carbon index 9f6dbec7e3be..1aa3420169de 100644 --- a/toolchain/check/testdata/builtins/char/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/char/convert_checked.carbon @@ -14,11 +14,13 @@ library "[[@TEST_NAME]]"; -fn CharLiteral() -> type = "char_literal.make_type"; -fn IntLiteral() -> type = "int_literal.make_type"; -fn UInt(n: IntLiteral()) -> type = "int.make_type_unsigned"; +fn MakeCharLiteral() -> type = "char_literal.make_type"; +alias CharLiteral = MakeCharLiteral(); +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); +fn UInt(n: IntLiteral) -> type = "int.make_type_unsigned"; -fn ToChar(c: CharLiteral()) -> UInt(8) = "char.convert_checked"; +fn ToChar(c: CharLiteral) -> UInt(8) = "char.convert_checked"; // --- fail_bad_decl.carbon @@ -26,16 +28,16 @@ library "[[@TEST_NAME]]"; import library "builtin"; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "char.convert_checked" [InvalidBuiltinSignature] -// CHECK:STDERR: fn ToCharBarResultU16(c: CharLiteral()) -> UInt(16) = "char.convert_checked"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: -fn ToCharBarResultU16(c: CharLiteral()) -> UInt(16) = "char.convert_checked"; - -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "char.convert_checked" [InvalidBuiltinSignature] -// CHECK:STDERR: fn ToCharBadResultU9(c: CharLiteral()) -> UInt(9) = "char.convert_checked"; +// CHECK:STDERR: fn ToCharBarResultU16(c: CharLiteral) -> UInt(16) = "char.convert_checked"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn ToCharBadResultU9(c: CharLiteral()) -> UInt(9) = "char.convert_checked"; +fn ToCharBarResultU16(c: CharLiteral) -> UInt(16) = "char.convert_checked"; + +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "char.convert_checked" [InvalidBuiltinSignature] +// CHECK:STDERR: fn ToCharBadResultU9(c: CharLiteral) -> UInt(9) = "char.convert_checked"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +fn ToCharBadResultU9(c: CharLiteral) -> UInt(9) = "char.convert_checked"; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "char.convert_checked" [InvalidBuiltinSignature] // CHECK:STDERR: fn ToCharNoParam() -> UInt(8) = "char.convert_checked"; @@ -48,14 +50,14 @@ fn ToCharNoParam() -> UInt(8) = "char.convert_checked"; library "[[@TEST_NAME]]"; import library "builtin"; -let c: CharLiteral() = 'a'; +let c: CharLiteral = 'a'; // CHECK:STDERR: fail_runtime_call.carbon:[[@LINE+8]]:18: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: let d: UInt(8) = ToChar(c); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_runtime_call.carbon:[[@LINE-6]]:1: in import [InImport] -// CHECK:STDERR: builtin.carbon:8:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] -// CHECK:STDERR: fn ToChar(c: CharLiteral()) -> UInt(8) = "char.convert_checked"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: builtin.carbon:10:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] +// CHECK:STDERR: fn ToChar(c: CharLiteral) -> UInt(8) = "char.convert_checked"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let d: UInt(8) = ToChar(c); diff --git a/toolchain/check/testdata/builtins/char_literal/make_type.carbon b/toolchain/check/testdata/builtins/char_literal/make_type.carbon index 7c0612edb4ad..1f53b94292af 100644 --- a/toolchain/check/testdata/builtins/char_literal/make_type.carbon +++ b/toolchain/check/testdata/builtins/char_literal/make_type.carbon @@ -14,7 +14,8 @@ library "[[@TEST_NAME]]"; -fn CharLiteral() -> type = "char_literal.make_type"; +fn MakeCharLiteral() -> type = "char_literal.make_type"; +alias CharLiteral = MakeCharLiteral(); // --- use_types.carbon @@ -23,56 +24,39 @@ library "[[@TEST_NAME]]"; import library "types"; //@dump-sem-ir-begin -let ascii_x: CharLiteral() = 'x'; -let not_7_bit: CharLiteral() = '\u{80}'; -let not_8_bit: CharLiteral() = '\u{1E15}'; +let ascii_x: CharLiteral = 'x'; +let not_7_bit: CharLiteral = '\u{80}'; +let not_8_bit: CharLiteral = '\u{1E15}'; //@dump-sem-ir-end // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %CharLiteral.type: type = fn_type @CharLiteral [concrete] -// CHECK:STDOUT: %CharLiteral: %CharLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.8c6: type = pattern_type Core.CharLiteral [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type Core.CharLiteral [concrete] // CHECK:STDOUT: %.4ac: Core.CharLiteral = char_value U+0078 [concrete] // CHECK:STDOUT: %.ae7: Core.CharLiteral = char_value U+0080 [concrete] // CHECK:STDOUT: %.a81: Core.CharLiteral = char_value U+1E15 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Main.CharLiteral: %CharLiteral.type = import_ref Main//types, CharLiteral, loaded [concrete = constants.%CharLiteral] +// CHECK:STDOUT: %Main.CharLiteral: type = import_ref Main//types, CharLiteral, loaded [concrete = Core.CharLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %ascii_x.patt: %pattern_type.8c6 = value_binding_pattern ascii_x [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_26.1: type = splice_block %.loc7_26.3 [concrete = Core.CharLiteral] { -// CHECK:STDOUT: %CharLiteral.ref.loc7: %CharLiteral.type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = constants.%CharLiteral] -// CHECK:STDOUT: %CharLiteral.call.loc7: init type = call %CharLiteral.ref.loc7() [concrete = Core.CharLiteral] -// CHECK:STDOUT: %.loc7_26.2: type = value_of_initializer %CharLiteral.call.loc7 [concrete = Core.CharLiteral] -// CHECK:STDOUT: %.loc7_26.3: type = converted %CharLiteral.call.loc7, %.loc7_26.2 [concrete = Core.CharLiteral] +// CHECK:STDOUT: %ascii_x.patt: %pattern_type = value_binding_pattern ascii_x [concrete] // CHECK:STDOUT: } +// CHECK:STDOUT: %CharLiteral.ref.loc7: type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = Core.CharLiteral] // CHECK:STDOUT: %ascii_x: Core.CharLiteral = value_binding ascii_x, @__global_init.%.loc7 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %not_7_bit.patt: %pattern_type.8c6 = value_binding_pattern not_7_bit [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_28.1: type = splice_block %.loc8_28.3 [concrete = Core.CharLiteral] { -// CHECK:STDOUT: %CharLiteral.ref.loc8: %CharLiteral.type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = constants.%CharLiteral] -// CHECK:STDOUT: %CharLiteral.call.loc8: init type = call %CharLiteral.ref.loc8() [concrete = Core.CharLiteral] -// CHECK:STDOUT: %.loc8_28.2: type = value_of_initializer %CharLiteral.call.loc8 [concrete = Core.CharLiteral] -// CHECK:STDOUT: %.loc8_28.3: type = converted %CharLiteral.call.loc8, %.loc8_28.2 [concrete = Core.CharLiteral] +// CHECK:STDOUT: %not_7_bit.patt: %pattern_type = value_binding_pattern not_7_bit [concrete] // CHECK:STDOUT: } +// CHECK:STDOUT: %CharLiteral.ref.loc8: type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = Core.CharLiteral] // CHECK:STDOUT: %not_7_bit: Core.CharLiteral = value_binding not_7_bit, @__global_init.%.loc8 // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %not_8_bit.patt: %pattern_type.8c6 = value_binding_pattern not_8_bit [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc9_28.1: type = splice_block %.loc9_28.3 [concrete = Core.CharLiteral] { -// CHECK:STDOUT: %CharLiteral.ref.loc9: %CharLiteral.type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = constants.%CharLiteral] -// CHECK:STDOUT: %CharLiteral.call.loc9: init type = call %CharLiteral.ref.loc9() [concrete = Core.CharLiteral] -// CHECK:STDOUT: %.loc9_28.2: type = value_of_initializer %CharLiteral.call.loc9 [concrete = Core.CharLiteral] -// CHECK:STDOUT: %.loc9_28.3: type = converted %CharLiteral.call.loc9, %.loc9_28.2 [concrete = Core.CharLiteral] +// CHECK:STDOUT: %not_8_bit.patt: %pattern_type = value_binding_pattern not_8_bit [concrete] // CHECK:STDOUT: } +// CHECK:STDOUT: %CharLiteral.ref.loc9: type = name_ref CharLiteral, imports.%Main.CharLiteral [concrete = Core.CharLiteral] // CHECK:STDOUT: %not_8_bit: Core.CharLiteral = value_binding not_8_bit, @__global_init.%.loc9 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/convert.carbon b/toolchain/check/testdata/builtins/float/convert.carbon index ecd03071198c..2729445c54c5 100644 --- a/toolchain/check/testdata/builtins/float/convert.carbon +++ b/toolchain/check/testdata/builtins/float/convert.carbon @@ -14,9 +14,10 @@ library "literal"; -fn FloatLiteral() -> type = "float_literal.make_type"; +fn MakeFloatLiteral() -> type = "float_literal.make_type"; +alias FloatLiteral = MakeFloatLiteral(); -fn FloatLiteralToFloatLiteral(a: FloatLiteral()) -> FloatLiteral() = +fn FloatLiteralToFloatLiteral(a: FloatLiteral) -> FloatLiteral = "float.convert"; // --- identity_literal.carbon @@ -25,7 +26,7 @@ library "identity_literal"; import library "literal"; //@dump-sem-ir-begin -let f: FloatLiteral() = FloatLiteralToFloatLiteral(1.0); +let f: FloatLiteral = FloatLiteralToFloatLiteral(1.0); //@dump-sem-ir-end // --- f64.carbon @@ -34,7 +35,7 @@ library "f64"; export import library "literal"; fn Float64ToFloat64(a: f64) -> f64 = "float.convert"; -fn FloatLiteralToFloat64(a: FloatLiteral()) -> f64 = "float.convert"; +fn FloatLiteralToFloat64(a: FloatLiteral) -> f64 = "float.convert"; // --- f32.carbon @@ -42,7 +43,7 @@ library "f32"; export import library "literal"; fn Float32ToFloat32(a: f32) -> f32 = "float.convert"; -fn FloatLiteralToFloat32(a: FloatLiteral()) -> f32 = "float.convert"; +fn FloatLiteralToFloat32(a: FloatLiteral) -> f32 = "float.convert"; fn Float32ToFloat64(a: f32) -> f64 = "float.convert"; fn Float64ToFloat32(a: f64) -> f32 = "float.convert"; @@ -121,32 +122,25 @@ let b: f64 = Float32ToFloat64(1.0e30); // CHECK:STDOUT: --- identity_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %FloatLiteral.type: type = fn_type @FloatLiteral [concrete] -// CHECK:STDOUT: %FloatLiteral: %FloatLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.dab: type = pattern_type Core.FloatLiteral [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type Core.FloatLiteral [concrete] // CHECK:STDOUT: %FloatLiteralToFloatLiteral.type: type = fn_type @FloatLiteralToFloatLiteral [concrete] // CHECK:STDOUT: %FloatLiteralToFloatLiteral: %FloatLiteralToFloatLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Main.FloatLiteral: %FloatLiteral.type = import_ref Main//literal, FloatLiteral, loaded [concrete = constants.%FloatLiteral] +// CHECK:STDOUT: %Main.FloatLiteral: type = import_ref Main//literal, FloatLiteral, loaded [concrete = Core.FloatLiteral] // CHECK:STDOUT: %Main.FloatLiteralToFloatLiteral: %FloatLiteralToFloatLiteral.type = import_ref Main//literal, FloatLiteralToFloatLiteral, loaded [concrete = constants.%FloatLiteralToFloatLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %f.patt: %pattern_type.dab = value_binding_pattern f [concrete] +// CHECK:STDOUT: %f.patt: %pattern_type = value_binding_pattern f [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_21.1: type = splice_block %.loc6_21.3 [concrete = Core.FloatLiteral] { -// CHECK:STDOUT: %FloatLiteral.ref: %FloatLiteral.type = name_ref FloatLiteral, imports.%Main.FloatLiteral [concrete = constants.%FloatLiteral] -// CHECK:STDOUT: %FloatLiteral.call: init type = call %FloatLiteral.ref() [concrete = Core.FloatLiteral] -// CHECK:STDOUT: %.loc6_21.2: type = value_of_initializer %FloatLiteral.call [concrete = Core.FloatLiteral] -// CHECK:STDOUT: %.loc6_21.3: type = converted %FloatLiteral.call, %.loc6_21.2 [concrete = Core.FloatLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_55.1: Core.FloatLiteral = value_of_initializer @__global_init.%FloatLiteralToFloatLiteral.call [concrete = constants.%float] -// CHECK:STDOUT: %.loc6_55.2: Core.FloatLiteral = converted @__global_init.%FloatLiteralToFloatLiteral.call, %.loc6_55.1 [concrete = constants.%float] -// CHECK:STDOUT: %f: Core.FloatLiteral = value_binding f, %.loc6_55.2 +// CHECK:STDOUT: %FloatLiteral.ref: type = name_ref FloatLiteral, imports.%Main.FloatLiteral [concrete = Core.FloatLiteral] +// CHECK:STDOUT: %.loc6_53.1: Core.FloatLiteral = value_of_initializer @__global_init.%FloatLiteralToFloatLiteral.call [concrete = constants.%float] +// CHECK:STDOUT: %.loc6_53.2: Core.FloatLiteral = converted @__global_init.%FloatLiteralToFloatLiteral.call, %.loc6_53.1 [concrete = constants.%float] +// CHECK:STDOUT: %f: Core.FloatLiteral = value_binding f, %.loc6_53.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/builtins/float/convert_checked.carbon b/toolchain/check/testdata/builtins/float/convert_checked.carbon index eaa710fcdf52..121a920a668f 100644 --- a/toolchain/check/testdata/builtins/float/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/float/convert_checked.carbon @@ -14,9 +14,10 @@ library "[[@TEST_NAME]]"; -fn FloatLiteral() -> type = "float_literal.make_type"; +fn MakeFloatLiteral() -> type = "float_literal.make_type"; +alias FloatLiteral = MakeFloatLiteral(); -fn FloatLiteralToFloatLiteral(a: FloatLiteral()) -> FloatLiteral() = +fn FloatLiteralToFloatLiteral(a: FloatLiteral) -> FloatLiteral = "float.convert_checked"; // --- identity_literal.carbon @@ -25,7 +26,7 @@ library "[[@TEST_NAME]]"; import library "literal"; //@dump-sem-ir-begin -let f: FloatLiteral() = FloatLiteralToFloatLiteral(1.0); +let f: FloatLiteral = FloatLiteralToFloatLiteral(1.0); //@dump-sem-ir-end // --- f64.carbon @@ -34,8 +35,8 @@ library "[[@TEST_NAME]]"; export import library "literal"; fn Float64ToFloat64(a: f64) -> f64 = "float.convert_checked"; -fn Float64ToFloatLiteral(a: f64) -> FloatLiteral() = "float.convert_checked"; -fn FloatLiteralToFloat64(a: FloatLiteral()) -> f64 = "float.convert_checked"; +fn Float64ToFloatLiteral(a: f64) -> FloatLiteral = "float.convert_checked"; +fn FloatLiteralToFloat64(a: FloatLiteral) -> f64 = "float.convert_checked"; // --- f32.carbon @@ -43,8 +44,8 @@ library "[[@TEST_NAME]]"; export import library "literal"; fn Float32ToFloat32(a: f32) -> f32 = "float.convert_checked"; -fn Float32ToFloatLiteral(a: f32) -> FloatLiteral() = "float.convert_checked"; -fn FloatLiteralToFloat32(a: FloatLiteral()) -> f32 = "float.convert_checked"; +fn Float32ToFloatLiteral(a: f32) -> FloatLiteral = "float.convert_checked"; +fn FloatLiteralToFloat32(a: FloatLiteral) -> f32 = "float.convert_checked"; fn Float32ToFloat64(a: f32) -> f64 = "float.convert_checked"; fn Float64ToFloat32(a: f64) -> f32 = "float.convert_checked"; @@ -157,32 +158,25 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64); // CHECK:STDOUT: --- identity_literal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %FloatLiteral.type: type = fn_type @FloatLiteral [concrete] -// CHECK:STDOUT: %FloatLiteral: %FloatLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.dab: type = pattern_type Core.FloatLiteral [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type Core.FloatLiteral [concrete] // CHECK:STDOUT: %FloatLiteralToFloatLiteral.type: type = fn_type @FloatLiteralToFloatLiteral [concrete] // CHECK:STDOUT: %FloatLiteralToFloatLiteral: %FloatLiteralToFloatLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Main.FloatLiteral: %FloatLiteral.type = import_ref Main//literal, FloatLiteral, loaded [concrete = constants.%FloatLiteral] +// CHECK:STDOUT: %Main.FloatLiteral: type = import_ref Main//literal, FloatLiteral, loaded [concrete = Core.FloatLiteral] // CHECK:STDOUT: %Main.FloatLiteralToFloatLiteral: %FloatLiteralToFloatLiteral.type = import_ref Main//literal, FloatLiteralToFloatLiteral, loaded [concrete = constants.%FloatLiteralToFloatLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %f.patt: %pattern_type.dab = value_binding_pattern f [concrete] +// CHECK:STDOUT: %f.patt: %pattern_type = value_binding_pattern f [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_21.1: type = splice_block %.loc6_21.3 [concrete = Core.FloatLiteral] { -// CHECK:STDOUT: %FloatLiteral.ref: %FloatLiteral.type = name_ref FloatLiteral, imports.%Main.FloatLiteral [concrete = constants.%FloatLiteral] -// CHECK:STDOUT: %FloatLiteral.call: init type = call %FloatLiteral.ref() [concrete = Core.FloatLiteral] -// CHECK:STDOUT: %.loc6_21.2: type = value_of_initializer %FloatLiteral.call [concrete = Core.FloatLiteral] -// CHECK:STDOUT: %.loc6_21.3: type = converted %FloatLiteral.call, %.loc6_21.2 [concrete = Core.FloatLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc6_55.1: Core.FloatLiteral = value_of_initializer @__global_init.%FloatLiteralToFloatLiteral.call [concrete = constants.%float] -// CHECK:STDOUT: %.loc6_55.2: Core.FloatLiteral = converted @__global_init.%FloatLiteralToFloatLiteral.call, %.loc6_55.1 [concrete = constants.%float] -// CHECK:STDOUT: %f: Core.FloatLiteral = value_binding f, %.loc6_55.2 +// CHECK:STDOUT: %FloatLiteral.ref: type = name_ref FloatLiteral, imports.%Main.FloatLiteral [concrete = Core.FloatLiteral] +// CHECK:STDOUT: %.loc6_53.1: Core.FloatLiteral = value_of_initializer @__global_init.%FloatLiteralToFloatLiteral.call [concrete = constants.%float] +// CHECK:STDOUT: %.loc6_53.2: Core.FloatLiteral = converted @__global_init.%FloatLiteralToFloatLiteral.call, %.loc6_53.1 [concrete = constants.%float] +// CHECK:STDOUT: %f: Core.FloatLiteral = value_binding f, %.loc6_53.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { diff --git a/toolchain/check/testdata/builtins/float/convert_int.carbon b/toolchain/check/testdata/builtins/float/convert_int.carbon index 68374c85f312..d5c7ac1210d1 100644 --- a/toolchain/check/testdata/builtins/float/convert_int.carbon +++ b/toolchain/check/testdata/builtins/float/convert_int.carbon @@ -15,10 +15,10 @@ library "[[@TEST_NAME]]"; fn ConvertF64ToI32(a: f64) -> i32 = "float.convert_int"; fn ConvertF64ToU32(a: f64) -> u32 = "float.convert_int"; -fn ConvertFloatLiteralToI32(a: Core.FloatLiteral()) -> i32 = "float.convert_int"; -fn ConvertFloatLiteralToU32(a: Core.FloatLiteral()) -> u32 = "float.convert_int"; -fn ConvertFloatLiteralToIntLiteral(a: Core.FloatLiteral()) -> Core.IntLiteral() = "float.convert_int"; -fn ConvertF64ToIntLiteral(a: f64) -> Core.IntLiteral() = "float.convert_int"; +fn ConvertFloatLiteralToI32(a: Core.FloatLiteral) -> i32 = "float.convert_int"; +fn ConvertFloatLiteralToU32(a: Core.FloatLiteral) -> u32 = "float.convert_int"; +fn ConvertFloatLiteralToIntLiteral(a: Core.FloatLiteral) -> Core.IntLiteral = "float.convert_int"; +fn ConvertF64ToIntLiteral(a: f64) -> Core.IntLiteral = "float.convert_int"; fn Negate(a: f64) -> f64 = "float.negate"; fn Div(a: f64, b: f64) -> f64 = "float.div"; @@ -127,11 +127,11 @@ let literal_overflow: i32 = ConvertFloatLiteralToI32(2147483648.0); let giant_literal_overflow: i32 = ConvertFloatLiteralToI32(1.0e1000000); // -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:64: error: floating-point value 10*10^9999999 too large to convert: result would be an integer whose width is greater than the maximum supported width of 8388608 [RealLiteralTooLargeForUnsizedInt] -// CHECK:STDERR: let giant_literal_to_int_literal_overflow: Core.IntLiteral() = ConvertFloatLiteralToIntLiteral(1.0e10000000); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:62: error: floating-point value 10*10^9999999 too large to convert: result would be an integer whose width is greater than the maximum supported width of 8388608 [RealLiteralTooLargeForUnsizedInt] +// CHECK:STDERR: let giant_literal_to_int_literal_overflow: Core.IntLiteral = ConvertFloatLiteralToIntLiteral(1.0e10000000); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -let giant_literal_to_int_literal_overflow: Core.IntLiteral() = ConvertFloatLiteralToIntLiteral(1.0e10000000); +let giant_literal_to_int_literal_overflow: Core.IntLiteral = ConvertFloatLiteralToIntLiteral(1.0e10000000); // // CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:44: error: floating-point value 10*10^999999999999999999999999999999999 too large for integer type `i32` [RealLiteralTooLargeForIntType] @@ -142,11 +142,11 @@ let giant_exponent_literal_overflow: i32 = ConvertFloatLiteralToI32(1.0e10000000 // // -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:73: error: floating-point value 10*10^999999999999999999999999999999999 too large to convert: result would be an integer whose width is greater than the maximum supported width of 8388608 [RealLiteralTooLargeForUnsizedInt] -// CHECK:STDERR: let giant_exponent_literal_to_int_literal_overflow: Core.IntLiteral() = ConvertFloatLiteralToIntLiteral(1.0e1000000000000000000000000000000000); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:71: error: floating-point value 10*10^999999999999999999999999999999999 too large to convert: result would be an integer whose width is greater than the maximum supported width of 8388608 [RealLiteralTooLargeForUnsizedInt] +// CHECK:STDERR: let giant_exponent_literal_to_int_literal_overflow: Core.IntLiteral = ConvertFloatLiteralToIntLiteral(1.0e1000000000000000000000000000000000); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -let giant_exponent_literal_to_int_literal_overflow: Core.IntLiteral() = ConvertFloatLiteralToIntLiteral(1.0e1000000000000000000000000000000000); +let giant_exponent_literal_to_int_literal_overflow: Core.IntLiteral = ConvertFloatLiteralToIntLiteral(1.0e1000000000000000000000000000000000); // // CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:44: error: floating-point value 2147483648*10^0 too large for integer type `i32` [RealLiteralTooLargeForIntType] @@ -268,8 +268,6 @@ let inf_val: i32 = ConvertF64ToI32(Div(1.0, 0.0)); // CHECK:STDOUT: %ConvertFloatLiteralToI32: %ConvertFloatLiteralToI32.type = struct_value () [concrete] // CHECK:STDOUT: %float.bab60c.2: Core.FloatLiteral = float_literal_value 21474836480e-1 [concrete] // CHECK:STDOUT: %float.53d: Core.FloatLiteral = float_literal_value 10e999999 [concrete] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %ConvertFloatLiteralToIntLiteral.type: type = fn_type @ConvertFloatLiteralToIntLiteral [concrete] // CHECK:STDOUT: %ConvertFloatLiteralToIntLiteral: %ConvertFloatLiteralToIntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %float.ef09: Core.FloatLiteral = float_literal_value 10e9999999 [concrete] @@ -306,7 +304,7 @@ let inf_val: i32 = ConvertF64ToI32(Div(1.0, 0.0)); // CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/parts/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/parts/uint, UInt, loaded [concrete = constants.%UInt.generic] -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -348,16 +346,13 @@ let inf_val: i32 = ConvertF64ToI32(Div(1.0, 0.0)); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %giant_literal_to_int_literal_overflow.patt: %pattern_type.dc0 = value_binding_pattern giant_literal_to_int_literal_overflow [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc40_60.1: type = splice_block %.loc40_60.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc40_48: type = splice_block %IntLiteral.ref.loc40 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %Core.ref.loc40: = name_ref Core, imports.%Core.048aa3.1 [concrete = imports.%Core.048aa3.1] -// CHECK:STDOUT: %IntLiteral.ref.loc40: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc40: init type = call %IntLiteral.ref.loc40() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc40_60.2: type = value_of_initializer %IntLiteral.call.loc40 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc40_60.3: type = converted %IntLiteral.call.loc40, %.loc40_60.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref.loc40: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc40_108.1: Core.IntLiteral = value_of_initializer @__global_init.%ConvertFloatLiteralToIntLiteral.call.loc40 [concrete = ] -// CHECK:STDOUT: %.loc40_108.2: Core.IntLiteral = converted @__global_init.%ConvertFloatLiteralToIntLiteral.call.loc40, %.loc40_108.1 [concrete = ] -// CHECK:STDOUT: %giant_literal_to_int_literal_overflow: Core.IntLiteral = value_binding giant_literal_to_int_literal_overflow, %.loc40_108.2 [concrete = ] +// CHECK:STDOUT: %.loc40_106.1: Core.IntLiteral = value_of_initializer @__global_init.%ConvertFloatLiteralToIntLiteral.call.loc40 [concrete = ] +// CHECK:STDOUT: %.loc40_106.2: Core.IntLiteral = converted @__global_init.%ConvertFloatLiteralToIntLiteral.call.loc40, %.loc40_106.1 [concrete = ] +// CHECK:STDOUT: %giant_literal_to_int_literal_overflow: Core.IntLiteral = value_binding giant_literal_to_int_literal_overflow, %.loc40_106.2 [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %giant_exponent_literal_overflow.patt: %pattern_type.6b6 = value_binding_pattern giant_exponent_literal_overflow [concrete] // CHECK:STDOUT: } @@ -368,16 +363,13 @@ let inf_val: i32 = ConvertF64ToI32(Div(1.0, 0.0)); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %giant_exponent_literal_to_int_literal_overflow.patt: %pattern_type.dc0 = value_binding_pattern giant_exponent_literal_to_int_literal_overflow [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc55_69.1: type = splice_block %.loc55_69.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc55_57: type = splice_block %IntLiteral.ref.loc55 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %Core.ref.loc55: = name_ref Core, imports.%Core.048aa3.1 [concrete = imports.%Core.048aa3.1] -// CHECK:STDOUT: %IntLiteral.ref.loc55: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc55: init type = call %IntLiteral.ref.loc55() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc55_69.2: type = value_of_initializer %IntLiteral.call.loc55 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc55_69.3: type = converted %IntLiteral.call.loc55, %.loc55_69.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref.loc55: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc55_143.1: Core.IntLiteral = value_of_initializer @__global_init.%ConvertFloatLiteralToIntLiteral.call.loc55 [concrete = ] -// CHECK:STDOUT: %.loc55_143.2: Core.IntLiteral = converted @__global_init.%ConvertFloatLiteralToIntLiteral.call.loc55, %.loc55_143.1 [concrete = ] -// CHECK:STDOUT: %giant_exponent_literal_to_int_literal_overflow: Core.IntLiteral = value_binding giant_exponent_literal_to_int_literal_overflow, %.loc55_143.2 [concrete = ] +// CHECK:STDOUT: %.loc55_141.1: Core.IntLiteral = value_of_initializer @__global_init.%ConvertFloatLiteralToIntLiteral.call.loc55 [concrete = ] +// CHECK:STDOUT: %.loc55_141.2: Core.IntLiteral = converted @__global_init.%ConvertFloatLiteralToIntLiteral.call.loc55, %.loc55_141.1 [concrete = ] +// CHECK:STDOUT: %giant_exponent_literal_to_int_literal_overflow: Core.IntLiteral = value_binding giant_exponent_literal_to_int_literal_overflow, %.loc55_141.2 [concrete = ] // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %literal_overflow_large_mantissa.patt: %pattern_type.6b6 = value_binding_pattern literal_overflow_large_mantissa [concrete] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index d634ab31c6f8..f2f6208471e0 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -43,10 +43,10 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_literal.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.eq" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Eq(a: Core.FloatLiteral(), b: Core.FloatLiteral()) -> bool = "float.eq"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Eq(a: Core.FloatLiteral, b: Core.FloatLiteral) -> bool = "float.eq"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Eq(a: Core.FloatLiteral(), b: Core.FloatLiteral()) -> bool = "float.eq"; +fn Eq(a: Core.FloatLiteral, b: Core.FloatLiteral) -> bool = "float.eq"; // CHECK:STDOUT: --- float_eq.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float/less_eq.carbon b/toolchain/check/testdata/builtins/float/less_eq.carbon index 801a16137ae4..f14a99629001 100644 --- a/toolchain/check/testdata/builtins/float/less_eq.carbon +++ b/toolchain/check/testdata/builtins/float/less_eq.carbon @@ -37,10 +37,10 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_literal.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.less_eq" [InvalidBuiltinSignature] -// CHECK:STDERR: fn LessEq(a: Core.FloatLiteral(), b: Core.FloatLiteral()) -> bool = "float.less_eq"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn LessEq(a: Core.FloatLiteral, b: Core.FloatLiteral) -> bool = "float.less_eq"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn LessEq(a: Core.FloatLiteral(), b: Core.FloatLiteral()) -> bool = "float.less_eq"; +fn LessEq(a: Core.FloatLiteral, b: Core.FloatLiteral) -> bool = "float.less_eq"; // CHECK:STDOUT: --- float_less_eq.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/float_literal/make_type.carbon b/toolchain/check/testdata/builtins/float_literal/make_type.carbon index 1dd90cc5aa49..61a01b4f77db 100644 --- a/toolchain/check/testdata/builtins/float_literal/make_type.carbon +++ b/toolchain/check/testdata/builtins/float_literal/make_type.carbon @@ -14,7 +14,8 @@ library "[[@TEST_NAME]]"; -fn FloatLiteral() -> type = "float_literal.make_type"; +fn MakeFloatLiteral() -> type = "float_literal.make_type"; +alias FloatLiteral = MakeFloatLiteral(); // --- use_types.carbon @@ -23,32 +24,25 @@ library "[[@TEST_NAME]]"; import library "types"; //@dump-sem-ir-begin -let f: FloatLiteral() = 1.0; +let f: FloatLiteral = 1.0; //@dump-sem-ir-end // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %FloatLiteral.type: type = fn_type @FloatLiteral [concrete] -// CHECK:STDOUT: %FloatLiteral: %FloatLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.dab: type = pattern_type Core.FloatLiteral [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type Core.FloatLiteral [concrete] // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Main.FloatLiteral: %FloatLiteral.type = import_ref Main//types, FloatLiteral, loaded [concrete = constants.%FloatLiteral] +// CHECK:STDOUT: %Main.FloatLiteral: type = import_ref Main//types, FloatLiteral, loaded [concrete = Core.FloatLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %f.patt: %pattern_type.dab = value_binding_pattern f [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_21.1: type = splice_block %.loc7_21.3 [concrete = Core.FloatLiteral] { -// CHECK:STDOUT: %FloatLiteral.ref: %FloatLiteral.type = name_ref FloatLiteral, imports.%Main.FloatLiteral [concrete = constants.%FloatLiteral] -// CHECK:STDOUT: %FloatLiteral.call: init type = call %FloatLiteral.ref() [concrete = Core.FloatLiteral] -// CHECK:STDOUT: %.loc7_21.2: type = value_of_initializer %FloatLiteral.call [concrete = Core.FloatLiteral] -// CHECK:STDOUT: %.loc7_21.3: type = converted %FloatLiteral.call, %.loc7_21.2 [concrete = Core.FloatLiteral] +// CHECK:STDOUT: %f.patt: %pattern_type = value_binding_pattern f [concrete] // CHECK:STDOUT: } +// CHECK:STDOUT: %FloatLiteral.ref: type = name_ref FloatLiteral, imports.%Main.FloatLiteral [concrete = Core.FloatLiteral] // CHECK:STDOUT: %f: Core.FloatLiteral = value_binding f, @__global_init.%float // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/form/make_type.carbon b/toolchain/check/testdata/builtins/form/make_type.carbon index ea55c9501531..084f3707f37d 100644 --- a/toolchain/check/testdata/builtins/form/make_type.carbon +++ b/toolchain/check/testdata/builtins/form/make_type.carbon @@ -14,7 +14,8 @@ library "[[@TEST_NAME]]"; -fn Form() -> type = "form.make_type"; +fn MakeForm() -> type = "form.make_type"; +alias Form = MakeForm(); // --- use_types.carbon @@ -23,42 +24,35 @@ library "[[@TEST_NAME]]"; import library "types"; //@dump-sem-ir-begin -let f: Form() = form(var ()); +let f: Form = form(var ()); //@dump-sem-ir-end // CHECK:STDOUT: --- use_types.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Form.type: type = fn_type @Form [concrete] -// CHECK:STDOUT: %Form: %Form.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.13f: type = pattern_type Core.Form [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type Core.Form [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %.262: Core.Form = init_form %empty_tuple.type [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Main.Form: %Form.type = import_ref Main//types, Form, loaded [concrete = constants.%Form] +// CHECK:STDOUT: %Main.Form: type = import_ref Main//types, Form, loaded [concrete = Core.Form] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %f.patt: %pattern_type.13f = value_binding_pattern f [concrete] +// CHECK:STDOUT: %f.patt: %pattern_type = value_binding_pattern f [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_13.1: type = splice_block %.loc7_13.3 [concrete = Core.Form] { -// CHECK:STDOUT: %Form.ref: %Form.type = name_ref Form, imports.%Main.Form [concrete = constants.%Form] -// CHECK:STDOUT: %Form.call: init type = call %Form.ref() [concrete = Core.Form] -// CHECK:STDOUT: %.loc7_13.2: type = value_of_initializer %Form.call [concrete = Core.Form] -// CHECK:STDOUT: %.loc7_13.3: type = converted %Form.call, %.loc7_13.2 [concrete = Core.Form] -// CHECK:STDOUT: } -// CHECK:STDOUT: %f: Core.Form = value_binding f, @__global_init.%.loc7_22 +// CHECK:STDOUT: %Form.ref: type = name_ref Form, imports.%Main.Form [concrete = Core.Form] +// CHECK:STDOUT: %f: Core.Form = value_binding f, @__global_init.%.loc7_20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc7_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc7_27.2: type = converted %.loc7_27.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc7_22: Core.Form = init_form %.loc7_27.2 [concrete = constants.%.262] +// CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_25.2: type = converted %.loc7_25.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc7_20: Core.Form = init_form %.loc7_25.2 [concrete = constants.%.262] // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 45277af24959..c0e0ec158779 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -29,10 +29,10 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { library "[[@TEST_NAME]]"; -fn And(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; +fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; -class Expect(N:! Core.IntLiteral()) {} -fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } +class Expect(N:! Core.IntLiteral) {} +fn Test(N:! Core.IntLiteral) -> Expect(N) { return {}; } fn F() { Test(And(1, 2)) as Expect(0); @@ -49,15 +49,15 @@ fn F() { library "[[@TEST_NAME]]"; -fn AndLit(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; +fn AndLit(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; -fn F(a: Core.IntLiteral()) -> Core.IntLiteral() { +fn F(a: Core.IntLiteral) -> Core.IntLiteral { // CHECK:STDERR: fail_literal_runtime.carbon:[[@LINE+7]]:10: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: return AndLit(5, a); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_literal_runtime.carbon:[[@LINE-6]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn AndLit(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn AndLit(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: return AndLit(5, a); } @@ -68,57 +68,57 @@ library "[[@TEST_NAME]]"; // Heterogeneous "and" is not supported. // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and" [InvalidBuiltinSignature] -// CHECK:STDERR: fn MixedAnd1(a: i32, b: Core.IntLiteral()) -> i32 = "int.and"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn MixedAnd1(a: i32, b: Core.IntLiteral) -> i32 = "int.and"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn MixedAnd1(a: i32, b: Core.IntLiteral()) -> i32 = "int.and"; +fn MixedAnd1(a: i32, b: Core.IntLiteral) -> i32 = "int.and"; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and" [InvalidBuiltinSignature] -// CHECK:STDERR: fn MixedAnd2(a: Core.IntLiteral(), b: i32) -> i32 = "int.and"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn MixedAnd2(a: Core.IntLiteral, b: i32) -> i32 = "int.and"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn MixedAnd2(a: Core.IntLiteral(), b: i32) -> i32 = "int.and"; +fn MixedAnd2(a: Core.IntLiteral, b: i32) -> i32 = "int.and"; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and" [InvalidBuiltinSignature] -// CHECK:STDERR: fn MixedAnd3(a: i32, b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn MixedAnd3(a: i32, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn MixedAnd3(a: i32, b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; +fn MixedAnd3(a: i32, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and" [InvalidBuiltinSignature] -// CHECK:STDERR: fn MixedAnd4(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.and"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn MixedAnd4(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.and"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn MixedAnd4(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.and"; +fn MixedAnd4(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.and"; // --- fail_runtime_literal.carbon library "[[@TEST_NAME]]"; -fn And(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; +fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; -fn Test(n: Core.IntLiteral()) { +fn Test(n: Core.IntLiteral) { // OK And(1, 1); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: And(n, 1); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-8]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn And(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: And(n, 1); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: And(1, n); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-16]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn And(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: And(1, n); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: And(n, n); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-24]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn And(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.and"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn And(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.and"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: And(n, n); } diff --git a/toolchain/check/testdata/builtins/int/and_assign.carbon b/toolchain/check/testdata/builtins/int/and_assign.carbon index c170e8fc51fa..ae47eeeae510 100644 --- a/toolchain/check/testdata/builtins/int/and_assign.carbon +++ b/toolchain/check/testdata/builtins/int/and_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.and_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.and_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.and_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.and_assign"; // --- fail_not_ptr.carbon diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index a356af81696a..04e535bf71f5 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -30,10 +30,10 @@ fn RuntimeCallIsValid(a: i32) -> i32 { library "[[@TEST_NAME]]"; -fn Complement(a: Core.IntLiteral()) -> Core.IntLiteral() = "int.complement"; +fn Complement(a: Core.IntLiteral) -> Core.IntLiteral = "int.complement"; -class Expect(N:! Core.IntLiteral()) {} -fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } +class Expect(N:! Core.IntLiteral) {} +fn Test(N:! Core.IntLiteral) -> Expect(N) { return {}; } fn F() { Test(Complement(0)) as Expect(-1); @@ -49,15 +49,15 @@ fn F() { library "[[@TEST_NAME]]"; -fn Complement(a: Core.IntLiteral()) -> Core.IntLiteral() = "int.complement"; +fn Complement(a: Core.IntLiteral) -> Core.IntLiteral = "int.complement"; -fn F(a: Core.IntLiteral()) -> Core.IntLiteral() { +fn F(a: Core.IntLiteral) -> Core.IntLiteral { // CHECK:STDERR: fail_literal_runtime.carbon:[[@LINE+7]]:10: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: return Complement(a); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fail_literal_runtime.carbon:[[@LINE-6]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn Complement(a: Core.IntLiteral()) -> Core.IntLiteral() = "int.complement"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Complement(a: Core.IntLiteral) -> Core.IntLiteral = "int.complement"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: return Complement(a); } diff --git a/toolchain/check/testdata/builtins/int/convert.carbon b/toolchain/check/testdata/builtins/int/convert.carbon index faaf7bb0ac45..ef81a83b685a 100644 --- a/toolchain/check/testdata/builtins/int/convert.carbon +++ b/toolchain/check/testdata/builtins/int/convert.carbon @@ -19,23 +19,23 @@ fn Int32ToInt32(a: i32) -> i32 = "int.convert"; fn Int32ToUint32(a: i32) -> u32 = "int.convert"; fn Uint32ToInt32(a: u32) -> i32 = "int.convert"; fn Uint32ToUint32(a: u32) -> u32 = "int.convert"; -fn IntLiteralToIntLiteral(a: Core.IntLiteral()) -> Core.IntLiteral() = "int.convert"; +fn IntLiteralToIntLiteral(a: Core.IntLiteral) -> Core.IntLiteral = "int.convert"; // Narrowing fn Int32ToInt16(a: i32) -> i16 = "int.convert"; fn Int32ToUint16(a: i32) -> u16 = "int.convert"; fn Uint32ToInt16(a: u32) -> i16 = "int.convert"; fn Uint32ToUint16(a: u32) -> u16 = "int.convert"; -fn IntLiteralToInt16(a: Core.IntLiteral()) -> i16 = "int.convert"; -fn IntLiteralToUint16(a: Core.IntLiteral()) -> u16 = "int.convert"; +fn IntLiteralToInt16(a: Core.IntLiteral) -> i16 = "int.convert"; +fn IntLiteralToUint16(a: Core.IntLiteral) -> u16 = "int.convert"; // Widening fn Int32ToInt64(a: i32) -> i64 = "int.convert"; fn Int32ToUint64(a: i32) -> u64 = "int.convert"; fn Uint32ToInt64(a: u32) -> i64 = "int.convert"; fn Uint32ToUint64(a: u32) -> u64 = "int.convert"; -fn Int32ToIntLiteral(a: i32) -> Core.IntLiteral() = "int.convert"; -fn Uint32ToIntLiteral(a: u32) -> Core.IntLiteral() = "int.convert"; +fn Int32ToIntLiteral(a: i32) -> Core.IntLiteral = "int.convert"; +fn Uint32ToIntLiteral(a: u32) -> Core.IntLiteral = "int.convert"; // char conversion fn UInt8ToChar(a: u8) -> u8 = "int.convert_char"; @@ -243,15 +243,15 @@ fn F() { library "[[@TEST_NAME]]"; import library "int_ops"; -let not_constant: Core.IntLiteral() = 0; +let not_constant: Core.IntLiteral = 0; // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+8]]:33: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: let convert_not_constant: i16 = IntLiteralToInt16(not_constant); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-7]]:1: in import [InImport] // CHECK:STDERR: int_ops.carbon:16:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] -// CHECK:STDERR: fn IntLiteralToInt16(a: Core.IntLiteral()) -> i16 = "int.convert"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn IntLiteralToInt16(a: Core.IntLiteral) -> i16 = "int.convert"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let convert_not_constant: i16 = IntLiteralToInt16(not_constant); diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index e2fde2dbe494..e427a290fc13 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -17,14 +17,15 @@ library "[[@TEST_NAME]]"; fn NegateI32(a: i32) -> i32 = "int.snegate"; fn SubI32(a: i32, b: i32) -> i32 = "int.ssub"; fn AddU32(a: u32, b: u32) -> u32 = "int.uadd"; -fn IntLiteral() -> type = "int_literal.make_type"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); // Size preserving fn Int32ToInt32(a: i32) -> i32 = "int.convert_checked"; fn Int32ToUint32(a: i32) -> u32 = "int.convert_checked"; fn Uint32ToInt32(a: u32) -> i32 = "int.convert_checked"; fn Uint32ToUint32(a: u32) -> u32 = "int.convert_checked"; -fn IntLiteralToIntLiteral(a: IntLiteral()) -> IntLiteral() = +fn IntLiteralToIntLiteral(a: IntLiteral) -> IntLiteral = "int.convert_checked"; // Narrowing @@ -32,16 +33,16 @@ fn Int32ToInt16(a: i32) -> i16 = "int.convert_checked"; fn Int32ToUint16(a: i32) -> u16 = "int.convert_checked"; fn Uint32ToInt16(a: u32) -> i16 = "int.convert_checked"; fn Uint32ToUint16(a: u32) -> u16 = "int.convert_checked"; -fn IntLiteralToInt16(a: IntLiteral()) -> i16 = "int.convert_checked"; -fn IntLiteralToUint16(a: IntLiteral()) -> u16 = "int.convert_checked"; +fn IntLiteralToInt16(a: IntLiteral) -> i16 = "int.convert_checked"; +fn IntLiteralToUint16(a: IntLiteral) -> u16 = "int.convert_checked"; // Widening fn Int32ToInt64(a: i32) -> i64 = "int.convert_checked"; fn Int32ToUint64(a: i32) -> u64 = "int.convert_checked"; fn Uint32ToInt64(a: u32) -> i64 = "int.convert_checked"; fn Uint32ToUint64(a: u32) -> u64 = "int.convert_checked"; -fn Int32ToIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked"; -fn Uint32ToUintLiteral(a: u32) -> IntLiteral() = "int.convert_checked"; +fn Int32ToIntLiteral(a: i32) -> IntLiteral = "int.convert_checked"; +fn Uint32ToUintLiteral(a: u32) -> IntLiteral = "int.convert_checked"; // --- runtime_call.carbon @@ -62,7 +63,7 @@ import library "int_ops"; let a: i32 = Int32ToInt32(0); let b: i32 = Int32ToInt32(0x7FFF_FFFF); let c: i32 = Int32ToInt32(SubI32(NegateI32(0x7FFF_FFFF), 1)); -let d: IntLiteral() = IntLiteralToIntLiteral(Int32ToIntLiteral(NegateI32(1))); +let d: IntLiteral = IntLiteralToIntLiteral(Int32ToIntLiteral(NegateI32(1))); // --- same_size.carbon @@ -236,7 +237,7 @@ let not_constant: i32 = 0; // CHECK:STDERR: let convert_not_constant_narrow: i16 = Int32ToInt16(not_constant); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-7]]:1: in import [InImport] -// CHECK:STDERR: int_ops.carbon:18:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] +// CHECK:STDERR: int_ops.carbon:19:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn Int32ToInt16(a: i32) -> i16 = "int.convert_checked"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -246,7 +247,7 @@ let convert_not_constant_narrow: i16 = Int32ToInt16(not_constant); // CHECK:STDERR: let convert_not_constant_same: i32 = Int32ToInt32(not_constant); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-17]]:1: in import [InImport] -// CHECK:STDERR: int_ops.carbon:10:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] +// CHECK:STDERR: int_ops.carbon:11:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn Int32ToInt32(a: i32) -> i32 = "int.convert_checked"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -256,7 +257,7 @@ let convert_not_constant_same: i32 = Int32ToInt32(not_constant); // CHECK:STDERR: let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_not_constant.carbon:[[@LINE-27]]:1: in import [InImport] -// CHECK:STDERR: int_ops.carbon:26:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] +// CHECK:STDERR: int_ops.carbon:27:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] // CHECK:STDERR: fn Int32ToInt64(a: i32) -> i64 = "int.convert_checked"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/builtins/int/convert_float.carbon b/toolchain/check/testdata/builtins/int/convert_float.carbon index b948fa520fba..d439080997a1 100644 --- a/toolchain/check/testdata/builtins/int/convert_float.carbon +++ b/toolchain/check/testdata/builtins/int/convert_float.carbon @@ -15,8 +15,8 @@ library "[[@TEST_NAME]]"; fn ConvertI32ToF64(a: i32) -> f64 = "int.convert_float"; fn ConvertU32ToF64(a: u32) -> f64 = "int.convert_float"; -fn ConvertIntLiteralToF64(a: Core.IntLiteral()) -> f64 = "int.convert_float"; -fn ConvertIntLiteralToFloatLiteral(a: Core.IntLiteral()) -> Core.FloatLiteral() = "int.convert_float"; +fn ConvertIntLiteralToF64(a: Core.IntLiteral) -> f64 = "int.convert_float"; +fn ConvertIntLiteralToFloatLiteral(a: Core.IntLiteral) -> Core.FloatLiteral = "int.convert_float"; fn Negate(a: f64) -> f64 = "float.negate"; diff --git a/toolchain/check/testdata/builtins/int/convert_float_checked.carbon b/toolchain/check/testdata/builtins/int/convert_float_checked.carbon index e5bd5ea04519..0c35b99ab4cf 100644 --- a/toolchain/check/testdata/builtins/int/convert_float_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_float_checked.carbon @@ -13,8 +13,8 @@ // --- int_to_float_checked.carbon library "[[@TEST_NAME]]"; -fn ConvertIntLiteralToFloatLiteral(a: Core.IntLiteral()) -> Core.FloatLiteral() = "int.convert_float_checked"; -fn ConvertIntLiteralToF32(a: Core.IntLiteral()) -> f32 = "int.convert_float_checked"; +fn ConvertIntLiteralToFloatLiteral(a: Core.IntLiteral) -> Core.FloatLiteral = "int.convert_float_checked"; +fn ConvertIntLiteralToF32(a: Core.IntLiteral) -> f32 = "int.convert_float_checked"; class Expect[T:! type](N:! T) {} fn Test[T:! type](N:! T) -> Expect(N) { return {}; } diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 1aacf6848164..bb614a626234 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -44,7 +44,7 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; library "[[@TEST_NAME]]"; -fn Eq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.eq"; +fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; class Expect(B:! bool) {} fn Test(B:! bool) -> Expect(B) { return {}; } @@ -60,7 +60,7 @@ fn F() { library "[[@TEST_NAME]]"; -fn Eq(a: Core.IntLiteral(), b: i32) -> bool = "int.eq"; +fn Eq(a: Core.IntLiteral, b: i32) -> bool = "int.eq"; class Expect(B:! bool) {} fn Test(B:! bool) -> Expect(B) { return {}; } @@ -76,33 +76,33 @@ fn F() { library "[[@TEST_NAME]]"; -fn Eq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.eq"; +fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; -fn Test(n: Core.IntLiteral()) { +fn Test(n: Core.IntLiteral) { // OK Eq(1, 1); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: Eq(n, 1); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-8]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn Eq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.eq"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Eq(n, 1); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: Eq(1, n); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-16]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn Eq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.eq"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Eq(1, n); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: Eq(n, n); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-24]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn Eq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.eq"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn Eq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.eq"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Eq(n, n); } diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index f31511fdcfd5..f472263f1a16 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -38,7 +38,7 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> bool { library "[[@TEST_NAME]]"; -fn GreaterEq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.greater_eq"; +fn GreaterEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.greater_eq"; class Expect(B:! bool) {} fn Test(B:! bool) -> Expect(B) { return {}; } @@ -56,7 +56,7 @@ fn F() { library "[[@TEST_NAME]]"; -fn GreaterEq(a: Core.IntLiteral(), b: i32) -> bool = "int.greater_eq"; +fn GreaterEq(a: Core.IntLiteral, b: i32) -> bool = "int.greater_eq"; class Expect(B:! bool) {} fn Test(B:! bool) -> Expect(B) { return {}; } diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index 3c5ff4dcfdad..74706b9baf13 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -66,10 +66,10 @@ fn RuntimeCall(a: u32, b: i32) -> u32 { library "[[@TEST_NAME]]"; -fn LeftShift(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.left_shift"; +fn LeftShift(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.left_shift"; -class Expect(N:! Core.IntLiteral()) {} -fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } +class Expect(N:! Core.IntLiteral) {} +fn Test(N:! Core.IntLiteral) -> Expect(N) { return {}; } fn F() { // Zero can be shifted by any amount. @@ -107,7 +107,7 @@ fn F() { library "[[@TEST_NAME]]"; fn LeftShift(a: i32, b: i32) -> i32 = "int.left_shift"; -fn LeftShiftLit(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.left_shift"; +fn LeftShiftLit(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.left_shift"; // Shift greater than size is disallowed for sized types. let size_1: i32 = LeftShift(1, 31); @@ -149,22 +149,22 @@ let negative: i32 = LeftShift(1, -1); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: let negative_zero: i32 = LeftShift(0, -1); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:39: error: shift distance negative in `1 << -1` [CompileTimeShiftNegative] -// CHECK:STDERR: let negative_lit: Core.IntLiteral() = LeftShiftLit(1, -1); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:37: error: shift distance negative in `1 << -1` [CompileTimeShiftNegative] +// CHECK:STDERR: let negative_lit: Core.IntLiteral = LeftShiftLit(1, -1); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -let negative_lit: Core.IntLiteral() = LeftShiftLit(1, -1); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:44: error: shift distance negative in `0 << -1` [CompileTimeShiftNegative] -// CHECK:STDERR: let negative_lit_zero: Core.IntLiteral() = LeftShiftLit(0, -1); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ +let negative_lit: Core.IntLiteral = LeftShiftLit(1, -1); +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:42: error: shift distance negative in `0 << -1` [CompileTimeShiftNegative] +// CHECK:STDERR: let negative_lit_zero: Core.IntLiteral = LeftShiftLit(0, -1); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -let negative_lit_zero: Core.IntLiteral() = LeftShiftLit(0, -1); +let negative_lit_zero: Core.IntLiteral = LeftShiftLit(0, -1); // --- fail_literal_overflow.carbon library "[[@TEST_NAME]]"; -fn LeftShift(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.left_shift"; +fn LeftShift(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.left_shift"; // CHECK:STDERR: fail_literal_overflow.carbon:[[@LINE+4]]:16: error: shift distance of 1000000000 would result in an integer whose width is greater than the maximum supported width of 8388608 [CompileTimeUnsizedShiftOutOfRange] // CHECK:STDERR: let bad: i32 = LeftShift(1, 1_000_000_000); @@ -182,10 +182,10 @@ let bad_negative: i32 = LeftShift(-1, 1_000_000_000); library "[[@TEST_NAME]]"; -fn LeftShiftByLit(a: i32, b: Core.IntLiteral()) -> i32 = "int.left_shift"; -fn LeftShiftOfLit(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.left_shift"; +fn LeftShiftByLit(a: i32, b: Core.IntLiteral) -> i32 = "int.left_shift"; +fn LeftShiftOfLit(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.left_shift"; -var a_lit: Core.IntLiteral() = 12; +var a_lit: Core.IntLiteral = 12; var an_i32: i32 = 34; // This can't be valid: we don't have a compile-time or runtime integer value for `a_lit`. @@ -193,40 +193,40 @@ var an_i32: i32 = 34; // CHECK:STDERR: let bad1: i32 = LeftShiftByLit(an_i32, a_lit); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE-10]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] -// CHECK:STDERR: fn LeftShiftByLit(a: i32, b: Core.IntLiteral()) -> i32 = "int.left_shift"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn LeftShiftByLit(a: i32, b: Core.IntLiteral) -> i32 = "int.left_shift"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let bad1: i32 = LeftShiftByLit(an_i32, a_lit); // TODO: This could be valid because we don't actually need the return value at runtime. -// CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE+7]]:31: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] -// CHECK:STDERR: let bad2: Core.IntLiteral() = LeftShiftOfLit(a_lit, an_i32); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE+7]]:29: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] +// CHECK:STDERR: let bad2: Core.IntLiteral = LeftShiftOfLit(a_lit, an_i32); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE-19]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] -// CHECK:STDERR: fn LeftShiftOfLit(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.left_shift"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn LeftShiftOfLit(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.left_shift"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -let bad2: Core.IntLiteral() = LeftShiftOfLit(a_lit, an_i32); +let bad2: Core.IntLiteral = LeftShiftOfLit(a_lit, an_i32); // TODO: This could be valid because the literal argument has a constant value. // CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE+7]]:17: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: let bad3: i32 = LeftShiftByLit(an_i32, 12); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE-30]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] -// CHECK:STDERR: fn LeftShiftByLit(a: i32, b: Core.IntLiteral()) -> i32 = "int.left_shift"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn LeftShiftByLit(a: i32, b: Core.IntLiteral) -> i32 = "int.left_shift"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let bad3: i32 = LeftShiftByLit(an_i32, 12); // TODO: This could be valid because we don't actually need the return value at runtime. -// CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE+7]]:31: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] -// CHECK:STDERR: let bad4: Core.IntLiteral() = LeftShiftOfLit(12, an_i32); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE+7]]:29: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] +// CHECK:STDERR: let bad4: Core.IntLiteral = LeftShiftOfLit(12, an_i32); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fail_comp_time_only_shift.carbon:[[@LINE-39]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] -// CHECK:STDERR: fn LeftShiftOfLit(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.left_shift"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn LeftShiftOfLit(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.left_shift"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -let bad4: Core.IntLiteral() = LeftShiftOfLit(12, an_i32); +let bad4: Core.IntLiteral = LeftShiftOfLit(12, an_i32); // CHECK:STDOUT: --- i32.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/left_shift_assign.carbon b/toolchain/check/testdata/builtins/int/left_shift_assign.carbon index 7ecee532bb28..eac2ca838fe3 100644 --- a/toolchain/check/testdata/builtins/int/left_shift_assign.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift_assign.carbon @@ -35,10 +35,10 @@ fn CallMixed(ref a: i32, b: i64) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.left_shift_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.left_shift_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.left_shift_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.left_shift_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.left_shift_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 5fee1574c66a..18d0fca1be8a 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -38,7 +38,7 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> bool { library "[[@TEST_NAME]]"; -fn LessEq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.less_eq"; +fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; class Expect(B:! bool) {} fn Test(B:! bool) -> Expect(B) { return {}; } @@ -56,7 +56,7 @@ fn F() { library "[[@TEST_NAME]]"; -fn LessEq(a: Core.IntLiteral(), b: i32) -> bool = "int.less_eq"; +fn LessEq(a: Core.IntLiteral, b: i32) -> bool = "int.less_eq"; class Expect(B:! bool) {} fn Test(B:! bool) -> Expect(B) { return {}; } @@ -74,33 +74,33 @@ fn F() { library "[[@TEST_NAME]]"; -fn LessEq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.less_eq"; +fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; -fn Test(n: Core.IntLiteral()) { +fn Test(n: Core.IntLiteral) { // OK LessEq(1, 1); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: LessEq(n, 1); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-8]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn LessEq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.less_eq"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: LessEq(n, 1); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: LessEq(1, n); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-16]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn LessEq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.less_eq"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: LessEq(1, n); // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction] // CHECK:STDERR: LessEq(n, n); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fail_runtime_literal.carbon:[[@LINE-24]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] - // CHECK:STDERR: fn LessEq(a: Core.IntLiteral(), b: Core.IntLiteral()) -> bool = "int.less_eq"; - // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: fn LessEq(a: Core.IntLiteral, b: Core.IntLiteral) -> bool = "int.less_eq"; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: LessEq(n, n); } diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 0b29459dcf7d..72720d7e7da1 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -14,8 +14,9 @@ library "[[@TEST_NAME]]"; -fn IntLiteral() -> type = "int_literal.make_type"; -fn Int(n: IntLiteral()) -> type = "int.make_type_signed"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); +fn Int(n: IntLiteral) -> type = "int.make_type_signed"; // --- use_types.carbon @@ -23,7 +24,7 @@ library "[[@TEST_NAME]]"; import library "types"; -fn Copy[N:! IntLiteral()](x: Int(N)) -> Int(N) = "primitive_copy"; +fn Copy[N:! IntLiteral](x: Int(N)) -> Int(N) = "primitive_copy"; fn F(n: Int(64)) -> //@dump-sem-ir-begin @@ -41,7 +42,7 @@ fn G(n: Int(13)) -> return Copy(n); } -fn Symbolic(N:! IntLiteral(), x: Int(N)) -> Int(N) { +fn Symbolic(N:! IntLiteral, x: Int(N)) -> Int(N) { return Copy(x); } @@ -82,7 +83,7 @@ library "[[@TEST_NAME]]"; import library "types"; -fn Negate(a: IntLiteral()) -> IntLiteral() = "int.snegate"; +fn Negate(a: IntLiteral) -> IntLiteral = "int.snegate"; // CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: error: integer type width of -1 is not positive [IntWidthNotPositive] // CHECK:STDERR: var n: Int(Negate(1)); diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index d5c28a84af47..ba788c3c2558 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -14,8 +14,9 @@ library "[[@TEST_NAME]]"; -fn IntLiteral() -> type = "int_literal.make_type"; -fn UInt(n: IntLiteral()) -> type = "int.make_type_unsigned"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); +fn UInt(n: IntLiteral) -> type = "int.make_type_unsigned"; // --- use_types.carbon @@ -23,7 +24,7 @@ library "[[@TEST_NAME]]"; import library "types"; -fn Copy[N:! IntLiteral()](x: UInt(N)) -> UInt(N) = "primitive_copy"; +fn Copy[N:! IntLiteral](x: UInt(N)) -> UInt(N) = "primitive_copy"; fn F(n: UInt(64)) -> //@dump-sem-ir-begin @@ -41,7 +42,7 @@ fn G(n: UInt(13)) -> return Copy(n); } -fn Symbolic(N:! IntLiteral(), x: UInt(N)) -> UInt(N) +fn Symbolic(N:! IntLiteral, x: UInt(N)) -> UInt(N) { return Copy(x); } diff --git a/toolchain/check/testdata/builtins/int/or_assign.carbon b/toolchain/check/testdata/builtins/int/or_assign.carbon index a97f235c20df..c21d742dcb9d 100644 --- a/toolchain/check/testdata/builtins/int/or_assign.carbon +++ b/toolchain/check/testdata/builtins/int/or_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.or_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.or_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.or_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.or_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.or_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 7fbda373db3e..37e3ae8a34ed 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -65,10 +65,10 @@ fn RuntimeCall(a: u32, b: i32) -> u32 { library "[[@TEST_NAME]]"; -fn RightShift(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.right_shift"; +fn RightShift(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.right_shift"; -class Expect(N:! Core.IntLiteral()) {} -fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } +class Expect(N:! Core.IntLiteral) {} +fn Test(N:! Core.IntLiteral) -> Expect(N) { return {}; } fn F() { Test(RightShift(0, 31)) as Expect(0); @@ -95,7 +95,7 @@ fn F() { library "[[@TEST_NAME]]"; fn RightShift(a: i32, b: i32) -> i32 = "int.right_shift"; -fn RightShiftLit(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.right_shift"; +fn RightShiftLit(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.right_shift"; // Shift greater than size is disallowed for sized types. let size_1: i32 = RightShift(1, 31); @@ -121,16 +121,16 @@ let negative: i32 = RightShift(1, -1); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: let negative_zero: i32 = RightShift(0, -1); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:39: error: shift distance negative in `1 >> -1` [CompileTimeShiftNegative] -// CHECK:STDERR: let negative_lit: Core.IntLiteral() = RightShiftLit(1, -1); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:37: error: shift distance negative in `1 >> -1` [CompileTimeShiftNegative] +// CHECK:STDERR: let negative_lit: Core.IntLiteral = RightShiftLit(1, -1); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -let negative_lit: Core.IntLiteral() = RightShiftLit(1, -1); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:44: error: shift distance negative in `0 >> -1` [CompileTimeShiftNegative] -// CHECK:STDERR: let negative_lit_zero: Core.IntLiteral() = RightShiftLit(0, -1); -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ +let negative_lit: Core.IntLiteral = RightShiftLit(1, -1); +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:42: error: shift distance negative in `0 >> -1` [CompileTimeShiftNegative] +// CHECK:STDERR: let negative_lit_zero: Core.IntLiteral = RightShiftLit(0, -1); +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -let negative_lit_zero: Core.IntLiteral() = RightShiftLit(0, -1); +let negative_lit_zero: Core.IntLiteral = RightShiftLit(0, -1); // CHECK:STDOUT: --- i32.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/right_shift_assign.carbon b/toolchain/check/testdata/builtins/int/right_shift_assign.carbon index e00a9cbca3fc..694b0ab226d1 100644 --- a/toolchain/check/testdata/builtins/int/right_shift_assign.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift_assign.carbon @@ -35,10 +35,10 @@ fn CallMixed(ref a: i32, b: i64) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.right_shift_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.right_shift_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.right_shift_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.right_shift_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.right_shift_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 1114909bd7b0..bf6589e46431 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -35,10 +35,10 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { library "[[@TEST_NAME]]"; -fn Add(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.sadd"; +fn Add(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.sadd"; -class Expect(N:! Core.IntLiteral()) {} -fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } +class Expect(N:! Core.IntLiteral) {} +fn Test(N:! Core.IntLiteral) -> Expect(N) { return {}; } fn F() { Test(Add(0, 0)) as Expect(0); @@ -128,25 +128,25 @@ var bad_call: array(i32, JustRight(1, 2, 3)); library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_mixed_add.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature] -// CHECK:STDERR: fn MixedAdd1(a: i32, b: Core.IntLiteral()) -> i32 = "int.sadd"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn MixedAdd1(a: i32, b: Core.IntLiteral) -> i32 = "int.sadd"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn MixedAdd1(a: i32, b: Core.IntLiteral()) -> i32 = "int.sadd"; +fn MixedAdd1(a: i32, b: Core.IntLiteral) -> i32 = "int.sadd"; // CHECK:STDERR: fail_mixed_add.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature] -// CHECK:STDERR: fn MixedAdd2(a: Core.IntLiteral(), b: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn MixedAdd2(a: Core.IntLiteral, b: i32) -> i32 = "int.sadd"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn MixedAdd2(a: Core.IntLiteral(), b: i32) -> i32 = "int.sadd"; +fn MixedAdd2(a: Core.IntLiteral, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: fail_mixed_add.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature] -// CHECK:STDERR: fn MixedAdd3(a: i32, b: Core.IntLiteral()) -> Core.IntLiteral() = "int.sadd"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn MixedAdd3(a: i32, b: Core.IntLiteral) -> Core.IntLiteral = "int.sadd"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn MixedAdd3(a: i32, b: Core.IntLiteral()) -> Core.IntLiteral() = "int.sadd"; +fn MixedAdd3(a: i32, b: Core.IntLiteral) -> Core.IntLiteral = "int.sadd"; // CHECK:STDERR: fail_mixed_add.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature] -// CHECK:STDERR: fn MixedAdd4(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.sadd"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn MixedAdd4(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.sadd"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn MixedAdd4(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.sadd"; +fn MixedAdd4(a: Core.IntLiteral, b: i32) -> Core.IntLiteral = "int.sadd"; // --- fail_overflow.carbon diff --git a/toolchain/check/testdata/builtins/int/sadd_assign.carbon b/toolchain/check/testdata/builtins/int/sadd_assign.carbon index f01f5ac5886b..6c38a5907f8e 100644 --- a/toolchain/check/testdata/builtins/int/sadd_assign.carbon +++ b/toolchain/check/testdata/builtins/int/sadd_assign.carbon @@ -25,10 +25,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.sadd_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.sadd_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.sadd_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.sadd_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index 8ecc28910dde..b5620076dced 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -50,10 +50,10 @@ let c: i32 = Div(-0x8000_0000, -1); library "[[@TEST_NAME]]"; -fn Div(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.sdiv"; +fn Div(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.sdiv"; -class Expect(N:! Core.IntLiteral()) {} -fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } +class Expect(N:! Core.IntLiteral) {} +fn Test(N:! Core.IntLiteral) -> Expect(N) { return {}; } fn F() { Test(Div(-0x8000_0000, -1)) as Expect(0x8000_0000); @@ -65,7 +65,7 @@ fn F() { library "[[@TEST_NAME]]"; fn Div(a: i32, b: i32) -> i32 = "int.sdiv"; -fn DivLit(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.sdiv"; +fn DivLit(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.sdiv"; // CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero [CompileTimeDivisionByZero] // CHECK:STDERR: let a: i32 = Div(1, 0); @@ -80,17 +80,17 @@ let a: i32 = Div(1, 0); let b: i32 = Div(0, 0); // IntLiteral allows "overflow" by widening its representation, but not overflow to infinity. -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:28: error: division by zero [CompileTimeDivisionByZero] -// CHECK:STDERR: let c: Core.IntLiteral() = DivLit(1, 0); -// CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:26: error: division by zero [CompileTimeDivisionByZero] +// CHECK:STDERR: let c: Core.IntLiteral = DivLit(1, 0); +// CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: -let c: Core.IntLiteral() = DivLit(1, 0); +let c: Core.IntLiteral = DivLit(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:28: error: division by zero [CompileTimeDivisionByZero] -// CHECK:STDERR: let d: Core.IntLiteral() = DivLit(0, 0); -// CHECK:STDERR: ^~~~~~~~~~~~ +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:26: error: division by zero [CompileTimeDivisionByZero] +// CHECK:STDERR: let d: Core.IntLiteral = DivLit(0, 0); +// CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: -let d: Core.IntLiteral() = DivLit(0, 0); +let d: Core.IntLiteral = DivLit(0, 0); // CHECK:STDOUT: --- int_div.carbon // CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/sdiv_assign.carbon b/toolchain/check/testdata/builtins/int/sdiv_assign.carbon index 0732a7c61c15..35572841e3b6 100644 --- a/toolchain/check/testdata/builtins/int/sdiv_assign.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sdiv_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.sdiv_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.sdiv_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.sdiv_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.sdiv_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/smod_assign.carbon b/toolchain/check/testdata/builtins/int/smod_assign.carbon index baa079f9f5e2..c5236fc9fa62 100644 --- a/toolchain/check/testdata/builtins/int/smod_assign.carbon +++ b/toolchain/check/testdata/builtins/int/smod_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.smod_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.smod_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.smod_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.smod_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.smod_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 95acca529b1c..1de0075e6128 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -38,10 +38,10 @@ fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { library "[[@TEST_NAME]]"; -fn Mul(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.smul"; +fn Mul(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.smul"; -class Expect(N:! Core.IntLiteral()) {} -fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } +class Expect(N:! Core.IntLiteral) {} +fn Test(N:! Core.IntLiteral) -> Expect(N) { return {}; } fn F() { Test(Mul(0, 0)) as Expect(0); diff --git a/toolchain/check/testdata/builtins/int/smul_assign.carbon b/toolchain/check/testdata/builtins/int/smul_assign.carbon index 7d812293eade..fdca90483e38 100644 --- a/toolchain/check/testdata/builtins/int/smul_assign.carbon +++ b/toolchain/check/testdata/builtins/int/smul_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.smul_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.smul_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.smul_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.smul_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.smul_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index 23b2c99b6243..108a82f5dba5 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -31,11 +31,11 @@ fn RuntimeCallIsValid(a: i32, unused b: i32) -> i32 { library "[[@TEST_NAME]]"; -fn Negate(a: Core.IntLiteral()) -> Core.IntLiteral() = "int.snegate"; -fn Sub(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.ssub"; +fn Negate(a: Core.IntLiteral) -> Core.IntLiteral = "int.snegate"; +fn Sub(a: Core.IntLiteral, b: Core.IntLiteral) -> Core.IntLiteral = "int.ssub"; -class Expect(N:! Core.IntLiteral()) {} -fn Test(N:! Core.IntLiteral()) -> Expect(N) { return {}; } +class Expect(N:! Core.IntLiteral) {} +fn Test(N:! Core.IntLiteral) -> Expect(N) { return {}; } fn F() { Test(Negate(0)) as Expect(0); diff --git a/toolchain/check/testdata/builtins/int/ssub_assign.carbon b/toolchain/check/testdata/builtins/int/ssub_assign.carbon index ab862c93df83..b601810f8b74 100644 --- a/toolchain/check/testdata/builtins/int/ssub_assign.carbon +++ b/toolchain/check/testdata/builtins/int/ssub_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.ssub_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.ssub_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.ssub_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.ssub_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.ssub_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/uadd_assign.carbon b/toolchain/check/testdata/builtins/int/uadd_assign.carbon index a6634e531c08..97c3448676c8 100644 --- a/toolchain/check/testdata/builtins/int/uadd_assign.carbon +++ b/toolchain/check/testdata/builtins/int/uadd_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.uadd_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.uadd_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.uadd_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.uadd_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/udiv_assign.carbon b/toolchain/check/testdata/builtins/int/udiv_assign.carbon index 6e82b36e1691..1d6beefd5161 100644 --- a/toolchain/check/testdata/builtins/int/udiv_assign.carbon +++ b/toolchain/check/testdata/builtins/int/udiv_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.udiv_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.udiv_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.udiv_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.udiv_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.udiv_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/umod_assign.carbon b/toolchain/check/testdata/builtins/int/umod_assign.carbon index 17664e033f86..7bad94dafb7c 100644 --- a/toolchain/check/testdata/builtins/int/umod_assign.carbon +++ b/toolchain/check/testdata/builtins/int/umod_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.umod_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.umod_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.umod_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.umod_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.umod_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/umul_assign.carbon b/toolchain/check/testdata/builtins/int/umul_assign.carbon index 87e5dc081752..be4e538bf315 100644 --- a/toolchain/check/testdata/builtins/int/umul_assign.carbon +++ b/toolchain/check/testdata/builtins/int/umul_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.umul_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.umul_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.umul_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.umul_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.umul_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/usub_assign.carbon b/toolchain/check/testdata/builtins/int/usub_assign.carbon index 06e31f1f28c8..03db09fb1d1a 100644 --- a/toolchain/check/testdata/builtins/int/usub_assign.carbon +++ b/toolchain/check/testdata/builtins/int/usub_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.usub_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.usub_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.usub_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.usub_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.usub_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int/xor_assign.carbon b/toolchain/check/testdata/builtins/int/xor_assign.carbon index 6649c728d970..16d09eec4df6 100644 --- a/toolchain/check/testdata/builtins/int/xor_assign.carbon +++ b/toolchain/check/testdata/builtins/int/xor_assign.carbon @@ -27,10 +27,10 @@ fn Call(ref a: i32, b: i32) { library "[[@TEST_NAME]]"; // CHECK:STDERR: fail_unsized.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.xor_assign" [InvalidBuiltinSignature] -// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.xor_assign"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.xor_assign"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn Builtin(ref a: Core.IntLiteral(), b: Core.IntLiteral()) = "int.xor_assign"; +fn Builtin(ref a: Core.IntLiteral, b: Core.IntLiteral) = "int.xor_assign"; // --- fail_bad_decl.carbon diff --git a/toolchain/check/testdata/builtins/int_literal/make_type.carbon b/toolchain/check/testdata/builtins/int_literal/make_type.carbon index da55d5775295..2468bc1d2dec 100644 --- a/toolchain/check/testdata/builtins/int_literal/make_type.carbon +++ b/toolchain/check/testdata/builtins/int_literal/make_type.carbon @@ -14,7 +14,8 @@ library "[[@TEST_NAME]]"; -fn IntLiteral() -> type = "int_literal.make_type"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); // --- use_types.carbon @@ -22,4 +23,4 @@ library "[[@TEST_NAME]]"; import library "types"; -var i: IntLiteral(); +var i: IntLiteral; diff --git a/toolchain/check/testdata/class/adapter/extend_adapt.carbon b/toolchain/check/testdata/class/adapter/extend_adapt.carbon index 4f3094127858..48d9f7a80e4b 100644 --- a/toolchain/check/testdata/class/adapter/extend_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/extend_adapt.carbon @@ -127,7 +127,7 @@ fn F(a: TupleAdapter) -> i32 { library "[[@TEST_NAME]]"; -fn MakeInt(N: Core.IntLiteral()) -> type = "int.make_type_signed"; +fn MakeInt(N: Core.IntLiteral) -> type = "int.make_type_signed"; class IntAdapter { extend adapt MakeInt(32); @@ -593,11 +593,9 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: --- fail_adapt_builtin.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] +// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] +// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %MakeInt.type: type = fn_type @MakeInt [concrete] // CHECK:STDOUT: %MakeInt: %MakeInt.type = struct_value () [concrete] // CHECK:STDOUT: %IntAdapter: type = class_type @IntAdapter [concrete] @@ -621,7 +619,7 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -637,17 +635,14 @@ fn F(a: IntAdapter) -> i32 { // CHECK:STDOUT: %N.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = at_binding_pattern N, %N.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_37.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_35.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_37.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc4_37.2: Core.Form = init_form %.loc4_37.1 [concrete = constants.%.805] +// CHECK:STDOUT: %.loc4_35.1: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc4_35.2: Core.Form = init_form %.loc4_35.1 [concrete = constants.%.805] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %.loc4_31.1: type = splice_block %.loc4_31.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc4_19: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_31.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_31.3: type = converted %IntLiteral.call, %.loc4_31.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N: Core.IntLiteral = value_binding N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param call_param1 diff --git a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon index b6e6c0721f4b..fa9dee07e699 100644 --- a/toolchain/check/testdata/class/generic/complete_in_conversion.carbon +++ b/toolchain/check/testdata/class/generic/complete_in_conversion.carbon @@ -14,7 +14,7 @@ // --- fail_derived_to_base.carbon -fn Int(N: Core.IntLiteral()) -> type = "int.make_type_signed"; +fn Int(N: Core.IntLiteral) -> type = "int.make_type_signed"; base class B {} @@ -38,11 +38,9 @@ fn F(a: A(0)*) { // CHECK:STDOUT: --- fail_derived_to_base.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] +// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] +// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %Int.type.9c0: type = fn_type @Int.loc2 [concrete] // CHECK:STDOUT: %Int.c4a: %Int.type.9c0 = struct_value () [concrete] // CHECK:STDOUT: %B: type = class_type @B [concrete] @@ -108,7 +106,7 @@ fn F(a: A(0)*) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type.6c1 = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] @@ -128,17 +126,14 @@ fn F(a: A(0)*) { // CHECK:STDOUT: %N.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = at_binding_pattern N, %N.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc2_33.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc2_31.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc2_33.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc2_33.2: Core.Form = init_form %.loc2_33.1 [concrete = constants.%.805] +// CHECK:STDOUT: %.loc2_31.1: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc2_31.2: Core.Form = init_form %.loc2_31.1 [concrete = constants.%.805] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %.loc2_27.1: type = splice_block %.loc2_27.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc2_15: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc2_27.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc2_27.3: type = converted %IntLiteral.call, %.loc2_27.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N: Core.IntLiteral = value_binding N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param call_param1 diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 0c0af0ab44e7..b485fa71a63b 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -31,7 +31,7 @@ library "[[@TEST_NAME]]"; class C {} -fn F[N:! Core.IntLiteral()](unused a: array(C, N)) -> i32 { return N; } +fn F[N:! Core.IntLiteral](unused a: array(C, N)) -> i32 { return N; } fn G() -> i32 { var a: array(C, 3) = ({}, {}, {}); @@ -44,7 +44,7 @@ library "[[@TEST_NAME]]"; class C {} -fn F[T:! type, N:! Core.IntLiteral()](unused a: array(T, N)) {} +fn F[T:! type, N:! Core.IntLiteral](unused a: array(T, N)) {} fn G() { var a: array(C, 3) = ({}, {}, {}); @@ -82,7 +82,7 @@ library "[[@TEST_NAME]]"; class C {} class D {} -fn F[N:! Core.IntLiteral()](unused a: array(C, N)) -> i32 { return N; } +fn F[N:! Core.IntLiteral](unused a: array(C, N)) -> i32 { return N; } fn G() -> i32 { // TODO: We succeed at deducing N here but fail to convert. Is this the right behavior? @@ -93,9 +93,9 @@ fn G() -> i32 { // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:12: note: type `array(D, 3)` does not implement interface `Core.ImplicitAs(array(C, 3))` [MissingImplInMemberAccessInContext] // CHECK:STDERR: return F(a); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-11]]:36: note: initializing function parameter [InCallToFunctionParam] - // CHECK:STDERR: fn F[N:! Core.IntLiteral()](unused a: array(C, N)) -> i32 { return N; } - // CHECK:STDERR: ^~~~~~~~~~~~~~ + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-11]]:34: note: initializing function parameter [InCallToFunctionParam] + // CHECK:STDERR: fn F[N:! Core.IntLiteral](unused a: array(C, N)) -> i32 { return N; } + // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: return F(a); } @@ -356,8 +356,6 @@ fn G() { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %array_type.87f: type = array_type %N, %C [symbolic] @@ -420,7 +418,7 @@ fn G() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] @@ -445,23 +443,20 @@ fn G() { // CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc6_55: Core.Form = init_form %i32 [concrete = constants.%.795] -// CHECK:STDOUT: %.loc6_26.1: type = splice_block %.loc6_26.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc6_53: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %.loc6_14: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_26.3: type = converted %IntLiteral.call, %.loc6_26.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_7.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc6_7.1 (constants.%N)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc6_49.1 (%array_type.87f) = value_param call_param0 -// CHECK:STDOUT: %.loc6_49: type = splice_block %array_type.loc6_49.2 [symbolic = %array_type.loc6_49.1 (constants.%array_type.87f)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc6_47.1 (%array_type.87f) = value_param call_param0 +// CHECK:STDOUT: %.loc6_47: type = splice_block %array_type.loc6_47.2 [symbolic = %array_type.loc6_47.1 (constants.%array_type.87f)] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %N.ref.loc6_48: Core.IntLiteral = name_ref N, %N.loc6_7.2 [symbolic = %N.loc6_7.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc6_49.2: type = array_type %N.ref.loc6_48, %C.ref [symbolic = %array_type.loc6_49.1 (constants.%array_type.87f)] +// CHECK:STDOUT: %N.ref.loc6_46: Core.IntLiteral = name_ref N, %N.loc6_7.2 [symbolic = %N.loc6_7.1 (constants.%N)] +// CHECK:STDOUT: %array_type.loc6_47.2: type = array_type %N.ref.loc6_46, %C.ref [symbolic = %array_type.loc6_47.1 (constants.%array_type.87f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc6_49.1 (%array_type.87f) = value_binding a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc6_47.1 (%array_type.87f) = value_binding a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -486,25 +481,25 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc6_7.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc6_7.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc6_7.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc6_49.1: type = array_type %N.loc6_7.1, constants.%C [symbolic = %array_type.loc6_49.1 (constants.%array_type.87f)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_49.1 [symbolic = %pattern_type (constants.%pattern_type.5ed)] +// CHECK:STDOUT: %array_type.loc6_47.1: type = array_type %N.loc6_7.1, constants.%C [symbolic = %array_type.loc6_47.1 (constants.%array_type.87f)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_47.1 [symbolic = %pattern_type (constants.%pattern_type.5ed)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_49.1 [symbolic = %require_complete (constants.%require_complete.29f)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_47.1 [symbolic = %require_complete (constants.%require_complete.29f)] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %N.loc6_7.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.2b9)] -// CHECK:STDOUT: %bound_method.loc6_69.3: = bound_method %N.loc6_7.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_69.3 (constants.%bound_method.ee4)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2: init %i32 = call %bound_method.loc6_69.3(%N.loc6_7.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %bound_method.loc6_67.3: = bound_method %N.loc6_7.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_67.3 (constants.%bound_method.ee4)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_67.2: init %i32 = call %bound_method.loc6_67.3(%N.loc6_7.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_67.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_49.1 (%array_type.87f)) -> out %return.param: %i32 { +// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_47.1 (%array_type.87f)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc6_68: Core.IntLiteral = name_ref N, %N.loc6_7.2 [symbolic = %N.loc6_7.1 (constants.%N)] +// CHECK:STDOUT: %N.ref.loc6_66: Core.IntLiteral = name_ref N, %N.loc6_7.2 [symbolic = %N.loc6_7.1 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.1c5 = impl_witness_access constants.%ImplicitAs.impl_witness.a23, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39] -// CHECK:STDOUT: %bound_method.loc6_69.1: = bound_method %N.ref.loc6_68, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.2b9)] +// CHECK:STDOUT: %bound_method.loc6_67.1: = bound_method %N.ref.loc6_66, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.2b9)] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_69.2: = bound_method %N.ref.loc6_68, %specific_fn [symbolic = %bound_method.loc6_69.3 (constants.%bound_method.ee4)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.1: init %i32 = call %bound_method.loc6_69.2(%N.ref.loc6_68) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc6_69: init %i32 = converted %N.ref.loc6_68, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: return %.loc6_69 +// CHECK:STDOUT: %bound_method.loc6_67.2: = bound_method %N.ref.loc6_66, %specific_fn [symbolic = %bound_method.loc6_67.3 (constants.%bound_method.ee4)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_67.1: init %i32 = call %bound_method.loc6_67.2(%N.ref.loc6_66) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_67.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc6_67: init %i32 = converted %N.ref.loc6_66, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_67.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_67.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: return %.loc6_67 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -564,20 +559,20 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc6_7.1 => constants.%N -// CHECK:STDOUT: %array_type.loc6_49.1 => constants.%array_type.87f +// CHECK:STDOUT: %array_type.loc6_47.1 => constants.%array_type.87f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.5ed // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_3.1ba) { // CHECK:STDOUT: %N.loc6_7.1 => constants.%int_3.1ba -// CHECK:STDOUT: %array_type.loc6_49.1 => constants.%array_type.9a3 +// CHECK:STDOUT: %array_type.loc6_47.1 => constants.%array_type.9a3 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.3f5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.1a4 // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.485 -// CHECK:STDOUT: %bound_method.loc6_69.3 => constants.%bound_method.763 -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_69.2 => constants.%int_3.410 +// CHECK:STDOUT: %bound_method.loc6_67.3 => constants.%bound_method.763 +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_67.2 => constants.%int_3.410 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- type_and_bound.carbon @@ -590,8 +585,6 @@ fn G() { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 1 [symbolic] // CHECK:STDOUT: %array_type.6d2: type = array_type %N, %T [symbolic] @@ -627,7 +620,7 @@ fn G() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -651,22 +644,19 @@ fn G() { // CHECK:STDOUT: %.loc6_10.2: type = type_literal type [concrete = type] // CHECK:STDOUT: } // CHECK:STDOUT: %T.loc6_7.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_7.1 (constants.%T)] -// CHECK:STDOUT: %.loc6_36.1: type = splice_block %.loc6_36.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc6_24: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self.loc6_17: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_36.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_36.3: type = converted %IntLiteral.call, %.loc6_36.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc6_17.2: Core.IntLiteral = symbolic_binding N, 1 [symbolic = %N.loc6_17.1 (constants.%N)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc6_59.1 (%array_type.6d2) = value_param call_param0 -// CHECK:STDOUT: %.loc6_59: type = splice_block %array_type.loc6_59.2 [symbolic = %array_type.loc6_59.1 (constants.%array_type.6d2)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc6_57.1 (%array_type.6d2) = value_param call_param0 +// CHECK:STDOUT: %.loc6_57: type = splice_block %array_type.loc6_57.2 [symbolic = %array_type.loc6_57.1 (constants.%array_type.6d2)] { // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_7.2 [symbolic = %T.loc6_7.1 (constants.%T)] // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc6_17.2 [symbolic = %N.loc6_17.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc6_59.2: type = array_type %N.ref, %T.ref [symbolic = %array_type.loc6_59.1 (constants.%array_type.6d2)] +// CHECK:STDOUT: %array_type.loc6_57.2: type = array_type %N.ref, %T.ref [symbolic = %array_type.loc6_57.1 (constants.%array_type.6d2)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc6_59.1 (%array_type.6d2) = value_binding a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc6_57.1 (%array_type.6d2) = value_binding a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} // CHECK:STDOUT: } @@ -682,13 +672,13 @@ fn G() { // CHECK:STDOUT: generic fn @F(%T.loc6_7.2: type, %N.loc6_17.2: Core.IntLiteral) { // CHECK:STDOUT: %T.loc6_7.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_7.1 (constants.%T)] // CHECK:STDOUT: %N.loc6_17.1: Core.IntLiteral = symbolic_binding N, 1 [symbolic = %N.loc6_17.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc6_59.1: type = array_type %N.loc6_17.1, %T.loc6_7.1 [symbolic = %array_type.loc6_59.1 (constants.%array_type.6d2)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_59.1 [symbolic = %pattern_type (constants.%pattern_type.4d8)] +// CHECK:STDOUT: %array_type.loc6_57.1: type = array_type %N.loc6_17.1, %T.loc6_7.1 [symbolic = %array_type.loc6_57.1 (constants.%array_type.6d2)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_57.1 [symbolic = %pattern_type (constants.%pattern_type.4d8)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_59.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_57.1 [symbolic = %require_complete (constants.%require_complete)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_59.1 (%array_type.6d2)) { +// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_57.1 (%array_type.6d2)) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -751,14 +741,14 @@ fn G() { // CHECK:STDOUT: specific @F(constants.%T, constants.%N) { // CHECK:STDOUT: %T.loc6_7.1 => constants.%T // CHECK:STDOUT: %N.loc6_17.1 => constants.%N -// CHECK:STDOUT: %array_type.loc6_59.1 => constants.%array_type.6d2 +// CHECK:STDOUT: %array_type.loc6_57.1 => constants.%array_type.6d2 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4d8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%C, constants.%int_3) { // CHECK:STDOUT: %T.loc6_7.1 => constants.%C // CHECK:STDOUT: %N.loc6_17.1 => constants.%int_3 -// CHECK:STDOUT: %array_type.loc6_59.1 => constants.%array_type.9a3 +// CHECK:STDOUT: %array_type.loc6_57.1 => constants.%array_type.9a3 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.3f5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -983,8 +973,6 @@ fn G() { // CHECK:STDOUT: %D: type = class_type @D [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %array_type.87f: type = array_type %N, %C [symbolic] @@ -1049,7 +1037,7 @@ fn G() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] @@ -1076,23 +1064,20 @@ fn G() { // CHECK:STDOUT: %return.patt: %pattern_type.6b6 = return_slot_pattern %return.param_patt, %i32 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %.loc7_55: Core.Form = init_form %i32 [concrete = constants.%.795] -// CHECK:STDOUT: %.loc7_26.1: type = splice_block %.loc7_26.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc7_53: Core.Form = init_form %i32 [concrete = constants.%.795] +// CHECK:STDOUT: %.loc7_14: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc7_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc7_26.3: type = converted %IntLiteral.call, %.loc7_26.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc7_7.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc7_7.1 (constants.%N)] -// CHECK:STDOUT: %a.param: @F.%array_type.loc7_49.1 (%array_type.87f) = value_param call_param0 -// CHECK:STDOUT: %.loc7_49: type = splice_block %array_type.loc7_49.2 [symbolic = %array_type.loc7_49.1 (constants.%array_type.87f)] { +// CHECK:STDOUT: %a.param: @F.%array_type.loc7_47.1 (%array_type.87f) = value_param call_param0 +// CHECK:STDOUT: %.loc7_47: type = splice_block %array_type.loc7_47.2 [symbolic = %array_type.loc7_47.1 (constants.%array_type.87f)] { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %N.ref.loc7_48: Core.IntLiteral = name_ref N, %N.loc7_7.2 [symbolic = %N.loc7_7.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc7_49.2: type = array_type %N.ref.loc7_48, %C.ref [symbolic = %array_type.loc7_49.1 (constants.%array_type.87f)] +// CHECK:STDOUT: %N.ref.loc7_46: Core.IntLiteral = name_ref N, %N.loc7_7.2 [symbolic = %N.loc7_7.1 (constants.%N)] +// CHECK:STDOUT: %array_type.loc7_47.2: type = array_type %N.ref.loc7_46, %C.ref [symbolic = %array_type.loc7_47.1 (constants.%array_type.87f)] // CHECK:STDOUT: } -// CHECK:STDOUT: %a: @F.%array_type.loc7_49.1 (%array_type.87f) = value_binding a, %a.param +// CHECK:STDOUT: %a: @F.%array_type.loc7_47.1 (%array_type.87f) = value_binding a, %a.param // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1 // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param // CHECK:STDOUT: } @@ -1125,25 +1110,25 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc7_7.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc7_7.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc7_7.1 (constants.%N)] -// CHECK:STDOUT: %array_type.loc7_49.1: type = array_type %N.loc7_7.1, constants.%C [symbolic = %array_type.loc7_49.1 (constants.%array_type.87f)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_49.1 [symbolic = %pattern_type (constants.%pattern_type.5ed)] +// CHECK:STDOUT: %array_type.loc7_47.1: type = array_type %N.loc7_7.1, constants.%C [symbolic = %array_type.loc7_47.1 (constants.%array_type.87f)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_47.1 [symbolic = %pattern_type (constants.%pattern_type.5ed)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc7_49.1 [symbolic = %require_complete (constants.%require_complete.29f)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc7_47.1 [symbolic = %require_complete (constants.%require_complete.29f)] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %N.loc7_7.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.2b9)] -// CHECK:STDOUT: %bound_method.loc7_69.3: = bound_method %N.loc7_7.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc7_69.3 (constants.%bound_method.ee4)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2: init %i32 = call %bound_method.loc7_69.3(%N.loc7_7.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %bound_method.loc7_67.3: = bound_method %N.loc7_7.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc7_67.3 (constants.%bound_method.ee4)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_67.2: init %i32 = call %bound_method.loc7_67.3(%N.loc7_7.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_67.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc7_49.1 (%array_type.87f)) -> out %return.param: %i32 { +// CHECK:STDOUT: fn(%a.param: @F.%array_type.loc7_47.1 (%array_type.87f)) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %N.ref.loc7_68: Core.IntLiteral = name_ref N, %N.loc7_7.2 [symbolic = %N.loc7_7.1 (constants.%N)] +// CHECK:STDOUT: %N.ref.loc7_66: Core.IntLiteral = name_ref N, %N.loc7_7.2 [symbolic = %N.loc7_7.1 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.1c5 = impl_witness_access constants.%ImplicitAs.impl_witness.a23, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39] -// CHECK:STDOUT: %bound_method.loc7_69.1: = bound_method %N.ref.loc7_68, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.2b9)] +// CHECK:STDOUT: %bound_method.loc7_67.1: = bound_method %N.ref.loc7_66, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.2b9)] // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc7_69.2: = bound_method %N.ref.loc7_68, %specific_fn [symbolic = %bound_method.loc7_69.3 (constants.%bound_method.ee4)] -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.1: init %i32 = call %bound_method.loc7_69.2(%N.ref.loc7_68) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: %.loc7_69: init %i32 = converted %N.ref.loc7_68, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] -// CHECK:STDOUT: return %.loc7_69 +// CHECK:STDOUT: %bound_method.loc7_67.2: = bound_method %N.ref.loc7_66, %specific_fn [symbolic = %bound_method.loc7_67.3 (constants.%bound_method.ee4)] +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_67.1: init %i32 = call %bound_method.loc7_67.2(%N.ref.loc7_66) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_67.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: %.loc7_67: init %i32 = converted %N.ref.loc7_66, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_67.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_67.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)] +// CHECK:STDOUT: return %.loc7_67 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1203,20 +1188,20 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc7_7.1 => constants.%N -// CHECK:STDOUT: %array_type.loc7_49.1 => constants.%array_type.87f +// CHECK:STDOUT: %array_type.loc7_47.1 => constants.%array_type.87f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.5ed // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_3.1ba) { // CHECK:STDOUT: %N.loc7_7.1 => constants.%int_3.1ba -// CHECK:STDOUT: %array_type.loc7_49.1 => constants.%array_type.9a3 +// CHECK:STDOUT: %array_type.loc7_47.1 => constants.%array_type.9a3 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.3f5 // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete => constants.%complete_type.1a4 // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.485 -// CHECK:STDOUT: %bound_method.loc7_69.3 => constants.%bound_method.763 -// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_69.2 => constants.%int_3.410 +// CHECK:STDOUT: %bound_method.loc7_67.3 => constants.%bound_method.763 +// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_67.2 => constants.%int_3.410 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_bound_type_mismatch.carbon diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index 33454e28a193..2761813d9ca4 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -16,11 +16,11 @@ library "[[@TEST_NAME]]"; -fn F[N:! Core.IntLiteral()](unused n: Core.Int(N)) -> Core.IntLiteral() { +fn F[N:! Core.IntLiteral](unused n: Core.Int(N)) -> Core.IntLiteral { return N; } -fn G(a: i64) -> Core.IntLiteral() { +fn G(a: i64) -> Core.IntLiteral { return F(a); } @@ -28,11 +28,11 @@ fn G(a: i64) -> Core.IntLiteral() { library "[[@TEST_NAME]]"; -fn F[N:! Core.IntLiteral()](unused n: Core.Float(N)) -> Core.IntLiteral() { +fn F[N:! Core.IntLiteral](unused n: Core.Float(N)) -> Core.IntLiteral { return N; } -fn G(a: f64) -> Core.IntLiteral() { +fn G(a: f64) -> Core.IntLiteral { return F(a); } @@ -41,8 +41,6 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] @@ -80,7 +78,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.9c3: %Core.IntLiteral.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] @@ -99,31 +97,25 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %n.param_patt: @F.%pattern_type (%pattern_type.142) = value_param_pattern [concrete] // CHECK:STDOUT: %n.patt: @F.%pattern_type (%pattern_type.142) = at_binding_pattern n, %n.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc4_71.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %IntLiteral.ref.loc4_57 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc4_55: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc4_59: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc4_71: init type = call %IntLiteral.ref.loc4_59() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_71.1: type = value_of_initializer %IntLiteral.call.loc4_71 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_71.2: type = converted %IntLiteral.call.loc4_71, %.loc4_71.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_71.3: Core.Form = init_form %.loc4_71.2 [concrete = constants.%.f7d] -// CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %Core.ref.loc4_53: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref.loc4_57: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_57: Core.Form = init_form %IntLiteral.ref.loc4_57 [concrete = constants.%.f7d] +// CHECK:STDOUT: %.loc4_14: type = splice_block %IntLiteral.ref.loc4_14 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref.loc4_10: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc4_14: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc4_26: init type = call %IntLiteral.ref.loc4_14() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %IntLiteral.call.loc4_26 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_26.3: type = converted %IntLiteral.call.loc4_26, %.loc4_26.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref.loc4_14: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_7.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_7.1 (constants.%N)] -// CHECK:STDOUT: %n.param: @F.%Int.loc4_49.1 (%Int) = value_param call_param0 -// CHECK:STDOUT: %.loc4_49: type = splice_block %Int.loc4_49.2 [symbolic = %Int.loc4_49.1 (constants.%Int)] { -// CHECK:STDOUT: %Core.ref.loc4_39: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %n.param: @F.%Int.loc4_47.1 (%Int) = value_param call_param0 +// CHECK:STDOUT: %.loc4_47: type = splice_block %Int.loc4_47.2 [symbolic = %Int.loc4_47.1 (constants.%Int)] { +// CHECK:STDOUT: %Core.ref.loc4_37: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic] // CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_7.2 [symbolic = %N.loc4_7.1 (constants.%N)] -// CHECK:STDOUT: %Int.loc4_49.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc4_49.1 (constants.%Int)] +// CHECK:STDOUT: %Int.loc4_47.2: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc4_47.1 (constants.%Int)] // CHECK:STDOUT: } -// CHECK:STDOUT: %n: @F.%Int.loc4_49.1 (%Int) = value_binding n, %n.param +// CHECK:STDOUT: %n: @F.%Int.loc4_47.1 (%Int) = value_binding n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } @@ -131,14 +123,11 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %a.param_patt: %pattern_type.f57 = value_param_pattern [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.f57 = at_binding_pattern a, %a.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc8_33.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %IntLiteral.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_33.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_33.2: type = converted %IntLiteral.call, %.loc8_33.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_33.3: Core.Form = init_form %.loc8_33.2 [concrete = constants.%.f7d] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc8: Core.Form = init_form %IntLiteral.ref [concrete = constants.%.f7d] // CHECK:STDOUT: %a.param: %i64 = value_param call_param0 // CHECK:STDOUT: %i64: type = type_literal constants.%i64 [concrete = constants.%i64] // CHECK:STDOUT: %a: %i64 = value_binding a, %a.param @@ -149,14 +138,14 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc4_7.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc4_7.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_7.1 (constants.%N)] -// CHECK:STDOUT: %Int.loc4_49.1: type = class_type @Int, @Int(%N.loc4_7.1) [symbolic = %Int.loc4_49.1 (constants.%Int)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc4_49.1 [symbolic = %pattern_type (constants.%pattern_type.142)] +// CHECK:STDOUT: %Int.loc4_47.1: type = class_type @Int, @Int(%N.loc4_7.1) [symbolic = %Int.loc4_47.1 (constants.%Int)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc4_47.1 [symbolic = %pattern_type (constants.%pattern_type.142)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Int.loc4_49.1 [symbolic = %require_complete (constants.%require_complete.4df)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Int.loc4_47.1 [symbolic = %require_complete (constants.%require_complete.4df)] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.bound: = bound_method %N.loc4_7.1, constants.%Core.IntLiteral.as.Copy.impl.Op [symbolic = %Core.IntLiteral.as.Copy.impl.Op.bound (constants.%Core.IntLiteral.as.Copy.impl.Op.bound.3c6)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n.param: @F.%Int.loc4_49.1 (%Int)) -> out %return.param: Core.IntLiteral { +// CHECK:STDOUT: fn(%n.param: @F.%Int.loc4_47.1 (%Int)) -> out %return.param: Core.IntLiteral { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc5: Core.IntLiteral = name_ref N, %N.loc4_7.2 [symbolic = %N.loc4_7.1 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.c22 = impl_witness_access constants.%Copy.impl_witness.6f1, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] @@ -177,13 +166,13 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc4_7.1 => constants.%N -// CHECK:STDOUT: %Int.loc4_49.1 => constants.%Int +// CHECK:STDOUT: %Int.loc4_47.1 => constants.%Int // CHECK:STDOUT: %pattern_type => constants.%pattern_type.142 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_64) { // CHECK:STDOUT: %N.loc4_7.1 => constants.%int_64 -// CHECK:STDOUT: %Int.loc4_49.1 => constants.%i64 +// CHECK:STDOUT: %Int.loc4_47.1 => constants.%i64 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.f57 // CHECK:STDOUT: // CHECK:STDOUT: !definition: @@ -196,8 +185,6 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %Float.type: type = generic_class_type @Float [concrete] @@ -235,7 +222,7 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/parts/float, Float, loaded [concrete = constants.%Float.generic] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.9c3: %Core.IntLiteral.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] @@ -254,31 +241,25 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %n.param_patt: @F.%pattern_type (%pattern_type.903) = value_param_pattern [concrete] // CHECK:STDOUT: %n.patt: @F.%pattern_type (%pattern_type.903) = at_binding_pattern n, %n.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc4_73.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %IntLiteral.ref.loc4_59 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Core.ref.loc4_57: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc4_61: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc4_73: init type = call %IntLiteral.ref.loc4_61() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_73.1: type = value_of_initializer %IntLiteral.call.loc4_73 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_73.2: type = converted %IntLiteral.call.loc4_73, %.loc4_73.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_73.3: Core.Form = init_form %.loc4_73.2 [concrete = constants.%.f7d] -// CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %Core.ref.loc4_55: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %IntLiteral.ref.loc4_59: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc4_59: Core.Form = init_form %IntLiteral.ref.loc4_59 [concrete = constants.%.f7d] +// CHECK:STDOUT: %.loc4_14: type = splice_block %IntLiteral.ref.loc4_14 [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref.loc4_10: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref.loc4_14: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc4_26: init type = call %IntLiteral.ref.loc4_14() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %IntLiteral.call.loc4_26 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_26.3: type = converted %IntLiteral.call.loc4_26, %.loc4_26.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref.loc4_14: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_7.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_7.1 (constants.%N)] -// CHECK:STDOUT: %n.param: @F.%Float.loc4_51.1 (%Float) = value_param call_param0 -// CHECK:STDOUT: %.loc4_51: type = splice_block %Float.loc4_51.2 [symbolic = %Float.loc4_51.1 (constants.%Float)] { -// CHECK:STDOUT: %Core.ref.loc4_39: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %n.param: @F.%Float.loc4_49.1 (%Float) = value_param call_param0 +// CHECK:STDOUT: %.loc4_49: type = splice_block %Float.loc4_49.2 [symbolic = %Float.loc4_49.1 (constants.%Float)] { +// CHECK:STDOUT: %Core.ref.loc4_37: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%Core.Float [concrete = constants.%Float.generic] // CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_7.2 [symbolic = %N.loc4_7.1 (constants.%N)] -// CHECK:STDOUT: %Float.loc4_51.2: type = class_type @Float, @Float(constants.%N) [symbolic = %Float.loc4_51.1 (constants.%Float)] +// CHECK:STDOUT: %Float.loc4_49.2: type = class_type @Float, @Float(constants.%N) [symbolic = %Float.loc4_49.1 (constants.%Float)] // CHECK:STDOUT: } -// CHECK:STDOUT: %n: @F.%Float.loc4_51.1 (%Float) = value_binding n, %n.param +// CHECK:STDOUT: %n: @F.%Float.loc4_49.1 (%Float) = value_binding n, %n.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param // CHECK:STDOUT: } @@ -286,14 +267,11 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: %a.param_patt: %pattern_type.fb7 = value_param_pattern [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.fb7 = at_binding_pattern a, %a.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc8_33.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %IntLiteral.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_33.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_33.2: type = converted %IntLiteral.call, %.loc8_33.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_33.3: Core.Form = init_form %.loc8_33.2 [concrete = constants.%.f7d] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc8: Core.Form = init_form %IntLiteral.ref [concrete = constants.%.f7d] // CHECK:STDOUT: %a.param: %f64.dc1 = value_param call_param0 // CHECK:STDOUT: %f64: type = type_literal constants.%f64.dc1 [concrete = constants.%f64.dc1] // CHECK:STDOUT: %a: %f64.dc1 = value_binding a, %a.param @@ -304,14 +282,14 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%N.loc4_7.2: Core.IntLiteral) { // CHECK:STDOUT: %N.loc4_7.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_7.1 (constants.%N)] -// CHECK:STDOUT: %Float.loc4_51.1: type = class_type @Float, @Float(%N.loc4_7.1) [symbolic = %Float.loc4_51.1 (constants.%Float)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Float.loc4_51.1 [symbolic = %pattern_type (constants.%pattern_type.903)] +// CHECK:STDOUT: %Float.loc4_49.1: type = class_type @Float, @Float(%N.loc4_7.1) [symbolic = %Float.loc4_49.1 (constants.%Float)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Float.loc4_49.1 [symbolic = %pattern_type (constants.%pattern_type.903)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Float.loc4_51.1 [symbolic = %require_complete (constants.%require_complete.eb0)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Float.loc4_49.1 [symbolic = %require_complete (constants.%require_complete.eb0)] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.bound: = bound_method %N.loc4_7.1, constants.%Core.IntLiteral.as.Copy.impl.Op [symbolic = %Core.IntLiteral.as.Copy.impl.Op.bound (constants.%Core.IntLiteral.as.Copy.impl.Op.bound.3c6)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%n.param: @F.%Float.loc4_51.1 (%Float)) -> out %return.param: Core.IntLiteral { +// CHECK:STDOUT: fn(%n.param: @F.%Float.loc4_49.1 (%Float)) -> out %return.param: Core.IntLiteral { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %N.ref.loc5: Core.IntLiteral = name_ref N, %N.loc4_7.2 [symbolic = %N.loc4_7.1 (constants.%N)] // CHECK:STDOUT: %impl.elem0: %.c22 = impl_witness_access constants.%Copy.impl_witness.6f1, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] @@ -332,13 +310,13 @@ fn G(a: f64) -> Core.IntLiteral() { // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%N) { // CHECK:STDOUT: %N.loc4_7.1 => constants.%N -// CHECK:STDOUT: %Float.loc4_51.1 => constants.%Float +// CHECK:STDOUT: %Float.loc4_49.1 => constants.%Float // CHECK:STDOUT: %pattern_type => constants.%pattern_type.903 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%int_64) { // CHECK:STDOUT: %N.loc4_7.1 => constants.%int_64 -// CHECK:STDOUT: %Float.loc4_51.1 => constants.%f64.dc1 +// CHECK:STDOUT: %Float.loc4_49.1 => constants.%f64.dc1 // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fb7 // CHECK:STDOUT: // CHECK:STDOUT: !definition: diff --git a/toolchain/check/testdata/facet/early_impls.carbon b/toolchain/check/testdata/facet/early_impls.carbon index 79d24ba2af19..6de135796aa5 100644 --- a/toolchain/check/testdata/facet/early_impls.carbon +++ b/toolchain/check/testdata/facet/early_impls.carbon @@ -180,13 +180,14 @@ interface Y(T:! type) { } // A concrete type that is not a class, tuple, or struct. -fn IntLiteral() -> type = "int_literal.make_type"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); -// CHECK:STDERR: fail_todo_early_concrete_impls.carbon:[[@LINE+4]]:56: error: cannot convert type `Core.IntLiteral` into type implementing `Y(.Self)` [ConversionFailureTypeToFacet] -// CHECK:STDERR: fn F(_:! Z where IntLiteral() impls Y(.Self) and .Z1 = IntLiteral().(Y(.Self).Y1)) {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fail_todo_early_concrete_impls.carbon:[[@LINE+4]]:54: error: cannot convert type `IntLiteral` into type implementing `Y(.Self)` [ConversionFailureTypeToFacet] +// CHECK:STDERR: fn F(_:! Z where IntLiteral impls Y(.Self) and .Z1 = IntLiteral.(Y(.Self).Y1)) {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -fn F(_:! Z where IntLiteral() impls Y(.Self) and .Z1 = IntLiteral().(Y(.Self).Y1)) {} +fn F(_:! Z where IntLiteral impls Y(.Self) and .Z1 = IntLiteral.(Y(.Self).Y1)) {} // --- early_impl_named_constraint.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index a5ebd74b5849..065905d5c718 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -15,7 +15,7 @@ library "lib"; -class IntRange(N:! Core.IntLiteral()) { +class IntRange(N:! Core.IntLiteral) { fn Make(start: Core.Int(N), end: Core.Int(N)) -> Self { return {.start = start, .end = end}; } @@ -45,7 +45,7 @@ fn Range(end: i32) -> IntRange(32) { import library "lib"; -fn Read(y:! Core.IntLiteral()) { +fn Read(y:! Core.IntLiteral) { var unused x: IntRange(32) = Range(y); } @@ -54,8 +54,6 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %IntRange.type: type = generic_class_type @IntRange [concrete] @@ -224,7 +222,7 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Iterate: type = import_ref Core//prelude/iterate, Iterate, loaded [concrete = constants.%Iterate.type] // CHECK:STDOUT: %Core.import_ref.96b: %Iterate.assoc_type = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0.0f0] @@ -265,13 +263,10 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %IntRange.decl: %IntRange.type = class_decl @IntRange [concrete = constants.%IntRange.generic] { // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_36.1: type = splice_block %.loc4_36.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc4: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_36.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_36.3: type = converted %IntLiteral.call, %.loc4_36.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_17.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_17.1 (constants.%N)] // CHECK:STDOUT: } @@ -845,8 +840,6 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %y: Core.IntLiteral = symbolic_binding y, 0 [symbolic] // CHECK:STDOUT: %Read.type: type = fn_type @Read [concrete] @@ -919,7 +912,7 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Main.import_ref.6b552a.1: Core.IntLiteral = import_ref Main//lib, loc4_17, loaded [symbolic = @IntRange.%N (constants.%N)] // CHECK:STDOUT: %Main.import_ref.e06: = import_ref Main//lib, loc24_1, loaded [symbolic = @IntRange.%complete_type (constants.%complete_type.aa1)] // CHECK:STDOUT: %Main.import_ref.663 = import_ref Main//lib, inst{{[0-9A-F]+}} [no loc], unloaded @@ -945,13 +938,10 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %Read.decl: %Read.type = fn_decl @Read [concrete = constants.%Read] { // CHECK:STDOUT: %y.patt: %pattern_type.dc0 = symbolic_binding_pattern y, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_29.1: type = splice_block %.loc4_29.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc4: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core.048aa3.1 [concrete = imports.%Core.048aa3.1] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_29.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_29.3: type = converted %IntLiteral.call, %.loc4_29.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %y.loc4_10.2: Core.IntLiteral = symbolic_binding y, 0 [symbolic = %y.loc4_10.1 (constants.%y)] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/builtin/adapted_type.carbon b/toolchain/check/testdata/function/builtin/adapted_type.carbon index 8e731c9bbd18..df5ff10db7c7 100644 --- a/toolchain/check/testdata/function/builtin/adapted_type.carbon +++ b/toolchain/check/testdata/function/builtin/adapted_type.carbon @@ -16,10 +16,11 @@ library "[[@TEST_NAME]]"; -fn IntLiteral() -> type = "int_literal.make_type"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); class MyIntLiteral { - adapt IntLiteral(); + adapt IntLiteral; } fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; @@ -55,8 +56,8 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: constants { // CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] +// CHECK:STDOUT: %MakeIntLiteral.type: type = fn_type @MakeIntLiteral [concrete] +// CHECK:STDOUT: %MakeIntLiteral: %MakeIntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %MyIntLiteral: type = class_type @MyIntLiteral [concrete] // CHECK:STDOUT: %complete_type.972: = complete_type_witness Core.IntLiteral [concrete] // CHECK:STDOUT: %pattern_type.129: type = pattern_type %MyIntLiteral [concrete] @@ -84,31 +85,37 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl +// CHECK:STDOUT: .MakeIntLiteral = %MakeIntLiteral.decl +// CHECK:STDOUT: .IntLiteral = %IntLiteral // CHECK:STDOUT: .MyIntLiteral = %MyIntLiteral.decl // CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: .MyInt32 = %MyInt32.decl // CHECK:STDOUT: .MyAdd = %MyAdd.decl // CHECK:STDOUT: .v = %v // CHECK:STDOUT: } -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [concrete = constants.%IntLiteral] { +// CHECK:STDOUT: %MakeIntLiteral.decl: %MakeIntLiteral.type = fn_decl @MakeIntLiteral [concrete = constants.%MakeIntLiteral] { // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_20.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_24.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_20.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc4_20.2: Core.Form = init_form %.loc4_20.1 [concrete = constants.%.805] +// CHECK:STDOUT: %.loc4_24.1: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc4_24.2: Core.Form = init_form %.loc4_24.1 [concrete = constants.%.805] // CHECK:STDOUT: %return.param: ref type = out_param call_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %MakeIntLiteral.ref: %MakeIntLiteral.type = name_ref MakeIntLiteral, %MakeIntLiteral.decl [concrete = constants.%MakeIntLiteral] +// CHECK:STDOUT: %MakeIntLiteral.call: init type = call %MakeIntLiteral.ref() [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_35.1: type = value_of_initializer %MakeIntLiteral.call [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_35.2: type = converted %MakeIntLiteral.call, %.loc5_35.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral: type = alias_binding IntLiteral, %.loc5_35.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: %MyIntLiteral.decl: type = class_decl @MyIntLiteral [concrete = constants.%MyIntLiteral] {} {} // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] { // CHECK:STDOUT: %N.param_patt: %pattern_type.129 = value_param_pattern [concrete] // CHECK:STDOUT: %N.patt: %pattern_type.129 = at_binding_pattern N, %N.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc10_28.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc11_28.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc10_28.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc10_28.2: Core.Form = init_form %.loc10_28.1 [concrete = constants.%.805] +// CHECK:STDOUT: %.loc11_28.1: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc11_28.2: Core.Form = init_form %.loc11_28.1 [concrete = constants.%.805] // CHECK:STDOUT: %N.param: %MyIntLiteral = value_param call_param0 // CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] // CHECK:STDOUT: %N: %MyIntLiteral = value_binding N, %N.param @@ -120,15 +127,15 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %a.param_patt: %pattern_type.129 = value_param_pattern [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.129 = at_binding_pattern a, %a.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.af4 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.af4 = return_slot_pattern %return.param_patt, %MyInt32.ref.loc18 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.af4 = return_slot_pattern %return.param_patt, %MyInt32.ref.loc19 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt32.ref.loc18: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] -// CHECK:STDOUT: %.loc18: Core.Form = init_form %MyInt32.ref.loc18 [concrete = constants.%.6a2] -// CHECK:STDOUT: %a.param.loc18: %MyIntLiteral = value_param call_param0 -// CHECK:STDOUT: %MyIntLiteral.ref.loc18: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] -// CHECK:STDOUT: %a.loc18: %MyIntLiteral = value_binding a, %a.param.loc18 -// CHECK:STDOUT: %return.param.loc18: ref %MyInt32 = out_param call_param1 -// CHECK:STDOUT: %return.loc18: ref %MyInt32 = return_slot %return.param.loc18 +// CHECK:STDOUT: %MyInt32.ref.loc19: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] +// CHECK:STDOUT: %.loc19: Core.Form = init_form %MyInt32.ref.loc19 [concrete = constants.%.6a2] +// CHECK:STDOUT: %a.param.loc19: %MyIntLiteral = value_param call_param0 +// CHECK:STDOUT: %MyIntLiteral.ref.loc19: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] +// CHECK:STDOUT: %a.loc19: %MyIntLiteral = value_binding a, %a.param.loc19 +// CHECK:STDOUT: %return.param.loc19: ref %MyInt32 = out_param call_param1 +// CHECK:STDOUT: %return.loc19: ref %MyInt32 = return_slot %return.param.loc19 // CHECK:STDOUT: } // CHECK:STDOUT: %MyAdd.decl: %MyAdd.type = fn_decl @MyAdd [concrete = constants.%MyAdd] { // CHECK:STDOUT: %a.param_patt: %pattern_type.af4 = value_param_pattern [concrete] @@ -136,15 +143,15 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %b.param_patt: %pattern_type.af4 = value_param_pattern [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.af4 = at_binding_pattern b, %b.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.af4 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.af4 = return_slot_pattern %return.param_patt, %MyInt32.ref.loc20_37 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.af4 = return_slot_pattern %return.param_patt, %MyInt32.ref.loc21_37 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt32.ref.loc20_37: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] -// CHECK:STDOUT: %.loc20: Core.Form = init_form %MyInt32.ref.loc20_37 [concrete = constants.%.6a2] +// CHECK:STDOUT: %MyInt32.ref.loc21_37: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] +// CHECK:STDOUT: %.loc21: Core.Form = init_form %MyInt32.ref.loc21_37 [concrete = constants.%.6a2] // CHECK:STDOUT: %a.param: %MyInt32 = value_param call_param0 -// CHECK:STDOUT: %MyInt32.ref.loc20_13: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] +// CHECK:STDOUT: %MyInt32.ref.loc21_13: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] // CHECK:STDOUT: %a: %MyInt32 = value_binding a, %a.param // CHECK:STDOUT: %b.param: %MyInt32 = value_param call_param1 -// CHECK:STDOUT: %MyInt32.ref.loc20_25: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] +// CHECK:STDOUT: %MyInt32.ref.loc21_25: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] // CHECK:STDOUT: %b: %MyInt32 = value_binding b, %b.param // CHECK:STDOUT: %return.param: ref %MyInt32 = out_param call_param2 // CHECK:STDOUT: %return: ref %MyInt32 = return_slot %return.param @@ -159,11 +166,8 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @MyIntLiteral { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc7_21.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc7_21.2: type = converted %IntLiteral.call, %.loc7_21.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: adapt_decl %.loc7_21.2 [concrete] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] +// CHECK:STDOUT: adapt_decl %IntLiteral.ref [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness Core.IntLiteral [concrete = constants.%complete_type.972] // CHECK:STDOUT: complete_type_witness = %complete_type // CHECK:STDOUT: @@ -176,25 +180,25 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [concrete = constants.%Int] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32.be0] // CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] -// CHECK:STDOUT: %.loc13_16.1: %MyIntLiteral = as_compatible %int_32 [concrete = constants.%int_32.80c] -// CHECK:STDOUT: %.loc13_16.2: %MyIntLiteral = converted %int_32, %.loc13_16.1 [concrete = constants.%int_32.80c] -// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%.loc13_16.2) [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc13_32.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc13_32.2: type = converted %Int.call, %.loc13_32.1 [concrete = constants.%i32.builtin] -// CHECK:STDOUT: adapt_decl %.loc13_32.2 [concrete] +// CHECK:STDOUT: %.loc14_16.1: %MyIntLiteral = as_compatible %int_32 [concrete = constants.%int_32.80c] +// CHECK:STDOUT: %.loc14_16.2: %MyIntLiteral = converted %int_32, %.loc14_16.1 [concrete = constants.%int_32.80c] +// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%.loc14_16.2) [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc14_32.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc14_32.2: type = converted %Int.call, %.loc14_32.1 [concrete = constants.%i32.builtin] +// CHECK:STDOUT: adapt_decl %.loc14_32.2 [concrete] // CHECK:STDOUT: %MyInt32.Make.decl: %MyInt32.Make.type = fn_decl @MyInt32.Make [concrete = constants.%MyInt32.Make] { // CHECK:STDOUT: %a.param_patt: %pattern_type.129 = value_param_pattern [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.129 = at_binding_pattern a, %a.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.af4 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.af4 = return_slot_pattern %return.param_patt, %MyInt32.ref.loc18 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.af4 = return_slot_pattern %return.param_patt, %MyInt32.ref.loc19 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt32.ref.loc15: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] -// CHECK:STDOUT: %.loc15: Core.Form = init_form %MyInt32.ref.loc15 [concrete = constants.%.6a2] -// CHECK:STDOUT: %a.param.loc15: %MyIntLiteral = value_param call_param0 -// CHECK:STDOUT: %MyIntLiteral.ref.loc15: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] -// CHECK:STDOUT: %a.loc15: %MyIntLiteral = value_binding a, %a.param.loc15 -// CHECK:STDOUT: %return.param.loc15: ref %MyInt32 = out_param call_param1 -// CHECK:STDOUT: %return.loc15: ref %MyInt32 = return_slot %return.param.loc15 +// CHECK:STDOUT: %MyInt32.ref.loc16: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] +// CHECK:STDOUT: %.loc16: Core.Form = init_form %MyInt32.ref.loc16 [concrete = constants.%.6a2] +// CHECK:STDOUT: %a.param.loc16: %MyIntLiteral = value_param call_param0 +// CHECK:STDOUT: %MyIntLiteral.ref.loc16: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] +// CHECK:STDOUT: %a.loc16: %MyIntLiteral = value_binding a, %a.param.loc16 +// CHECK:STDOUT: %return.param.loc16: ref %MyInt32 = out_param call_param1 +// CHECK:STDOUT: %return.loc16: ref %MyInt32 = return_slot %return.param.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: %complete_type: = complete_type_witness constants.%i32.builtin [concrete = constants.%complete_type.113] // CHECK:STDOUT: complete_type_witness = %complete_type @@ -207,36 +211,36 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed"; // CHECK:STDOUT: .Make = %MyInt32.Make.decl // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> out %return.param: type = "int_literal.make_type"; +// CHECK:STDOUT: fn @MakeIntLiteral() -> out %return.param: type = "int_literal.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%N.param: %MyIntLiteral) -> out %return.param: type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @MyInt32.Make(%a.param.loc18: %MyIntLiteral) -> out %return.param.loc18: %MyInt32 = "int.convert_checked"; +// CHECK:STDOUT: fn @MyInt32.Make(%a.param.loc19: %MyIntLiteral) -> out %return.param.loc19: %MyInt32 = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: fn @MyAdd(%a.param: %MyInt32, %b.param: %MyInt32) -> out %return.param: %MyInt32 = "int.sadd"; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %MyAdd.ref: %MyAdd.type = name_ref MyAdd, file.%MyAdd.decl [concrete = constants.%MyAdd] -// CHECK:STDOUT: %MyInt32.ref.loc22_24: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] -// CHECK:STDOUT: %Make.ref.loc22_31: %MyInt32.Make.type = name_ref Make, @MyInt32.%MyInt32.Make.decl [concrete = constants.%MyInt32.Make] +// CHECK:STDOUT: %MyInt32.ref.loc23_24: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] +// CHECK:STDOUT: %Make.ref.loc23_31: %MyInt32.Make.type = name_ref Make, @MyInt32.%MyInt32.Make.decl [concrete = constants.%MyInt32.Make] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %MyIntLiteral.ref.loc22_42: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] -// CHECK:STDOUT: %.loc22_39.1: %MyIntLiteral = as_compatible %int_1 [concrete = constants.%int_1.004] -// CHECK:STDOUT: %.loc22_39.2: %MyIntLiteral = converted %int_1, %.loc22_39.1 [concrete = constants.%int_1.004] -// CHECK:STDOUT: %MyInt32.Make.call.loc22_54: init %MyInt32 = call %Make.ref.loc22_31(%.loc22_39.2) [concrete = constants.%int_1.adf] -// CHECK:STDOUT: %MyInt32.ref.loc22_57: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] -// CHECK:STDOUT: %Make.ref.loc22_64: %MyInt32.Make.type = name_ref Make, @MyInt32.%MyInt32.Make.decl [concrete = constants.%MyInt32.Make] +// CHECK:STDOUT: %MyIntLiteral.ref.loc23_42: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] +// CHECK:STDOUT: %.loc23_39.1: %MyIntLiteral = as_compatible %int_1 [concrete = constants.%int_1.004] +// CHECK:STDOUT: %.loc23_39.2: %MyIntLiteral = converted %int_1, %.loc23_39.1 [concrete = constants.%int_1.004] +// CHECK:STDOUT: %MyInt32.Make.call.loc23_54: init %MyInt32 = call %Make.ref.loc23_31(%.loc23_39.2) [concrete = constants.%int_1.adf] +// CHECK:STDOUT: %MyInt32.ref.loc23_57: type = name_ref MyInt32, file.%MyInt32.decl [concrete = constants.%MyInt32] +// CHECK:STDOUT: %Make.ref.loc23_64: %MyInt32.Make.type = name_ref Make, @MyInt32.%MyInt32.Make.decl [concrete = constants.%MyInt32.Make] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %MyIntLiteral.ref.loc22_75: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] -// CHECK:STDOUT: %.loc22_72.1: %MyIntLiteral = as_compatible %int_2 [concrete = constants.%int_2.6b8] -// CHECK:STDOUT: %.loc22_72.2: %MyIntLiteral = converted %int_2, %.loc22_72.1 [concrete = constants.%int_2.6b8] -// CHECK:STDOUT: %MyInt32.Make.call.loc22_87: init %MyInt32 = call %Make.ref.loc22_64(%.loc22_72.2) [concrete = constants.%int_2.596] -// CHECK:STDOUT: %.loc22_54.1: %MyInt32 = value_of_initializer %MyInt32.Make.call.loc22_54 [concrete = constants.%int_1.adf] -// CHECK:STDOUT: %.loc22_54.2: %MyInt32 = converted %MyInt32.Make.call.loc22_54, %.loc22_54.1 [concrete = constants.%int_1.adf] -// CHECK:STDOUT: %.loc22_87.1: %MyInt32 = value_of_initializer %MyInt32.Make.call.loc22_87 [concrete = constants.%int_2.596] -// CHECK:STDOUT: %.loc22_87.2: %MyInt32 = converted %MyInt32.Make.call.loc22_87, %.loc22_87.1 [concrete = constants.%int_2.596] -// CHECK:STDOUT: %MyAdd.call: init %MyInt32 = call %MyAdd.ref(%.loc22_54.2, %.loc22_87.2) [concrete = constants.%int_3] +// CHECK:STDOUT: %MyIntLiteral.ref.loc23_75: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral] +// CHECK:STDOUT: %.loc23_72.1: %MyIntLiteral = as_compatible %int_2 [concrete = constants.%int_2.6b8] +// CHECK:STDOUT: %.loc23_72.2: %MyIntLiteral = converted %int_2, %.loc23_72.1 [concrete = constants.%int_2.6b8] +// CHECK:STDOUT: %MyInt32.Make.call.loc23_87: init %MyInt32 = call %Make.ref.loc23_64(%.loc23_72.2) [concrete = constants.%int_2.596] +// CHECK:STDOUT: %.loc23_54.1: %MyInt32 = value_of_initializer %MyInt32.Make.call.loc23_54 [concrete = constants.%int_1.adf] +// CHECK:STDOUT: %.loc23_54.2: %MyInt32 = converted %MyInt32.Make.call.loc23_54, %.loc23_54.1 [concrete = constants.%int_1.adf] +// CHECK:STDOUT: %.loc23_87.1: %MyInt32 = value_of_initializer %MyInt32.Make.call.loc23_87 [concrete = constants.%int_2.596] +// CHECK:STDOUT: %.loc23_87.2: %MyInt32 = converted %MyInt32.Make.call.loc23_87, %.loc23_87.1 [concrete = constants.%int_2.596] +// CHECK:STDOUT: %MyAdd.call: init %MyInt32 = call %MyAdd.ref(%.loc23_54.2, %.loc23_87.2) [concrete = constants.%int_3] // CHECK:STDOUT: assign file.%v.var, %MyAdd.call // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/builtin/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/call_from_operator.carbon index 8b5c0f2fc580..7d69f3fe0e89 100644 --- a/toolchain/check/testdata/function/builtin/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/call_from_operator.carbon @@ -16,8 +16,9 @@ package Core; -fn IntLiteral() -> type = "int_literal.make_type"; -fn Int(N: IntLiteral()) -> type = "int.make_type_signed"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); +fn Int(N: IntLiteral) -> type = "int.make_type_signed"; interface AddWith(T:! type) { fn Op[self: Self](other: Self) -> Self; @@ -35,16 +36,16 @@ impl i32 as AddWith(i32) { fn Op[self: Self](other: Self) -> Self = "int.sadd"; } -impl IntLiteral() as As(i32) { +impl IntLiteral as As(i32) { fn Convert[self: Self]() -> i32 = "int.convert_checked"; } -impl IntLiteral() as ImplicitAs(i32) { +impl IntLiteral as ImplicitAs(i32) { fn Convert[self: Self]() -> i32 = "int.convert_checked"; } -impl i32 as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +impl i32 as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // --- user.carbon @@ -58,8 +59,8 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: constants { // CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] +// CHECK:STDOUT: %MakeIntLiteral.type: type = fn_type @MakeIntLiteral [concrete] +// CHECK:STDOUT: %MakeIntLiteral: %MakeIntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete] // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete] @@ -156,36 +157,37 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl +// CHECK:STDOUT: .MakeIntLiteral = %MakeIntLiteral.decl +// CHECK:STDOUT: .IntLiteral = %IntLiteral // CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: .AddWith = %AddWith.decl // CHECK:STDOUT: .As = %As.decl // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [concrete = constants.%IntLiteral] { +// CHECK:STDOUT: %MakeIntLiteral.decl: %MakeIntLiteral.type = fn_decl @MakeIntLiteral [concrete = constants.%MakeIntLiteral] { // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_20.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_24.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_20.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc4_20.2: Core.Form = init_form %.loc4_20.1 [concrete = constants.%.805] +// CHECK:STDOUT: %.loc4_24.1: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc4_24.2: Core.Form = init_form %.loc4_24.1 [concrete = constants.%.805] // CHECK:STDOUT: %return.param: ref type = out_param call_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %MakeIntLiteral.ref: %MakeIntLiteral.type = name_ref MakeIntLiteral, %MakeIntLiteral.decl [concrete = constants.%MakeIntLiteral] +// CHECK:STDOUT: %MakeIntLiteral.call: init type = call %MakeIntLiteral.ref() [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_35.1: type = value_of_initializer %MakeIntLiteral.call [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc5_35.2: type = converted %MakeIntLiteral.call, %.loc5_35.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral: type = alias_binding IntLiteral, %.loc5_35.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] { // CHECK:STDOUT: %N.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = at_binding_pattern N, %N.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc5_28.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc6_26.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc5_28.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc5_28.2: Core.Form = init_form %.loc5_28.1 [concrete = constants.%.805] +// CHECK:STDOUT: %.loc6_26.1: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc6_26.2: Core.Form = init_form %.loc6_26.1 [concrete = constants.%.805] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.3: type = converted %IntLiteral.call, %.loc5_22.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: %N: Core.IntLiteral = value_binding N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param call_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -193,74 +195,65 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %AddWith.decl: %AddWith.type.2ef = interface_decl @AddWith [concrete = constants.%AddWith.generic] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc7_23.1: type = splice_block %.loc7_23.2 [concrete = type] { +// CHECK:STDOUT: %.loc8_23.1: type = splice_block %.loc8_23.2 [concrete = type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.loc7_23.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc8_23.2: type = type_literal type [concrete = type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc7_20.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_20.1 (constants.%T)] +// CHECK:STDOUT: %T.loc8_20.2: type = symbolic_binding T, 0 [symbolic = %T.loc8_20.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %As.decl: %As.type.116 = interface_decl @As [concrete = constants.%As.generic] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_18.1: type = splice_block %.loc11_18.2 [concrete = type] { +// CHECK:STDOUT: %.loc12_18.1: type = splice_block %.loc12_18.2 [concrete = type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.loc11_18.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc12_18.2: type = type_literal type [concrete = type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc11_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc11_15.1 (constants.%T)] +// CHECK:STDOUT: %T.loc12_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc12_15.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.0ff = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] { // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc15_26.1: type = splice_block %.loc15_26.2 [concrete = type] { +// CHECK:STDOUT: %.loc16_26.1: type = splice_block %.loc16_26.2 [concrete = type] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.loc15_26.2: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc16_26.2: type = type_literal type [concrete = type] // CHECK:STDOUT: } -// CHECK:STDOUT: %T.loc15_23.2: type = symbolic_binding T, 0 [symbolic = %T.loc15_23.1 (constants.%T)] +// CHECK:STDOUT: %T.loc16_23.2: type = symbolic_binding T, 0 [symbolic = %T.loc16_23.1 (constants.%T)] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @i32.builtin.as.AddWith.impl [concrete] {} { -// CHECK:STDOUT: %.loc19_6: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc20_6: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] // CHECK:STDOUT: %AddWith.ref: %AddWith.type.2ef = name_ref AddWith, file.%AddWith.decl [concrete = constants.%AddWith.generic] -// CHECK:STDOUT: %.loc19_21: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc20_21: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(constants.%i32.builtin)> [concrete = constants.%AddWith.type.7c6] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @Core.IntLiteral.as.As.impl [concrete] {} { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc23_17.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc23_17.2: type = converted %IntLiteral.call, %.loc23_17.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: %As.ref: %As.type.116 = name_ref As, file.%As.decl [concrete = constants.%As.generic] -// CHECK:STDOUT: %.loc23_25: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc24: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32.builtin)> [concrete = constants.%As.type.dfb] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @Core.IntLiteral.as.ImplicitAs.impl [concrete] {} { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc27_17.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc27_17.2: type = converted %IntLiteral.call, %.loc27_17.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.0ff = name_ref ImplicitAs, file.%ImplicitAs.decl [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %.loc27_33: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc28: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32.builtin)> [concrete = constants.%ImplicitAs.type.9df] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @i32.builtin.as.ImplicitAs.impl [concrete] {} { -// CHECK:STDOUT: %.loc31_6: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc32: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.0ff = name_ref ImplicitAs, file.%ImplicitAs.decl [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc31_36.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc31_36.2: type = converted %IntLiteral.call, %.loc31_36.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete = constants.%ImplicitAs.type.7cb] // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @AddWith(%T.loc7_20.2: type) { -// CHECK:STDOUT: %T.loc7_20.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_20.1 (constants.%T)] +// CHECK:STDOUT: generic interface @AddWith(%T.loc8_20.2: type) { +// CHECK:STDOUT: %T.loc8_20.1: type = symbolic_binding T, 0 [symbolic = %T.loc8_20.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(%T.loc7_20.1)> [symbolic = %AddWith.type (constants.%AddWith.type.7e9)] -// CHECK:STDOUT: %Self.loc7_29.2: @AddWith.%AddWith.type (%AddWith.type.7e9) = symbolic_binding Self, 1 [symbolic = %Self.loc7_29.2 (constants.%Self.8d5)] +// CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(%T.loc8_20.1)> [symbolic = %AddWith.type (constants.%AddWith.type.7e9)] +// CHECK:STDOUT: %Self.loc8_29.2: @AddWith.%AddWith.type (%AddWith.type.7e9) = symbolic_binding Self, 1 [symbolic = %Self.loc8_29.2 (constants.%Self.8d5)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.loc7_29.1: @AddWith.%AddWith.type (%AddWith.type.7e9) = symbolic_binding Self, 1 [symbolic = %Self.loc7_29.2 (constants.%Self.8d5)] +// CHECK:STDOUT: %Self.loc8_29.1: @AddWith.%AddWith.type (%AddWith.type.7e9) = symbolic_binding Self, 1 [symbolic = %Self.loc8_29.2 (constants.%Self.8d5)] // CHECK:STDOUT: %AddWith.WithSelf.decl = interface_with_self_decl @AddWith [concrete] // CHECK:STDOUT: // CHECK:STDOUT: !with Self: @@ -270,125 +263,125 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %other.param_patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = value_param_pattern [concrete] // CHECK:STDOUT: %other.patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = at_binding_pattern other, %other.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = return_slot_pattern %return.param_patt, %.loc8_37.3 [concrete] +// CHECK:STDOUT: %return.patt: @AddWith.WithSelf.Op.%pattern_type (%pattern_type.131) = return_slot_pattern %return.param_patt, %.loc9_37.3 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc8_37.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc7_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)] -// CHECK:STDOUT: %Self.ref.loc8_37: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc8_37.2 [symbolic = %Self (constants.%Self.8d5)] -// CHECK:STDOUT: %Self.as_type.loc8_37: type = facet_access_type %Self.ref.loc8_37 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] -// CHECK:STDOUT: %.loc8_37.3: type = converted %Self.ref.loc8_37, %Self.as_type.loc8_37 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] -// CHECK:STDOUT: %.loc8_37.4: Core.Form = init_form %.loc8_37.3 [symbolic = %.loc8_37.1 (constants.%.e80)] -// CHECK:STDOUT: %self.param: @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c) = value_param call_param0 -// CHECK:STDOUT: %.loc8_15.1: type = splice_block %.loc8_15.3 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] { -// CHECK:STDOUT: %.loc8_15.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc7_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)] -// CHECK:STDOUT: %Self.ref.loc8_15: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc8_15.2 [symbolic = %Self (constants.%Self.8d5)] -// CHECK:STDOUT: %Self.as_type.loc8_15.2: type = facet_access_type %Self.ref.loc8_15 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] -// CHECK:STDOUT: %.loc8_15.3: type = converted %Self.ref.loc8_15, %Self.as_type.loc8_15.2 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] +// CHECK:STDOUT: %.loc9_37.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)] +// CHECK:STDOUT: %Self.ref.loc9_37: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_37.2 [symbolic = %Self (constants.%Self.8d5)] +// CHECK:STDOUT: %Self.as_type.loc9_37: type = facet_access_type %Self.ref.loc9_37 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] +// CHECK:STDOUT: %.loc9_37.3: type = converted %Self.ref.loc9_37, %Self.as_type.loc9_37 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] +// CHECK:STDOUT: %.loc9_37.4: Core.Form = init_form %.loc9_37.3 [symbolic = %.loc9_37.1 (constants.%.e80)] +// CHECK:STDOUT: %self.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = value_param call_param0 +// CHECK:STDOUT: %.loc9_15.1: type = splice_block %.loc9_15.3 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] { +// CHECK:STDOUT: %.loc9_15.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)] +// CHECK:STDOUT: %Self.ref.loc9_15: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_15.2 [symbolic = %Self (constants.%Self.8d5)] +// CHECK:STDOUT: %Self.as_type.loc9_15.2: type = facet_access_type %Self.ref.loc9_15 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] +// CHECK:STDOUT: %.loc9_15.3: type = converted %Self.ref.loc9_15, %Self.as_type.loc9_15.2 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c) = value_binding self, %self.param -// CHECK:STDOUT: %other.param: @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c) = value_param call_param1 -// CHECK:STDOUT: %.loc8_28.1: type = splice_block %.loc8_28.3 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] { -// CHECK:STDOUT: %.loc8_28.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc7_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)] -// CHECK:STDOUT: %Self.ref.loc8_28: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc8_28.2 [symbolic = %Self (constants.%Self.8d5)] -// CHECK:STDOUT: %Self.as_type.loc8_28: type = facet_access_type %Self.ref.loc8_28 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] -// CHECK:STDOUT: %.loc8_28.3: type = converted %Self.ref.loc8_28, %Self.as_type.loc8_28 [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] +// CHECK:STDOUT: %self: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = value_binding self, %self.param +// CHECK:STDOUT: %other.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = value_param call_param1 +// CHECK:STDOUT: %.loc9_28.1: type = splice_block %.loc9_28.3 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] { +// CHECK:STDOUT: %.loc9_28.2: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = specific_constant @AddWith.%Self.loc8_29.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.8d5)] +// CHECK:STDOUT: %Self.ref.loc9_28: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = name_ref Self, %.loc9_28.2 [symbolic = %Self (constants.%Self.8d5)] +// CHECK:STDOUT: %Self.as_type.loc9_28: type = facet_access_type %Self.ref.loc9_28 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] +// CHECK:STDOUT: %.loc9_28.3: type = converted %Self.ref.loc9_28, %Self.as_type.loc9_28 [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] // CHECK:STDOUT: } -// CHECK:STDOUT: %other: @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c) = value_binding other, %other.param -// CHECK:STDOUT: %return.param: ref @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c) = out_param call_param2 -// CHECK:STDOUT: %return: ref @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c) = return_slot %return.param +// CHECK:STDOUT: %other: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = value_binding other, %other.param +// CHECK:STDOUT: %return.param: ref @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = out_param call_param2 +// CHECK:STDOUT: %return: ref @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc8_41.1: @AddWith.WithSelf.%AddWith.assoc_type (%AddWith.assoc_type.588) = assoc_entity element0, %AddWith.WithSelf.Op.decl [symbolic = %assoc0.loc8_41.2 (constants.%assoc0.aed)] +// CHECK:STDOUT: %assoc0.loc9_41.1: @AddWith.WithSelf.%AddWith.assoc_type (%AddWith.assoc_type.588) = assoc_entity element0, %AddWith.WithSelf.Op.decl [symbolic = %assoc0.loc9_41.2 (constants.%assoc0.aed)] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.loc7_29.1 -// CHECK:STDOUT: .Op = @AddWith.WithSelf.%assoc0.loc8_41.1 +// CHECK:STDOUT: .Self = %Self.loc8_29.1 +// CHECK:STDOUT: .Op = @AddWith.WithSelf.%assoc0.loc9_41.1 // CHECK:STDOUT: witness = (@AddWith.WithSelf.%AddWith.WithSelf.Op.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @As(%T.loc11_15.2: type) { -// CHECK:STDOUT: %T.loc11_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc11_15.1 (constants.%T)] +// CHECK:STDOUT: generic interface @As(%T.loc12_15.2: type) { +// CHECK:STDOUT: %T.loc12_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc12_15.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T.loc11_15.1)> [symbolic = %As.type (constants.%As.type.c5f)] -// CHECK:STDOUT: %Self.loc11_24.2: @As.%As.type (%As.type.c5f) = symbolic_binding Self, 1 [symbolic = %Self.loc11_24.2 (constants.%Self.f80)] +// CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T.loc12_15.1)> [symbolic = %As.type (constants.%As.type.c5f)] +// CHECK:STDOUT: %Self.loc12_24.2: @As.%As.type (%As.type.c5f) = symbolic_binding Self, 1 [symbolic = %Self.loc12_24.2 (constants.%Self.f80)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.loc11_24.1: @As.%As.type (%As.type.c5f) = symbolic_binding Self, 1 [symbolic = %Self.loc11_24.2 (constants.%Self.f80)] +// CHECK:STDOUT: %Self.loc12_24.1: @As.%As.type (%As.type.c5f) = symbolic_binding Self, 1 [symbolic = %Self.loc12_24.2 (constants.%Self.f80)] // CHECK:STDOUT: %As.WithSelf.decl = interface_with_self_decl @As [concrete] // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %As.WithSelf.Convert.decl: @As.WithSelf.%As.WithSelf.Convert.type (%As.WithSelf.Convert.type.640) = fn_decl @As.WithSelf.Convert [symbolic = @As.WithSelf.%As.WithSelf.Convert (constants.%As.WithSelf.Convert.896)] { -// CHECK:STDOUT: %self.param_patt: @As.WithSelf.Convert.%pattern_type.loc12_18 (%pattern_type.a01) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @As.WithSelf.Convert.%pattern_type.loc12_18 (%pattern_type.a01) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @As.WithSelf.Convert.%pattern_type.loc12_31 (%pattern_type.51d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @As.WithSelf.Convert.%pattern_type.loc12_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] +// CHECK:STDOUT: %self.param_patt: @As.WithSelf.Convert.%pattern_type.loc13_18 (%pattern_type.a01) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @As.WithSelf.Convert.%pattern_type.loc13_18 (%pattern_type.a01) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @As.WithSelf.Convert.%pattern_type.loc13_31 (%pattern_type.51d) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @As.WithSelf.Convert.%pattern_type.loc13_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, @As.%T.loc11_15.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc12_31.2: Core.Form = init_form %T.ref [symbolic = %.loc12_31.1 (constants.%.184)] -// CHECK:STDOUT: %self.param: @As.WithSelf.Convert.%Self.as_type.loc12_20.1 (%Self.as_type.1ce) = value_param call_param0 -// CHECK:STDOUT: %.loc12_20.1: type = splice_block %.loc12_20.3 [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.1ce)] { -// CHECK:STDOUT: %.loc12_20.2: @As.WithSelf.Convert.%As.type (%As.type.c5f) = specific_constant @As.%Self.loc11_24.1, @As(constants.%T) [symbolic = %Self (constants.%Self.f80)] -// CHECK:STDOUT: %Self.ref: @As.WithSelf.Convert.%As.type (%As.type.c5f) = name_ref Self, %.loc12_20.2 [symbolic = %Self (constants.%Self.f80)] -// CHECK:STDOUT: %Self.as_type.loc12_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.1ce)] -// CHECK:STDOUT: %.loc12_20.3: type = converted %Self.ref, %Self.as_type.loc12_20.2 [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.1ce)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @As.%T.loc12_15.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %.loc13_31.2: Core.Form = init_form %T.ref [symbolic = %.loc13_31.1 (constants.%.184)] +// CHECK:STDOUT: %self.param: @As.WithSelf.Convert.%Self.as_type.loc13_20.1 (%Self.as_type.1ce) = value_param call_param0 +// CHECK:STDOUT: %.loc13_20.1: type = splice_block %.loc13_20.3 [symbolic = %Self.as_type.loc13_20.1 (constants.%Self.as_type.1ce)] { +// CHECK:STDOUT: %.loc13_20.2: @As.WithSelf.Convert.%As.type (%As.type.c5f) = specific_constant @As.%Self.loc12_24.1, @As(constants.%T) [symbolic = %Self (constants.%Self.f80)] +// CHECK:STDOUT: %Self.ref: @As.WithSelf.Convert.%As.type (%As.type.c5f) = name_ref Self, %.loc13_20.2 [symbolic = %Self (constants.%Self.f80)] +// CHECK:STDOUT: %Self.as_type.loc13_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc13_20.1 (constants.%Self.as_type.1ce)] +// CHECK:STDOUT: %.loc13_20.3: type = converted %Self.ref, %Self.as_type.loc13_20.2 [symbolic = %Self.as_type.loc13_20.1 (constants.%Self.as_type.1ce)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @As.WithSelf.Convert.%Self.as_type.loc12_20.1 (%Self.as_type.1ce) = value_binding self, %self.param +// CHECK:STDOUT: %self: @As.WithSelf.Convert.%Self.as_type.loc13_20.1 (%Self.as_type.1ce) = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref @As.WithSelf.Convert.%T (%T) = out_param call_param1 // CHECK:STDOUT: %return: ref @As.WithSelf.Convert.%T (%T) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc12_32.1: @As.WithSelf.%As.assoc_type (%As.assoc_type.b40) = assoc_entity element0, %As.WithSelf.Convert.decl [symbolic = %assoc0.loc12_32.2 (constants.%assoc0.a44)] +// CHECK:STDOUT: %assoc0.loc13_32.1: @As.WithSelf.%As.assoc_type (%As.assoc_type.b40) = assoc_entity element0, %As.WithSelf.Convert.decl [symbolic = %assoc0.loc13_32.2 (constants.%assoc0.a44)] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.loc11_24.1 +// CHECK:STDOUT: .Self = %Self.loc12_24.1 // CHECK:STDOUT: .T = // CHECK:STDOUT: .T = -// CHECK:STDOUT: .Convert = @As.WithSelf.%assoc0.loc12_32.1 +// CHECK:STDOUT: .Convert = @As.WithSelf.%assoc0.loc13_32.1 // CHECK:STDOUT: witness = (@As.WithSelf.%As.WithSelf.Convert.decl) // CHECK:STDOUT: // CHECK:STDOUT: !requires: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc15_23.2: type) { -// CHECK:STDOUT: %T.loc15_23.1: type = symbolic_binding T, 0 [symbolic = %T.loc15_23.1 (constants.%T)] +// CHECK:STDOUT: generic interface @ImplicitAs(%T.loc16_23.2: type) { +// CHECK:STDOUT: %T.loc16_23.1: type = symbolic_binding T, 0 [symbolic = %T.loc16_23.1 (constants.%T)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc15_23.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3aa)] -// CHECK:STDOUT: %Self.loc15_32.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3aa) = symbolic_binding Self, 1 [symbolic = %Self.loc15_32.2 (constants.%Self.bb1)] +// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc16_23.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3aa)] +// CHECK:STDOUT: %Self.loc16_32.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3aa) = symbolic_binding Self, 1 [symbolic = %Self.loc16_32.2 (constants.%Self.bb1)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.loc15_32.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3aa) = symbolic_binding Self, 1 [symbolic = %Self.loc15_32.2 (constants.%Self.bb1)] +// CHECK:STDOUT: %Self.loc16_32.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3aa) = symbolic_binding Self, 1 [symbolic = %Self.loc16_32.2 (constants.%Self.bb1)] // CHECK:STDOUT: %ImplicitAs.WithSelf.decl = interface_with_self_decl @ImplicitAs [concrete] // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.decl: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.920) = fn_decl @ImplicitAs.WithSelf.Convert [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.293)] { -// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc16_18 (%pattern_type.701) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc16_18 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc16_31 (%pattern_type.51d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc16_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] +// CHECK:STDOUT: %self.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_18 (%pattern_type.701) = value_param_pattern [concrete] +// CHECK:STDOUT: %self.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_18 (%pattern_type.701) = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: %return.param_patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_31 (%pattern_type.51d) = out_param_pattern [concrete] +// CHECK:STDOUT: %return.patt: @ImplicitAs.WithSelf.Convert.%pattern_type.loc17_31 (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc15_23.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %.loc16_31.2: Core.Form = init_form %T.ref [symbolic = %.loc16_31.1 (constants.%.184)] -// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc16_20.1 (%Self.as_type.5b8) = value_param call_param0 -// CHECK:STDOUT: %.loc16_20.1: type = splice_block %.loc16_20.3 [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.5b8)] { -// CHECK:STDOUT: %.loc16_20.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc15_32.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.bb1)] -// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc16_20.2 [symbolic = %Self (constants.%Self.bb1)] -// CHECK:STDOUT: %Self.as_type.loc16_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.5b8)] -// CHECK:STDOUT: %.loc16_20.3: type = converted %Self.ref, %Self.as_type.loc16_20.2 [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.5b8)] +// CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc16_23.2 [symbolic = %T (constants.%T)] +// CHECK:STDOUT: %.loc17_31.2: Core.Form = init_form %T.ref [symbolic = %.loc17_31.1 (constants.%.184)] +// CHECK:STDOUT: %self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_20.1 (%Self.as_type.5b8) = value_param call_param0 +// CHECK:STDOUT: %.loc17_20.1: type = splice_block %.loc17_20.3 [symbolic = %Self.as_type.loc17_20.1 (constants.%Self.as_type.5b8)] { +// CHECK:STDOUT: %.loc17_20.2: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = specific_constant @ImplicitAs.%Self.loc16_32.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.bb1)] +// CHECK:STDOUT: %Self.ref: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = name_ref Self, %.loc17_20.2 [symbolic = %Self (constants.%Self.bb1)] +// CHECK:STDOUT: %Self.as_type.loc17_20.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc17_20.1 (constants.%Self.as_type.5b8)] +// CHECK:STDOUT: %.loc17_20.3: type = converted %Self.ref, %Self.as_type.loc17_20.2 [symbolic = %Self.as_type.loc17_20.1 (constants.%Self.as_type.5b8)] // CHECK:STDOUT: } -// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc16_20.1 (%Self.as_type.5b8) = value_binding self, %self.param +// CHECK:STDOUT: %self: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_20.1 (%Self.as_type.5b8) = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref @ImplicitAs.WithSelf.Convert.%T (%T) = out_param call_param1 // CHECK:STDOUT: %return: ref @ImplicitAs.WithSelf.Convert.%T (%T) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc16_32.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.fcc) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc16_32.2 (constants.%assoc0.313)] +// CHECK:STDOUT: %assoc0.loc17_32.1: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.fcc) = assoc_entity element0, %ImplicitAs.WithSelf.Convert.decl [symbolic = %assoc0.loc17_32.2 (constants.%assoc0.313)] // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.loc15_32.1 +// CHECK:STDOUT: .Self = %Self.loc16_32.1 // CHECK:STDOUT: .T = // CHECK:STDOUT: .T = -// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc16_32.1 +// CHECK:STDOUT: .Convert = @ImplicitAs.WithSelf.%assoc0.loc17_32.1 // CHECK:STDOUT: .IntLiteral = // CHECK:STDOUT: witness = (@ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.decl) // CHECK:STDOUT: @@ -396,22 +389,22 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @i32.builtin.as.AddWith.impl: %.loc19_6 as %AddWith.type { +// CHECK:STDOUT: impl @i32.builtin.as.AddWith.impl: %.loc20_6 as %AddWith.type { // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op.decl: %i32.builtin.as.AddWith.impl.Op.type = fn_decl @i32.builtin.as.AddWith.impl.Op [concrete = constants.%i32.builtin.as.AddWith.impl.Op] { // CHECK:STDOUT: %self.param_patt: %pattern_type.956 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.956 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %other.param_patt: %pattern_type.956 = value_param_pattern [concrete] // CHECK:STDOUT: %other.patt: %pattern_type.956 = at_binding_pattern other, %other.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %Self.ref.loc20_37 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %Self.ref.loc21_37 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc20_37: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc19_6 [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc20: Core.Form = init_form %Self.ref.loc20_37 [concrete = constants.%.9cb] +// CHECK:STDOUT: %Self.ref.loc21_37: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc21: Core.Form = init_form %Self.ref.loc21_37 [concrete = constants.%.9cb] // CHECK:STDOUT: %self.param: %i32.builtin = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc20_15: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc19_6 [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %Self.ref.loc21_15: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin] // CHECK:STDOUT: %self: %i32.builtin = value_binding self, %self.param // CHECK:STDOUT: %other.param: %i32.builtin = value_param call_param1 -// CHECK:STDOUT: %Self.ref.loc20_28: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc19_6 [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %Self.ref.loc21_28: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc20_6 [concrete = constants.%i32.builtin] // CHECK:STDOUT: %other: %i32.builtin = value_binding other, %other.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param2 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -425,17 +418,17 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: witness = %AddWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @Core.IntLiteral.as.As.impl: %.loc23_17.2 as %As.type { +// CHECK:STDOUT: impl @Core.IntLiteral.as.As.impl: %IntLiteral.ref as %As.type { // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.decl: %Core.IntLiteral.as.As.impl.Convert.type = fn_decl @Core.IntLiteral.as.As.impl.Convert [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] { // CHECK:STDOUT: %self.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.dc0 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc24_31.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc25_31.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc24_31.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc24_31.2: Core.Form = init_form %.loc24_31.1 [concrete = constants.%.9cb] +// CHECK:STDOUT: %.loc25_31.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc25_31.2: Core.Form = init_form %.loc25_31.1 [concrete = constants.%.9cb] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @Core.IntLiteral.as.As.impl.%.loc23_17.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @Core.IntLiteral.as.As.impl.%IntLiteral.ref [concrete = Core.IntLiteral] // CHECK:STDOUT: %self: Core.IntLiteral = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -449,17 +442,17 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: witness = %As.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @Core.IntLiteral.as.ImplicitAs.impl: %.loc27_17.2 as %ImplicitAs.type { +// CHECK:STDOUT: impl @Core.IntLiteral.as.ImplicitAs.impl: %IntLiteral.ref as %ImplicitAs.type { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.decl: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type = fn_decl @Core.IntLiteral.as.ImplicitAs.impl.Convert [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert] { // CHECK:STDOUT: %self.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.dc0 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc28_31.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc29_31.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc28_31.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc28_31.2: Core.Form = init_form %.loc28_31.1 [concrete = constants.%.9cb] +// CHECK:STDOUT: %.loc29_31.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc29_31.2: Core.Form = init_form %.loc29_31.1 [concrete = constants.%.9cb] // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @Core.IntLiteral.as.ImplicitAs.impl.%.loc27_17.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @Core.IntLiteral.as.ImplicitAs.impl.%IntLiteral.ref [concrete = Core.IntLiteral] // CHECK:STDOUT: %self: Core.IntLiteral = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -473,20 +466,17 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @i32.builtin.as.ImplicitAs.impl: %.loc31_6 as %ImplicitAs.type { +// CHECK:STDOUT: impl @i32.builtin.as.ImplicitAs.impl: %.loc32 as %ImplicitAs.type { // CHECK:STDOUT: %i32.builtin.as.ImplicitAs.impl.Convert.decl: %i32.builtin.as.ImplicitAs.impl.Convert.type = fn_decl @i32.builtin.as.ImplicitAs.impl.Convert [concrete = constants.%i32.builtin.as.ImplicitAs.impl.Convert] { // CHECK:STDOUT: %self.param_patt: %pattern_type.956 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.956 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc32_42.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %IntLiteral.ref [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc32_42.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc32_42.2: type = converted %IntLiteral.call, %.loc32_42.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc32_42.3: Core.Form = init_form %.loc32_42.2 [concrete = constants.%.f7d] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc33: Core.Form = init_form %IntLiteral.ref [concrete = constants.%.f7d] // CHECK:STDOUT: %self.param: %i32.builtin = value_param call_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @i32.builtin.as.ImplicitAs.impl.%.loc31_6 [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @i32.builtin.as.ImplicitAs.impl.%.loc32 [concrete = constants.%i32.builtin] // CHECK:STDOUT: %self: %i32.builtin = value_binding self, %self.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -501,43 +491,43 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: witness = %ImplicitAs.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> out %return.param: type = "int_literal.make_type"; +// CHECK:STDOUT: fn @MakeIntLiteral() -> out %return.param: type = "int_literal.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%N.param: Core.IntLiteral) -> out %return.param: type = "int.make_type_signed"; // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @AddWith.WithSelf.Op(@AddWith.%T.loc7_20.2: type, @AddWith.%Self.loc7_29.1: @AddWith.%AddWith.type (%AddWith.type.7e9)) { +// CHECK:STDOUT: generic fn @AddWith.WithSelf.Op(@AddWith.%T.loc8_20.2: type, @AddWith.%Self.loc8_29.1: @AddWith.%AddWith.type (%AddWith.type.7e9)) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(%T)> [symbolic = %AddWith.type (constants.%AddWith.type.7e9)] // CHECK:STDOUT: %Self: @AddWith.WithSelf.Op.%AddWith.type (%AddWith.type.7e9) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.8d5)] -// CHECK:STDOUT: %Self.as_type.loc8_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_15.1 (constants.%Self.as_type.48c)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc8_15.1 [symbolic = %pattern_type (constants.%pattern_type.131)] -// CHECK:STDOUT: %.loc8_37.1: Core.Form = init_form %Self.as_type.loc8_15.1 [symbolic = %.loc8_37.1 (constants.%.e80)] +// CHECK:STDOUT: %Self.as_type.loc9_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc9_15.1 (constants.%Self.as_type.48c)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc9_15.1 [symbolic = %pattern_type (constants.%pattern_type.131)] +// CHECK:STDOUT: %.loc9_37.1: Core.Form = init_form %Self.as_type.loc9_15.1 [symbolic = %.loc9_37.1 (constants.%.e80)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c), %other.param: @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c)) -> out %return.param: @AddWith.WithSelf.Op.%Self.as_type.loc8_15.1 (%Self.as_type.48c); +// CHECK:STDOUT: fn(%self.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c), %other.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c)) -> out %return.param: @AddWith.WithSelf.Op.%Self.as_type.loc9_15.1 (%Self.as_type.48c); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @As.WithSelf.Convert(@As.%T.loc11_15.2: type, @As.%Self.loc11_24.1: @As.%As.type (%As.type.c5f)) { +// CHECK:STDOUT: generic fn @As.WithSelf.Convert(@As.%T.loc12_15.2: type, @As.%Self.loc12_24.1: @As.%As.type (%As.type.c5f)) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T)> [symbolic = %As.type (constants.%As.type.c5f)] // CHECK:STDOUT: %Self: @As.WithSelf.Convert.%As.type (%As.type.c5f) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.f80)] -// CHECK:STDOUT: %Self.as_type.loc12_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc12_20.1 (constants.%Self.as_type.1ce)] -// CHECK:STDOUT: %pattern_type.loc12_18: type = pattern_type %Self.as_type.loc12_20.1 [symbolic = %pattern_type.loc12_18 (constants.%pattern_type.a01)] -// CHECK:STDOUT: %.loc12_31.1: Core.Form = init_form %T [symbolic = %.loc12_31.1 (constants.%.184)] -// CHECK:STDOUT: %pattern_type.loc12_31: type = pattern_type %T [symbolic = %pattern_type.loc12_31 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %Self.as_type.loc13_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc13_20.1 (constants.%Self.as_type.1ce)] +// CHECK:STDOUT: %pattern_type.loc13_18: type = pattern_type %Self.as_type.loc13_20.1 [symbolic = %pattern_type.loc13_18 (constants.%pattern_type.a01)] +// CHECK:STDOUT: %.loc13_31.1: Core.Form = init_form %T [symbolic = %.loc13_31.1 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc13_31: type = pattern_type %T [symbolic = %pattern_type.loc13_31 (constants.%pattern_type.51d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @As.WithSelf.Convert.%Self.as_type.loc12_20.1 (%Self.as_type.1ce)) -> out %return.param: @As.WithSelf.Convert.%T (%T); +// CHECK:STDOUT: fn(%self.param: @As.WithSelf.Convert.%Self.as_type.loc13_20.1 (%Self.as_type.1ce)) -> out %return.param: @As.WithSelf.Convert.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @ImplicitAs.WithSelf.Convert(@ImplicitAs.%T.loc15_23.2: type, @ImplicitAs.%Self.loc15_32.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3aa)) { +// CHECK:STDOUT: generic fn @ImplicitAs.WithSelf.Convert(@ImplicitAs.%T.loc16_23.2: type, @ImplicitAs.%Self.loc16_32.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3aa)) { // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3aa)] // CHECK:STDOUT: %Self: @ImplicitAs.WithSelf.Convert.%ImplicitAs.type (%ImplicitAs.type.3aa) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.bb1)] -// CHECK:STDOUT: %Self.as_type.loc16_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc16_20.1 (constants.%Self.as_type.5b8)] -// CHECK:STDOUT: %pattern_type.loc16_18: type = pattern_type %Self.as_type.loc16_20.1 [symbolic = %pattern_type.loc16_18 (constants.%pattern_type.701)] -// CHECK:STDOUT: %.loc16_31.1: Core.Form = init_form %T [symbolic = %.loc16_31.1 (constants.%.184)] -// CHECK:STDOUT: %pattern_type.loc16_31: type = pattern_type %T [symbolic = %pattern_type.loc16_31 (constants.%pattern_type.51d)] +// CHECK:STDOUT: %Self.as_type.loc17_20.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc17_20.1 (constants.%Self.as_type.5b8)] +// CHECK:STDOUT: %pattern_type.loc17_18: type = pattern_type %Self.as_type.loc17_20.1 [symbolic = %pattern_type.loc17_18 (constants.%pattern_type.701)] +// CHECK:STDOUT: %.loc17_31.1: Core.Form = init_form %T [symbolic = %.loc17_31.1 (constants.%.184)] +// CHECK:STDOUT: %pattern_type.loc17_31: type = pattern_type %T [symbolic = %pattern_type.loc17_31 (constants.%pattern_type.51d)] // CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc16_20.1 (%Self.as_type.5b8)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%T (%T); +// CHECK:STDOUT: fn(%self.param: @ImplicitAs.WithSelf.Convert.%Self.as_type.loc17_20.1 (%Self.as_type.5b8)) -> out %return.param: @ImplicitAs.WithSelf.Convert.%T (%T); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @i32.builtin.as.AddWith.impl.Op(%self.param: %i32.builtin, %other.param: %i32.builtin) -> out %return.param: %i32.builtin = "int.sadd"; @@ -549,7 +539,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: fn @i32.builtin.as.ImplicitAs.impl.Convert(%self.param: %i32.builtin) -> out %return.param: Core.IntLiteral = "int.convert_checked"; // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith(constants.%T) { -// CHECK:STDOUT: %T.loc7_20.1 => constants.%T +// CHECK:STDOUT: %T.loc8_20.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith.WithSelf(constants.%T, constants.%Self.8d5) {} @@ -558,13 +548,13 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.7e9 // CHECK:STDOUT: %Self => constants.%Self.8d5 -// CHECK:STDOUT: %Self.as_type.loc8_15.1 => constants.%Self.as_type.48c +// CHECK:STDOUT: %Self.as_type.loc9_15.1 => constants.%Self.as_type.48c // CHECK:STDOUT: %pattern_type => constants.%pattern_type.131 -// CHECK:STDOUT: %.loc8_37.1 => constants.%.e80 +// CHECK:STDOUT: %.loc9_37.1 => constants.%.e80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%T) { -// CHECK:STDOUT: %T.loc11_15.1 => constants.%T +// CHECK:STDOUT: %T.loc12_15.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As.WithSelf(constants.%T, constants.%Self.f80) {} @@ -573,14 +563,14 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %As.type => constants.%As.type.c5f // CHECK:STDOUT: %Self => constants.%Self.f80 -// CHECK:STDOUT: %Self.as_type.loc12_20.1 => constants.%Self.as_type.1ce -// CHECK:STDOUT: %pattern_type.loc12_18 => constants.%pattern_type.a01 -// CHECK:STDOUT: %.loc12_31.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc12_31 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc13_20.1 => constants.%Self.as_type.1ce +// CHECK:STDOUT: %pattern_type.loc13_18 => constants.%pattern_type.a01 +// CHECK:STDOUT: %.loc13_31.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc13_31 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%T) { -// CHECK:STDOUT: %T.loc15_23.1 => constants.%T +// CHECK:STDOUT: %T.loc16_23.1 => constants.%T // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs.WithSelf(constants.%T, constants.%Self.bb1) {} @@ -589,18 +579,18 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %T => constants.%T // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3aa // CHECK:STDOUT: %Self => constants.%Self.bb1 -// CHECK:STDOUT: %Self.as_type.loc16_20.1 => constants.%Self.as_type.5b8 -// CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.701 -// CHECK:STDOUT: %.loc16_31.1 => constants.%.184 -// CHECK:STDOUT: %pattern_type.loc16_31 => constants.%pattern_type.51d +// CHECK:STDOUT: %Self.as_type.loc17_20.1 => constants.%Self.as_type.5b8 +// CHECK:STDOUT: %pattern_type.loc17_18 => constants.%pattern_type.701 +// CHECK:STDOUT: %.loc17_31.1 => constants.%.184 +// CHECK:STDOUT: %pattern_type.loc17_31 => constants.%pattern_type.51d // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith(constants.%i32.builtin) { -// CHECK:STDOUT: %T.loc7_20.1 => constants.%i32.builtin +// CHECK:STDOUT: %T.loc8_20.1 => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.7c6 -// CHECK:STDOUT: %Self.loc7_29.2 => constants.%Self.9ab +// CHECK:STDOUT: %Self.loc8_29.2 => constants.%Self.9ab // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith.WithSelf(constants.%i32.builtin, constants.%Self.8d5) { @@ -611,7 +601,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.aad // CHECK:STDOUT: %AddWith.WithSelf.Op => constants.%AddWith.WithSelf.Op.e15 // CHECK:STDOUT: %AddWith.assoc_type => constants.%AddWith.assoc_type.439 -// CHECK:STDOUT: %assoc0.loc8_41.2 => constants.%assoc0.7f8 +// CHECK:STDOUT: %assoc0.loc9_41.2 => constants.%assoc0.7f8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith.WithSelf(constants.%i32.builtin, constants.%AddWith.facet) { @@ -622,24 +612,24 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.2dc // CHECK:STDOUT: %AddWith.WithSelf.Op => constants.%AddWith.WithSelf.Op.921 // CHECK:STDOUT: %AddWith.assoc_type => constants.%AddWith.assoc_type.439 -// CHECK:STDOUT: %assoc0.loc8_41.2 => constants.%assoc0.7f8 +// CHECK:STDOUT: %assoc0.loc9_41.2 => constants.%assoc0.7f8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddWith.WithSelf.Op(constants.%i32.builtin, constants.%AddWith.facet) { // CHECK:STDOUT: %T => constants.%i32.builtin // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.7c6 // CHECK:STDOUT: %Self => constants.%AddWith.facet -// CHECK:STDOUT: %Self.as_type.loc8_15.1 => constants.%i32.builtin +// CHECK:STDOUT: %Self.as_type.loc9_15.1 => constants.%i32.builtin // CHECK:STDOUT: %pattern_type => constants.%pattern_type.956 -// CHECK:STDOUT: %.loc8_37.1 => constants.%.9cb +// CHECK:STDOUT: %.loc9_37.1 => constants.%.9cb // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As(constants.%i32.builtin) { -// CHECK:STDOUT: %T.loc11_15.1 => constants.%i32.builtin +// CHECK:STDOUT: %T.loc12_15.1 => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %As.type => constants.%As.type.dfb -// CHECK:STDOUT: %Self.loc11_24.2 => constants.%Self.2c0 +// CHECK:STDOUT: %Self.loc12_24.2 => constants.%Self.2c0 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As.WithSelf(constants.%i32.builtin, constants.%Self.f80) { @@ -650,7 +640,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %As.WithSelf.Convert.type => constants.%As.WithSelf.Convert.type.d9c // CHECK:STDOUT: %As.WithSelf.Convert => constants.%As.WithSelf.Convert.140 // CHECK:STDOUT: %As.assoc_type => constants.%As.assoc_type.7f2 -// CHECK:STDOUT: %assoc0.loc12_32.2 => constants.%assoc0.402 +// CHECK:STDOUT: %assoc0.loc13_32.2 => constants.%assoc0.402 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As.WithSelf(constants.%i32.builtin, constants.%As.facet) { @@ -661,25 +651,25 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %As.WithSelf.Convert.type => constants.%As.WithSelf.Convert.type.e08 // CHECK:STDOUT: %As.WithSelf.Convert => constants.%As.WithSelf.Convert.5a5 // CHECK:STDOUT: %As.assoc_type => constants.%As.assoc_type.7f2 -// CHECK:STDOUT: %assoc0.loc12_32.2 => constants.%assoc0.402 +// CHECK:STDOUT: %assoc0.loc13_32.2 => constants.%assoc0.402 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @As.WithSelf.Convert(constants.%i32.builtin, constants.%As.facet) { // CHECK:STDOUT: %T => constants.%i32.builtin // CHECK:STDOUT: %As.type => constants.%As.type.dfb // CHECK:STDOUT: %Self => constants.%As.facet -// CHECK:STDOUT: %Self.as_type.loc12_20.1 => Core.IntLiteral -// CHECK:STDOUT: %pattern_type.loc12_18 => constants.%pattern_type.dc0 -// CHECK:STDOUT: %.loc12_31.1 => constants.%.9cb -// CHECK:STDOUT: %pattern_type.loc12_31 => constants.%pattern_type.956 +// CHECK:STDOUT: %Self.as_type.loc13_20.1 => Core.IntLiteral +// CHECK:STDOUT: %pattern_type.loc13_18 => constants.%pattern_type.dc0 +// CHECK:STDOUT: %.loc13_31.1 => constants.%.9cb +// CHECK:STDOUT: %pattern_type.loc13_31 => constants.%pattern_type.956 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) { -// CHECK:STDOUT: %T.loc15_23.1 => constants.%i32.builtin +// CHECK:STDOUT: %T.loc16_23.1 => constants.%i32.builtin // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.9df -// CHECK:STDOUT: %Self.loc15_32.2 => constants.%Self.19a +// CHECK:STDOUT: %Self.loc16_32.2 => constants.%Self.19a // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs.WithSelf(constants.%i32.builtin, constants.%Self.bb1) { @@ -690,7 +680,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type => constants.%ImplicitAs.WithSelf.Convert.type.247 // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert => constants.%ImplicitAs.WithSelf.Convert.e9a // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.081 -// CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.0d1 +// CHECK:STDOUT: %assoc0.loc17_32.2 => constants.%assoc0.0d1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs.WithSelf(constants.%i32.builtin, constants.%ImplicitAs.facet.18f) { @@ -701,25 +691,25 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type => constants.%ImplicitAs.WithSelf.Convert.type.20b // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert => constants.%ImplicitAs.WithSelf.Convert.b9f // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.081 -// CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.0d1 +// CHECK:STDOUT: %assoc0.loc17_32.2 => constants.%assoc0.0d1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs.WithSelf.Convert(constants.%i32.builtin, constants.%ImplicitAs.facet.18f) { // CHECK:STDOUT: %T => constants.%i32.builtin // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.9df // CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.18f -// CHECK:STDOUT: %Self.as_type.loc16_20.1 => Core.IntLiteral -// CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.dc0 -// CHECK:STDOUT: %.loc16_31.1 => constants.%.9cb -// CHECK:STDOUT: %pattern_type.loc16_31 => constants.%pattern_type.956 +// CHECK:STDOUT: %Self.as_type.loc17_20.1 => Core.IntLiteral +// CHECK:STDOUT: %pattern_type.loc17_18 => constants.%pattern_type.dc0 +// CHECK:STDOUT: %.loc17_31.1 => constants.%.9cb +// CHECK:STDOUT: %pattern_type.loc17_31 => constants.%pattern_type.956 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) { -// CHECK:STDOUT: %T.loc15_23.1 => Core.IntLiteral +// CHECK:STDOUT: %T.loc16_23.1 => Core.IntLiteral // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7cb -// CHECK:STDOUT: %Self.loc15_32.2 => constants.%Self.c40 +// CHECK:STDOUT: %Self.loc16_32.2 => constants.%Self.c40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs.WithSelf(Core.IntLiteral, constants.%Self.bb1) { @@ -730,7 +720,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type => constants.%ImplicitAs.WithSelf.Convert.type.46f // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert => constants.%ImplicitAs.WithSelf.Convert.a78 // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.e73 -// CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.a37 +// CHECK:STDOUT: %assoc0.loc17_32.2 => constants.%assoc0.a37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs.WithSelf(Core.IntLiteral, constants.%ImplicitAs.facet.776) { @@ -741,17 +731,17 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type => constants.%ImplicitAs.WithSelf.Convert.type.dc2 // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert => constants.%ImplicitAs.WithSelf.Convert.c73 // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.e73 -// CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.a37 +// CHECK:STDOUT: %assoc0.loc17_32.2 => constants.%assoc0.a37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ImplicitAs.WithSelf.Convert(Core.IntLiteral, constants.%ImplicitAs.facet.776) { // CHECK:STDOUT: %T => Core.IntLiteral // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7cb // CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.776 -// CHECK:STDOUT: %Self.as_type.loc16_20.1 => constants.%i32.builtin -// CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.956 -// CHECK:STDOUT: %.loc16_31.1 => constants.%.f7d -// CHECK:STDOUT: %pattern_type.loc16_31 => constants.%pattern_type.dc0 +// CHECK:STDOUT: %Self.as_type.loc17_20.1 => constants.%i32.builtin +// CHECK:STDOUT: %pattern_type.loc17_18 => constants.%pattern_type.956 +// CHECK:STDOUT: %.loc17_31.1 => constants.%.f7d +// CHECK:STDOUT: %pattern_type.loc17_31 => constants.%pattern_type.dc0 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- user.carbon @@ -892,7 +882,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Core.import_ref.b3bc94.3: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @As.%T (constants.%T)] // CHECK:STDOUT: %Core.import_ref.47a = import_ref Core//default, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.ed7: = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%As.impl_witness] -// CHECK:STDOUT: %Core.import_ref.737b3b.1: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = Core.IntLiteral] +// CHECK:STDOUT: %Core.import_ref.2dc10a.1: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.import_ref.908: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%As.type.dfb] // CHECK:STDOUT: %Core.import_ref.06c923.1: %Core.IntLiteral.as.As.impl.Convert.type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] // CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (%Core.import_ref.06c923.1), @Core.IntLiteral.as.As.impl [concrete] @@ -920,7 +910,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %Core.import_ref.b3bc94.9: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.%T (constants.%T)] // CHECK:STDOUT: %Core.import_ref.f9d = import_ref Core//default, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.eab: = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%ImplicitAs.impl_witness.da4] -// CHECK:STDOUT: %Core.import_ref.737b3b.2: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = Core.IntLiteral] +// CHECK:STDOUT: %Core.import_ref.2dc10a.2: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.import_ref.7e0: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%ImplicitAs.type.9df] // CHECK:STDOUT: %Core.import_ref.f49: = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%ImplicitAs.impl_witness.750] // CHECK:STDOUT: %Core.import_ref.63cbb1.3: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%i32.builtin] @@ -1024,7 +1014,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @Core.IntLiteral.as.As.impl: imports.%Core.import_ref.737b3b.1 as imports.%Core.import_ref.908 [from "core.carbon"] { +// CHECK:STDOUT: impl @Core.IntLiteral.as.As.impl: imports.%Core.import_ref.2dc10a.1 as imports.%Core.import_ref.908 [from "core.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = imports.%Core.import_ref.ed7 // CHECK:STDOUT: } @@ -1034,7 +1024,7 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: witness = imports.%Core.import_ref.37d // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @Core.IntLiteral.as.ImplicitAs.impl: imports.%Core.import_ref.737b3b.2 as imports.%Core.import_ref.7e0 [from "core.carbon"] { +// CHECK:STDOUT: impl @Core.IntLiteral.as.ImplicitAs.impl: imports.%Core.import_ref.2dc10a.2 as imports.%Core.import_ref.7e0 [from "core.carbon"] { // CHECK:STDOUT: !members: // CHECK:STDOUT: witness = imports.%Core.import_ref.eab // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/builtin/import.carbon b/toolchain/check/testdata/function/builtin/import.carbon index 6a0566eabefe..d5d8dcfaaf03 100644 --- a/toolchain/check/testdata/function/builtin/import.carbon +++ b/toolchain/check/testdata/function/builtin/import.carbon @@ -17,11 +17,12 @@ package Core library "[[@TEST_NAME]]"; -fn IntLiteral() -> type = "int_literal.make_type"; -fn Int(N: IntLiteral()) -> type = "int.make_type_signed"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); +fn Int(N: IntLiteral) -> type = "int.make_type_signed"; -fn AsI32(a: IntLiteral()) -> i32 = "int.convert_checked"; -fn AsIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked"; +fn AsI32(a: IntLiteral) -> i32 = "int.convert_checked"; +fn AsIntLiteral(a: i32) -> IntLiteral = "int.convert_checked"; fn TestAdd(a: i32, b: i32) -> i32 = "int.sadd"; @@ -36,8 +37,8 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)) // CHECK:STDOUT: constants { // CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] +// CHECK:STDOUT: %MakeIntLiteral.type: type = fn_type @MakeIntLiteral [concrete] +// CHECK:STDOUT: %MakeIntLiteral: %MakeIntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete] // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete] @@ -56,36 +57,37 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)) // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl +// CHECK:STDOUT: .MakeIntLiteral = %MakeIntLiteral.decl +// CHECK:STDOUT: .IntLiteral = %IntLiteral // CHECK:STDOUT: .Int = %Int.decl // CHECK:STDOUT: .AsI32 = %AsI32.decl // CHECK:STDOUT: .AsIntLiteral = %AsIntLiteral.decl // CHECK:STDOUT: .TestAdd = %TestAdd.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [concrete = constants.%IntLiteral] { +// CHECK:STDOUT: %MakeIntLiteral.decl: %MakeIntLiteral.type = fn_decl @MakeIntLiteral [concrete = constants.%MakeIntLiteral] { // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc5_20.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc5_24.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc5_20.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc5_20.2: Core.Form = init_form %.loc5_20.1 [concrete = constants.%.805] +// CHECK:STDOUT: %.loc5_24.1: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc5_24.2: Core.Form = init_form %.loc5_24.1 [concrete = constants.%.805] // CHECK:STDOUT: %return.param: ref type = out_param call_param0 // CHECK:STDOUT: %return: ref type = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %MakeIntLiteral.ref: %MakeIntLiteral.type = name_ref MakeIntLiteral, %MakeIntLiteral.decl [concrete = constants.%MakeIntLiteral] +// CHECK:STDOUT: %MakeIntLiteral.call: init type = call %MakeIntLiteral.ref() [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_35.1: type = value_of_initializer %MakeIntLiteral.call [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc6_35.2: type = converted %MakeIntLiteral.call, %.loc6_35.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral: type = alias_binding IntLiteral, %.loc6_35.2 [concrete = Core.IntLiteral] // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] { // CHECK:STDOUT: %N.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = at_binding_pattern N, %N.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc6_28.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc7_26.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc6_28.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc6_28.2: Core.Form = init_form %.loc6_28.1 [concrete = constants.%.805] +// CHECK:STDOUT: %.loc7_26.1: type = type_literal type [concrete = type] +// CHECK:STDOUT: %.loc7_26.2: Core.Form = init_form %.loc7_26.1 [concrete = constants.%.805] // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %.loc6_22.1: type = splice_block %.loc6_22.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_22.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_22.3: type = converted %IntLiteral.call, %.loc6_22.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: %N: Core.IntLiteral = value_binding N, %N.param // CHECK:STDOUT: %return.param: ref type = out_param call_param1 // CHECK:STDOUT: %return: ref type = return_slot %return.param @@ -94,17 +96,12 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)) // CHECK:STDOUT: %a.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.dc0 = at_binding_pattern a, %a.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc8_30.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc9_28.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc8_30.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc8_30.2: Core.Form = init_form %.loc8_30.1 [concrete = constants.%.9cb] +// CHECK:STDOUT: %.loc9_28.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc9_28.2: Core.Form = init_form %.loc9_28.1 [concrete = constants.%.9cb] // CHECK:STDOUT: %a.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %.loc8_24.1: type = splice_block %.loc8_24.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_24.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_24.3: type = converted %IntLiteral.call, %.loc8_24.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: %a: Core.IntLiteral = value_binding a, %a.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param1 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param @@ -113,15 +110,12 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)) // CHECK:STDOUT: %a.param_patt: %pattern_type.956 = value_param_pattern [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.956 = at_binding_pattern a, %a.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc9_39.2 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %IntLiteral.ref [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_39.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_39.2: type = converted %IntLiteral.call, %.loc9_39.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_39.3: Core.Form = init_form %.loc9_39.2 [concrete = constants.%.f7d] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, file.%IntLiteral [concrete = Core.IntLiteral] +// CHECK:STDOUT: %.loc10_28: Core.Form = init_form %IntLiteral.ref [concrete = constants.%.f7d] // CHECK:STDOUT: %a.param: %i32.builtin = value_param call_param0 -// CHECK:STDOUT: %.loc9_20: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc10_20: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] // CHECK:STDOUT: %a: %i32.builtin = value_binding a, %a.param // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param @@ -132,22 +126,22 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)) // CHECK:STDOUT: %b.param_patt: %pattern_type.956 = value_param_pattern [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.956 = at_binding_pattern b, %b.param_patt [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc11_31.1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc12_31.1 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_31.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc11_31.2: Core.Form = init_form %.loc11_31.1 [concrete = constants.%.9cb] +// CHECK:STDOUT: %.loc12_31.1: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc12_31.2: Core.Form = init_form %.loc12_31.1 [concrete = constants.%.9cb] // CHECK:STDOUT: %a.param: %i32.builtin = value_param call_param0 -// CHECK:STDOUT: %.loc11_15: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc12_15: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] // CHECK:STDOUT: %a: %i32.builtin = value_binding a, %a.param // CHECK:STDOUT: %b.param: %i32.builtin = value_param call_param1 -// CHECK:STDOUT: %.loc11_23: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] +// CHECK:STDOUT: %.loc12_23: type = type_literal constants.%i32.builtin [concrete = constants.%i32.builtin] // CHECK:STDOUT: %b: %i32.builtin = value_binding b, %b.param // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param2 // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> out %return.param: type = "int_literal.make_type"; +// CHECK:STDOUT: fn @MakeIntLiteral() -> out %return.param: type = "int_literal.make_type"; // CHECK:STDOUT: // CHECK:STDOUT: fn @Int(%N.param: Core.IntLiteral) -> out %return.param: type = "int.make_type_signed"; // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index a3ef4109d9ef..82d00ec6ce68 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -78,8 +78,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/parts/float, Float, loaded [concrete = constants.%Float.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/parts/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.393 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.c4c7: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/parts/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.393 = impl_witness_table (%Core.import_ref.c4c7), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/call/form.carbon b/toolchain/check/testdata/function/call/form.carbon index 362779d526f9..832194a37372 100644 --- a/toolchain/check/testdata/function/call/form.carbon +++ b/toolchain/check/testdata/function/call/form.carbon @@ -60,7 +60,7 @@ fn F(x:? form(ref ())); // --- fail_param_form_not_constant.carbon library "[[@TEST_NAME]]"; -fn F() -> Core.Form(); +fn F() -> Core.Form; // CHECK:STDERR: fail_param_form_not_constant.carbon:[[@LINE+4]]:10: error: cannot evaluate form expression [FormExprEvaluationFailure] // CHECK:STDERR: fn G(x:? F()); // CHECK:STDERR: ^~~ @@ -108,11 +108,11 @@ fn G() { // --- fail_todo_form_generic_param.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_form_generic_param.carbon:[[@LINE+4]]:26: error: semantics TODO: `Support symbolic form bindings` [SemanticsTodo] -// CHECK:STDERR: fn F(Form:! Core.Form(), x:? Form); -// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: fail_todo_form_generic_param.carbon:[[@LINE+4]]:24: error: semantics TODO: `Support symbolic form bindings` [SemanticsTodo] +// CHECK:STDERR: fn F(Form:! Core.Form, x:? Form); +// CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -fn F(Form:! Core.Form(), x:? Form); +fn F(Form:! Core.Form, x:? Form); fn G() { var x: i32; @@ -135,7 +135,7 @@ library "[[@TEST_NAME]]"; // TODO: this code should fail for a different reason, but right now we don't // have a way to write correct code that reaches the TODO we're exercising here. -fn F(Form:! Core.Form()) { +fn F(Form:! Core.Form) { // CHECK:STDERR: fail_todo_local_symbolic_form_binding.carbon:[[@LINE+4]]:7: error: semantics TODO: `Support symbolic form bindings` [SemanticsTodo] // CHECK:STDERR: let y:? Form = 0; // CHECK:STDERR: ^~~~~~~~ @@ -203,7 +203,7 @@ fn F() ->? ref i32; library "[[@TEST_NAME]]"; //@dump-sem-ir-begin -fn F(Form:! Core.Form()) ->? Form; +fn F(Form:! Core.Form) ->? Form; //@dump-sem-ir-end // CHECK:STDOUT: --- ref_form_param.carbon @@ -544,15 +544,13 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %Form.type: type = fn_type @Form [concrete] -// CHECK:STDOUT: %Form.4d0: %Form.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.13f: type = pattern_type Core.Form [concrete] -// CHECK:STDOUT: %Form.ac3: Core.Form = symbolic_binding Form, 0 [symbolic] -// CHECK:STDOUT: %.344: Core.Form = splice_inst @F.%.loc4_30.1 [template] +// CHECK:STDOUT: %Form: Core.Form = symbolic_binding Form, 0 [symbolic] +// CHECK:STDOUT: %.344: Core.Form = splice_inst @F.%.loc4_28.1 [template] // CHECK:STDOUT: %.82f: type = type_component_of %.344 [template] // CHECK:STDOUT: %pattern_type.ec7: type = pattern_type %.82f [template] -// CHECK:STDOUT: %.f74: %.82f = splice_inst @F.%.loc4_26.2 [template] -// CHECK:STDOUT: %.33d: = refine_form_action %Form.ac3 [template] +// CHECK:STDOUT: %.f74: %.82f = splice_inst @F.%.loc4_24.2 [template] +// CHECK:STDOUT: %.33d: = refine_form_action %Form [template] // CHECK:STDOUT: %.80a: Core.Form = splice_inst %.33d [template] // CHECK:STDOUT: %.af3: = out_form_param_pattern_action %.80a [template] // CHECK:STDOUT: %.465: type = type_component_of %.80a [template] @@ -569,52 +567,49 @@ fn F(Form:! Core.Form()) ->? Form; // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Form: %Form.type = import_ref Core//prelude/parts/form, Form, loaded [concrete = constants.%Form.4d0] +// CHECK:STDOUT: %Core.Form: type = import_ref Core//prelude/parts/form, Form, loaded [concrete = Core.Form] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %Form.patt: %pattern_type.13f = symbolic_binding_pattern Form, 0 [concrete] -// CHECK:STDOUT: %return.patt: @F.%pattern_type (%pattern_type.ec7) = return_slot_pattern %.loc4_26.6, constants.%.82f [concrete] +// CHECK:STDOUT: %return.patt: @F.%pattern_type (%pattern_type.ec7) = return_slot_pattern %.loc4_24.6, constants.%.82f [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %Form.ref.loc4_30: Core.Form = name_ref Form, %Form.loc4_10.2 [symbolic = %Form.loc4_10.1 (constants.%Form.ac3)] -// CHECK:STDOUT: %.loc4_30.3: Core.Form = splice_inst %.loc4_30.1 [template = %.loc4_30.2 (constants.%.344)] -// CHECK:STDOUT: %.loc4_26.6: @F.%.loc4_26.3 (%.82f) = splice_inst %.loc4_26.2 [template = %.loc4_26.4 (constants.%.f74)] -// CHECK:STDOUT: %.loc4_23.1: type = splice_block %.loc4_23.3 [concrete = Core.Form] { +// CHECK:STDOUT: %Form.ref.loc4_28: Core.Form = name_ref Form, %Form.loc4_10.2 [symbolic = %Form.loc4_10.1 (constants.%Form)] +// CHECK:STDOUT: %.loc4_28.3: Core.Form = splice_inst %.loc4_28.1 [template = %.loc4_28.2 (constants.%.344)] +// CHECK:STDOUT: %.loc4_24.6: @F.%.loc4_24.3 (%.82f) = splice_inst %.loc4_24.2 [template = %.loc4_24.4 (constants.%.f74)] +// CHECK:STDOUT: %.loc4_17: type = splice_block %Form.ref.loc4_17 [concrete = Core.Form] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %Form.ref.loc4_17: %Form.type = name_ref Form, imports.%Core.Form [concrete = constants.%Form.4d0] -// CHECK:STDOUT: %Form.call: init type = call %Form.ref.loc4_17() [concrete = Core.Form] -// CHECK:STDOUT: %.loc4_23.2: type = value_of_initializer %Form.call [concrete = Core.Form] -// CHECK:STDOUT: %.loc4_23.3: type = converted %Form.call, %.loc4_23.2 [concrete = Core.Form] +// CHECK:STDOUT: %Form.ref.loc4_17: type = name_ref Form, imports.%Core.Form [concrete = Core.Form] // CHECK:STDOUT: } -// CHECK:STDOUT: %Form.loc4_10.2: Core.Form = symbolic_binding Form, 0 [symbolic = %Form.loc4_10.1 (constants.%Form.ac3)] -// CHECK:STDOUT: %.loc4_26.1: @F.%.loc4_26.3 (%.82f) = splice_inst %.loc4_26.5 -// CHECK:STDOUT: %return: @F.%.loc4_26.3 (%.82f) = return_slot %.loc4_26.1 +// CHECK:STDOUT: %Form.loc4_10.2: Core.Form = symbolic_binding Form, 0 [symbolic = %Form.loc4_10.1 (constants.%Form)] +// CHECK:STDOUT: %.loc4_24.1: @F.%.loc4_24.3 (%.82f) = splice_inst %.loc4_24.5 +// CHECK:STDOUT: %return: @F.%.loc4_24.3 (%.82f) = return_slot %.loc4_24.1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @F(%Form.loc4_10.2: Core.Form) { -// CHECK:STDOUT: %Form.loc4_10.1: Core.Form = symbolic_binding Form, 0 [symbolic = %Form.loc4_10.1 (constants.%Form.ac3)] -// CHECK:STDOUT: %.loc4_30.1: = refine_form_action %Form.ref.loc4_30 [template] -// CHECK:STDOUT: %.loc4_30.2: Core.Form = splice_inst %.loc4_30.1 [template = %.loc4_30.2 (constants.%.344)] -// CHECK:STDOUT: %.loc4_26.2: = out_form_param_pattern_action %.loc4_30.3 [template] -// CHECK:STDOUT: %.loc4_26.3: type = type_component_of %.loc4_30.2 [template = %.loc4_26.3 (constants.%.82f)] -// CHECK:STDOUT: %.loc4_26.4: @F.%.loc4_26.3 (%.82f) = splice_inst %.loc4_26.2 [template = %.loc4_26.4 (constants.%.f74)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc4_26.3 [template = %pattern_type (constants.%pattern_type.ec7)] -// CHECK:STDOUT: %.loc4_26.5: = callee_pattern_match_action %.loc4_26.6, call_param0 [template] +// CHECK:STDOUT: %Form.loc4_10.1: Core.Form = symbolic_binding Form, 0 [symbolic = %Form.loc4_10.1 (constants.%Form)] +// CHECK:STDOUT: %.loc4_28.1: = refine_form_action %Form.ref.loc4_28 [template] +// CHECK:STDOUT: %.loc4_28.2: Core.Form = splice_inst %.loc4_28.1 [template = %.loc4_28.2 (constants.%.344)] +// CHECK:STDOUT: %.loc4_24.2: = out_form_param_pattern_action %.loc4_28.3 [template] +// CHECK:STDOUT: %.loc4_24.3: type = type_component_of %.loc4_28.2 [template = %.loc4_24.3 (constants.%.82f)] +// CHECK:STDOUT: %.loc4_24.4: @F.%.loc4_24.3 (%.82f) = splice_inst %.loc4_24.2 [template = %.loc4_24.4 (constants.%.f74)] +// CHECK:STDOUT: %pattern_type: type = pattern_type %.loc4_24.3 [template = %pattern_type (constants.%pattern_type.ec7)] +// CHECK:STDOUT: %.loc4_24.5: = callee_pattern_match_action %.loc4_24.6, call_param0 [template] // CHECK:STDOUT: -// CHECK:STDOUT: fn() -> out %.loc4_26.1:? @F.%.loc4_30.1 (@F.%.loc4_30.1); +// CHECK:STDOUT: fn() -> out %.loc4_24.1:? @F.%.loc4_28.1 (@F.%.loc4_28.1); // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @F(constants.%Form.ac3) { -// CHECK:STDOUT: %Form.loc4_10.1 => constants.%Form.ac3 -// CHECK:STDOUT: %.loc4_30.1 => constants.%.33d -// CHECK:STDOUT: %.loc4_30.2 => constants.%.80a -// CHECK:STDOUT: %.loc4_26.2 => constants.%.af3 -// CHECK:STDOUT: %.loc4_26.3 => constants.%.465 -// CHECK:STDOUT: %.loc4_26.4 => constants.%.e7f +// CHECK:STDOUT: specific @F(constants.%Form) { +// CHECK:STDOUT: %Form.loc4_10.1 => constants.%Form +// CHECK:STDOUT: %.loc4_28.1 => constants.%.33d +// CHECK:STDOUT: %.loc4_28.2 => constants.%.80a +// CHECK:STDOUT: %.loc4_24.2 => constants.%.af3 +// CHECK:STDOUT: %.loc4_24.3 => constants.%.465 +// CHECK:STDOUT: %.loc4_24.4 => constants.%.e7f // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a51 -// CHECK:STDOUT: %.loc4_26.5 => constants.%.cab +// CHECK:STDOUT: %.loc4_24.5 => constants.%.cab // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index b5130bb75737..2c4149c6f8d8 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -16,7 +16,7 @@ library "[[@TEST_NAME]]"; -fn ErrorIfNIsZero(N:! Core.IntLiteral()) { +fn ErrorIfNIsZero(N:! Core.IntLiteral) { // Check that we resolve the definition of a used specific function by // ensuring we produce an error when doing so. Notionally this error is // produced as a result of instantiating the `Core.Int` template, although @@ -43,8 +43,6 @@ fn CallNegative() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %ErrorIfNIsZero.type: type = fn_type @ErrorIfNIsZero [concrete] @@ -104,7 +102,7 @@ fn CallNegative() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.DefaultOrUnformed: type = import_ref Core//prelude/parts/default, DefaultOrUnformed, loaded [concrete = constants.%DefaultOrUnformed.type] // CHECK:STDOUT: %Core.import_ref.cc8: @T.as.DefaultOrUnformed.impl.%T.as.DefaultOrUnformed.impl.Op.type (%T.as.DefaultOrUnformed.impl.Op.type.150) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as.DefaultOrUnformed.impl.%T.as.DefaultOrUnformed.impl.Op (constants.%T.as.DefaultOrUnformed.impl.Op.53a)] @@ -122,13 +120,10 @@ fn CallNegative() { // CHECK:STDOUT: %ErrorIfNIsZero.decl: %ErrorIfNIsZero.type = fn_decl @ErrorIfNIsZero [concrete = constants.%ErrorIfNIsZero] { // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_39.1: type = splice_block %.loc4_39.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc4: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %Core.ref.loc4: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_39.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_39.3: type = converted %IntLiteral.call, %.loc4_39.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_20.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_20.1 (constants.%N)] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if/basics.carbon b/toolchain/check/testdata/if/basics.carbon index 708a943c1178..93e3dbdc44e4 100644 --- a/toolchain/check/testdata/if/basics.carbon +++ b/toolchain/check/testdata/if/basics.carbon @@ -117,15 +117,15 @@ fn VarScope(b: bool) -> bool { // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %H.type: type = fn_type @H [concrete] // CHECK:STDOUT: %H: %H.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type bool [concrete] // CHECK:STDOUT: %If.type: type = fn_type @If [concrete] // CHECK:STDOUT: %If: %If.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [concrete = constants.%If] { -// CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete] -// CHECK:STDOUT: %b.patt: %pattern_type.831 = at_binding_pattern b, %b.param_patt [concrete] +// CHECK:STDOUT: %b.param_patt: %pattern_type = value_param_pattern [concrete] +// CHECK:STDOUT: %b.patt: %pattern_type = at_binding_pattern b, %b.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %b.param: bool = value_param call_param0 // CHECK:STDOUT: %.loc8: type = type_literal bool [concrete = bool] @@ -162,15 +162,15 @@ fn VarScope(b: bool) -> bool { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type bool [concrete] // CHECK:STDOUT: %If.type: type = fn_type @If [concrete] // CHECK:STDOUT: %If: %If.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [concrete = constants.%If] { -// CHECK:STDOUT: %b.param_patt: %pattern_type.831 = value_param_pattern [concrete] -// CHECK:STDOUT: %b.patt: %pattern_type.831 = at_binding_pattern b, %b.param_patt [concrete] +// CHECK:STDOUT: %b.param_patt: %pattern_type = value_param_pattern [concrete] +// CHECK:STDOUT: %b.patt: %pattern_type = at_binding_pattern b, %b.param_patt [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %b.param: bool = value_param call_param0 // CHECK:STDOUT: %.loc7: type = type_literal bool [concrete = bool] diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index ae6193a30658..c515b8c1c7f7 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -20,8 +20,6 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: --- basic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] @@ -82,7 +80,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 7808cf9e35a4..a8e0d8330d21 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -54,8 +54,6 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9f3: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.3cb: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.295: %i32 = int_value 2 [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -84,7 +82,7 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b3c = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)] // CHECK:STDOUT: %Copy.impl_witness_table.367 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index e6740cfa2f91..b0da4e7dda22 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -47,8 +47,6 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: --- fail_non_constant_condition.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %ConditionIsNonConstant.type: type = fn_type @ConditionIsNonConstant [concrete] // CHECK:STDOUT: %ConditionIsNonConstant: %ConditionIsNonConstant.type = struct_value () [concrete] @@ -68,7 +66,7 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index 2a54192b99ae..a980f788a193 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -19,8 +19,6 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: --- nested.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] @@ -81,7 +79,7 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 8d67153fb939..1fef57465a9e 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -31,8 +31,6 @@ fn F(cond: bool) { // CHECK:STDOUT: %pattern_type.20e3: type = pattern_type %struct_type.a.b.b4c [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -76,7 +74,7 @@ fn F(cond: bool) { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b3c = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] diff --git a/toolchain/check/testdata/impl/assoc_const_self.carbon b/toolchain/check/testdata/impl/assoc_const_self.carbon index d0d8955e641b..56e9a313bcf5 100644 --- a/toolchain/check/testdata/impl/assoc_const_self.carbon +++ b/toolchain/check/testdata/impl/assoc_const_self.carbon @@ -65,7 +65,7 @@ impl C as I where .V = () {} library "[[@TEST_NAME]]"; -interface I(N:! Core.IntLiteral()) { +interface I(N:! Core.IntLiteral) { let V:! array(Self, N); } @@ -582,8 +582,6 @@ fn CallF() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self.c39: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %I.type.335: type = generic_interface_type @I [concrete] @@ -623,7 +621,7 @@ fn CallF() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type] // CHECK:STDOUT: %Core.import_ref.abd = import_ref Core//prelude/parts/int_literal, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.9c3: %Core.IntLiteral.as.Negate.impl.Op.type = import_ref Core//prelude/parts/int_literal, loc{{\d+_\d+}}, loaded [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op] @@ -639,13 +637,10 @@ fn CallF() { // CHECK:STDOUT: %I.decl: %I.type.335 = interface_decl @I [concrete = constants.%I.generic] { // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_33.1: type = splice_block %.loc4_33.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc4: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_33.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc4_33.3: type = converted %IntLiteral.call, %.loc4_33.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %N.loc4_14.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_14.1 (constants.%N)] // CHECK:STDOUT: } @@ -678,10 +673,10 @@ fn CallF() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%N.loc4_14.1)> [symbolic = %I.type (constants.%I.type.ac2)] -// CHECK:STDOUT: %Self.loc4_36.2: @I.%I.type (%I.type.ac2) = symbolic_binding Self, 1 [symbolic = %Self.loc4_36.2 (constants.%Self.4d2)] +// CHECK:STDOUT: %Self.loc4_34.2: @I.%I.type (%I.type.ac2) = symbolic_binding Self, 1 [symbolic = %Self.loc4_34.2 (constants.%Self.4d2)] // CHECK:STDOUT: // CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.loc4_36.1: @I.%I.type (%I.type.ac2) = symbolic_binding Self, 1 [symbolic = %Self.loc4_36.2 (constants.%Self.4d2)] +// CHECK:STDOUT: %Self.loc4_34.1: @I.%I.type (%I.type.ac2) = symbolic_binding Self, 1 [symbolic = %Self.loc4_34.2 (constants.%Self.4d2)] // CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete] // CHECK:STDOUT: // CHECK:STDOUT: !with Self: @@ -690,7 +685,7 @@ fn CallF() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.loc4_36.1 +// CHECK:STDOUT: .Self = %Self.loc4_34.1 // CHECK:STDOUT: .N = // CHECK:STDOUT: .N = // CHECK:STDOUT: .V = @V.%assoc0 @@ -717,7 +712,7 @@ fn CallF() { // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %I.type => constants.%I.type.ce3 -// CHECK:STDOUT: %Self.loc4_36.2 => constants.%Self.4a1 +// CHECK:STDOUT: %Self.loc4_34.2 => constants.%Self.4a1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%int_-1, constants.%Self.4d2) { diff --git a/toolchain/check/testdata/impl/custom_witness/destroy.carbon b/toolchain/check/testdata/impl/custom_witness/destroy.carbon index 4d13db0dd0b8..c3fbfd612cdb 100644 --- a/toolchain/check/testdata/impl/custom_witness/destroy.carbon +++ b/toolchain/check/testdata/impl/custom_witness/destroy.carbon @@ -33,7 +33,7 @@ library "[[@TEST_NAME]]"; fn F() { // This looks for a Destroy witness for an IntLiteralType. - Core.IntLiteral() as Core.Destroy; + Core.IntLiteral as Core.Destroy; } // --- destroy_int_type.carbon @@ -48,7 +48,7 @@ fn F() { // --- destroy_symbolic_int_type.carbon library "[[@TEST_NAME]]"; -fn F(N:! Core.IntLiteral()) { +fn F(N:! Core.IntLiteral) { // This looks for a Destroy witness for a class type that adapts IntType with a // symbolic type. Core.Int(N) as Core.Destroy; diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index ad0196157f51..201f0db3262d 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -272,8 +272,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: %I.WithSelf.F.6d6: %I.WithSelf.F.type.751 = struct_value () [concrete] // CHECK:STDOUT: %FExtraParam: type = class_type @FExtraParam [concrete] // CHECK:STDOUT: %I.impl_witness.99e: = impl_witness @FExtraParam.as.I.impl.%I.impl_witness_table [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %FExtraParam.as.I.impl.F.type.ec7b0b.1: type = fn_type @FExtraParam.as.I.impl.F.loc69_18.1 [concrete] // CHECK:STDOUT: %FExtraParam.as.I.impl.F.ef9801.1: %FExtraParam.as.I.impl.F.type.ec7b0b.1 = struct_value () [concrete] @@ -435,7 +433,7 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index bd555a83e26c..0cad2bb3bf43 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -100,18 +100,13 @@ impl {.a: bool} as type where .Self impls I {} // CHECK:STDOUT: // CHECK:STDOUT: --- fail_impl_as_type.carbon // CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Bool = %Core.Bool // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -183,8 +178,6 @@ impl {.a: bool} as type where .Self impls I {} // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: bool} [concrete] // CHECK:STDOUT: %type: type = facet_type [concrete] // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] @@ -198,7 +191,7 @@ impl {.a: bool} as type where .Self impls I {} // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon index 9726c09f3295..6ae7cb8e617b 100644 --- a/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon +++ b/toolchain/check/testdata/impl/fail_self_type_mismatch.carbon @@ -67,8 +67,6 @@ impl i32 as I { // CHECK:STDOUT: %I.WithSelf.F.ec6: %I.WithSelf.F.type.dcc = struct_value () [symbolic] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] // CHECK:STDOUT: %assoc0.6c9: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.F.decl [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %I.impl_witness.020: = impl_witness @bool.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet.11c: %I.type = facet_value bool, (%I.impl_witness.020) [concrete] // CHECK:STDOUT: %C.071: type = class_type @C, @C(%I.type, %I.facet.11c) [concrete] @@ -105,7 +103,7 @@ impl i32 as I { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_todo_form_thunk.carbon b/toolchain/check/testdata/impl/fail_todo_form_thunk.carbon index 7de37346a125..96f7ab6de071 100644 --- a/toolchain/check/testdata/impl/fail_todo_form_thunk.carbon +++ b/toolchain/check/testdata/impl/fail_todo_form_thunk.carbon @@ -12,7 +12,7 @@ interface I { let T:! type; - let Fm:! Core.Form(); + let Fm:! Core.Form; // CHECK:STDERR: fail_todo_form_thunk.carbon:[[@LINE+4]]:8: error: semantics TODO: `Support symbolic form bindings` [SemanticsTodo] // CHECK:STDERR: fn F(x:? Fm, y: T); // CHECK:STDERR: ^~~~~~ diff --git a/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon b/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon index 78a36a79780c..d43aa7b91172 100644 --- a/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon +++ b/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon @@ -37,8 +37,6 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self.37e: %I.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -119,7 +117,7 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] @@ -268,8 +266,6 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self.37e: %I.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -335,7 +331,7 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] diff --git a/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon b/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon index a8bc989a1785..1fcf1cbf04b7 100644 --- a/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon +++ b/toolchain/check/testdata/impl/impl_thunk_min_prelude.carbon @@ -95,7 +95,7 @@ fn Call() -> i32 { // The conversion from 2 to IntLiteral here relies on having the // constant value available, so is only possible if the thunk is // inlined. - return i32.(Add(Core.IntLiteral()).Op) + return i32.(Add(Core.IntLiteral).Op) //@dump-sem-ir-begin (a, 2) //@dump-sem-ir-end diff --git a/toolchain/check/testdata/impl/import_builtin_call.carbon b/toolchain/check/testdata/impl/import_builtin_call.carbon index 6f0099ba276b..063a9fe5c29b 100644 --- a/toolchain/check/testdata/impl/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/import_builtin_call.carbon @@ -3,8 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon -// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: @@ -12,26 +10,34 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_builtin_call.carbon +// --- int_literal.carbon + +library "[[@TEST_NAME]]"; + +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); + // --- generic_impl.carbon library "[[@TEST_NAME]]"; +import library "int_literal"; + interface Add { fn Op[self: Self](other: Self) -> Self; } -fn IntLiteral() -> type = "int_literal.make_type"; -fn Int(n: IntLiteral()) -> type = "int.make_type_signed"; +fn Int(n: IntLiteral) -> type = "int.make_type_signed"; -class MyInt(N:! IntLiteral()) { +class MyInt(N:! IntLiteral) { adapt Int(N); } -impl forall [N:! IntLiteral()] MyInt(N) as Add { +impl forall [N:! IntLiteral] MyInt(N) as Add { fn Op[self: Self](other: Self) -> Self = "int.sadd"; } -fn Double[N:! IntLiteral()](x: MyInt(N)) -> MyInt(N) { +fn Double[N:! IntLiteral](x: MyInt(N)) -> MyInt(N) { return x.(Add.Op)(x); } @@ -42,26 +48,29 @@ library "[[@TEST_NAME]]"; import library "generic_impl"; fn CallImportedDouble(n: MyInt(64)) -> MyInt(64) { + //@dump-sem-ir-begin return Double(n); + //@dump-sem-ir-end } // --- convert_symbolic.carbon library "[[@TEST_NAME]]"; -fn IntLiteral() -> type = "int_literal.make_type"; -fn Int(n: IntLiteral()) -> type = "int.make_type_signed"; -fn ToLiteral(n: Int(32)) -> IntLiteral() = "int.convert_checked"; -fn FromLiteral(n: IntLiteral()) -> Int(32) = "int.convert_checked"; +import library "int_literal"; + +fn Int(n: IntLiteral) -> type = "int.make_type_signed"; +fn ToLiteral(n: Int(32)) -> IntLiteral = "int.convert_checked"; +fn FromLiteral(n: IntLiteral) -> Int(32) = "int.convert_checked"; fn Make(N:! Int(32)) -> Int(ToLiteral(N)) { return Make(N); } class OtherInt { adapt Int(32); - fn ToLiteral[self: Self]() -> IntLiteral(); + fn ToLiteral[self: Self]() -> IntLiteral; }; -fn OtherInt.ToLiteral[self: Self]() -> IntLiteral() = "int.convert_checked"; +fn OtherInt.ToLiteral[self: Self]() -> IntLiteral = "int.convert_checked"; fn MakeFromClass(N:! OtherInt) -> Int(N.ToLiteral()) { return MakeFromClass(N); } @@ -71,542 +80,23 @@ library "[[@TEST_NAME]]"; import library "convert_symbolic"; +//@dump-sem-ir-begin var m: Int(64) = Make(FromLiteral(64)); var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); +//@dump-sem-ir-end -// CHECK:STDOUT: --- generic_impl.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [concrete] -// CHECK:STDOUT: %Self: %Add.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] -// CHECK:STDOUT: %pattern_type.e4c: type = pattern_type %Self.as_type [symbolic] -// CHECK:STDOUT: %.3bf: Core.Form = init_form %Self.as_type [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.type.271: type = fn_type @Add.WithSelf.Op, @Add.WithSelf(%Self) [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.134: %Add.WithSelf.Op.type.271 = struct_value () [symbolic] -// CHECK:STDOUT: %Add.assoc_type: type = assoc_entity_type @Add [concrete] -// CHECK:STDOUT: %assoc0: %Add.assoc_type = assoc_entity element0, @Add.WithSelf.%Add.WithSelf.Op.decl [concrete] -// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete] -// CHECK:STDOUT: %type: type = facet_type [concrete] -// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] -// CHECK:STDOUT: %MyInt.type: type = generic_class_type @MyInt [concrete] -// CHECK:STDOUT: %MyInt.generic: %MyInt.type = struct_value () [concrete] -// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %require_complete.269: = require_complete_type %iN.builtin [symbolic] -// CHECK:STDOUT: %complete_type: = complete_type_witness %iN.builtin [symbolic] -// CHECK:STDOUT: %Add.impl_witness: = impl_witness @MyInt.as.Add.impl.%Add.impl_witness_table, @MyInt.as.Add.impl(%N) [symbolic] -// CHECK:STDOUT: %pattern_type.6bc: type = pattern_type %MyInt [symbolic] -// CHECK:STDOUT: %.5dd: Core.Form = init_form %MyInt [symbolic] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.type: type = fn_type @MyInt.as.Add.impl.Op, @MyInt.as.Add.impl(%N) [symbolic] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op: %MyInt.as.Add.impl.Op.type = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete.f24: = require_complete_type %MyInt [symbolic] -// CHECK:STDOUT: %Add.facet.6b8: %Add.type = facet_value %MyInt, (%Add.impl_witness) [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.type.21b: type = fn_type @Add.WithSelf.Op, @Add.WithSelf(%Add.facet.6b8) [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.780: %Add.WithSelf.Op.type.21b = struct_value () [symbolic] -// CHECK:STDOUT: %Double.type: type = fn_type @Double [concrete] -// CHECK:STDOUT: %Double: %Double.type = struct_value () [concrete] -// CHECK:STDOUT: %Add.lookup_impl_witness: = lookup_impl_witness %MyInt, @Add [symbolic] -// CHECK:STDOUT: %.747: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%N) [symbolic] -// CHECK:STDOUT: %Add.facet.255: %Add.type = facet_value %MyInt, (%Add.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.type.de5: type = fn_type @Add.WithSelf.Op, @Add.WithSelf(%Add.facet.255) [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.594: %Add.WithSelf.Op.type.de5 = struct_value () [symbolic] -// CHECK:STDOUT: %.ccf: type = fn_type_with_self_type %Add.WithSelf.Op.type.de5, %Add.facet.255 [symbolic] -// CHECK:STDOUT: %impl.elem0: %.ccf = impl_witness_access %Add.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Add.WithSelf.Op(%Add.facet.255) [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl -// CHECK:STDOUT: .Int = %Int.decl -// CHECK:STDOUT: .MyInt = %MyInt.decl -// CHECK:STDOUT: .Double = %Double.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Add.decl: type = interface_decl @Add [concrete = constants.%Add.type] {} {} -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [concrete = constants.%IntLiteral] { -// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc8_20.1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc8_20.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc8_20.2: Core.Form = init_form %.loc8_20.1 [concrete = constants.%.805] -// CHECK:STDOUT: %return.param: ref type = out_param call_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] { -// CHECK:STDOUT: %n.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] -// CHECK:STDOUT: %n.patt: %pattern_type.dc0 = at_binding_pattern n, %n.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc9_28.1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc9_28.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc9_28.2: Core.Form = init_form %.loc9_28.1 [concrete = constants.%.805] -// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %.loc9_22.1: type = splice_block %.loc9_22.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_22.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_22.3: type = converted %IntLiteral.call, %.loc9_22.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: Core.IntLiteral = value_binding n, %n.param -// CHECK:STDOUT: %return.param: ref type = out_param call_param1 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %MyInt.decl: %MyInt.type = class_decl @MyInt [concrete = constants.%MyInt.generic] { -// CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc11_28.1: type = splice_block %.loc11_28.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc11_28.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc11_28.3: type = converted %IntLiteral.call, %.loc11_28.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc11_14.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc11_14.1 (constants.%N)] -// CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @MyInt.as.Add.impl [concrete] { -// CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt.ref: %MyInt.type = name_ref MyInt, file.%MyInt.decl [concrete = constants.%MyInt.generic] -// CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc15_15.2 [symbolic = %N.loc15_15.1 (constants.%N)] -// CHECK:STDOUT: %MyInt.loc15_39.2: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc15_39.1 (constants.%MyInt)] -// CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [concrete = constants.%Add.type] -// CHECK:STDOUT: %.loc15_29.1: type = splice_block %.loc15_29.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc15_29.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc15_29.3: type = converted %IntLiteral.call, %.loc15_29.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc15_15.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc15_15.1 (constants.%N)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %Double.decl: %Double.type = fn_decl @Double [concrete = constants.%Double] { -// CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete] -// CHECK:STDOUT: %x.param_patt: @Double.%pattern_type (%pattern_type.6bc) = value_param_pattern [concrete] -// CHECK:STDOUT: %x.patt: @Double.%pattern_type (%pattern_type.6bc) = at_binding_pattern x, %x.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Double.%pattern_type (%pattern_type.6bc) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Double.%pattern_type (%pattern_type.6bc) = return_slot_pattern %return.param_patt, %MyInt.loc19_52 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt.ref.loc19_45: %MyInt.type = name_ref MyInt, file.%MyInt.decl [concrete = constants.%MyInt.generic] -// CHECK:STDOUT: %N.ref.loc19_51: Core.IntLiteral = name_ref N, %N.loc19_12.2 [symbolic = %N.loc19_12.1 (constants.%N)] -// CHECK:STDOUT: %MyInt.loc19_52: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.1 (constants.%MyInt)] -// CHECK:STDOUT: %.loc19_52.2: Core.Form = init_form %MyInt.loc19_52 [symbolic = %.loc19_52.1 (constants.%.5dd)] -// CHECK:STDOUT: %.loc19_26.1: type = splice_block %.loc19_26.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc19_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc19_26.3: type = converted %IntLiteral.call, %.loc19_26.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc19_12.2: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc19_12.1 (constants.%N)] -// CHECK:STDOUT: %x.param: @Double.%MyInt.loc19_39.1 (%MyInt) = value_param call_param0 -// CHECK:STDOUT: %.loc19_39: type = splice_block %MyInt.loc19_39.2 [symbolic = %MyInt.loc19_39.1 (constants.%MyInt)] { -// CHECK:STDOUT: %MyInt.ref.loc19_32: %MyInt.type = name_ref MyInt, file.%MyInt.decl [concrete = constants.%MyInt.generic] -// CHECK:STDOUT: %N.ref.loc19_38: Core.IntLiteral = name_ref N, %N.loc19_12.2 [symbolic = %N.loc19_12.1 (constants.%N)] -// CHECK:STDOUT: %MyInt.loc19_39.2: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.1 (constants.%MyInt)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: @Double.%MyInt.loc19_39.1 (%MyInt) = value_binding x, %x.param -// CHECK:STDOUT: %return.param: ref @Double.%MyInt.loc19_39.1 (%MyInt) = out_param call_param1 -// CHECK:STDOUT: %return: ref @Double.%MyInt.loc19_39.1 (%MyInt) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @Add { -// CHECK:STDOUT: %Self: %Add.type = symbolic_binding Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %Add.WithSelf.decl = interface_with_self_decl @Add [concrete] -// CHECK:STDOUT: -// CHECK:STDOUT: !with Self: -// CHECK:STDOUT: %Add.WithSelf.Op.decl: @Add.WithSelf.%Add.WithSelf.Op.type (%Add.WithSelf.Op.type.271) = fn_decl @Add.WithSelf.Op [symbolic = @Add.WithSelf.%Add.WithSelf.Op (constants.%Add.WithSelf.Op.134)] { -// CHECK:STDOUT: %self.param_patt: @Add.WithSelf.Op.%pattern_type (%pattern_type.e4c) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @Add.WithSelf.Op.%pattern_type (%pattern_type.e4c) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %other.param_patt: @Add.WithSelf.Op.%pattern_type (%pattern_type.e4c) = value_param_pattern [concrete] -// CHECK:STDOUT: %other.patt: @Add.WithSelf.Op.%pattern_type (%pattern_type.e4c) = at_binding_pattern other, %other.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @Add.WithSelf.Op.%pattern_type (%pattern_type.e4c) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Add.WithSelf.Op.%pattern_type (%pattern_type.e4c) = return_slot_pattern %return.param_patt, %.loc5_37.2 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc5_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_37: type = facet_access_type %Self.ref.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_37.2: type = converted %Self.ref.loc5_37, %Self.as_type.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_37.3: Core.Form = init_form %.loc5_37.2 [symbolic = %.loc5_37.1 (constants.%.3bf)] -// CHECK:STDOUT: %self.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref.loc5_15 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref.loc5_15, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_binding self, %self.param -// CHECK:STDOUT: %other.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param1 -// CHECK:STDOUT: %.loc5_28.1: type = splice_block %.loc5_28.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_28.2: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %other: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = value_binding other, %other.param -// CHECK:STDOUT: %return.param: ref @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param call_param2 -// CHECK:STDOUT: %return: ref @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0: %Add.assoc_type = assoc_entity element0, %Add.WithSelf.Op.decl [concrete = constants.%assoc0] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .Op = @Add.WithSelf.%assoc0 -// CHECK:STDOUT: witness = (@Add.WithSelf.%Add.WithSelf.Op.decl) -// CHECK:STDOUT: -// CHECK:STDOUT: !requires: -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @MyInt.as.Add.impl(%N.loc15_15.2: Core.IntLiteral) { -// CHECK:STDOUT: %N.loc15_15.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc15_15.1 (constants.%N)] -// CHECK:STDOUT: %MyInt.loc15_39.1: type = class_type @MyInt, @MyInt(%N.loc15_15.1) [symbolic = %MyInt.loc15_39.1 (constants.%MyInt)] -// CHECK:STDOUT: %Add.impl_witness.loc15_48.2: = impl_witness %Add.impl_witness_table, @MyInt.as.Add.impl(%N.loc15_15.1) [symbolic = %Add.impl_witness.loc15_48.2 (constants.%Add.impl_witness)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.type: type = fn_type @MyInt.as.Add.impl.Op, @MyInt.as.Add.impl(%N.loc15_15.1) [symbolic = %MyInt.as.Add.impl.Op.type (constants.%MyInt.as.Add.impl.Op.type)] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op: @MyInt.as.Add.impl.%MyInt.as.Add.impl.Op.type (%MyInt.as.Add.impl.Op.type) = struct_value () [symbolic = %MyInt.as.Add.impl.Op (constants.%MyInt.as.Add.impl.Op)] -// CHECK:STDOUT: %require_complete: = require_complete_type %MyInt.loc15_39.1 [symbolic = %require_complete (constants.%require_complete.f24)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: %MyInt.loc15_39.2 as %Add.ref { -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.decl: @MyInt.as.Add.impl.%MyInt.as.Add.impl.Op.type (%MyInt.as.Add.impl.Op.type) = fn_decl @MyInt.as.Add.impl.Op [symbolic = @MyInt.as.Add.impl.%MyInt.as.Add.impl.Op (constants.%MyInt.as.Add.impl.Op)] { -// CHECK:STDOUT: %self.param_patt: @MyInt.as.Add.impl.Op.%pattern_type (%pattern_type.6bc) = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: @MyInt.as.Add.impl.Op.%pattern_type (%pattern_type.6bc) = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %other.param_patt: @MyInt.as.Add.impl.Op.%pattern_type (%pattern_type.6bc) = value_param_pattern [concrete] -// CHECK:STDOUT: %other.patt: @MyInt.as.Add.impl.Op.%pattern_type (%pattern_type.6bc) = at_binding_pattern other, %other.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: @MyInt.as.Add.impl.Op.%pattern_type (%pattern_type.6bc) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @MyInt.as.Add.impl.Op.%pattern_type (%pattern_type.6bc) = return_slot_pattern %return.param_patt, %Self.ref.loc16_37 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Self.ref.loc16_37: type = name_ref Self, @MyInt.as.Add.impl.%MyInt.loc15_39.2 [symbolic = %MyInt (constants.%MyInt)] -// CHECK:STDOUT: %.loc16_37.2: Core.Form = init_form %Self.ref.loc16_37 [symbolic = %.loc16_37.1 (constants.%.5dd)] -// CHECK:STDOUT: %self.param: @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @MyInt.as.Add.impl.%MyInt.loc15_39.2 [symbolic = %MyInt (constants.%MyInt)] -// CHECK:STDOUT: %self: @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = value_binding self, %self.param -// CHECK:STDOUT: %other.param: @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = value_param call_param1 -// CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @MyInt.as.Add.impl.%MyInt.loc15_39.2 [symbolic = %MyInt (constants.%MyInt)] -// CHECK:STDOUT: %other: @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = value_binding other, %other.param -// CHECK:STDOUT: %return.param: ref @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = out_param call_param2 -// CHECK:STDOUT: %return: ref @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Add.impl_witness_table = impl_witness_table (%MyInt.as.Add.impl.Op.decl), @MyInt.as.Add.impl [concrete] -// CHECK:STDOUT: %Add.impl_witness.loc15_48.1: = impl_witness %Add.impl_witness_table, @MyInt.as.Add.impl(constants.%N) [symbolic = %Add.impl_witness.loc15_48.2 (constants.%Add.impl_witness)] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Op = %MyInt.as.Add.impl.Op.decl -// CHECK:STDOUT: extend %Add.ref -// CHECK:STDOUT: witness = %Add.impl_witness.loc15_48.1 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @MyInt(%N.loc11_14.2: Core.IntLiteral) { -// CHECK:STDOUT: %N.loc11_14.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc11_14.1 (constants.%N)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N.loc11_14.1 [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic = %require_complete (constants.%require_complete.269)] -// CHECK:STDOUT: %complete_type.loc13_1.2: = complete_type_witness %iN.builtin [symbolic = %complete_type.loc13_1.2 (constants.%complete_type)] -// CHECK:STDOUT: -// CHECK:STDOUT: class { -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [concrete = constants.%Int] -// CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc11_14.2 [symbolic = %N.loc11_14.1 (constants.%N)] -// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%N.ref) [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %Int.call [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %.loc12_15.2: type = converted %Int.call, %.loc12_15.1 [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: adapt_decl %.loc12_15.2 [concrete] -// CHECK:STDOUT: %complete_type.loc13_1.1: = complete_type_witness constants.%iN.builtin [symbolic = %complete_type.loc13_1.2 (constants.%complete_type)] -// CHECK:STDOUT: complete_type_witness = %complete_type.loc13_1.1 -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%MyInt -// CHECK:STDOUT: .Int = -// CHECK:STDOUT: .N = -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Add.WithSelf.Op(@Add.%Self: %Add.type) { -// CHECK:STDOUT: %Self: %Add.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type (constants.%pattern_type.e4c)] -// CHECK:STDOUT: %.loc5_37.1: Core.Form = init_form %Self.as_type.loc5_15.1 [symbolic = %.loc5_37.1 (constants.%.3bf)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type), %other.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type)) -> out %return.param: @Add.WithSelf.Op.%Self.as_type.loc5_15.1 (%Self.as_type); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> out %return.param: type = "int_literal.make_type"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param: Core.IntLiteral) -> out %return.param: type = "int.make_type_signed"; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @MyInt.as.Add.impl.Op(@MyInt.as.Add.impl.%N.loc15_15.2: Core.IntLiteral) { -// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %MyInt [symbolic = %pattern_type (constants.%pattern_type.6bc)] -// CHECK:STDOUT: %.loc16_37.1: Core.Form = init_form %MyInt [symbolic = %.loc16_37.1 (constants.%.5dd)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @MyInt.as.Add.impl.Op.%MyInt (%MyInt), %other.param: @MyInt.as.Add.impl.Op.%MyInt (%MyInt)) -> out %return.param: @MyInt.as.Add.impl.Op.%MyInt (%MyInt) = "int.sadd"; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Double(%N.loc19_12.2: Core.IntLiteral) { -// CHECK:STDOUT: %N.loc19_12.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc19_12.1 (constants.%N)] -// CHECK:STDOUT: %MyInt.loc19_39.1: type = class_type @MyInt, @MyInt(%N.loc19_12.1) [symbolic = %MyInt.loc19_39.1 (constants.%MyInt)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %MyInt.loc19_39.1 [symbolic = %pattern_type (constants.%pattern_type.6bc)] -// CHECK:STDOUT: %.loc19_52.1: Core.Form = init_form %MyInt.loc19_39.1 [symbolic = %.loc19_52.1 (constants.%.5dd)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %MyInt.loc19_39.1 [symbolic = %require_complete (constants.%require_complete.f24)] -// CHECK:STDOUT: %.loc20_11.1: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%N.loc19_12.1) [symbolic = %.loc20_11.1 (constants.%.747)] -// CHECK:STDOUT: %Add.lookup_impl_witness: = lookup_impl_witness %MyInt.loc19_39.1, @Add [symbolic = %Add.lookup_impl_witness (constants.%Add.lookup_impl_witness)] -// CHECK:STDOUT: %Add.facet.loc20_11: %Add.type = facet_value %MyInt.loc19_39.1, (%Add.lookup_impl_witness) [symbolic = %Add.facet.loc20_11 (constants.%Add.facet.255)] -// CHECK:STDOUT: %Add.WithSelf.Op.type: type = fn_type @Add.WithSelf.Op, @Add.WithSelf(%Add.facet.loc20_11) [symbolic = %Add.WithSelf.Op.type (constants.%Add.WithSelf.Op.type.de5)] -// CHECK:STDOUT: %.loc20_11.2: type = fn_type_with_self_type %Add.WithSelf.Op.type, %Add.facet.loc20_11 [symbolic = %.loc20_11.2 (constants.%.ccf)] -// CHECK:STDOUT: %impl.elem0.loc20_11.2: @Double.%.loc20_11.2 (%.ccf) = impl_witness_access %Add.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_11.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc20_11.2: = specific_impl_function %impl.elem0.loc20_11.2, @Add.WithSelf.Op(%Add.facet.loc20_11) [symbolic = %specific_impl_fn.loc20_11.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%x.param: @Double.%MyInt.loc19_39.1 (%MyInt)) -> out %return.param: @Double.%MyInt.loc19_39.1 (%MyInt) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref.loc20_10: @Double.%MyInt.loc19_39.1 (%MyInt) = name_ref x, %x -// CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [concrete = constants.%Add.type] -// CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, @Add.WithSelf.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.loc20_11.1: @Double.%.loc20_11.2 (%.ccf) = impl_witness_access constants.%Add.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc20_11.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.loc20_11: = bound_method %x.ref.loc20_10, %impl.elem0.loc20_11.1 -// CHECK:STDOUT: %x.ref.loc20_21: @Double.%MyInt.loc19_39.1 (%MyInt) = name_ref x, %x -// CHECK:STDOUT: %Add.facet.loc20_22: %Add.type = facet_value constants.%MyInt, (constants.%Add.lookup_impl_witness) [symbolic = %Add.facet.loc20_11 (constants.%Add.facet.255)] -// CHECK:STDOUT: %.loc20_22: %Add.type = converted constants.%MyInt, %Add.facet.loc20_22 [symbolic = %Add.facet.loc20_11 (constants.%Add.facet.255)] -// CHECK:STDOUT: %specific_impl_fn.loc20_11.1: = specific_impl_function %impl.elem0.loc20_11.1, @Add.WithSelf.Op(constants.%Add.facet.255) [symbolic = %specific_impl_fn.loc20_11.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: %bound_method.loc20_22: = bound_method %x.ref.loc20_10, %specific_impl_fn.loc20_11.1 -// CHECK:STDOUT: %Add.WithSelf.Op.call: init @Double.%MyInt.loc19_39.1 (%MyInt) = call %bound_method.loc20_22(%x.ref.loc20_10, %x.ref.loc20_21) -// CHECK:STDOUT: return %Add.WithSelf.Op.call -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf(constants.%Self) { -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Add.WithSelf.Op.type => constants.%Add.WithSelf.Op.type.271 -// CHECK:STDOUT: %Add.WithSelf.Op => constants.%Add.WithSelf.Op.134 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf.Op(constants.%Self) { -// CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.e4c -// CHECK:STDOUT: %.loc5_37.1 => constants.%.3bf -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt(constants.%N) { -// CHECK:STDOUT: %N.loc11_14.1 => constants.%N -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin -// CHECK:STDOUT: %require_complete => constants.%require_complete.269 -// CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt.as.Add.impl(constants.%N) { -// CHECK:STDOUT: %N.loc15_15.1 => constants.%N -// CHECK:STDOUT: %MyInt.loc15_39.1 => constants.%MyInt -// CHECK:STDOUT: %Add.impl_witness.loc15_48.2 => constants.%Add.impl_witness -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.type => constants.%MyInt.as.Add.impl.Op.type -// CHECK:STDOUT: %MyInt.as.Add.impl.Op => constants.%MyInt.as.Add.impl.Op -// CHECK:STDOUT: %require_complete => constants.%require_complete.f24 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt.as.Add.impl.Op(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %MyInt => constants.%MyInt -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bc -// CHECK:STDOUT: %.loc16_37.1 => constants.%.5dd -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf(constants.%Add.facet.6b8) { -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Self => constants.%Add.facet.6b8 -// CHECK:STDOUT: %Add.WithSelf.Op.type => constants.%Add.WithSelf.Op.type.21b -// CHECK:STDOUT: %Add.WithSelf.Op => constants.%Add.WithSelf.Op.780 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf.Op(constants.%Add.facet.6b8) { -// CHECK:STDOUT: %Self => constants.%Add.facet.6b8 -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%MyInt -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bc -// CHECK:STDOUT: %.loc5_37.1 => constants.%.5dd -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Double(constants.%N) { -// CHECK:STDOUT: %N.loc19_12.1 => constants.%N -// CHECK:STDOUT: %MyInt.loc19_39.1 => constants.%MyInt -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bc -// CHECK:STDOUT: %.loc19_52.1 => constants.%.5dd -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf(constants.%Add.facet.255) { -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Self => constants.%Add.facet.255 -// CHECK:STDOUT: %Add.WithSelf.Op.type => constants.%Add.WithSelf.Op.type.de5 -// CHECK:STDOUT: %Add.WithSelf.Op => constants.%Add.WithSelf.Op.594 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf.Op(constants.%Add.facet.255) { -// CHECK:STDOUT: %Self => constants.%Add.facet.255 -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%MyInt -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bc -// CHECK:STDOUT: %.loc5_37.1 => constants.%.5dd -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: --- use_generic_impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %MyInt.type: type = generic_class_type @MyInt [concrete] -// CHECK:STDOUT: %MyInt.generic: %MyInt.type = struct_value () [concrete] -// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %complete_type.d26: = complete_type_witness %iN.builtin [symbolic] -// CHECK:STDOUT: %MyInt.e0a: type = class_type @MyInt, @MyInt(%N) [symbolic] -// CHECK:STDOUT: %require_complete.269: = require_complete_type %iN.builtin [symbolic] // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %MyInt.9fc: type = class_type @MyInt, @MyInt(%int_64) [concrete] -// CHECK:STDOUT: %pattern_type.507: type = pattern_type %MyInt.9fc [concrete] -// CHECK:STDOUT: %.a16: Core.Form = init_form %MyInt.9fc [concrete] -// CHECK:STDOUT: %CallImportedDouble.type: type = fn_type @CallImportedDouble [concrete] -// CHECK:STDOUT: %CallImportedDouble: %CallImportedDouble.type = struct_value () [concrete] -// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] -// CHECK:STDOUT: %complete_type.4a1: = complete_type_witness %i64.builtin [concrete] // CHECK:STDOUT: %Double.type: type = fn_type @Double [concrete] // CHECK:STDOUT: %Double: %Double.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.6bc: type = pattern_type %MyInt.e0a [symbolic] -// CHECK:STDOUT: %.5dd: Core.Form = init_form %MyInt.e0a [symbolic] -// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [concrete] -// CHECK:STDOUT: %Self: %Add.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.type.ee5: type = fn_type @Add.WithSelf.Op, @Add.WithSelf(%Self) [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.39f: %Add.WithSelf.Op.type.ee5 = struct_value () [symbolic] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] -// CHECK:STDOUT: %pattern_type.78d: type = pattern_type %Self.as_type [symbolic] -// CHECK:STDOUT: %.719: Core.Form = init_form %Self.as_type [symbolic] -// CHECK:STDOUT: %Add.lookup_impl_witness: = lookup_impl_witness %MyInt.e0a, @Add [symbolic] -// CHECK:STDOUT: %Add.facet.255: %Add.type = facet_value %MyInt.e0a, (%Add.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.type.de5: type = fn_type @Add.WithSelf.Op, @Add.WithSelf(%Add.facet.255) [symbolic] -// CHECK:STDOUT: %Add.WithSelf.Op.594: %Add.WithSelf.Op.type.de5 = struct_value () [symbolic] -// CHECK:STDOUT: %.ccf: type = fn_type_with_self_type %Add.WithSelf.Op.type.de5, %Add.facet.255 [symbolic] -// CHECK:STDOUT: %impl.elem0: %.ccf = impl_witness_access %Add.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Add.WithSelf.Op(%Add.facet.255) [symbolic] -// CHECK:STDOUT: %Add.impl_witness.5f1: = impl_witness imports.%Add.impl_witness_table, @MyInt.as.Add.impl(%N) [symbolic] -// CHECK:STDOUT: %require_complete.f24: = require_complete_type %MyInt.e0a [symbolic] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.type.784: type = fn_type @MyInt.as.Add.impl.Op, @MyInt.as.Add.impl(%N) [symbolic] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.5e3: %MyInt.as.Add.impl.Op.type.784 = struct_value () [symbolic] -// CHECK:STDOUT: %.795: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%N) [symbolic] // CHECK:STDOUT: %Double.specific_fn: = specific_function %Double, @Double(%int_64) [concrete] -// CHECK:STDOUT: %Add.impl_witness.503: = impl_witness imports.%Add.impl_witness_table, @MyInt.as.Add.impl(%int_64) [concrete] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.type.fc5: type = fn_type @MyInt.as.Add.impl.Op, @MyInt.as.Add.impl(%int_64) [concrete] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.a07: %MyInt.as.Add.impl.Op.type.fc5 = struct_value () [concrete] -// CHECK:STDOUT: %.7d9: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%int_64) [concrete] -// CHECK:STDOUT: %Add.facet.414: %Add.type = facet_value %MyInt.9fc, (%Add.impl_witness.503) [concrete] -// CHECK:STDOUT: %Add.WithSelf.Op.type.620: type = fn_type @Add.WithSelf.Op, @Add.WithSelf(%Add.facet.414) [concrete] -// CHECK:STDOUT: %.134: type = fn_type_with_self_type %Add.WithSelf.Op.type.620, %Add.facet.414 [concrete] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.specific_fn: = specific_function %MyInt.as.Add.impl.Op.a07, @MyInt.as.Add.impl.Op(%int_64) [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Main.Add = import_ref Main//generic_impl, Add, unloaded -// CHECK:STDOUT: %Main.IntLiteral = import_ref Main//generic_impl, IntLiteral, unloaded -// CHECK:STDOUT: %Main.Int = import_ref Main//generic_impl, Int, unloaded -// CHECK:STDOUT: %Main.MyInt: %MyInt.type = import_ref Main//generic_impl, MyInt, loaded [concrete = constants.%MyInt.generic] // CHECK:STDOUT: %Main.Double: %Double.type = import_ref Main//generic_impl, Double, loaded [concrete = constants.%Double] -// CHECK:STDOUT: %Main.import_ref.f9e: = import_ref Main//generic_impl, loc13_1, loaded [symbolic = @MyInt.%complete_type (constants.%complete_type.d26)] -// CHECK:STDOUT: %Main.import_ref.942 = import_ref Main//generic_impl, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.6b552a.1: Core.IntLiteral = import_ref Main//generic_impl, loc11_14, loaded [symbolic = @MyInt.%N (constants.%N)] -// CHECK:STDOUT: %Main.import_ref.6b552a.2: Core.IntLiteral = import_ref Main//generic_impl, loc19_12, loaded [symbolic = @Double.%N (constants.%N)] -// CHECK:STDOUT: %Main.import_ref.773 = import_ref Main//generic_impl, loc5_41, unloaded -// CHECK:STDOUT: %Main.Op = import_ref Main//generic_impl, Op, unloaded -// CHECK:STDOUT: %Main.import_ref.9e12ee.2: %Add.type = import_ref Main//generic_impl, loc4_15, loaded [symbolic = constants.%Self] -// CHECK:STDOUT: %Main.import_ref.6b4 = import_ref Main//generic_impl, loc4_15, unloaded -// CHECK:STDOUT: %Main.import_ref.d03: = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @MyInt.as.Add.impl.%Add.impl_witness (constants.%Add.impl_witness.5f1)] -// CHECK:STDOUT: %Main.import_ref.6b52: @MyInt.as.Add.impl.%MyInt.as.Add.impl.Op.type (%MyInt.as.Add.impl.Op.type.784) = import_ref Main//generic_impl, loc16_42, loaded [symbolic = @MyInt.as.Add.impl.%MyInt.as.Add.impl.Op (constants.%MyInt.as.Add.impl.Op.5e3)] -// CHECK:STDOUT: %Add.impl_witness_table = impl_witness_table (%Main.import_ref.6b52), @MyInt.as.Add.impl [concrete] -// CHECK:STDOUT: %Main.import_ref.6b552a.3: Core.IntLiteral = import_ref Main//generic_impl, loc15_15, loaded [symbolic = @MyInt.as.Add.impl.%N (constants.%N)] -// CHECK:STDOUT: %Main.import_ref.1d56b6.2: type = import_ref Main//generic_impl, loc15_39, loaded [symbolic = @MyInt.as.Add.impl.%MyInt (constants.%MyInt.e0a)] -// CHECK:STDOUT: %Main.import_ref.5e3: type = import_ref Main//generic_impl, loc15_44, loaded [concrete = constants.%Add.type] -// CHECK:STDOUT: %Main.import_ref.6b552a.4: Core.IntLiteral = import_ref Main//generic_impl, loc15_15, loaded [symbolic = @MyInt.as.Add.impl.%N (constants.%N)] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Add = imports.%Main.Add -// CHECK:STDOUT: .IntLiteral = imports.%Main.IntLiteral -// CHECK:STDOUT: .Int = imports.%Main.Int -// CHECK:STDOUT: .MyInt = imports.%Main.MyInt -// CHECK:STDOUT: .Double = imports.%Main.Double -// CHECK:STDOUT: .CallImportedDouble = %CallImportedDouble.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %CallImportedDouble.decl: %CallImportedDouble.type = fn_decl @CallImportedDouble [concrete = constants.%CallImportedDouble] { -// CHECK:STDOUT: %n.param_patt: %pattern_type.507 = value_param_pattern [concrete] -// CHECK:STDOUT: %n.patt: %pattern_type.507 = at_binding_pattern n, %n.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.507 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.507 = return_slot_pattern %return.param_patt, %MyInt.loc6_48 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %MyInt.ref.loc6_40: %MyInt.type = name_ref MyInt, imports.%Main.MyInt [concrete = constants.%MyInt.generic] -// CHECK:STDOUT: %int_64.loc6_46: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %MyInt.loc6_48: type = class_type @MyInt, @MyInt(constants.%int_64) [concrete = constants.%MyInt.9fc] -// CHECK:STDOUT: %.loc6_48: Core.Form = init_form %MyInt.loc6_48 [concrete = constants.%.a16] -// CHECK:STDOUT: %n.param: %MyInt.9fc = value_param call_param0 -// CHECK:STDOUT: %.loc6_34: type = splice_block %MyInt.loc6_34 [concrete = constants.%MyInt.9fc] { -// CHECK:STDOUT: %MyInt.ref.loc6_26: %MyInt.type = name_ref MyInt, imports.%Main.MyInt [concrete = constants.%MyInt.generic] -// CHECK:STDOUT: %int_64.loc6_32: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] -// CHECK:STDOUT: %MyInt.loc6_34: type = class_type @MyInt, @MyInt(constants.%int_64) [concrete = constants.%MyInt.9fc] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %MyInt.9fc = value_binding n, %n.param -// CHECK:STDOUT: %return.param: ref %MyInt.9fc = out_param call_param1 -// CHECK:STDOUT: %return: ref %MyInt.9fc = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @Add [from "generic_impl.carbon"] { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%Main.import_ref.6b4 -// CHECK:STDOUT: .Op = imports.%Main.import_ref.773 -// CHECK:STDOUT: witness = (imports.%Main.Op) -// CHECK:STDOUT: -// CHECK:STDOUT: !requires: -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic impl @MyInt.as.Add.impl(imports.%Main.import_ref.6b552a.4: Core.IntLiteral) [from "generic_impl.carbon"] { -// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.e0a)] -// CHECK:STDOUT: %Add.impl_witness: = impl_witness imports.%Add.impl_witness_table, @MyInt.as.Add.impl(%N) [symbolic = %Add.impl_witness (constants.%Add.impl_witness.5f1)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.type: type = fn_type @MyInt.as.Add.impl.Op, @MyInt.as.Add.impl(%N) [symbolic = %MyInt.as.Add.impl.Op.type (constants.%MyInt.as.Add.impl.Op.type.784)] -// CHECK:STDOUT: %MyInt.as.Add.impl.Op: @MyInt.as.Add.impl.%MyInt.as.Add.impl.Op.type (%MyInt.as.Add.impl.Op.type.784) = struct_value () [symbolic = %MyInt.as.Add.impl.Op (constants.%MyInt.as.Add.impl.Op.5e3)] -// CHECK:STDOUT: %require_complete: = require_complete_type %MyInt [symbolic = %require_complete (constants.%require_complete.f24)] -// CHECK:STDOUT: -// CHECK:STDOUT: impl: imports.%Main.import_ref.1d56b6.2 as imports.%Main.import_ref.5e3 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = imports.%Main.import_ref.d03 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @MyInt(imports.%Main.import_ref.6b552a.1: Core.IntLiteral) [from "generic_impl.carbon"] { -// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic = %require_complete (constants.%require_complete.269)] -// CHECK:STDOUT: %complete_type: = complete_type_witness %iN.builtin [symbolic = %complete_type (constants.%complete_type.d26)] -// CHECK:STDOUT: -// CHECK:STDOUT: class { -// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.f9e -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%Main.import_ref.942 -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @CallImportedDouble(%n.param: %MyInt.9fc) -> out %return.param: %MyInt.9fc { @@ -618,476 +108,6 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: return %Double.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Double(imports.%Main.import_ref.6b552a.2: Core.IntLiteral) [from "generic_impl.carbon"] { -// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.e0a)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %MyInt [symbolic = %pattern_type (constants.%pattern_type.6bc)] -// CHECK:STDOUT: %.1: Core.Form = init_form %MyInt [symbolic = %.1 (constants.%.5dd)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %MyInt [symbolic = %require_complete (constants.%require_complete.f24)] -// CHECK:STDOUT: %.2: require_specific_def_type = require_specific_def @MyInt.as.Add.impl(%N) [symbolic = %.2 (constants.%.795)] -// CHECK:STDOUT: %Add.lookup_impl_witness: = lookup_impl_witness %MyInt, @Add [symbolic = %Add.lookup_impl_witness (constants.%Add.lookup_impl_witness)] -// CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, (%Add.lookup_impl_witness) [symbolic = %Add.facet (constants.%Add.facet.255)] -// CHECK:STDOUT: %Add.WithSelf.Op.type: type = fn_type @Add.WithSelf.Op, @Add.WithSelf(%Add.facet) [symbolic = %Add.WithSelf.Op.type (constants.%Add.WithSelf.Op.type.de5)] -// CHECK:STDOUT: %.3: type = fn_type_with_self_type %Add.WithSelf.Op.type, %Add.facet [symbolic = %.3 (constants.%.ccf)] -// CHECK:STDOUT: %impl.elem0: @Double.%.3 (%.ccf) = impl_witness_access %Add.lookup_impl_witness, element0 [symbolic = %impl.elem0 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Add.WithSelf.Op(%Add.facet) [symbolic = %specific_impl_fn (constants.%specific_impl_fn)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Add.WithSelf.Op(imports.%Main.import_ref.9e12ee.2: %Add.type) [from "generic_impl.carbon"] { -// CHECK:STDOUT: %Self: %Add.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %Self.as_type [symbolic = %pattern_type (constants.%pattern_type.78d)] -// CHECK:STDOUT: %.1: Core.Form = init_form %Self.as_type [symbolic = %.1 (constants.%.719)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @MyInt.as.Add.impl.Op(imports.%Main.import_ref.6b552a.3: Core.IntLiteral) [from "generic_impl.carbon"] { -// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.e0a)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %MyInt [symbolic = %pattern_type (constants.%pattern_type.6bc)] -// CHECK:STDOUT: %.1: Core.Form = init_form %MyInt [symbolic = %.1 (constants.%.5dd)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: fn = "int.sadd"; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin -// CHECK:STDOUT: %require_complete => constants.%require_complete.269 -// CHECK:STDOUT: %complete_type => constants.%complete_type.d26 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt(constants.%int_64) { -// CHECK:STDOUT: %N => constants.%int_64 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %iN.builtin => constants.%i64.builtin -// CHECK:STDOUT: %require_complete => constants.%complete_type.4a1 -// CHECK:STDOUT: %complete_type => constants.%complete_type.4a1 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf(constants.%Self) { -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Add.WithSelf.Op.type => constants.%Add.WithSelf.Op.type.ee5 -// CHECK:STDOUT: %Add.WithSelf.Op => constants.%Add.WithSelf.Op.39f -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf.Op(constants.%Self) { -// CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.78d -// CHECK:STDOUT: %.1 => constants.%.719 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf(constants.%Add.facet.255) { -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %Self => constants.%Add.facet.255 -// CHECK:STDOUT: %Add.WithSelf.Op.type => constants.%Add.WithSelf.Op.type.de5 -// CHECK:STDOUT: %Add.WithSelf.Op => constants.%Add.WithSelf.Op.594 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf.Op(constants.%Add.facet.255) { -// CHECK:STDOUT: %Self => constants.%Add.facet.255 -// CHECK:STDOUT: %Self.as_type => constants.%MyInt.e0a -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bc -// CHECK:STDOUT: %.1 => constants.%.5dd -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt.as.Add.impl(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %MyInt => constants.%MyInt.e0a -// CHECK:STDOUT: %Add.impl_witness => constants.%Add.impl_witness.5f1 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.type => constants.%MyInt.as.Add.impl.Op.type.784 -// CHECK:STDOUT: %MyInt.as.Add.impl.Op => constants.%MyInt.as.Add.impl.Op.5e3 -// CHECK:STDOUT: %require_complete => constants.%require_complete.f24 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt.as.Add.impl.Op(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %MyInt => constants.%MyInt.e0a -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bc -// CHECK:STDOUT: %.1 => constants.%.5dd -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Double(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %MyInt => constants.%MyInt.e0a -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6bc -// CHECK:STDOUT: %.1 => constants.%.5dd -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Double(constants.%int_64) { -// CHECK:STDOUT: %N => constants.%int_64 -// CHECK:STDOUT: %MyInt => constants.%MyInt.9fc -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.507 -// CHECK:STDOUT: %.1 => constants.%.a16 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.4a1 -// CHECK:STDOUT: %.2 => constants.%.7d9 -// CHECK:STDOUT: %Add.lookup_impl_witness => constants.%Add.impl_witness.503 -// CHECK:STDOUT: %Add.facet => constants.%Add.facet.414 -// CHECK:STDOUT: %Add.WithSelf.Op.type => constants.%Add.WithSelf.Op.type.620 -// CHECK:STDOUT: %.3 => constants.%.134 -// CHECK:STDOUT: %impl.elem0 => constants.%MyInt.as.Add.impl.Op.a07 -// CHECK:STDOUT: %specific_impl_fn => constants.%MyInt.as.Add.impl.Op.specific_fn -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt.as.Add.impl(constants.%int_64) { -// CHECK:STDOUT: %N => constants.%int_64 -// CHECK:STDOUT: %MyInt => constants.%MyInt.9fc -// CHECK:STDOUT: %Add.impl_witness => constants.%Add.impl_witness.503 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %MyInt.as.Add.impl.Op.type => constants.%MyInt.as.Add.impl.Op.type.fc5 -// CHECK:STDOUT: %MyInt.as.Add.impl.Op => constants.%MyInt.as.Add.impl.Op.a07 -// CHECK:STDOUT: %require_complete => constants.%complete_type.4a1 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf(constants.%Add.facet.414) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Add.WithSelf.Op(constants.%Add.facet.414) { -// CHECK:STDOUT: %Self => constants.%Add.facet.414 -// CHECK:STDOUT: %Self.as_type => constants.%MyInt.9fc -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.507 -// CHECK:STDOUT: %.1 => constants.%.a16 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MyInt.as.Add.impl.Op(constants.%int_64) { -// CHECK:STDOUT: %N => constants.%int_64 -// CHECK:STDOUT: %MyInt => constants.%MyInt.9fc -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.507 -// CHECK:STDOUT: %.1 => constants.%.a16 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- convert_symbolic.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %.805: Core.Form = init_form type [concrete] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] -// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] -// CHECK:STDOUT: %.f7d: Core.Form = init_form Core.IntLiteral [concrete] -// CHECK:STDOUT: %ToLiteral.type: type = fn_type @ToLiteral [concrete] -// CHECK:STDOUT: %ToLiteral: %ToLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %.9cb: Core.Form = init_form %i32.builtin [concrete] -// CHECK:STDOUT: %FromLiteral.type: type = fn_type @FromLiteral [concrete] -// CHECK:STDOUT: %FromLiteral: %FromLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %type: type = facet_type [concrete] -// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self] -// CHECK:STDOUT: %N.7e8: %i32.builtin = symbolic_binding N, 0 [symbolic] -// CHECK:STDOUT: %ToLiteral.call: init Core.IntLiteral = call %ToLiteral(%N.7e8) [symbolic] -// CHECK:STDOUT: %iN.builtin.384: type = int_type signed, %ToLiteral.call [symbolic] -// CHECK:STDOUT: %.220: Core.Form = init_form %iN.builtin.384 [symbolic] -// CHECK:STDOUT: %pattern_type.86d: type = pattern_type %iN.builtin.384 [symbolic] -// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] -// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.b2b: = require_complete_type %iN.builtin.384 [symbolic] -// CHECK:STDOUT: %Make.specific_fn: = specific_function %Make, @Make(%N.7e8) [symbolic] -// CHECK:STDOUT: %OtherInt: type = class_type @OtherInt [concrete] -// CHECK:STDOUT: %pattern_type.35b: type = pattern_type %OtherInt [concrete] -// CHECK:STDOUT: %OtherInt.ToLiteral.type: type = fn_type @OtherInt.ToLiteral [concrete] -// CHECK:STDOUT: %OtherInt.ToLiteral: %OtherInt.ToLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i32.builtin [concrete] -// CHECK:STDOUT: %N.93f: %OtherInt = symbolic_binding N, 0 [symbolic] -// CHECK:STDOUT: %OtherInt.ToLiteral.bound: = bound_method %N.93f, %OtherInt.ToLiteral [symbolic] -// CHECK:STDOUT: %OtherInt.ToLiteral.call: init Core.IntLiteral = call %OtherInt.ToLiteral.bound(%N.93f) [symbolic] -// CHECK:STDOUT: %iN.builtin.11d: type = int_type signed, %OtherInt.ToLiteral.call [symbolic] -// CHECK:STDOUT: %.bae: Core.Form = init_form %iN.builtin.11d [symbolic] -// CHECK:STDOUT: %pattern_type.558: type = pattern_type %iN.builtin.11d [symbolic] -// CHECK:STDOUT: %MakeFromClass.type: type = fn_type @MakeFromClass [concrete] -// CHECK:STDOUT: %MakeFromClass: %MakeFromClass.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete.11f: = require_complete_type %iN.builtin.11d [symbolic] -// CHECK:STDOUT: %MakeFromClass.specific_fn: = specific_function %MakeFromClass, @MakeFromClass(%N.93f) [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl -// CHECK:STDOUT: .Int = %Int.decl -// CHECK:STDOUT: .ToLiteral = %ToLiteral.decl -// CHECK:STDOUT: .FromLiteral = %FromLiteral.decl -// CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: .OtherInt = %OtherInt.decl -// CHECK:STDOUT: .MakeFromClass = %MakeFromClass.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [concrete = constants.%IntLiteral] { -// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc4_20.1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc4_20.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc4_20.2: Core.Form = init_form %.loc4_20.1 [concrete = constants.%.805] -// CHECK:STDOUT: %return.param: ref type = out_param call_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] { -// CHECK:STDOUT: %n.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] -// CHECK:STDOUT: %n.patt: %pattern_type.dc0 = at_binding_pattern n, %n.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern %return.param_patt, %.loc5_28.1 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc5_28.1: type = type_literal type [concrete = type] -// CHECK:STDOUT: %.loc5_28.2: Core.Form = init_form %.loc5_28.1 [concrete = constants.%.805] -// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.3: type = converted %IntLiteral.call, %.loc5_22.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: Core.IntLiteral = value_binding n, %n.param -// CHECK:STDOUT: %return.param: ref type = out_param call_param1 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %ToLiteral.decl: %ToLiteral.type = fn_decl @ToLiteral [concrete = constants.%ToLiteral] { -// CHECK:STDOUT: %n.param_patt: %pattern_type.956 = value_param_pattern [concrete] -// CHECK:STDOUT: %n.patt: %pattern_type.956 = at_binding_pattern n, %n.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc6_40.2 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_40.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_40.2: type = converted %IntLiteral.call, %.loc6_40.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc6_40.3: Core.Form = init_form %.loc6_40.2 [concrete = constants.%.f7d] -// CHECK:STDOUT: %n.param: %i32.builtin = value_param call_param0 -// CHECK:STDOUT: %.loc6_23.1: type = splice_block %.loc6_23.3 [concrete = constants.%i32.builtin] { -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [concrete = constants.%Int] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%int_32) [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc6_23.2: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc6_23.3: type = converted %Int.call, %.loc6_23.2 [concrete = constants.%i32.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %i32.builtin = value_binding n, %n.param -// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1 -// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %FromLiteral.decl: %FromLiteral.type = fn_decl @FromLiteral [concrete = constants.%FromLiteral] { -// CHECK:STDOUT: %n.param_patt: %pattern_type.dc0 = value_param_pattern [concrete] -// CHECK:STDOUT: %n.patt: %pattern_type.dc0 = at_binding_pattern n, %n.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern %return.param_patt, %.loc7_42.2 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [concrete = constants.%Int] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%int_32) [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_42.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_42.2: type = converted %Int.call, %.loc7_42.1 [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc7_42.3: Core.Form = init_form %.loc7_42.2 [concrete = constants.%.9cb] -// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param call_param0 -// CHECK:STDOUT: %.loc7_30.1: type = splice_block %.loc7_30.3 [concrete = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc7_30.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc7_30.3: type = converted %IntLiteral.call, %.loc7_30.2 [concrete = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: Core.IntLiteral = value_binding n, %n.param -// CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param1 -// CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [concrete = constants.%Make] { -// CHECK:STDOUT: %N.patt: %pattern_type.956 = symbolic_binding_pattern N, 0 [concrete] -// CHECK:STDOUT: %return.param_patt: @Make.%pattern_type (%pattern_type.86d) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @Make.%pattern_type (%pattern_type.86d) = return_slot_pattern %return.param_patt, %.loc9_41.3 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc9_25: %Int.type = name_ref Int, file.%Int.decl [concrete = constants.%Int] -// CHECK:STDOUT: %ToLiteral.ref: %ToLiteral.type = name_ref ToLiteral, file.%ToLiteral.decl [concrete = constants.%ToLiteral] -// CHECK:STDOUT: %N.ref.loc9_39: %i32.builtin = name_ref N, %N.loc9_10.2 [symbolic = %N.loc9_10.1 (constants.%N.7e8)] -// CHECK:STDOUT: %ToLiteral.call.loc9_40.2: init Core.IntLiteral = call %ToLiteral.ref(%N.ref.loc9_39) [symbolic = %ToLiteral.call.loc9_40.1 (constants.%ToLiteral.call)] -// CHECK:STDOUT: %.loc9_40.1: Core.IntLiteral = value_of_initializer %ToLiteral.call.loc9_40.2 [symbolic = %ToLiteral.call.loc9_40.1 (constants.%ToLiteral.call)] -// CHECK:STDOUT: %.loc9_40.2: Core.IntLiteral = converted %ToLiteral.call.loc9_40.2, %.loc9_40.1 [symbolic = %ToLiteral.call.loc9_40.1 (constants.%ToLiteral.call)] -// CHECK:STDOUT: %Int.call.loc9_41: init type = call %Int.ref.loc9_25(%.loc9_40.2) [symbolic = %iN.builtin (constants.%iN.builtin.384)] -// CHECK:STDOUT: %.loc9_41.2: type = value_of_initializer %Int.call.loc9_41 [symbolic = %iN.builtin (constants.%iN.builtin.384)] -// CHECK:STDOUT: %.loc9_41.3: type = converted %Int.call.loc9_41, %.loc9_41.2 [symbolic = %iN.builtin (constants.%iN.builtin.384)] -// CHECK:STDOUT: %.loc9_41.4: Core.Form = init_form %.loc9_41.3 [symbolic = %.loc9_41.1 (constants.%.220)] -// CHECK:STDOUT: %.loc9_19.1: type = splice_block %.loc9_19.3 [concrete = constants.%i32.builtin] { -// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %Int.ref.loc9_13: %Int.type = name_ref Int, file.%Int.decl [concrete = constants.%Int] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %Int.call.loc9_19: init type = call %Int.ref.loc9_13(%int_32) [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %Int.call.loc9_19 [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc9_19.3: type = converted %Int.call.loc9_19, %.loc9_19.2 [concrete = constants.%i32.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc9_10.2: %i32.builtin = symbolic_binding N, 0 [symbolic = %N.loc9_10.1 (constants.%N.7e8)] -// CHECK:STDOUT: %return.param: ref @Make.%iN.builtin (%iN.builtin.384) = out_param call_param0 -// CHECK:STDOUT: %return: ref @Make.%iN.builtin (%iN.builtin.384) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %OtherInt.decl: type = class_decl @OtherInt [concrete = constants.%OtherInt] {} {} -// CHECK:STDOUT: %OtherInt.ToLiteral.decl: %OtherInt.ToLiteral.type = fn_decl @OtherInt.ToLiteral [concrete = constants.%OtherInt.ToLiteral] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.35b = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.35b = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc16_51.2 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref.loc16: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc16: init type = call %IntLiteral.ref.loc16() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc16_51.1: type = value_of_initializer %IntLiteral.call.loc16 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc16_51.2: type = converted %IntLiteral.call.loc16, %.loc16_51.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc16_51.3: Core.Form = init_form %.loc16_51.2 [concrete = constants.%.f7d] -// CHECK:STDOUT: %self.param.loc16: %OtherInt = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%OtherInt [concrete = constants.%OtherInt] -// CHECK:STDOUT: %self.loc16: %OtherInt = value_binding self, %self.param.loc16 -// CHECK:STDOUT: %return.param.loc16: ref Core.IntLiteral = out_param call_param1 -// CHECK:STDOUT: %return.loc16: ref Core.IntLiteral = return_slot %return.param.loc16 -// CHECK:STDOUT: } -// CHECK:STDOUT: %MakeFromClass.decl: %MakeFromClass.type = fn_decl @MakeFromClass [concrete = constants.%MakeFromClass] { -// CHECK:STDOUT: %N.patt: %pattern_type.35b = symbolic_binding_pattern N, 0 [concrete] -// CHECK:STDOUT: %return.param_patt: @MakeFromClass.%pattern_type (%pattern_type.558) = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: @MakeFromClass.%pattern_type (%pattern_type.558) = return_slot_pattern %return.param_patt, %.loc18_52.3 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [concrete = constants.%Int] -// CHECK:STDOUT: %N.ref.loc18_39: %OtherInt = name_ref N, %N.loc18_19.2 [symbolic = %N.loc18_19.1 (constants.%N.93f)] -// CHECK:STDOUT: %ToLiteral.ref: %OtherInt.ToLiteral.type = name_ref ToLiteral, @OtherInt.%OtherInt.ToLiteral.decl [concrete = constants.%OtherInt.ToLiteral] -// CHECK:STDOUT: %OtherInt.ToLiteral.bound.loc18_40.2: = bound_method %N.ref.loc18_39, %ToLiteral.ref [symbolic = %OtherInt.ToLiteral.bound.loc18_40.1 (constants.%OtherInt.ToLiteral.bound)] -// CHECK:STDOUT: %OtherInt.ToLiteral.call.loc18_51.2: init Core.IntLiteral = call %OtherInt.ToLiteral.bound.loc18_40.2(%N.ref.loc18_39) [symbolic = %OtherInt.ToLiteral.call.loc18_51.1 (constants.%OtherInt.ToLiteral.call)] -// CHECK:STDOUT: %.loc18_51.1: Core.IntLiteral = value_of_initializer %OtherInt.ToLiteral.call.loc18_51.2 [symbolic = %OtherInt.ToLiteral.call.loc18_51.1 (constants.%OtherInt.ToLiteral.call)] -// CHECK:STDOUT: %.loc18_51.2: Core.IntLiteral = converted %OtherInt.ToLiteral.call.loc18_51.2, %.loc18_51.1 [symbolic = %OtherInt.ToLiteral.call.loc18_51.1 (constants.%OtherInt.ToLiteral.call)] -// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%.loc18_51.2) [symbolic = %iN.builtin (constants.%iN.builtin.11d)] -// CHECK:STDOUT: %.loc18_52.2: type = value_of_initializer %Int.call [symbolic = %iN.builtin (constants.%iN.builtin.11d)] -// CHECK:STDOUT: %.loc18_52.3: type = converted %Int.call, %.loc18_52.2 [symbolic = %iN.builtin (constants.%iN.builtin.11d)] -// CHECK:STDOUT: %.loc18_52.4: Core.Form = init_form %.loc18_52.3 [symbolic = %.loc18_52.1 (constants.%.bae)] -// CHECK:STDOUT: %.loc18_22: type = splice_block %OtherInt.ref [concrete = constants.%OtherInt] { -// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %OtherInt.ref: type = name_ref OtherInt, file.%OtherInt.decl [concrete = constants.%OtherInt] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc18_19.2: %OtherInt = symbolic_binding N, 0 [symbolic = %N.loc18_19.1 (constants.%N.93f)] -// CHECK:STDOUT: %return.param: ref @MakeFromClass.%iN.builtin (%iN.builtin.11d) = out_param call_param0 -// CHECK:STDOUT: %return: ref @MakeFromClass.%iN.builtin (%iN.builtin.11d) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @OtherInt { -// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [concrete = constants.%Int] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %Int.call: init type = call %Int.ref(%int_32) [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc12_16.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin] -// CHECK:STDOUT: %.loc12_16.2: type = converted %Int.call, %.loc12_16.1 [concrete = constants.%i32.builtin] -// CHECK:STDOUT: adapt_decl %.loc12_16.2 [concrete] -// CHECK:STDOUT: %OtherInt.ToLiteral.decl: %OtherInt.ToLiteral.type = fn_decl @OtherInt.ToLiteral [concrete = constants.%OtherInt.ToLiteral] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.35b = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.35b = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern %return.param_patt, %.loc16_51.2 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref.loc13: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call.loc13: init type = call %IntLiteral.ref.loc13() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc13_44.1: type = value_of_initializer %IntLiteral.call.loc13 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc13_44.2: type = converted %IntLiteral.call.loc13, %.loc13_44.1 [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc13_44.3: Core.Form = init_form %.loc13_44.2 [concrete = constants.%.f7d] -// CHECK:STDOUT: %self.param.loc13: %OtherInt = value_param call_param0 -// CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%OtherInt [concrete = constants.%OtherInt] -// CHECK:STDOUT: %self.loc13: %OtherInt = value_binding self, %self.param.loc13 -// CHECK:STDOUT: %return.param.loc13: ref Core.IntLiteral = out_param call_param1 -// CHECK:STDOUT: %return.loc13: ref Core.IntLiteral = return_slot %return.param.loc13 -// CHECK:STDOUT: } -// CHECK:STDOUT: %complete_type: = complete_type_witness constants.%i32.builtin [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%OtherInt -// CHECK:STDOUT: .Int = -// CHECK:STDOUT: .IntLiteral = -// CHECK:STDOUT: .ToLiteral = %OtherInt.ToLiteral.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> out %return.param: type = "int_literal.make_type"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param: Core.IntLiteral) -> out %return.param: type = "int.make_type_signed"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @ToLiteral(%n.param: %i32.builtin) -> out %return.param: Core.IntLiteral = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @FromLiteral(%n.param: Core.IntLiteral) -> out %return.param: %i32.builtin = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make(%N.loc9_10.2: %i32.builtin) { -// CHECK:STDOUT: %N.loc9_10.1: %i32.builtin = symbolic_binding N, 0 [symbolic = %N.loc9_10.1 (constants.%N.7e8)] -// CHECK:STDOUT: %ToLiteral.call.loc9_40.1: init Core.IntLiteral = call constants.%ToLiteral(%N.loc9_10.1) [symbolic = %ToLiteral.call.loc9_40.1 (constants.%ToLiteral.call)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %ToLiteral.call.loc9_40.1 [symbolic = %iN.builtin (constants.%iN.builtin.384)] -// CHECK:STDOUT: %.loc9_41.1: Core.Form = init_form %iN.builtin [symbolic = %.loc9_41.1 (constants.%.220)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %iN.builtin [symbolic = %pattern_type (constants.%pattern_type.86d)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic = %require_complete (constants.%require_complete.b2b)] -// CHECK:STDOUT: %Make.specific_fn.loc9_52.2: = specific_function constants.%Make, @Make(%N.loc9_10.1) [symbolic = %Make.specific_fn.loc9_52.2 (constants.%Make.specific_fn)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn() -> out %return.param: @Make.%iN.builtin (%iN.builtin.384) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] -// CHECK:STDOUT: %N.ref.loc9_57: %i32.builtin = name_ref N, %N.loc9_10.2 [symbolic = %N.loc9_10.1 (constants.%N.7e8)] -// CHECK:STDOUT: %Make.specific_fn.loc9_52.1: = specific_function %Make.ref, @Make(constants.%N.7e8) [symbolic = %Make.specific_fn.loc9_52.2 (constants.%Make.specific_fn)] -// CHECK:STDOUT: %Make.call: init @Make.%iN.builtin (%iN.builtin.384) = call %Make.specific_fn.loc9_52.1() -// CHECK:STDOUT: return %Make.call -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @OtherInt.ToLiteral(%self.param.loc16: %OtherInt) -> out %return.param.loc16: Core.IntLiteral = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @MakeFromClass(%N.loc18_19.2: %OtherInt) { -// CHECK:STDOUT: %N.loc18_19.1: %OtherInt = symbolic_binding N, 0 [symbolic = %N.loc18_19.1 (constants.%N.93f)] -// CHECK:STDOUT: %OtherInt.ToLiteral.bound.loc18_40.1: = bound_method %N.loc18_19.1, constants.%OtherInt.ToLiteral [symbolic = %OtherInt.ToLiteral.bound.loc18_40.1 (constants.%OtherInt.ToLiteral.bound)] -// CHECK:STDOUT: %OtherInt.ToLiteral.call.loc18_51.1: init Core.IntLiteral = call %OtherInt.ToLiteral.bound.loc18_40.1(%N.loc18_19.1) [symbolic = %OtherInt.ToLiteral.call.loc18_51.1 (constants.%OtherInt.ToLiteral.call)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %OtherInt.ToLiteral.call.loc18_51.1 [symbolic = %iN.builtin (constants.%iN.builtin.11d)] -// CHECK:STDOUT: %.loc18_52.1: Core.Form = init_form %iN.builtin [symbolic = %.loc18_52.1 (constants.%.bae)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %iN.builtin [symbolic = %pattern_type (constants.%pattern_type.558)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic = %require_complete (constants.%require_complete.11f)] -// CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.2: = specific_function constants.%MakeFromClass, @MakeFromClass(%N.loc18_19.1) [symbolic = %MakeFromClass.specific_fn.loc18_63.2 (constants.%MakeFromClass.specific_fn)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn() -> out %return.param: @MakeFromClass.%iN.builtin (%iN.builtin.11d) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %MakeFromClass.ref: %MakeFromClass.type = name_ref MakeFromClass, file.%MakeFromClass.decl [concrete = constants.%MakeFromClass] -// CHECK:STDOUT: %N.ref.loc18_77: %OtherInt = name_ref N, %N.loc18_19.2 [symbolic = %N.loc18_19.1 (constants.%N.93f)] -// CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.1: = specific_function %MakeFromClass.ref, @MakeFromClass(constants.%N.93f) [symbolic = %MakeFromClass.specific_fn.loc18_63.2 (constants.%MakeFromClass.specific_fn)] -// CHECK:STDOUT: %MakeFromClass.call: init @MakeFromClass.%iN.builtin (%iN.builtin.11d) = call %MakeFromClass.specific_fn.loc18_63.1() -// CHECK:STDOUT: return %MakeFromClass.call -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Make(constants.%N.7e8) { -// CHECK:STDOUT: %N.loc9_10.1 => constants.%N.7e8 -// CHECK:STDOUT: %ToLiteral.call.loc9_40.1 => constants.%ToLiteral.call -// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.384 -// CHECK:STDOUT: %.loc9_41.1 => constants.%.220 -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.86d -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.b2b -// CHECK:STDOUT: %Make.specific_fn.loc9_52.2 => constants.%Make.specific_fn -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MakeFromClass(constants.%N.93f) { -// CHECK:STDOUT: %N.loc18_19.1 => constants.%N.93f -// CHECK:STDOUT: %OtherInt.ToLiteral.bound.loc18_40.1 => constants.%OtherInt.ToLiteral.bound -// CHECK:STDOUT: %OtherInt.ToLiteral.call.loc18_51.1 => constants.%OtherInt.ToLiteral.call -// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.11d -// CHECK:STDOUT: %.loc18_52.1 => constants.%.bae -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.558 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.11f -// CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.2 => constants.%MakeFromClass.specific_fn -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: --- use_convert_symbolic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1100,86 +120,31 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] -// CHECK:STDOUT: %N.7e8: %i32.builtin = symbolic_binding N, 0 [symbolic] -// CHECK:STDOUT: %ToLiteral.type: type = fn_type @ToLiteral [concrete] -// CHECK:STDOUT: %ToLiteral: %ToLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %ToLiteral.call: init Core.IntLiteral = call %ToLiteral(%N.7e8) [symbolic] -// CHECK:STDOUT: %iN.builtin.384: type = int_type signed, %ToLiteral.call [symbolic] -// CHECK:STDOUT: %pattern_type.86d: type = pattern_type %iN.builtin.384 [symbolic] -// CHECK:STDOUT: %.220: Core.Form = init_form %iN.builtin.384 [symbolic] -// CHECK:STDOUT: %Make.specific_fn.a18: = specific_function %Make, @Make(%N.7e8) [symbolic] -// CHECK:STDOUT: %require_complete.b2b: = require_complete_type %iN.builtin.384 [symbolic] // CHECK:STDOUT: %FromLiteral.type: type = fn_type @FromLiteral [concrete] // CHECK:STDOUT: %FromLiteral: %FromLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %int_64.f82: %i32.builtin = int_value 64 [concrete] -// CHECK:STDOUT: %.df2: Core.Form = init_form %i64.builtin [concrete] // CHECK:STDOUT: %Make.specific_fn.bb3: = specific_function %Make, @Make(%int_64.f82) [concrete] // CHECK:STDOUT: %MakeFromClass.type: type = fn_type @MakeFromClass [concrete] // CHECK:STDOUT: %MakeFromClass: %MakeFromClass.type = struct_value () [concrete] // CHECK:STDOUT: %OtherInt: type = class_type @OtherInt [concrete] -// CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] -// CHECK:STDOUT: %N.93f: %OtherInt = symbolic_binding N, 0 [symbolic] -// CHECK:STDOUT: %OtherInt.ToLiteral.type: type = fn_type @OtherInt.ToLiteral [concrete] -// CHECK:STDOUT: %OtherInt.ToLiteral: %OtherInt.ToLiteral.type = struct_value () [concrete] -// CHECK:STDOUT: %OtherInt.ToLiteral.bound.154: = bound_method %N.93f, %OtherInt.ToLiteral [symbolic] -// CHECK:STDOUT: %OtherInt.ToLiteral.call: init Core.IntLiteral = call %OtherInt.ToLiteral.bound.154(%N.93f) [symbolic] -// CHECK:STDOUT: %iN.builtin.11d: type = int_type signed, %OtherInt.ToLiteral.call [symbolic] -// CHECK:STDOUT: %pattern_type.558: type = pattern_type %iN.builtin.11d [symbolic] -// CHECK:STDOUT: %.bae: Core.Form = init_form %iN.builtin.11d [symbolic] -// CHECK:STDOUT: %MakeFromClass.specific_fn.171: = specific_function %MakeFromClass, @MakeFromClass(%N.93f) [symbolic] -// CHECK:STDOUT: %require_complete.11f: = require_complete_type %iN.builtin.11d [symbolic] // CHECK:STDOUT: %int_64.420: %OtherInt = int_value 64 [concrete] -// CHECK:STDOUT: %OtherInt.ToLiteral.bound.4ee: = bound_method %int_64.420, %OtherInt.ToLiteral [concrete] // CHECK:STDOUT: %MakeFromClass.specific_fn.3a7: = specific_function %MakeFromClass, @MakeFromClass(%int_64.420) [concrete] -// CHECK:STDOUT: %complete_type.4a1: = complete_type_witness %i64.builtin [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Main.IntLiteral = import_ref Main//convert_symbolic, IntLiteral, unloaded // CHECK:STDOUT: %Main.Int: %Int.type = import_ref Main//convert_symbolic, Int, loaded [concrete = constants.%Int] -// CHECK:STDOUT: %Main.ToLiteral = import_ref Main//convert_symbolic, ToLiteral, unloaded // CHECK:STDOUT: %Main.FromLiteral: %FromLiteral.type = import_ref Main//convert_symbolic, FromLiteral, loaded [concrete = constants.%FromLiteral] // CHECK:STDOUT: %Main.Make: %Make.type = import_ref Main//convert_symbolic, Make, loaded [concrete = constants.%Make] // CHECK:STDOUT: %Main.OtherInt: type = import_ref Main//convert_symbolic, OtherInt, loaded [concrete = constants.%OtherInt] // CHECK:STDOUT: %Main.MakeFromClass: %MakeFromClass.type = import_ref Main//convert_symbolic, MakeFromClass, loaded [concrete = constants.%MakeFromClass] -// CHECK:STDOUT: %Main.import_ref.87d: %i32.builtin = import_ref Main//convert_symbolic, loc9_10, loaded [symbolic = @Make.%N (constants.%N.7e8)] -// CHECK:STDOUT: %Main.import_ref.b03: = import_ref Main//convert_symbolic, loc14_1, loaded [concrete = constants.%complete_type.f8a] -// CHECK:STDOUT: %Main.import_ref.6e7 = import_ref Main//convert_symbolic, inst{{[0-9A-F]+}} [no loc], unloaded -// CHECK:STDOUT: %Main.import_ref.550 = import_ref Main//convert_symbolic, loc13_45, unloaded -// CHECK:STDOUT: %Main.import_ref.a4d: %OtherInt = import_ref Main//convert_symbolic, loc18_19, loaded [symbolic = @MakeFromClass.%N (constants.%N.93f)] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .IntLiteral = imports.%Main.IntLiteral -// CHECK:STDOUT: .Int = imports.%Main.Int -// CHECK:STDOUT: .ToLiteral = imports.%Main.ToLiteral -// CHECK:STDOUT: .FromLiteral = imports.%Main.FromLiteral -// CHECK:STDOUT: .Make = imports.%Main.Make -// CHECK:STDOUT: .OtherInt = imports.%Main.OtherInt -// CHECK:STDOUT: .MakeFromClass = imports.%Main.MakeFromClass -// CHECK:STDOUT: .m = %m -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %m.patt: %pattern_type.e13 = ref_binding_pattern m [concrete] // CHECK:STDOUT: %m.var_patt: %pattern_type.e13 = var_pattern %m.patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: %m.var: ref %i64.builtin = var %m.var_patt [concrete] -// CHECK:STDOUT: %.loc6_14.1: type = splice_block %.loc6_14.3 [concrete = constants.%i64.builtin] { -// CHECK:STDOUT: %Int.ref.loc6: %Int.type = name_ref Int, imports.%Main.Int [concrete = constants.%Int] -// CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] -// CHECK:STDOUT: %Int.call.loc6: init type = call %Int.ref.loc6(%int_64.loc6) [concrete = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %Int.call.loc6 [concrete = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_14.3: type = converted %Int.call.loc6, %.loc6_14.2 [concrete = constants.%i64.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %m: ref %i64.builtin = ref_binding m, %m.var [concrete = %m.var] -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %n.patt: %pattern_type.e13 = ref_binding_pattern n [concrete] -// CHECK:STDOUT: %n.var_patt: %pattern_type.e13 = var_pattern %n.patt [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n.var: ref %i64.builtin = var %n.var_patt [concrete] // CHECK:STDOUT: %.loc7_14.1: type = splice_block %.loc7_14.3 [concrete = constants.%i64.builtin] { // CHECK:STDOUT: %Int.ref.loc7: %Int.type = name_ref Int, imports.%Main.Int [concrete = constants.%Int] // CHECK:STDOUT: %int_64.loc7: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] @@ -1187,127 +152,45 @@ var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt); // CHECK:STDOUT: %.loc7_14.2: type = value_of_initializer %Int.call.loc7 [concrete = constants.%i64.builtin] // CHECK:STDOUT: %.loc7_14.3: type = converted %Int.call.loc7, %.loc7_14.2 [concrete = constants.%i64.builtin] // CHECK:STDOUT: } +// CHECK:STDOUT: %m: ref %i64.builtin = ref_binding m, %m.var [concrete = %m.var] +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %n.patt: %pattern_type.e13 = ref_binding_pattern n [concrete] +// CHECK:STDOUT: %n.var_patt: %pattern_type.e13 = var_pattern %n.patt [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %n.var: ref %i64.builtin = var %n.var_patt [concrete] +// CHECK:STDOUT: %.loc8_14.1: type = splice_block %.loc8_14.3 [concrete = constants.%i64.builtin] { +// CHECK:STDOUT: %Int.ref.loc8: %Int.type = name_ref Int, imports.%Main.Int [concrete = constants.%Int] +// CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] +// CHECK:STDOUT: %Int.call.loc8: init type = call %Int.ref.loc8(%int_64.loc8) [concrete = constants.%i64.builtin] +// CHECK:STDOUT: %.loc8_14.2: type = value_of_initializer %Int.call.loc8 [concrete = constants.%i64.builtin] +// CHECK:STDOUT: %.loc8_14.3: type = converted %Int.call.loc8, %.loc8_14.2 [concrete = constants.%i64.builtin] +// CHECK:STDOUT: } // CHECK:STDOUT: %n: ref %i64.builtin = ref_binding n, %n.var [concrete = %n.var] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @OtherInt [from "convert_symbolic.carbon"] { -// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.b03 -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%Main.import_ref.6e7 -// CHECK:STDOUT: .ToLiteral = imports.%Main.import_ref.550 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int = "int.make_type_signed" [from "convert_symbolic.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Make(imports.%Main.import_ref.87d: %i32.builtin) [from "convert_symbolic.carbon"] { -// CHECK:STDOUT: %N: %i32.builtin = symbolic_binding N, 0 [symbolic = %N (constants.%N.7e8)] -// CHECK:STDOUT: %ToLiteral.call: init Core.IntLiteral = call constants.%ToLiteral(%N) [symbolic = %ToLiteral.call (constants.%ToLiteral.call)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %ToLiteral.call [symbolic = %iN.builtin (constants.%iN.builtin.384)] -// CHECK:STDOUT: %.1: Core.Form = init_form %iN.builtin [symbolic = %.1 (constants.%.220)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %iN.builtin [symbolic = %pattern_type (constants.%pattern_type.86d)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic = %require_complete (constants.%require_complete.b2b)] -// CHECK:STDOUT: %Make.specific_fn: = specific_function constants.%Make, @Make(%N) [symbolic = %Make.specific_fn (constants.%Make.specific_fn.a18)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @ToLiteral = "int.convert_checked" [from "convert_symbolic.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @FromLiteral = "int.convert_checked" [from "convert_symbolic.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @MakeFromClass(imports.%Main.import_ref.a4d: %OtherInt) [from "convert_symbolic.carbon"] { -// CHECK:STDOUT: %N: %OtherInt = symbolic_binding N, 0 [symbolic = %N (constants.%N.93f)] -// CHECK:STDOUT: %OtherInt.ToLiteral.bound: = bound_method %N, constants.%OtherInt.ToLiteral [symbolic = %OtherInt.ToLiteral.bound (constants.%OtherInt.ToLiteral.bound.154)] -// CHECK:STDOUT: %OtherInt.ToLiteral.call: init Core.IntLiteral = call %OtherInt.ToLiteral.bound(%N) [symbolic = %OtherInt.ToLiteral.call (constants.%OtherInt.ToLiteral.call)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %OtherInt.ToLiteral.call [symbolic = %iN.builtin (constants.%iN.builtin.11d)] -// CHECK:STDOUT: %.1: Core.Form = init_form %iN.builtin [symbolic = %.1 (constants.%.bae)] -// CHECK:STDOUT: %pattern_type: type = pattern_type %iN.builtin [symbolic = %pattern_type (constants.%pattern_type.558)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic = %require_complete (constants.%require_complete.11f)] -// CHECK:STDOUT: %MakeFromClass.specific_fn: = specific_function constants.%MakeFromClass, @MakeFromClass(%N) [symbolic = %MakeFromClass.specific_fn (constants.%MakeFromClass.specific_fn.171)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @OtherInt.ToLiteral = "int.convert_checked" [from "convert_symbolic.carbon"]; -// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%Main.Make [concrete = constants.%Make] -// CHECK:STDOUT: %FromLiteral.ref.loc6: %FromLiteral.type = name_ref FromLiteral, imports.%Main.FromLiteral [concrete = constants.%FromLiteral] -// CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] -// CHECK:STDOUT: %FromLiteral.call.loc6: init %i32.builtin = call %FromLiteral.ref.loc6(%int_64.loc6) [concrete = constants.%int_64.f82] -// CHECK:STDOUT: %.loc6_38.1: %i32.builtin = value_of_initializer %FromLiteral.call.loc6 [concrete = constants.%int_64.f82] -// CHECK:STDOUT: %.loc6_38.2: %i32.builtin = converted %FromLiteral.call.loc6, %.loc6_38.1 [concrete = constants.%int_64.f82] +// CHECK:STDOUT: %FromLiteral.ref.loc7: %FromLiteral.type = name_ref FromLiteral, imports.%Main.FromLiteral [concrete = constants.%FromLiteral] +// CHECK:STDOUT: %int_64.loc7: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] +// CHECK:STDOUT: %FromLiteral.call.loc7: init %i32.builtin = call %FromLiteral.ref.loc7(%int_64.loc7) [concrete = constants.%int_64.f82] +// CHECK:STDOUT: %.loc7_38.1: %i32.builtin = value_of_initializer %FromLiteral.call.loc7 [concrete = constants.%int_64.f82] +// CHECK:STDOUT: %.loc7_38.2: %i32.builtin = converted %FromLiteral.call.loc7, %.loc7_38.1 [concrete = constants.%int_64.f82] // CHECK:STDOUT: %Make.specific_fn: = specific_function %Make.ref, @Make(constants.%int_64.f82) [concrete = constants.%Make.specific_fn.bb3] // CHECK:STDOUT: %Make.call: init %i64.builtin = call %Make.specific_fn() // CHECK:STDOUT: assign file.%m.var, %Make.call // CHECK:STDOUT: %MakeFromClass.ref: %MakeFromClass.type = name_ref MakeFromClass, imports.%Main.MakeFromClass [concrete = constants.%MakeFromClass] -// CHECK:STDOUT: %FromLiteral.ref.loc7: %FromLiteral.type = name_ref FromLiteral, imports.%Main.FromLiteral [concrete = constants.%FromLiteral] -// CHECK:STDOUT: %int_64.loc7: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] -// CHECK:STDOUT: %FromLiteral.call.loc7: init %i32.builtin = call %FromLiteral.ref.loc7(%int_64.loc7) [concrete = constants.%int_64.f82] +// CHECK:STDOUT: %FromLiteral.ref.loc8: %FromLiteral.type = name_ref FromLiteral, imports.%Main.FromLiteral [concrete = constants.%FromLiteral] +// CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab] +// CHECK:STDOUT: %FromLiteral.call.loc8: init %i32.builtin = call %FromLiteral.ref.loc8(%int_64.loc8) [concrete = constants.%int_64.f82] // CHECK:STDOUT: %OtherInt.ref: type = name_ref OtherInt, imports.%Main.OtherInt [concrete = constants.%OtherInt] -// CHECK:STDOUT: %.loc7_48.1: init %OtherInt = as_compatible %FromLiteral.call.loc7 [concrete = constants.%int_64.420] -// CHECK:STDOUT: %.loc7_48.2: init %OtherInt = converted %FromLiteral.call.loc7, %.loc7_48.1 [concrete = constants.%int_64.420] -// CHECK:STDOUT: %.loc7_59.1: %OtherInt = value_of_initializer %.loc7_48.2 [concrete = constants.%int_64.420] -// CHECK:STDOUT: %.loc7_59.2: %OtherInt = converted %.loc7_48.2, %.loc7_59.1 [concrete = constants.%int_64.420] +// CHECK:STDOUT: %.loc8_48.1: init %OtherInt = as_compatible %FromLiteral.call.loc8 [concrete = constants.%int_64.420] +// CHECK:STDOUT: %.loc8_48.2: init %OtherInt = converted %FromLiteral.call.loc8, %.loc8_48.1 [concrete = constants.%int_64.420] +// CHECK:STDOUT: %.loc8_59.1: %OtherInt = value_of_initializer %.loc8_48.2 [concrete = constants.%int_64.420] +// CHECK:STDOUT: %.loc8_59.2: %OtherInt = converted %.loc8_48.2, %.loc8_59.1 [concrete = constants.%int_64.420] // CHECK:STDOUT: %MakeFromClass.specific_fn: = specific_function %MakeFromClass.ref, @MakeFromClass(constants.%int_64.420) [concrete = constants.%MakeFromClass.specific_fn.3a7] // CHECK:STDOUT: %MakeFromClass.call: init %i64.builtin = call %MakeFromClass.specific_fn() // CHECK:STDOUT: assign file.%n.var, %MakeFromClass.call -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Make(constants.%N.7e8) { -// CHECK:STDOUT: %N => constants.%N.7e8 -// CHECK:STDOUT: %ToLiteral.call => constants.%ToLiteral.call -// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.384 -// CHECK:STDOUT: %.1 => constants.%.220 -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.86d -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.b2b -// CHECK:STDOUT: %Make.specific_fn => constants.%Make.specific_fn.a18 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Make(constants.%int_64.f82) { -// CHECK:STDOUT: %N => constants.%int_64.f82 -// CHECK:STDOUT: %ToLiteral.call => constants.%int_64.fab -// CHECK:STDOUT: %iN.builtin => constants.%i64.builtin -// CHECK:STDOUT: %.1 => constants.%.df2 -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.e13 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.4a1 -// CHECK:STDOUT: %Make.specific_fn => constants.%Make.specific_fn.bb3 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MakeFromClass(constants.%N.93f) { -// CHECK:STDOUT: %N => constants.%N.93f -// CHECK:STDOUT: %OtherInt.ToLiteral.bound => constants.%OtherInt.ToLiteral.bound.154 -// CHECK:STDOUT: %OtherInt.ToLiteral.call => constants.%OtherInt.ToLiteral.call -// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.11d -// CHECK:STDOUT: %.1 => constants.%.bae -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.558 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete.11f -// CHECK:STDOUT: %MakeFromClass.specific_fn => constants.%MakeFromClass.specific_fn.171 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @MakeFromClass(constants.%int_64.420) { -// CHECK:STDOUT: %N => constants.%int_64.420 -// CHECK:STDOUT: %OtherInt.ToLiteral.bound => constants.%OtherInt.ToLiteral.bound.4ee -// CHECK:STDOUT: %OtherInt.ToLiteral.call => constants.%int_64.fab -// CHECK:STDOUT: %iN.builtin => constants.%i64.builtin -// CHECK:STDOUT: %.1 => constants.%.df2 -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.e13 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.4a1 -// CHECK:STDOUT: %MakeFromClass.specific_fn => constants.%MakeFromClass.specific_fn.3a7 +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/require_satisified_in_interface.carbon b/toolchain/check/testdata/impl/require_satisified_in_interface.carbon index ccabfb15c061..8a838b13ddca 100644 --- a/toolchain/check/testdata/impl/require_satisified_in_interface.carbon +++ b/toolchain/check/testdata/impl/require_satisified_in_interface.carbon @@ -290,21 +290,21 @@ class W(T:! type) { adapt {}; } -interface A(N:! Core.IntLiteral()) { +interface A(N:! Core.IntLiteral) { fn AA() -> W(array((), N)); } -interface B(N:! Core.IntLiteral()) { +interface B(N:! Core.IntLiteral) { require impls A(N); } -interface C(N:! Core.IntLiteral()) { +interface C(N:! Core.IntLiteral) { require impls B(N); } -impl forall [N:! Core.IntLiteral(), T:! B(N)] T as A(N) { +impl forall [N:! Core.IntLiteral, T:! B(N)] T as A(N) { fn AA() -> W(array((), N)) { return {} as W(array((), N)); } } -impl forall [N:! Core.IntLiteral(), T:! C(N)] T as B(N) { +impl forall [N:! Core.IntLiteral, T:! C(N)] T as B(N) { // The definition here does not contain the lookups verifying that C(N) impls // `A(N)`, so they do not get re-evaluated for a specific `N`. That doesn't // prevent us from producing a reasonable diagnostic when that `N` causes an diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index 18b53ddab3a5..d28643eb3f03 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -33,8 +33,6 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: --- and.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %.f34: Core.Form = init_form bool [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] @@ -75,7 +73,7 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.9c3: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%bool.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.1ff = impl_witness_table (%Core.import_ref.9c3), @bool.as.Copy.impl [concrete] diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon index 5c503b0a6eb6..6f9a08bd02a9 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon @@ -51,8 +51,6 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: --- fail_non_constant_result.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %PartialConstant.type: type = fn_type @PartialConstant [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -70,7 +68,7 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -171,8 +169,6 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: --- fail_despite_known_result.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %KnownValueButNonConstantCondition.type: type = fn_type @KnownValueButNonConstantCondition [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -190,7 +186,7 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 43884a4d3f06..025a2f17d46d 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -29,8 +29,6 @@ fn Main() { // CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Main: %Main.type = struct_value () [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete] // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] @@ -48,7 +46,7 @@ fn Main() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index 1fbf4f8467a5..005bcec15e21 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -33,8 +33,6 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: --- or.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %.f34: Core.Form = init_form bool [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] @@ -75,7 +73,7 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.9c3: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%bool.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.1ff = impl_witness_table (%Core.import_ref.9c3), @bool.as.Copy.impl [concrete] diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index 15e67d653bc2..6f9d949bf931 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -27,8 +27,6 @@ fn Constant() { // CHECK:STDOUT: --- unary_op.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %.f34: Core.Form = init_form bool [concrete] // CHECK:STDOUT: %Not.type: type = fn_type @Not [concrete] @@ -63,7 +61,7 @@ fn Constant() { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.import_ref.9c3: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%bool.as.Copy.impl.Op] // CHECK:STDOUT: %Copy.impl_witness_table.1ff = impl_witness_table (%Core.import_ref.9c3), @bool.as.Copy.impl [concrete] diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index f395575b646e..fbc84194f130 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -94,8 +94,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %EqWith.type.d1f: type = facet_type <@EqWith, @EqWith(%C)> [concrete] // CHECK:STDOUT: %EqWith.impl_witness: = impl_witness @C.as.EqWith.impl.%EqWith.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.4a7: type = pattern_type %C [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %C.as.EqWith.impl.Equal.type: type = fn_type @C.as.EqWith.impl.Equal [concrete] // CHECK:STDOUT: %C.as.EqWith.impl.Equal: %C.as.EqWith.impl.Equal.type = struct_value () [concrete] // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual.type: type = fn_type @C.as.EqWith.impl.NotEqual [concrete] @@ -119,7 +117,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.EqWith: %EqWith.type.f77 = import_ref Core//prelude/operators/comparison, EqWith, loaded [concrete = constants.%EqWith.generic] -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -267,8 +265,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.9dc: type = pattern_type %D [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %.f34: Core.Form = init_form bool [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [concrete] @@ -286,7 +282,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.EqWith: %EqWith.type.f77 = import_ref Core//prelude/operators/comparison, EqWith, loaded [concrete = constants.%EqWith.generic] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -375,8 +371,6 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %EqWith.type.c2a: type = facet_type <@EqWith, @EqWith(%C)> [concrete] // CHECK:STDOUT: %EqWith.impl_witness: = impl_witness @C.as.EqWith.impl.%EqWith.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.eae: type = pattern_type %C [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %C.as.EqWith.impl.Equal.type: type = fn_type @C.as.EqWith.impl.Equal [concrete] // CHECK:STDOUT: %C.as.EqWith.impl.Equal: %C.as.EqWith.impl.Equal.type = struct_value () [concrete] // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual.type: type = fn_type @C.as.EqWith.impl.NotEqual [concrete] @@ -396,7 +390,7 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.EqWith: %EqWith.type.f77 = import_ref Core//prelude/operators/comparison, EqWith, loaded [concrete = constants.%EqWith.generic] -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon index dbf867d070eb..877163806590 100644 --- a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon +++ b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon @@ -38,8 +38,8 @@ class C { adapt (); } -impl (C, C) as Core.IndexWith(Core.IntLiteral()) where .ElementType = C { - fn At[self: Self](unused subscript: Core.IntLiteral()) -> C { +impl (C, C) as Core.IndexWith(Core.IntLiteral) where .ElementType = C { + fn At[self: Self](unused subscript: Core.IntLiteral) -> C { return self.0; } } @@ -290,8 +290,6 @@ let x: i32 = c[0]; // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.df6 = struct_value () [concrete] // CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic] // CHECK:STDOUT: %IndexWith.assoc_type.e15: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType) [symbolic] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete] // CHECK:STDOUT: %IndexWith.type.385: type = facet_type <@IndexWith, @IndexWith(Core.IntLiteral)> [concrete] // CHECK:STDOUT: %.Self: %IndexWith.type.385 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %IndexWith.assoc_type.ecd: type = assoc_entity_type @IndexWith, @IndexWith(Core.IntLiteral) [concrete] @@ -326,7 +324,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.df6 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] // CHECK:STDOUT: %Core.import_ref.bc6: @IndexWith.WithSelf.%IndexWith.assoc_type (%IndexWith.assoc_type.e15) = import_ref Core//prelude/operators/index, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.WithSelf.%assoc0 (constants.%assoc0.a4e)] // CHECK:STDOUT: %Core.import_ref.fc2: type = import_ref Core//prelude/operators/index, loc{{\d+_\d+}}, loaded [concrete = %ElementType] -// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral] +// CHECK:STDOUT: %Core.IntLiteral: type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = Core.IntLiteral] // CHECK:STDOUT: %Core.import_ref.6b6 = import_ref Core//prelude/operators/index, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %ElementType: type = assoc_const_decl @ElementType [concrete] {} // CHECK:STDOUT: } @@ -348,22 +346,19 @@ let x: i32 = c[0]; // CHECK:STDOUT: %Core.ref.loc8_16: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.df6 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic] // CHECK:STDOUT: %Core.ref.loc8_31: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_48.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc8_48.2: type = converted %IntLiteral.call, %.loc8_48.1 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(Core.IntLiteral)> [concrete = constants.%IndexWith.type.385] // CHECK:STDOUT: %.Self: %IndexWith.type.385 = symbolic_binding .Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %.Self.ref: %IndexWith.type.385 = name_ref .Self, %.Self [symbolic_self = constants.%.Self] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc8_56.1: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc8_56.2: %IndexWith.assoc_type.ecd = specific_constant imports.%Core.import_ref.bc6, @IndexWith.WithSelf(Core.IntLiteral, constants.%.Self) [concrete = constants.%assoc0.abe] -// CHECK:STDOUT: %ElementType.ref: %IndexWith.assoc_type.ecd = name_ref ElementType, %.loc8_56.2 [concrete = constants.%assoc0.abe] +// CHECK:STDOUT: %.loc8_54.1: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc8_54.2: %IndexWith.assoc_type.ecd = specific_constant imports.%Core.import_ref.bc6, @IndexWith.WithSelf(Core.IntLiteral, constants.%.Self) [concrete = constants.%assoc0.abe] +// CHECK:STDOUT: %ElementType.ref: %IndexWith.assoc_type.ecd = name_ref ElementType, %.loc8_54.2 [concrete = constants.%assoc0.abe] // CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%IndexWith.lookup_impl_witness.abf, element0 [symbolic_self = constants.%impl.elem0.c76] -// CHECK:STDOUT: %C.ref.loc8_71: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc8_50: type = where_expr [concrete = constants.%IndexWith_where.type] { +// CHECK:STDOUT: %C.ref.loc8_69: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc8_48: type = where_expr [concrete = constants.%IndexWith_where.type] { // CHECK:STDOUT: requirement_base_facet_type %IndexWith.type -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc8_71 +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc8_69 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: name_binding_decl { @@ -391,7 +386,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: %e: %C = value_binding e, %.loc15_15.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @tuple.type.as.IndexWith.impl: %.loc8_11.2 as %.loc8_50 { +// CHECK:STDOUT: impl @tuple.type.as.IndexWith.impl: %.loc8_11.2 as %.loc8_48 { // CHECK:STDOUT: %tuple.type.as.IndexWith.impl.At.decl: %tuple.type.as.IndexWith.impl.At.type = fn_decl @tuple.type.as.IndexWith.impl.At [concrete = constants.%tuple.type.as.IndexWith.impl.At] { // CHECK:STDOUT: %self.param_patt: %pattern_type.8b4 = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt: %pattern_type.8b4 = at_binding_pattern self, %self.param_patt [concrete] @@ -401,17 +396,14 @@ let x: i32 = c[0]; // CHECK:STDOUT: %return.patt: %pattern_type.98b = return_slot_pattern %return.param_patt, %C.ref [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc9_61: Core.Form = init_form %C.ref [concrete = constants.%.a44] +// CHECK:STDOUT: %.loc9_59: Core.Form = init_form %C.ref [concrete = constants.%.a44] // CHECK:STDOUT: %self.param: %tuple.type.748 = value_param call_param0 // CHECK:STDOUT: %Self.ref: type = name_ref Self, @tuple.type.as.IndexWith.impl.%.loc8_11.2 [concrete = constants.%tuple.type.748] // CHECK:STDOUT: %self: %tuple.type.748 = value_binding self, %self.param // CHECK:STDOUT: %subscript.param: Core.IntLiteral = value_param call_param1 -// CHECK:STDOUT: %.loc9_55.1: type = splice_block %.loc9_55.3 [concrete = Core.IntLiteral] { +// CHECK:STDOUT: %.loc9_43: type = splice_block %IntLiteral.ref [concrete = Core.IntLiteral] { // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral] -// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_55.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral] -// CHECK:STDOUT: %.loc9_55.3: type = converted %IntLiteral.call, %.loc9_55.2 [concrete = Core.IntLiteral] +// CHECK:STDOUT: %IntLiteral.ref: type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = Core.IntLiteral] // CHECK:STDOUT: } // CHECK:STDOUT: %subscript: Core.IntLiteral = value_binding subscript, %subscript.param // CHECK:STDOUT: %return.param: ref %C = out_param call_param2 @@ -424,7 +416,7 @@ let x: i32 = c[0]; // CHECK:STDOUT: !members: // CHECK:STDOUT: .C = // CHECK:STDOUT: .At = %tuple.type.as.IndexWith.impl.At.decl -// CHECK:STDOUT: extend %.loc8_50 +// CHECK:STDOUT: extend %.loc8_48 // CHECK:STDOUT: witness = %IndexWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 2f18e9bee51f..54eab365c82e 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -92,8 +92,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %OrderedWith.type.108: type = facet_type <@OrderedWith, @OrderedWith(%C)> [concrete] // CHECK:STDOUT: %OrderedWith.impl_witness: = impl_witness @C.as.OrderedWith.impl.%OrderedWith.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.4a7: type = pattern_type %C [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %C.as.OrderedWith.impl.Less.type: type = fn_type @C.as.OrderedWith.impl.Less [concrete] // CHECK:STDOUT: %C.as.OrderedWith.impl.Less: %C.as.OrderedWith.impl.Less.type = struct_value () [concrete] // CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent.type: type = fn_type @C.as.OrderedWith.impl.LessOrEquivalent [concrete] @@ -129,7 +127,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.OrderedWith: %OrderedWith.type.ad8 = import_ref Core//prelude/operators/comparison, OrderedWith, loaded [concrete = constants.%OrderedWith.generic] -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -381,8 +379,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.9dc: type = pattern_type %D [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %.f34: Core.Form = init_form bool [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [concrete] @@ -404,7 +400,7 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.OrderedWith: %OrderedWith.type.ad8 = import_ref Core//prelude/operators/comparison, OrderedWith, loaded [concrete = constants.%OrderedWith.generic] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/primitives/float_conversions.carbon b/toolchain/check/testdata/primitives/float_conversions.carbon index 6493c4904377..654483de2aa4 100644 --- a/toolchain/check/testdata/primitives/float_conversions.carbon +++ b/toolchain/check/testdata/primitives/float_conversions.carbon @@ -21,8 +21,8 @@ library "[[@TEST_NAME]]"; let _: f32 = 1.25; -let _: Core.FloatLiteral() = 42; -let _: Core.IntLiteral() = 42.0 unsafe as Core.IntLiteral(); +let _: Core.FloatLiteral = 42; +let _: Core.IntLiteral = 42.0 unsafe as Core.IntLiteral; // --- int_to_float.carbon library "[[@TEST_NAME]]"; @@ -83,7 +83,7 @@ fn F() { Test(-(1.99 as f64) unsafe as i8) as Expect(-1 as i8); // Float literal to int literal. - Test(123.45 unsafe as Core.IntLiteral()) as Expect(123); + Test(123.45 unsafe as Core.IntLiteral) as Expect(123); } // --- fail_float_as_int.carbon diff --git a/toolchain/check/testdata/primitives/import_symbolic.carbon b/toolchain/check/testdata/primitives/import_symbolic.carbon index 8d3554f5002d..98c787fdf656 100644 --- a/toolchain/check/testdata/primitives/import_symbolic.carbon +++ b/toolchain/check/testdata/primitives/import_symbolic.carbon @@ -61,7 +61,7 @@ fn F() -> Core.Char { library "[[@TEST_NAME]]"; interface I { - let value:! Core.CharLiteral(); + let value:! Core.CharLiteral; } class C {} @@ -73,7 +73,7 @@ impl C as I where .value = 'a' {} library "[[@TEST_NAME]]"; import library "char_literal"; -fn F() -> Core.CharLiteral() { +fn F() -> Core.CharLiteral { //@dump-sem-ir-begin return (C as I).value; //@dump-sem-ir-end @@ -107,7 +107,7 @@ fn F() -> f64 { library "[[@TEST_NAME]]"; interface I { - let value:! Core.FloatLiteral(); + let value:! Core.FloatLiteral; } class C {} @@ -119,7 +119,7 @@ impl C as I where .value = 0.1 {} library "[[@TEST_NAME]]"; import library "float_literal"; -fn F() -> Core.FloatLiteral() { +fn F() -> Core.FloatLiteral { //@dump-sem-ir-begin return (C as I).value; //@dump-sem-ir-end @@ -153,7 +153,7 @@ fn F() -> i32 { library "[[@TEST_NAME]]"; interface I { - let value:! Core.IntLiteral(); + let value:! Core.IntLiteral; } class C {} @@ -165,7 +165,7 @@ impl C as I where .value = 7 {} library "[[@TEST_NAME]]"; import library "int_literal"; -fn F() -> Core.IntLiteral() { +fn F() -> Core.IntLiteral { //@dump-sem-ir-begin return (C as I).value; //@dump-sem-ir-end diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 69e8c256b543..d9db7c562593 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -27,8 +27,6 @@ fn F(unused b: bool) -> i32 { // CHECK:STDOUT: --- code_after_return_value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] @@ -67,7 +65,7 @@ fn F(unused b: bool) -> i32 { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 4239f20ec490..48d359b1160b 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -69,8 +69,6 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.Op.type.1d8f74.2: type = fn_type @Destroy.Op.loc20_14.2 [concrete] // CHECK:STDOUT: %Destroy.Op.1a2547.2: %Destroy.Op.type.1d8f74.2 = struct_value () [concrete] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %EnclosingButAfter.type: type = fn_type @EnclosingButAfter [concrete] // CHECK:STDOUT: %EnclosingButAfter: %EnclosingButAfter.type = struct_value () [concrete] @@ -90,7 +88,7 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b3c = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 58302690f4cc..12a68e59f000 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -91,8 +91,8 @@ var z: i32 = y; // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/parts/float, Float, loaded [concrete = constants.%Float.generic] // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic] // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/parts/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.393 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %Core.import_ref.c4c7: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/parts/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.393 = impl_witness_table (%Core.import_ref.c4c7), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b3c = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] diff --git a/toolchain/check/testdata/tuple/element_access.carbon b/toolchain/check/testdata/tuple/element_access.carbon index 0439168957eb..27955a1f82f6 100644 --- a/toolchain/check/testdata/tuple/element_access.carbon +++ b/toolchain/check/testdata/tuple/element_access.carbon @@ -147,8 +147,8 @@ var b: i32 = 0; // CHECK:STDERR: var c: i32 = a.(b); // CHECK:STDERR: ^ // CHECK:STDERR: min_prelude/parts/int.carbon:27:3: note: compile-time-only function declared here [CompTimeOnlyFunctionHere] -// CHECK:STDERR: fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: // CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+4]]:14: error: tuple index must be a constant [TupleIndexNotConstant] // CHECK:STDERR: var c: i32 = a.(b); diff --git a/toolchain/check/testdata/where_expr/equal_rewrite.carbon b/toolchain/check/testdata/where_expr/equal_rewrite.carbon index ce8aff1c776d..6bcac3ee7c80 100644 --- a/toolchain/check/testdata/where_expr/equal_rewrite.carbon +++ b/toolchain/check/testdata/where_expr/equal_rewrite.carbon @@ -294,7 +294,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %A_where.type.879: type = facet_type <@A where %impl.elem0 = bool and %impl.elem1 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %pattern_type.aec: type = pattern_type %A_where.type.879 [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type %A_where.type.879 [concrete] // CHECK:STDOUT: %D: %A_where.type.879 = symbolic_binding D, 0 [symbolic] // CHECK:STDOUT: %NestedRewrite.type: type = fn_type @NestedRewrite [concrete] // CHECK:STDOUT: %NestedRewrite: %NestedRewrite.type = struct_value () [concrete] @@ -302,7 +302,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %NestedRewrite.decl: %NestedRewrite.type = fn_decl @NestedRewrite [concrete = constants.%NestedRewrite] { -// CHECK:STDOUT: %D.patt: %pattern_type.aec = symbolic_binding_pattern D, 0 [concrete] +// CHECK:STDOUT: %D.patt: %pattern_type = symbolic_binding_pattern D, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc10_42.1: type = splice_block %.loc10_42.2 [concrete = constants.%A_where.type.879] { // CHECK:STDOUT: %.Self.loc10_19: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] @@ -489,7 +489,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %impl.elem1: type = impl_witness_access %J.lookup_impl_witness, element1 [symbolic_self] // CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0 = %empty_tuple.type and %impl.elem1 = bool> [concrete] -// CHECK:STDOUT: %pattern_type.026: type = pattern_type %J_where.type [concrete] +// CHECK:STDOUT: %pattern_type: type = pattern_type %J_where.type [concrete] // CHECK:STDOUT: %M: %J_where.type = symbolic_binding M, 0 [symbolic] // CHECK:STDOUT: %Alphabetical.type: type = fn_type @Alphabetical [concrete] // CHECK:STDOUT: %Alphabetical: %Alphabetical.type = struct_value () [concrete] @@ -500,7 +500,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %Alphabetical.decl: %Alphabetical.type = fn_decl @Alphabetical [concrete = constants.%Alphabetical] { -// CHECK:STDOUT: %M.patt: %pattern_type.026 = symbolic_binding_pattern M, 0 [concrete] +// CHECK:STDOUT: %M.patt: %pattern_type = symbolic_binding_pattern M, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc10_30.1: type = splice_block %.loc10_30.2 [concrete = constants.%J_where.type] { // CHECK:STDOUT: %.Self.loc10_25: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] @@ -528,7 +528,7 @@ let K: (E where .F = .Self.G) = bool; // CHECK:STDOUT: %M.loc10_25.2: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_25.1 (constants.%M)] // CHECK:STDOUT: } // CHECK:STDOUT: %Reversed.decl: %Reversed.type = fn_decl @Reversed [concrete = constants.%Reversed] { -// CHECK:STDOUT: %N.patt: %pattern_type.026 = symbolic_binding_pattern N, 0 [concrete] +// CHECK:STDOUT: %N.patt: %pattern_type = symbolic_binding_pattern N, 0 [concrete] // CHECK:STDOUT: } { // CHECK:STDOUT: %.loc12_19.1: type = splice_block %.loc12_19.2 [concrete = constants.%J_where.type] { // CHECK:STDOUT: %.Self.loc12_14: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.c39] diff --git a/toolchain/lower/testdata/builtins/types.carbon b/toolchain/lower/testdata/builtins/types.carbon index 1bf145e1081a..e22ce80285c5 100644 --- a/toolchain/lower/testdata/builtins/types.carbon +++ b/toolchain/lower/testdata/builtins/types.carbon @@ -10,16 +10,18 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/types.carbon -fn IntLiteral() -> type = "int_literal.make_type"; -fn FloatLiteral() -> type = "float_literal.make_type"; -fn Int(size: IntLiteral()) -> type = "int.make_type_signed"; -fn Float(size: IntLiteral()) -> type = "float.make_type"; +fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); +fn MakeFloatLiteral() -> type = "float_literal.make_type"; +alias FloatLiteral = MakeFloatLiteral(); +fn Int(size: IntLiteral) -> type = "int.make_type_signed"; +fn Float(size: IntLiteral) -> type = "float.make_type"; fn Bool() -> type = "bool.make_type"; -fn AsI32(n: IntLiteral()) -> Int(32) = "int.convert_checked"; -fn AsF16(f: FloatLiteral()) -> Float(16) = "float.convert_checked"; -fn AsF32(f: FloatLiteral()) -> Float(32) = "float.convert_checked"; -fn AsF64(f: FloatLiteral()) -> Float(64) = "float.convert_checked"; -fn AsF128(f: FloatLiteral()) -> Float(128) = "float.convert_checked"; +fn AsI32(n: IntLiteral) -> Int(32) = "int.convert_checked"; +fn AsF16(f: FloatLiteral) -> Float(16) = "float.convert_checked"; +fn AsF32(f: FloatLiteral) -> Float(32) = "float.convert_checked"; +fn AsF64(f: FloatLiteral) -> Float(64) = "float.convert_checked"; +fn AsF128(f: FloatLiteral) -> Float(128) = "float.convert_checked"; fn IntParam(i: Int(32)); fn FloatParam(e: Float(16), f: Float(32), g: Float(64), h: Float(128)); @@ -58,10 +60,10 @@ fn Uses() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "types.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Uses", linkageName: "_CUses.Main", scope: null, file: !3, line: 28, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Uses", linkageName: "_CUses.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{null} -// CHECK:STDOUT: !7 = !DILocation(line: 29, column: 3, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 30, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 31, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 28, column: 1, scope: !4) +// CHECK:STDOUT: !7 = !DILocation(line: 31, column: 3, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 32, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 33, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 30, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/class/generic.carbon b/toolchain/lower/testdata/class/generic.carbon index 3adc15e8b538..e1b8383f947c 100644 --- a/toolchain/lower/testdata/class/generic.carbon +++ b/toolchain/lower/testdata/class/generic.carbon @@ -270,16 +270,16 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: !35 = !DILocation(line: 10, column: 16, scope: !28) // CHECK:STDOUT: !36 = !DILocation(line: 10, column: 24, scope: !28) // CHECK:STDOUT: !37 = !DILocation(line: 10, column: 3, scope: !28) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8", scope: null, file: !39, line: 48, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8", scope: null, file: !39, line: 52, type: !40, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !42) // CHECK:STDOUT: !39 = !DIFile(filename: "min_prelude/parts/copy.carbon", directory: "") // CHECK:STDOUT: !40 = !DISubroutineType(types: !41) // CHECK:STDOUT: !41 = !{!7, !7} // CHECK:STDOUT: !42 = !{!43} // CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !38, type: !7) -// CHECK:STDOUT: !44 = !DILocation(line: 49, column: 13, scope: !38) -// CHECK:STDOUT: !45 = !DILocation(line: 49, column: 12, scope: !38) -// CHECK:STDOUT: !46 = !DILocation(line: 49, column: 26, scope: !38) -// CHECK:STDOUT: !47 = !DILocation(line: 49, column: 5, scope: !38) +// CHECK:STDOUT: !44 = !DILocation(line: 53, column: 13, scope: !38) +// CHECK:STDOUT: !45 = !DILocation(line: 53, column: 12, scope: !38) +// CHECK:STDOUT: !46 = !DILocation(line: 53, column: 26, scope: !38) +// CHECK:STDOUT: !47 = !DILocation(line: 53, column: 5, scope: !38) // CHECK:STDOUT: ; ModuleID = 'access.carbon' // CHECK:STDOUT: source_filename = "access.carbon" // CHECK:STDOUT: @@ -548,12 +548,12 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !88, type: !7) // CHECK:STDOUT: !91 = !DILocation(line: 9, column: 12, scope: !88) // CHECK:STDOUT: !92 = !DILocation(line: 9, column: 5, scope: !88) -// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6753b13effab4291:Copy.Core.f23c1a2465d2ad7f", scope: null, file: !94, line: 54, type: !70, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !95) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6753b13effab4291:Copy.Core.f23c1a2465d2ad7f", scope: null, file: !94, line: 58, type: !70, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !95) // CHECK:STDOUT: !94 = !DIFile(filename: "min_prelude/parts/copy.carbon", directory: "") // CHECK:STDOUT: !95 = !{!96} // CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !93, type: !7) -// CHECK:STDOUT: !97 = !DILocation(line: 55, column: 13, scope: !93) -// CHECK:STDOUT: !98 = !DILocation(line: 55, column: 12, scope: !93) -// CHECK:STDOUT: !99 = !DILocation(line: 55, column: 26, scope: !93) -// CHECK:STDOUT: !100 = !DILocation(line: 55, column: 39, scope: !93) -// CHECK:STDOUT: !101 = !DILocation(line: 55, column: 5, scope: !93) +// CHECK:STDOUT: !97 = !DILocation(line: 59, column: 13, scope: !93) +// CHECK:STDOUT: !98 = !DILocation(line: 59, column: 12, scope: !93) +// CHECK:STDOUT: !99 = !DILocation(line: 59, column: 26, scope: !93) +// CHECK:STDOUT: !100 = !DILocation(line: 59, column: 39, scope: !93) +// CHECK:STDOUT: !101 = !DILocation(line: 59, column: 5, scope: !93) diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index 75d02bcd7e6b..bb0f7d7d9a33 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -291,11 +291,11 @@ fn For() { // CHECK:STDOUT: !87 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.c9f733d9bf35d2e5", scope: null, file: !60, line: 125, type: !73, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !88 = !DILocation(line: 128, column: 5, scope: !87) // CHECK:STDOUT: !89 = !DILocation(line: 129, column: 5, scope: !87) -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8", scope: null, file: !91, line: 58, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !92) +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4e4edddc7580c79b:Copy.Core.58bedf1100cb91a8", scope: null, file: !91, line: 62, type: !61, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !92) // CHECK:STDOUT: !91 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") // CHECK:STDOUT: !92 = !{!93} // CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !90, type: !23) -// CHECK:STDOUT: !94 = !DILocation(line: 59, column: 13, scope: !90) -// CHECK:STDOUT: !95 = !DILocation(line: 59, column: 12, scope: !90) -// CHECK:STDOUT: !96 = !DILocation(line: 59, column: 26, scope: !90) -// CHECK:STDOUT: !97 = !DILocation(line: 59, column: 5, scope: !90) +// CHECK:STDOUT: !94 = !DILocation(line: 63, column: 13, scope: !90) +// CHECK:STDOUT: !95 = !DILocation(line: 63, column: 12, scope: !90) +// CHECK:STDOUT: !96 = !DILocation(line: 63, column: 26, scope: !90) +// CHECK:STDOUT: !97 = !DILocation(line: 63, column: 5, scope: !90) diff --git a/toolchain/lower/testdata/packages/imported_package_mangle.carbon b/toolchain/lower/testdata/packages/imported_package_mangle.carbon index 94936a525835..7ab436c7a3b9 100644 --- a/toolchain/lower/testdata/packages/imported_package_mangle.carbon +++ b/toolchain/lower/testdata/packages/imported_package_mangle.carbon @@ -23,7 +23,7 @@ impl array(C, 1) as I { fn F() {} } -impl forall [N:! Core.IntLiteral()] array(C, N) as I { +impl forall [N:! Core.IntLiteral] array(C, N) as I { fn F() {} } @@ -55,7 +55,7 @@ impl array(C, 1) as I { fn F() {} } -impl forall [N:! Core.IntLiteral()] array(C, N) as I { +impl forall [N:! Core.IntLiteral] array(C, N) as I { fn F() {} } @@ -63,7 +63,7 @@ impl array(C, 1) as A.I { fn F() {} } -impl forall [N:! Core.IntLiteral()] array(C, N) as A.I { +impl forall [N:! Core.IntLiteral] array(C, N) as A.I { fn F() {} } @@ -71,7 +71,7 @@ impl array(A.C, 1) as I { fn F() {} } -impl forall [N:! Core.IntLiteral()] array(A.C, N) as I { +impl forall [N:! Core.IntLiteral] array(A.C, N) as I { fn F() {} } diff --git a/toolchain/lower/testdata/primitives/char.carbon b/toolchain/lower/testdata/primitives/char.carbon index dde44fd6eb35..dfba0db3c294 100644 --- a/toolchain/lower/testdata/primitives/char.carbon +++ b/toolchain/lower/testdata/primitives/char.carbon @@ -753,209 +753,209 @@ fn AddSubUInt32(c: char, i: u32) { // CHECK:STDOUT: !193 = !{!194} // CHECK:STDOUT: !194 = !DILocalVariable(arg: 1, scope: !190, type: !7) // CHECK:STDOUT: !195 = !DILocation(line: 19, column: 1, scope: !190) -// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.dbe0a954f4d47a23", scope: null, file: !197, line: 46, type: !198, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !200) +// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.dbe0a954f4d47a23", scope: null, file: !197, line: 47, type: !198, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !200) // CHECK:STDOUT: !197 = !DIFile(filename: "{{.*}}/prelude/types/char.carbon", directory: "") // CHECK:STDOUT: !198 = !DISubroutineType(types: !199) // CHECK:STDOUT: !199 = !{!165, !7} // CHECK:STDOUT: !200 = !{!201} // CHECK:STDOUT: !201 = !DILocalVariable(arg: 1, scope: !196, type: !7) -// CHECK:STDOUT: !202 = !DILocation(line: 47, column: 5, scope: !196) +// CHECK:STDOUT: !202 = !DILocation(line: 48, column: 5, scope: !196) // CHECK:STDOUT: !203 = distinct !DISubprogram(name: "Discard", linkageName: "_CDiscard.Main.147e0bd019a31663", scope: null, file: !3, line: 19, type: !204, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !206) // CHECK:STDOUT: !204 = !DISubroutineType(types: !205) // CHECK:STDOUT: !205 = !{null, !165} // CHECK:STDOUT: !206 = !{!207} // CHECK:STDOUT: !207 = !DILocalVariable(arg: 1, scope: !203, type: !165) // CHECK:STDOUT: !208 = !DILocation(line: 19, column: 1, scope: !203) -// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.691b43fb97812586", scope: null, file: !197, line: 46, type: !210, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !212) +// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.691b43fb97812586", scope: null, file: !197, line: 47, type: !210, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !212) // CHECK:STDOUT: !210 = !DISubroutineType(types: !211) // CHECK:STDOUT: !211 = !{!179, !7} // CHECK:STDOUT: !212 = !{!213} // CHECK:STDOUT: !213 = !DILocalVariable(arg: 1, scope: !209, type: !7) -// CHECK:STDOUT: !214 = !DILocation(line: 47, column: 5, scope: !209) +// CHECK:STDOUT: !214 = !DILocation(line: 48, column: 5, scope: !209) // CHECK:STDOUT: !215 = distinct !DISubprogram(name: "Discard", linkageName: "_CDiscard.Main.eadca4a969cf6f21", scope: null, file: !3, line: 19, type: !216, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !218) // CHECK:STDOUT: !216 = !DISubroutineType(types: !217) // CHECK:STDOUT: !217 = !{null, !179} // CHECK:STDOUT: !218 = !{!219} // CHECK:STDOUT: !219 = !DILocalVariable(arg: 1, scope: !215, type: !179) // CHECK:STDOUT: !220 = !DILocation(line: 19, column: 1, scope: !215) -// CHECK:STDOUT: !221 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.48e83ee0f3ef2ee8", scope: null, file: !197, line: 46, type: !222, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !224) +// CHECK:STDOUT: !221 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.48e83ee0f3ef2ee8", scope: null, file: !197, line: 47, type: !222, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !224) // CHECK:STDOUT: !222 = !DISubroutineType(types: !223) // CHECK:STDOUT: !223 = !{!126, !7} // CHECK:STDOUT: !224 = !{!225} // CHECK:STDOUT: !225 = !DILocalVariable(arg: 1, scope: !221, type: !7) -// CHECK:STDOUT: !226 = !DILocation(line: 47, column: 5, scope: !221) -// CHECK:STDOUT: !227 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.8da8ddbe24cfd39a", scope: null, file: !197, line: 46, type: !228, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !230) +// CHECK:STDOUT: !226 = !DILocation(line: 48, column: 5, scope: !221) +// CHECK:STDOUT: !227 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.8da8ddbe24cfd39a", scope: null, file: !197, line: 47, type: !228, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !230) // CHECK:STDOUT: !228 = !DISubroutineType(types: !229) // CHECK:STDOUT: !229 = !{!140, !7} // CHECK:STDOUT: !230 = !{!231} // CHECK:STDOUT: !231 = !DILocalVariable(arg: 1, scope: !227, type: !7) -// CHECK:STDOUT: !232 = !DILocation(line: 47, column: 5, scope: !227) +// CHECK:STDOUT: !232 = !DILocation(line: 48, column: 5, scope: !227) // CHECK:STDOUT: !233 = distinct !DISubprogram(name: "Discard", linkageName: "_CDiscard.Main.a4c7fafe8a72cac4", scope: null, file: !3, line: 19, type: !234, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !236) // CHECK:STDOUT: !234 = !DISubroutineType(types: !235) // CHECK:STDOUT: !235 = !{null, !8} // CHECK:STDOUT: !236 = !{!237} // CHECK:STDOUT: !237 = !DILocalVariable(arg: 1, scope: !233, type: !8) // CHECK:STDOUT: !238 = !DILocation(line: 19, column: 1, scope: !233) -// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.7c3e388e0087434a.Core.ab8531ca840d1501", scope: null, file: !197, line: 133, type: !240, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !242) +// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.7c3e388e0087434a.Core.ab8531ca840d1501", scope: null, file: !197, line: 134, type: !240, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !242) // CHECK:STDOUT: !240 = !DISubroutineType(types: !241) // CHECK:STDOUT: !241 = !{!140, !7, !7} // CHECK:STDOUT: !242 = !{!243, !244} // CHECK:STDOUT: !243 = !DILocalVariable(arg: 1, scope: !239, type: !7) // CHECK:STDOUT: !244 = !DILocalVariable(arg: 2, scope: !239, type: !7) -// CHECK:STDOUT: !245 = !DILocation(line: 134, column: 13, scope: !239) -// CHECK:STDOUT: !246 = !DILocation(line: 134, column: 29, scope: !239) -// CHECK:STDOUT: !247 = !DILocation(line: 134, column: 12, scope: !239) -// CHECK:STDOUT: !248 = !DILocation(line: 134, column: 5, scope: !239) -// CHECK:STDOUT: !249 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b27934686504f96c:SubWith.295cf9b677564c5c.Core.ab8531ca840d1501", scope: null, file: !197, line: 127, type: !240, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !250) +// CHECK:STDOUT: !245 = !DILocation(line: 135, column: 13, scope: !239) +// CHECK:STDOUT: !246 = !DILocation(line: 135, column: 29, scope: !239) +// CHECK:STDOUT: !247 = !DILocation(line: 135, column: 12, scope: !239) +// CHECK:STDOUT: !248 = !DILocation(line: 135, column: 5, scope: !239) +// CHECK:STDOUT: !249 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b27934686504f96c:SubWith.295cf9b677564c5c.Core.ab8531ca840d1501", scope: null, file: !197, line: 128, type: !240, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !250) // CHECK:STDOUT: !250 = !{!251, !252} // CHECK:STDOUT: !251 = !DILocalVariable(arg: 1, scope: !249, type: !7) // CHECK:STDOUT: !252 = !DILocalVariable(arg: 2, scope: !249, type: !7) -// CHECK:STDOUT: !253 = !DILocation(line: 128, column: 13, scope: !249) -// CHECK:STDOUT: !254 = !DILocation(line: 128, column: 29, scope: !249) -// CHECK:STDOUT: !255 = !DILocation(line: 128, column: 12, scope: !249) -// CHECK:STDOUT: !256 = !DILocation(line: 128, column: 5, scope: !249) -// CHECK:STDOUT: !257 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.852ed75bdc952b41", scope: null, file: !197, line: 98, type: !258, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !260) +// CHECK:STDOUT: !253 = !DILocation(line: 129, column: 13, scope: !249) +// CHECK:STDOUT: !254 = !DILocation(line: 129, column: 29, scope: !249) +// CHECK:STDOUT: !255 = !DILocation(line: 129, column: 12, scope: !249) +// CHECK:STDOUT: !256 = !DILocation(line: 129, column: 5, scope: !249) +// CHECK:STDOUT: !257 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.852ed75bdc952b41", scope: null, file: !197, line: 99, type: !258, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !260) // CHECK:STDOUT: !258 = !DISubroutineType(types: !259) // CHECK:STDOUT: !259 = !{!7, !7, !112} // CHECK:STDOUT: !260 = !{!261, !262} // CHECK:STDOUT: !261 = !DILocalVariable(arg: 1, scope: !257, type: !7) // CHECK:STDOUT: !262 = !DILocalVariable(arg: 2, scope: !257, type: !112) -// CHECK:STDOUT: !263 = !DILocation(line: 100, column: 13, scope: !257) -// CHECK:STDOUT: !264 = !DILocation(line: 100, column: 5, scope: !257) -// CHECK:STDOUT: !265 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.852ed75bdc952b41", scope: null, file: !197, line: 106, type: !266, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !268) +// CHECK:STDOUT: !263 = !DILocation(line: 101, column: 13, scope: !257) +// CHECK:STDOUT: !264 = !DILocation(line: 101, column: 5, scope: !257) +// CHECK:STDOUT: !265 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.852ed75bdc952b41", scope: null, file: !197, line: 107, type: !266, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !268) // CHECK:STDOUT: !266 = !DISubroutineType(types: !267) // CHECK:STDOUT: !267 = !{!7, !112, !7} // CHECK:STDOUT: !268 = !{!269, !270} // CHECK:STDOUT: !269 = !DILocalVariable(arg: 1, scope: !265, type: !112) // CHECK:STDOUT: !270 = !DILocalVariable(arg: 2, scope: !265, type: !7) -// CHECK:STDOUT: !271 = !DILocation(line: 108, column: 13, scope: !265) -// CHECK:STDOUT: !272 = !DILocation(line: 108, column: 5, scope: !265) -// CHECK:STDOUT: !273 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.852ed75bdc952b41", scope: null, file: !197, line: 114, type: !258, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !274) +// CHECK:STDOUT: !271 = !DILocation(line: 109, column: 13, scope: !265) +// CHECK:STDOUT: !272 = !DILocation(line: 109, column: 5, scope: !265) +// CHECK:STDOUT: !273 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.852ed75bdc952b41", scope: null, file: !197, line: 115, type: !258, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !274) // CHECK:STDOUT: !274 = !{!275, !276} // CHECK:STDOUT: !275 = !DILocalVariable(arg: 1, scope: !273, type: !7) // CHECK:STDOUT: !276 = !DILocalVariable(arg: 2, scope: !273, type: !112) -// CHECK:STDOUT: !277 = !DILocation(line: 116, column: 13, scope: !273) -// CHECK:STDOUT: !278 = !DILocation(line: 116, column: 5, scope: !273) -// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.4de33f895b808f69", scope: null, file: !197, line: 98, type: !280, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !282) +// CHECK:STDOUT: !277 = !DILocation(line: 117, column: 13, scope: !273) +// CHECK:STDOUT: !278 = !DILocation(line: 117, column: 5, scope: !273) +// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.4de33f895b808f69", scope: null, file: !197, line: 99, type: !280, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !282) // CHECK:STDOUT: !280 = !DISubroutineType(types: !281) // CHECK:STDOUT: !281 = !{!7, !7, !126} // CHECK:STDOUT: !282 = !{!283, !284} // CHECK:STDOUT: !283 = !DILocalVariable(arg: 1, scope: !279, type: !7) // CHECK:STDOUT: !284 = !DILocalVariable(arg: 2, scope: !279, type: !126) -// CHECK:STDOUT: !285 = !DILocation(line: 100, column: 29, scope: !279) -// CHECK:STDOUT: !286 = !DILocation(line: 100, column: 13, scope: !279) -// CHECK:STDOUT: !287 = !DILocation(line: 100, column: 5, scope: !279) -// CHECK:STDOUT: !288 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.4de33f895b808f69", scope: null, file: !197, line: 106, type: !289, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !291) +// CHECK:STDOUT: !285 = !DILocation(line: 101, column: 29, scope: !279) +// CHECK:STDOUT: !286 = !DILocation(line: 101, column: 13, scope: !279) +// CHECK:STDOUT: !287 = !DILocation(line: 101, column: 5, scope: !279) +// CHECK:STDOUT: !288 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.4de33f895b808f69", scope: null, file: !197, line: 107, type: !289, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !291) // CHECK:STDOUT: !289 = !DISubroutineType(types: !290) // CHECK:STDOUT: !290 = !{!7, !126, !7} // CHECK:STDOUT: !291 = !{!292, !293} // CHECK:STDOUT: !292 = !DILocalVariable(arg: 1, scope: !288, type: !126) // CHECK:STDOUT: !293 = !DILocalVariable(arg: 2, scope: !288, type: !7) -// CHECK:STDOUT: !294 = !DILocation(line: 108, column: 14, scope: !288) -// CHECK:STDOUT: !295 = !DILocation(line: 108, column: 13, scope: !288) -// CHECK:STDOUT: !296 = !DILocation(line: 108, column: 5, scope: !288) -// CHECK:STDOUT: !297 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.4de33f895b808f69", scope: null, file: !197, line: 114, type: !280, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !298) +// CHECK:STDOUT: !294 = !DILocation(line: 109, column: 14, scope: !288) +// CHECK:STDOUT: !295 = !DILocation(line: 109, column: 13, scope: !288) +// CHECK:STDOUT: !296 = !DILocation(line: 109, column: 5, scope: !288) +// CHECK:STDOUT: !297 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.4de33f895b808f69", scope: null, file: !197, line: 115, type: !280, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !298) // CHECK:STDOUT: !298 = !{!299, !300} // CHECK:STDOUT: !299 = !DILocalVariable(arg: 1, scope: !297, type: !7) // CHECK:STDOUT: !300 = !DILocalVariable(arg: 2, scope: !297, type: !126) -// CHECK:STDOUT: !301 = !DILocation(line: 116, column: 29, scope: !297) -// CHECK:STDOUT: !302 = !DILocation(line: 116, column: 13, scope: !297) -// CHECK:STDOUT: !303 = !DILocation(line: 116, column: 5, scope: !297) -// CHECK:STDOUT: !304 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.ae42bf297a1ee9b6", scope: null, file: !197, line: 98, type: !305, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !307) +// CHECK:STDOUT: !301 = !DILocation(line: 117, column: 29, scope: !297) +// CHECK:STDOUT: !302 = !DILocation(line: 117, column: 13, scope: !297) +// CHECK:STDOUT: !303 = !DILocation(line: 117, column: 5, scope: !297) +// CHECK:STDOUT: !304 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.ae42bf297a1ee9b6", scope: null, file: !197, line: 99, type: !305, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !307) // CHECK:STDOUT: !305 = !DISubroutineType(types: !306) // CHECK:STDOUT: !306 = !{!7, !7, !140} // CHECK:STDOUT: !307 = !{!308, !309} // CHECK:STDOUT: !308 = !DILocalVariable(arg: 1, scope: !304, type: !7) // CHECK:STDOUT: !309 = !DILocalVariable(arg: 2, scope: !304, type: !140) -// CHECK:STDOUT: !310 = !DILocation(line: 100, column: 29, scope: !304) -// CHECK:STDOUT: !311 = !DILocation(line: 100, column: 13, scope: !304) -// CHECK:STDOUT: !312 = !DILocation(line: 100, column: 5, scope: !304) -// CHECK:STDOUT: !313 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.ae42bf297a1ee9b6", scope: null, file: !197, line: 106, type: !314, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !316) +// CHECK:STDOUT: !310 = !DILocation(line: 101, column: 29, scope: !304) +// CHECK:STDOUT: !311 = !DILocation(line: 101, column: 13, scope: !304) +// CHECK:STDOUT: !312 = !DILocation(line: 101, column: 5, scope: !304) +// CHECK:STDOUT: !313 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.ae42bf297a1ee9b6", scope: null, file: !197, line: 107, type: !314, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !316) // CHECK:STDOUT: !314 = !DISubroutineType(types: !315) // CHECK:STDOUT: !315 = !{!7, !140, !7} // CHECK:STDOUT: !316 = !{!317, !318} // CHECK:STDOUT: !317 = !DILocalVariable(arg: 1, scope: !313, type: !140) // CHECK:STDOUT: !318 = !DILocalVariable(arg: 2, scope: !313, type: !7) -// CHECK:STDOUT: !319 = !DILocation(line: 108, column: 14, scope: !313) -// CHECK:STDOUT: !320 = !DILocation(line: 108, column: 13, scope: !313) -// CHECK:STDOUT: !321 = !DILocation(line: 108, column: 5, scope: !313) -// CHECK:STDOUT: !322 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.ae42bf297a1ee9b6", scope: null, file: !197, line: 114, type: !305, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !323) +// CHECK:STDOUT: !319 = !DILocation(line: 109, column: 14, scope: !313) +// CHECK:STDOUT: !320 = !DILocation(line: 109, column: 13, scope: !313) +// CHECK:STDOUT: !321 = !DILocation(line: 109, column: 5, scope: !313) +// CHECK:STDOUT: !322 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.ae42bf297a1ee9b6", scope: null, file: !197, line: 115, type: !305, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !323) // CHECK:STDOUT: !323 = !{!324, !325} // CHECK:STDOUT: !324 = !DILocalVariable(arg: 1, scope: !322, type: !7) // CHECK:STDOUT: !325 = !DILocalVariable(arg: 2, scope: !322, type: !140) -// CHECK:STDOUT: !326 = !DILocation(line: 116, column: 29, scope: !322) -// CHECK:STDOUT: !327 = !DILocation(line: 116, column: 13, scope: !322) -// CHECK:STDOUT: !328 = !DILocation(line: 116, column: 5, scope: !322) -// CHECK:STDOUT: !329 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.3ff23939bf07ad5f", scope: null, file: !197, line: 98, type: !330, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !332) +// CHECK:STDOUT: !326 = !DILocation(line: 117, column: 29, scope: !322) +// CHECK:STDOUT: !327 = !DILocation(line: 117, column: 13, scope: !322) +// CHECK:STDOUT: !328 = !DILocation(line: 117, column: 5, scope: !322) +// CHECK:STDOUT: !329 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.3ff23939bf07ad5f", scope: null, file: !197, line: 99, type: !330, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !332) // CHECK:STDOUT: !330 = !DISubroutineType(types: !331) // CHECK:STDOUT: !331 = !{!7, !7, !7} // CHECK:STDOUT: !332 = !{!333, !334} // CHECK:STDOUT: !333 = !DILocalVariable(arg: 1, scope: !329, type: !7) // CHECK:STDOUT: !334 = !DILocalVariable(arg: 2, scope: !329, type: !7) -// CHECK:STDOUT: !335 = !DILocation(line: 100, column: 13, scope: !329) -// CHECK:STDOUT: !336 = !DILocation(line: 100, column: 5, scope: !329) -// CHECK:STDOUT: !337 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.3ff23939bf07ad5f", scope: null, file: !197, line: 106, type: !330, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !338) +// CHECK:STDOUT: !335 = !DILocation(line: 101, column: 13, scope: !329) +// CHECK:STDOUT: !336 = !DILocation(line: 101, column: 5, scope: !329) +// CHECK:STDOUT: !337 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.3ff23939bf07ad5f", scope: null, file: !197, line: 107, type: !330, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !338) // CHECK:STDOUT: !338 = !{!339, !340} // CHECK:STDOUT: !339 = !DILocalVariable(arg: 1, scope: !337, type: !7) // CHECK:STDOUT: !340 = !DILocalVariable(arg: 2, scope: !337, type: !7) -// CHECK:STDOUT: !341 = !DILocation(line: 108, column: 13, scope: !337) -// CHECK:STDOUT: !342 = !DILocation(line: 108, column: 5, scope: !337) -// CHECK:STDOUT: !343 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.3ff23939bf07ad5f", scope: null, file: !197, line: 114, type: !330, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !344) +// CHECK:STDOUT: !341 = !DILocation(line: 109, column: 13, scope: !337) +// CHECK:STDOUT: !342 = !DILocation(line: 109, column: 5, scope: !337) +// CHECK:STDOUT: !343 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.3ff23939bf07ad5f", scope: null, file: !197, line: 115, type: !330, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !344) // CHECK:STDOUT: !344 = !{!345, !346} // CHECK:STDOUT: !345 = !DILocalVariable(arg: 1, scope: !343, type: !7) // CHECK:STDOUT: !346 = !DILocalVariable(arg: 2, scope: !343, type: !7) -// CHECK:STDOUT: !347 = !DILocation(line: 116, column: 13, scope: !343) -// CHECK:STDOUT: !348 = !DILocation(line: 116, column: 5, scope: !343) -// CHECK:STDOUT: !349 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.a374c478e4368fa7", scope: null, file: !197, line: 98, type: !350, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !352) +// CHECK:STDOUT: !347 = !DILocation(line: 117, column: 13, scope: !343) +// CHECK:STDOUT: !348 = !DILocation(line: 117, column: 5, scope: !343) +// CHECK:STDOUT: !349 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.a374c478e4368fa7", scope: null, file: !197, line: 99, type: !350, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !352) // CHECK:STDOUT: !350 = !DISubroutineType(types: !351) // CHECK:STDOUT: !351 = !{!7, !7, !165} // CHECK:STDOUT: !352 = !{!353, !354} // CHECK:STDOUT: !353 = !DILocalVariable(arg: 1, scope: !349, type: !7) // CHECK:STDOUT: !354 = !DILocalVariable(arg: 2, scope: !349, type: !165) -// CHECK:STDOUT: !355 = !DILocation(line: 100, column: 29, scope: !349) -// CHECK:STDOUT: !356 = !DILocation(line: 100, column: 13, scope: !349) -// CHECK:STDOUT: !357 = !DILocation(line: 100, column: 5, scope: !349) -// CHECK:STDOUT: !358 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.a374c478e4368fa7", scope: null, file: !197, line: 106, type: !359, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !361) +// CHECK:STDOUT: !355 = !DILocation(line: 101, column: 29, scope: !349) +// CHECK:STDOUT: !356 = !DILocation(line: 101, column: 13, scope: !349) +// CHECK:STDOUT: !357 = !DILocation(line: 101, column: 5, scope: !349) +// CHECK:STDOUT: !358 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.a374c478e4368fa7", scope: null, file: !197, line: 107, type: !359, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !361) // CHECK:STDOUT: !359 = !DISubroutineType(types: !360) // CHECK:STDOUT: !360 = !{!7, !165, !7} // CHECK:STDOUT: !361 = !{!362, !363} // CHECK:STDOUT: !362 = !DILocalVariable(arg: 1, scope: !358, type: !165) // CHECK:STDOUT: !363 = !DILocalVariable(arg: 2, scope: !358, type: !7) -// CHECK:STDOUT: !364 = !DILocation(line: 108, column: 14, scope: !358) -// CHECK:STDOUT: !365 = !DILocation(line: 108, column: 13, scope: !358) -// CHECK:STDOUT: !366 = !DILocation(line: 108, column: 5, scope: !358) -// CHECK:STDOUT: !367 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.a374c478e4368fa7", scope: null, file: !197, line: 114, type: !350, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !368) +// CHECK:STDOUT: !364 = !DILocation(line: 109, column: 14, scope: !358) +// CHECK:STDOUT: !365 = !DILocation(line: 109, column: 13, scope: !358) +// CHECK:STDOUT: !366 = !DILocation(line: 109, column: 5, scope: !358) +// CHECK:STDOUT: !367 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.a374c478e4368fa7", scope: null, file: !197, line: 115, type: !350, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !368) // CHECK:STDOUT: !368 = !{!369, !370} // CHECK:STDOUT: !369 = !DILocalVariable(arg: 1, scope: !367, type: !7) // CHECK:STDOUT: !370 = !DILocalVariable(arg: 2, scope: !367, type: !165) -// CHECK:STDOUT: !371 = !DILocation(line: 116, column: 29, scope: !367) -// CHECK:STDOUT: !372 = !DILocation(line: 116, column: 13, scope: !367) -// CHECK:STDOUT: !373 = !DILocation(line: 116, column: 5, scope: !367) -// CHECK:STDOUT: !374 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.bca5dfe49de51c76", scope: null, file: !197, line: 98, type: !375, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !377) +// CHECK:STDOUT: !371 = !DILocation(line: 117, column: 29, scope: !367) +// CHECK:STDOUT: !372 = !DILocation(line: 117, column: 13, scope: !367) +// CHECK:STDOUT: !373 = !DILocation(line: 117, column: 5, scope: !367) +// CHECK:STDOUT: !374 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:AddWith.d9344a06b22b3b94.Core.bca5dfe49de51c76", scope: null, file: !197, line: 99, type: !375, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !377) // CHECK:STDOUT: !375 = !DISubroutineType(types: !376) // CHECK:STDOUT: !376 = !{!7, !7, !179} // CHECK:STDOUT: !377 = !{!378, !379} // CHECK:STDOUT: !378 = !DILocalVariable(arg: 1, scope: !374, type: !7) // CHECK:STDOUT: !379 = !DILocalVariable(arg: 2, scope: !374, type: !179) -// CHECK:STDOUT: !380 = !DILocation(line: 100, column: 29, scope: !374) -// CHECK:STDOUT: !381 = !DILocation(line: 100, column: 13, scope: !374) -// CHECK:STDOUT: !382 = !DILocation(line: 100, column: 5, scope: !374) -// CHECK:STDOUT: !383 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.bca5dfe49de51c76", scope: null, file: !197, line: 106, type: !384, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !386) +// CHECK:STDOUT: !380 = !DILocation(line: 101, column: 29, scope: !374) +// CHECK:STDOUT: !381 = !DILocation(line: 101, column: 13, scope: !374) +// CHECK:STDOUT: !382 = !DILocation(line: 101, column: 5, scope: !374) +// CHECK:STDOUT: !383 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd9948a9ef8c6e5:AddWith.295cf9b677564c5c.Core.bca5dfe49de51c76", scope: null, file: !197, line: 107, type: !384, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !386) // CHECK:STDOUT: !384 = !DISubroutineType(types: !385) // CHECK:STDOUT: !385 = !{!7, !179, !7} // CHECK:STDOUT: !386 = !{!387, !388} // CHECK:STDOUT: !387 = !DILocalVariable(arg: 1, scope: !383, type: !179) // CHECK:STDOUT: !388 = !DILocalVariable(arg: 2, scope: !383, type: !7) -// CHECK:STDOUT: !389 = !DILocation(line: 108, column: 14, scope: !383) -// CHECK:STDOUT: !390 = !DILocation(line: 108, column: 13, scope: !383) -// CHECK:STDOUT: !391 = !DILocation(line: 108, column: 5, scope: !383) -// CHECK:STDOUT: !392 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.bca5dfe49de51c76", scope: null, file: !197, line: 114, type: !375, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !393) +// CHECK:STDOUT: !389 = !DILocation(line: 109, column: 14, scope: !383) +// CHECK:STDOUT: !390 = !DILocation(line: 109, column: 13, scope: !383) +// CHECK:STDOUT: !391 = !DILocation(line: 109, column: 5, scope: !383) +// CHECK:STDOUT: !392 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Char.Core:SubWith.d9344a06b22b3b94.Core.bca5dfe49de51c76", scope: null, file: !197, line: 115, type: !375, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !393) // CHECK:STDOUT: !393 = !{!394, !395} // CHECK:STDOUT: !394 = !DILocalVariable(arg: 1, scope: !392, type: !7) // CHECK:STDOUT: !395 = !DILocalVariable(arg: 2, scope: !392, type: !179) -// CHECK:STDOUT: !396 = !DILocation(line: 116, column: 29, scope: !392) -// CHECK:STDOUT: !397 = !DILocation(line: 116, column: 13, scope: !392) -// CHECK:STDOUT: !398 = !DILocation(line: 116, column: 5, scope: !392) +// CHECK:STDOUT: !396 = !DILocation(line: 117, column: 29, scope: !392) +// CHECK:STDOUT: !397 = !DILocation(line: 117, column: 13, scope: !392) +// CHECK:STDOUT: !398 = !DILocation(line: 117, column: 5, scope: !392) // CHECK:STDOUT: !399 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.UInt.9452f4c51951679b.Core:ImplicitAs.f48df0d8add56b17.Core.b906c5940adce8f0", scope: null, file: !400, line: 87, type: !198, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !401) // CHECK:STDOUT: !400 = !DIFile(filename: "{{.*}}/prelude/types/uint.carbon", directory: "") // CHECK:STDOUT: !401 = !{!402} @@ -977,10 +977,10 @@ fn AddSubUInt32(c: char, i: u32) { // CHECK:STDOUT: !417 = !DILocalVariable(arg: 1, scope: !415, type: !7) // CHECK:STDOUT: !418 = !DILocation(line: 88, column: 12, scope: !415) // CHECK:STDOUT: !419 = !DILocation(line: 88, column: 5, scope: !415) -// CHECK:STDOUT: !420 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.db6d5218df1134ee", scope: null, file: !197, line: 46, type: !228, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !421) +// CHECK:STDOUT: !420 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Char.Core:As.5d7343568c0b5715.Core.db6d5218df1134ee", scope: null, file: !197, line: 47, type: !228, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !421) // CHECK:STDOUT: !421 = !{!422} // CHECK:STDOUT: !422 = !DILocalVariable(arg: 1, scope: !420, type: !7) -// CHECK:STDOUT: !423 = !DILocation(line: 47, column: 5, scope: !420) +// CHECK:STDOUT: !423 = !DILocation(line: 48, column: 5, scope: !420) // CHECK:STDOUT: !424 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.UInt.9452f4c51951679b.Core:FromUInt.a1a82301830d1e08.Core.c3acaf94968d88d2", scope: null, file: !400, line: 71, type: !198, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !425) // CHECK:STDOUT: !425 = !{!426} // CHECK:STDOUT: !426 = !DILocalVariable(arg: 1, scope: !424, type: !7) diff --git a/toolchain/lower/testdata/primitives/optional.carbon b/toolchain/lower/testdata/primitives/optional.carbon index 45430fc87865..2f19703222e7 100644 --- a/toolchain/lower/testdata/primitives/optional.carbon +++ b/toolchain/lower/testdata/primitives/optional.carbon @@ -568,11 +568,11 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: !205 = !{!206} // CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !204, type: !7) // CHECK:STDOUT: !207 = !DILocation(line: 58, column: 36, scope: !204) -// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7c16f707f533a23:Copy.Core.5bd8d5767580997a", scope: null, file: !209, line: 19, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !210) +// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7c16f707f533a23:Copy.Core.5bd8d5767580997a", scope: null, file: !209, line: 23, type: !97, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !210) // CHECK:STDOUT: !209 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") // CHECK:STDOUT: !210 = !{!211} // CHECK:STDOUT: !211 = !DILocalVariable(arg: 1, scope: !208, type: !7) -// CHECK:STDOUT: !212 = !DILocation(line: 19, column: 33, scope: !208) +// CHECK:STDOUT: !212 = !DILocation(line: 23, column: 33, scope: !208) // CHECK:STDOUT: ; ModuleID = 'copy.carbon' // CHECK:STDOUT: source_filename = "copy.carbon" // CHECK:STDOUT: diff --git a/toolchain/sem_ir/builtin_function_kind.cpp b/toolchain/sem_ir/builtin_function_kind.cpp index b1bd7979d756..0638cc2d7bbf 100644 --- a/toolchain/sem_ir/builtin_function_kind.cpp +++ b/toolchain/sem_ir/builtin_function_kind.cpp @@ -823,7 +823,7 @@ static auto IsLiteralType(const File& sem_ir, TypeId type_id) -> bool { // runtime value of such a type may not have a value available for the builtin // to use. For example, given: // -// var n: Core.IntLiteral() = 123; +// var n: Core.IntLiteral = 123; // // we would be unable to lower a runtime operation such as `(1 as i32) << n` // because the runtime representation of `n` doesn't track its value at all. diff --git a/toolchain/testing/testdata/min_prelude/parts/bool.carbon b/toolchain/testing/testdata/min_prelude/parts/bool.carbon index d28f0a52da3e..2e26610e397e 100644 --- a/toolchain/testing/testdata/min_prelude/parts/bool.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/bool.carbon @@ -10,4 +10,5 @@ package Core library "prelude/parts/bool"; export import library "prelude/parts/copy"; -fn Bool() -> type = "bool.make_type"; +private fn MakeBool() -> type = "bool.make_type"; +alias Bool = MakeBool(); diff --git a/toolchain/testing/testdata/min_prelude/parts/char.carbon b/toolchain/testing/testdata/min_prelude/parts/char.carbon index 9b18edaed281..aa0434e0d781 100644 --- a/toolchain/testing/testdata/min_prelude/parts/char.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/char.carbon @@ -10,12 +10,13 @@ package Core library "prelude/parts/char"; import library "prelude/parts/uint"; -fn CharLiteral() -> type = "char_literal.make_type"; +private fn MakeCharLiteral() -> type = "char_literal.make_type"; +alias CharLiteral = MakeCharLiteral(); class Char { adapt u8; } -impl CharLiteral() as ImplicitAs(Char) { +impl CharLiteral as ImplicitAs(Char) { fn Convert[self: Self]() -> Char = "char.convert_checked"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/copy.carbon b/toolchain/testing/testdata/min_prelude/parts/copy.carbon index 97cf02443b9f..1c1bb43e6496 100644 --- a/toolchain/testing/testdata/min_prelude/parts/copy.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/copy.carbon @@ -12,28 +12,32 @@ interface Copy { fn Op[self: Self]() -> Self; } -private fn Bool() -> type = "bool.make_type"; -private fn CharLiteral() -> type = "char_literal.make_type"; -private fn FloatLiteral() -> type = "float_literal.make_type"; -private fn IntLiteral() -> type = "int_literal.make_type"; +private fn MakeBool() -> type = "bool.make_type"; +private alias Bool = MakeBool(); +private fn MakeCharLiteral() -> type = "char_literal.make_type"; +private alias CharLiteral = MakeCharLiteral(); +private fn MakeFloatLiteral() -> type = "float_literal.make_type"; +private alias FloatLiteral = MakeFloatLiteral(); +private fn MakeIntLiteral() -> type = "int_literal.make_type"; +private alias IntLiteral = MakeIntLiteral(); impl forall [T:! Copy] const T as Copy { fn Op[self: Self]() -> Self { return (self as T).(Copy.Op)() as const T; } } -impl Bool() as Copy { +impl Bool as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } -impl CharLiteral() as Copy { +impl CharLiteral as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } -impl FloatLiteral() as Copy { +impl FloatLiteral as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } -impl IntLiteral() as Copy { +impl IntLiteral as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/float.carbon b/toolchain/testing/testdata/min_prelude/parts/float.carbon index 4f03ede5a3b0..874a6a8570c5 100644 --- a/toolchain/testing/testdata/min_prelude/parts/float.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/float.carbon @@ -16,21 +16,21 @@ export import library "prelude/parts/copy"; export import library "prelude/parts/float_literal"; export import library "prelude/parts/int_literal"; -private fn MakeFloat(size: IntLiteral()) -> type = "float.make_type"; +private fn MakeFloat(size: IntLiteral) -> type = "float.make_type"; -class Float(N:! IntLiteral()) { +class Float(N:! IntLiteral) { adapt MakeFloat(N); } -impl forall [N:! IntLiteral()] Float(N) as Copy { +impl forall [N:! IntLiteral] Float(N) as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } -impl forall [To:! IntLiteral()] FloatLiteral() as ImplicitAs(Float(To)) { +impl forall [To:! IntLiteral] FloatLiteral as ImplicitAs(Float(To)) { fn Convert[self: Self]() -> Float(To) = "float.convert_checked"; } // TODO: Remove this once ImplicitAs extends As. -impl forall [To:! IntLiteral()] FloatLiteral() as As(Float(To)) { +impl forall [To:! IntLiteral] FloatLiteral as As(Float(To)) { fn Convert[self: Self]() -> Float(To) = "float.convert_checked"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/float_literal.carbon b/toolchain/testing/testdata/min_prelude/parts/float_literal.carbon index c4e4ac3cab57..9e737af7f84a 100644 --- a/toolchain/testing/testdata/min_prelude/parts/float_literal.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/float_literal.carbon @@ -6,4 +6,5 @@ package Core library "prelude/parts/float_literal"; -fn FloatLiteral() -> type = "float_literal.make_type"; +private fn MakeFloatLiteral() -> type = "float_literal.make_type"; +alias FloatLiteral = MakeFloatLiteral(); diff --git a/toolchain/testing/testdata/min_prelude/parts/form.carbon b/toolchain/testing/testdata/min_prelude/parts/form.carbon index 580670b112af..8983f255b101 100644 --- a/toolchain/testing/testdata/min_prelude/parts/form.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/form.carbon @@ -6,4 +6,5 @@ package Core library "prelude/parts/form"; -fn Form() -> type = "form.make_type"; +private fn MakeForm() -> type = "form.make_type"; +alias Form = MakeForm(); diff --git a/toolchain/testing/testdata/min_prelude/parts/int.carbon b/toolchain/testing/testdata/min_prelude/parts/int.carbon index 5186c50cc73b..94dcc35a2ea5 100644 --- a/toolchain/testing/testdata/min_prelude/parts/int.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/int.carbon @@ -14,40 +14,40 @@ export import library "prelude/parts/as"; export import library "prelude/parts/copy"; export import library "prelude/parts/int_literal"; -private fn MakeInt(size: IntLiteral()) -> type = "int.make_type_signed"; +private fn MakeInt(size: IntLiteral) -> type = "int.make_type_signed"; -class Int(N:! IntLiteral()) { +class Int(N:! IntLiteral) { adapt MakeInt(N); } // Copy. -impl forall [N:! IntLiteral()] Int(N) as Copy { +impl forall [N:! IntLiteral] Int(N) as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } // Conversions. -impl forall [To:! IntLiteral()] IntLiteral() as ImplicitAs(Int(To)) { +impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(Int(To)) { fn Convert[self: Self]() -> Int(To) = "int.convert_checked"; } -final impl forall [From:! IntLiteral()] Int(From) as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl forall [From:! IntLiteral] Int(From) as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. -impl forall [To:! IntLiteral()] IntLiteral() as As(Int(To)) { +impl forall [To:! IntLiteral] IntLiteral as As(Int(To)) { fn Convert[self: Self]() -> Int(To) = "int.convert_checked"; } -final impl forall [From:! IntLiteral()] Int(From) as As(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl forall [From:! IntLiteral] Int(From) as As(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // Negate. -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] Int(N) as Negate where .Result = Self { fn Op[self: Self]() -> Self = "int.snegate"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/int_literal.carbon b/toolchain/testing/testdata/min_prelude/parts/int_literal.carbon index b30a52a7ec16..a6bf809654fe 100644 --- a/toolchain/testing/testdata/min_prelude/parts/int_literal.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/int_literal.carbon @@ -6,7 +6,8 @@ package Core library "prelude/parts/int_literal"; -fn IntLiteral() -> type = "int_literal.make_type"; +private fn MakeIntLiteral() -> type = "int_literal.make_type"; +alias IntLiteral = MakeIntLiteral(); // Negate. @@ -15,6 +16,6 @@ interface Negate { fn Op[self: Self]() -> Result; } -impl IntLiteral() as Negate where .Result = Self { +impl IntLiteral as Negate where .Result = Self { fn Op[self: Self]() -> Self = "int.snegate"; } diff --git a/toolchain/testing/testdata/min_prelude/parts/uint.carbon b/toolchain/testing/testdata/min_prelude/parts/uint.carbon index e4e08602730c..2f6a50781d9e 100644 --- a/toolchain/testing/testdata/min_prelude/parts/uint.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/uint.carbon @@ -14,40 +14,40 @@ export import library "prelude/parts/as"; export import library "prelude/parts/copy"; export import library "prelude/parts/int_literal"; -private fn MakeUInt(size: IntLiteral()) -> type = "int.make_type_unsigned"; +private fn MakeUInt(size: IntLiteral) -> type = "int.make_type_unsigned"; -class UInt(N:! IntLiteral()) { +class UInt(N:! IntLiteral) { adapt MakeUInt(N); } // Copy. -impl forall [N:! IntLiteral()] UInt(N) as Copy { +impl forall [N:! IntLiteral] UInt(N) as Copy { fn Op[self: Self]() -> Self = "primitive_copy"; } // Conversions. -impl forall [To:! IntLiteral()] IntLiteral() as ImplicitAs(UInt(To)) { +impl forall [To:! IntLiteral] IntLiteral as ImplicitAs(UInt(To)) { fn Convert[self: Self]() -> UInt(To) = "int.convert_checked"; } -final impl forall [From:! IntLiteral()] UInt(From) as ImplicitAs(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl forall [From:! IntLiteral] UInt(From) as ImplicitAs(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // TODO: Remove these once ImplicitAs extends As. -impl forall [To:! IntLiteral()] IntLiteral() as As(UInt(To)) { +impl forall [To:! IntLiteral] IntLiteral as As(UInt(To)) { fn Convert[self: Self]() -> UInt(To) = "int.convert_checked"; } -final impl forall [From:! IntLiteral()] UInt(From) as As(IntLiteral()) { - fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked"; +final impl forall [From:! IntLiteral] UInt(From) as As(IntLiteral) { + fn Convert[self: Self]() -> IntLiteral = "int.convert_checked"; } // Negate. -final impl forall [N:! IntLiteral()] +final impl forall [N:! IntLiteral] UInt(N) as Negate where .Result = Self { fn Op[self: Self]() -> Self = "int.unegate"; }