mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 12:58:11 +00:00
Switch tests to use the rendered form of diagnostics (#8070)
Historically, we disabled the rendered form in tests outside of `toolchain/diagnostics`. The idea was to keep tests shorter and avoid very long chains of autoupdate before stabilizing due to all the line numbers and other artifacts in the rendered form. This PR adds `--diagnostic-line-numbers=[all|first]` and defaults to `first` in tests. This keeps the rendered form so that we can easily code review that form and the visual cues it does or doesn't provide. But it removes all but the first location's line numbers to provide significantly more stability in tests. By default, tests get the full unicode line-drawing form of diagnostics so we can ensure all of the artifacts there make sense with the specific case being diagnosed, but we do retain some focused ASCII-rendering tests to ensure that fallback remains usable. There are some issues here that will be fixed in subsequent PRs. Notably, we try to keep the frame together in the check lines, and so force some parts to use the first location. This largely works, but fails in some edge cases, causing the entire frame to be located incorrectly. There is a TODO about this that we need to fix, and it only occurs 6 times across the test suite, so it didn't seem worth front-loading a fix for here. Assisted-by: Claude Code
This commit is contained in:
1 parent
0b7059a360
commit
d0badecd2a
888 files changed
+39731
-12799
No files matched your search
+42
-10
@@ -39,28 +39,60 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "enum.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-18: error: cannot convert expression of type `Cpp.Enum` to `i8` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-18: note: type `Cpp.Enum` does not implement interface `Core.As(i8)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+9]]:3
|
||||
// CHECK:STDERR: -> │ Cpp.Enum.a as i8;
|
||||
// CHECK:STDERR: · ━━━━┳━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Cpp.Enum` to `i8` with `as`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface `Core.As(i8)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Cpp.Enum.a as i8;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-19: error: cannot convert expression of type `Cpp.Enum` to `i32` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-19: note: type `Cpp.Enum` does not implement interface `Core.As(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+9]]:3
|
||||
// CHECK:STDERR: -> │ Cpp.Enum.a as i32;
|
||||
// CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Cpp.Enum` to `i32` with `as`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface `Core.As(i32)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Cpp.Enum.a as i32;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-24: error: cannot convert expression of type `i8` to `Cpp.Enum` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-24: note: type `i8` does not implement interface `Core.As(Cpp.Enum)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+9]]:3
|
||||
// CHECK:STDERR: -> │ (42 as i8) as Cpp.Enum;
|
||||
// CHECK:STDERR: · ━━━━┳━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `i8` to `Cpp.Enum` with `as`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `i8` does not implement interface `Core.As(Cpp.Enum)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
(42 as i8) as Cpp.Enum;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-25: error: cannot convert expression of type `i32` to `Cpp.Enum` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-25: note: type `i32` does not implement interface `Core.As(Cpp.Enum)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+9]]:3
|
||||
// CHECK:STDERR: -> │ (42 as i32) as Cpp.Enum;
|
||||
// CHECK:STDERR: · ━━━┳━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `i32` to `Cpp.Enum` with `as`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `i32` does not implement interface `Core.As(Cpp.Enum)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
(42 as i32) as Cpp.Enum;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+3]]:3-28: error: cannot convert expression of type `Cpp.Enum` to `Cpp.DifferentSize` with `as` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_type.carbon:[[@LINE+2]]:3-28: note: type `Cpp.Enum` does not implement interface `Core.As(Cpp.DifferentSize)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_wrong_type.carbon:[[@LINE+11]]:3
|
||||
// CHECK:STDERR: -> │ Cpp.a as Cpp.DifferentSize;
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot convert expression of type `Cpp.Enum` to
|
||||
// CHECK:STDERR: · │ ┃ `Cpp.DifferentSize` with `as`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.As(Cpp.DifferentSize)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Cpp.a as Cpp.DifferentSize;
|
||||
}
|
||||
|
||||
+12
-2
@@ -76,8 +76,18 @@ fn CompareGeneric[U: type, T: Core.EqWith(U)](x: T, y: U) -> bool {
|
||||
}
|
||||
|
||||
fn CompareHeterogeneousFail(x: Cpp.Scoped, y: Cpp.Unscoped) -> bool {
|
||||
// CHECK:STDERR: fail_heterogeneous.carbon:[[@LINE+3]]:10-29: error: cannot convert type `Cpp.Scoped` into type implementing `Core.EqWith(Cpp.Unscoped)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_heterogeneous.carbon:[[@LINE-6]]:1-67: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_heterogeneous.carbon:[[@LINE+13]]:10
|
||||
// CHECK:STDERR: │ fn CompareGeneric[U: type, T: Core.EqWith(U)](x: T, y: U) -> bool {
|
||||
// CHECK:STDERR: · ─────────────────────────┬─────────────────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here
|
||||
// CHECK:STDERR: · │ [DeductionGenericHere]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ return CompareGeneric(x, y);
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot convert type `Cpp.Scoped` into type implementing
|
||||
// CHECK:STDERR: · ┃ `Core.EqWith(Cpp.Unscoped)`
|
||||
// CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return CompareGeneric(x, y);
|
||||
}
|
||||
+30
-10
@@ -15,15 +15,28 @@
|
||||
|
||||
// This is not valid in standard C++, but MSVC allows it as an extension, and so
|
||||
// Clang allows it in MSVC compatibility mode.
|
||||
// CHECK:STDERR: ╷ ╭── included from: import_declaration.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./declaration.h:[[@LINE+15]]:6
|
||||
// CHECK:STDERR: -> │ enum UnsizedEnum;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ warning: forward references to 'enum' types are a Microsoft extension
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: ╷ ╭── included from: fail_use_declaration_as_definition.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./declaration.h:[[@LINE+7]]:6
|
||||
// CHECK:STDERR: -> │ enum UnsizedEnum;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ warning: forward references to 'enum' types are a Microsoft extension
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
enum UnsizedEnum;
|
||||
|
||||
// --- import_declaration.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: import_declaration.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./declaration.h:4:6: warning: forward references to 'enum' types are a Microsoft extension [CppInteropParseWarning]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "declaration.h";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
@@ -34,17 +47,24 @@ fn F(e: Cpp.UnsizedEnum);
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: fail_use_declaration_as_definition.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./declaration.h:4:6: warning: forward references to 'enum' types are a Microsoft extension [CppInteropParseWarning]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "declaration.h";
|
||||
|
||||
fn MyF() {
|
||||
// TODO: It's a bit surprising to refer to this type as a class, even though
|
||||
// we model it as a class in Carbon. Consider customizing the diagnostic.
|
||||
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+4]]:17-31: error: binding pattern has incomplete type `UnsizedEnum` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: included from: fail_use_declaration_as_definition.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./declaration.h:4:6: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_use_declaration_as_definition.carbon:[[@LINE+14]]:17
|
||||
// CHECK:STDERR: -> │ var unused e: Cpp.UnsizedEnum;
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type `UnsizedEnum` in
|
||||
// CHECK:STDERR: · ┃ name binding declaration
|
||||
// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ ╭── included from: fail_use_declaration_as_definition.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./declaration.h
|
||||
// CHECK:STDERR: │ enum UnsizedEnum;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var unused e: Cpp.UnsizedEnum;
|
||||
}
|
||||
@@ -75,7 +95,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: %e.patt: %pattern_type = wrapper_binding_pattern e, %e.param_patt [concrete = constants.%e.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %e.param: %UnsizedEnum = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc10: type = splice_block %UnsizedEnum.ref [concrete = constants.%UnsizedEnum] {
|
||||
// CHECK:STDOUT: %.loc7: type = splice_block %UnsizedEnum.ref [concrete = constants.%UnsizedEnum] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %UnsizedEnum.ref: type = name_ref UnsizedEnum, imports.%UnsizedEnum.decl [concrete = constants.%UnsizedEnum]
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -15,7 +15,12 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_invalid_underlying_type.carbon:[[@LINE+2]]:20: error: unknown type name 'no_such_type' [CppInteropParseError]
|
||||
// CHECK:STDERR: ╭─┤ fail_invalid_underlying_type.carbon:[[@LINE+7]]:20
|
||||
// CHECK:STDERR: -> │ enum InvalidEnum : no_such_type {};
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: unknown type name 'no_such_type'
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
enum InvalidEnum : no_such_type {};
|
||||
''';
|
||||
|
||||
+6
-1
@@ -33,7 +33,12 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "enum.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_name_without_scope.carbon:[[@LINE+2]]:28-32: error: member name `b` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: ╭─┤ fail_name_without_scope.carbon:[[@LINE+7]]:28
|
||||
// CHECK:STDERR: -> │ let unused b: Cpp.Enum = Cpp.b;
|
||||
// CHECK:STDERR: · ━━┳━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: member name `b` not found in `Cpp`
|
||||
// CHECK:STDERR: · ┃ [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let unused b: Cpp.Enum = Cpp.b;
|
||||
}
|
||||
|
||||
+26
-5
@@ -36,13 +36,29 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "enum.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+3]]:29-38: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+2]]:29-38: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_wrong_enum.carbon:[[@LINE+11]]:29
|
||||
// CHECK:STDERR: -> │ let unused c: Cpp.Other = Cpp.Enum.c;
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `Cpp.Enum` to `Cpp.Other`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Other)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let unused c: Cpp.Other = Cpp.Enum.c;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+3]]:30-34: error: cannot implicitly convert expression of type `Cpp.Enum` to `Cpp.Other` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_wrong_enum.carbon:[[@LINE+2]]:30-34: note: type `Cpp.Enum` does not implement interface `Core.ImplicitAs(Cpp.Other)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_wrong_enum.carbon:[[@LINE+11]]:30
|
||||
// CHECK:STDERR: -> │ let unused c2: Cpp.Other = Cpp.c;
|
||||
// CHECK:STDERR: · ┳━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `Cpp.Enum` to `Cpp.Other`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.Enum` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Other)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let unused c2: Cpp.Other = Cpp.c;
|
||||
}
|
||||
@@ -54,7 +70,12 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "enum.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_non_enum_member.carbon:[[@LINE+2]]:29-38: error: member name `d` not found in `Cpp.Enum` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: ╭─┤ fail_non_enum_member.carbon:[[@LINE+7]]:29
|
||||
// CHECK:STDERR: -> │ let unused c: Cpp.Other = Cpp.Enum.d;
|
||||
// CHECK:STDERR: · ━┳━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: member name `d` not found in `Cpp.Enum`
|
||||
// CHECK:STDERR: · ┃ [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let unused c: Cpp.Other = Cpp.Enum.d;
|
||||
}
|
||||
|
||||
+37
-27
@@ -15,6 +15,14 @@
|
||||
|
||||
enum class Color {Red, Blue, Green};
|
||||
|
||||
// CHECK:STDERR: ╷ ╭── included from: import_enum.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./enum.h:[[@LINE+7]]:7
|
||||
// CHECK:STDERR: -> │ using enum Color;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ warning: using enum declaration is a C++20 extension
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
using enum Color;
|
||||
|
||||
class Zoo {
|
||||
@@ -22,18 +30,20 @@ public:
|
||||
enum class Animal { Cat, Dog, Horse };
|
||||
};
|
||||
|
||||
// CHECK:STDERR: ╷ ╭── included from: import_enum.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./enum.h:[[@LINE+7]]:7
|
||||
// CHECK:STDERR: -> │ using enum Zoo::Animal;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ warning: using enum declaration is a C++20 extension
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
using enum Zoo::Animal;
|
||||
|
||||
// --- import_enum.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: included from: import_enum.carbon:[[@LINE+6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./enum.h:5:7: warning: using enum declaration is a C++20 extension [CppInteropParseWarning]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: included from: import_enum.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./enum.h:12:7: warning: using enum declaration is a C++20 extension [CppInteropParseWarning]
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "enum.h";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
@@ -89,46 +99,46 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc14_35: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc8_35: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: %Red.ref: %Color = name_ref Red, imports.%int_0.59e [concrete = constants.%int_0.59e]
|
||||
// CHECK:STDOUT: %.loc14: type = splice_block %Color.ref.loc14_23 [concrete = constants.%Color] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc14_23: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: %.loc8: type = splice_block %Color.ref.loc8_23 [concrete = constants.%Color] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc8_23: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %col: %Color = wrapper_binding col, %Red.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %col.patt: %pattern_type.732 = value_binding_pattern col [concrete = constants.%col.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15_33: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc9_33: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Blue.ref: %Color = name_ref Blue, imports.%int_1.b76 [concrete = constants.%int_1.b76]
|
||||
// CHECK:STDOUT: %.loc15: type = splice_block %Color.ref.loc15 [concrete = constants.%Color] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc15: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: %.loc9: type = splice_block %Color.ref.loc9 [concrete = constants.%Color] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc9_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Color.ref.loc9: type = name_ref Color, imports.%Color.decl [concrete = constants.%Color]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %colb: %Color = wrapper_binding colb, %Blue.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %colb.patt: %pattern_type.732 = value_binding_pattern colb [concrete = constants.%colb.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_37: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc16_40: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc16_44: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_37: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc10_40: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc10_44: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: %Cat.ref: %Animal = name_ref Cat, imports.%int_0.648 [concrete = constants.%int_0.648]
|
||||
// CHECK:STDOUT: %.loc16: type = splice_block %Animal.ref.loc16_27 [concrete = constants.%Animal] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc16_23: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc16_27: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: %.loc10: type = splice_block %Animal.ref.loc10_27 [concrete = constants.%Animal] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc10_23: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc10_27: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %pet: %Animal = wrapper_binding pet, %Cat.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %pet.patt: %pattern_type.8cd = value_binding_pattern pet [concrete = constants.%pet.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17_38: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_38: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dog.ref: %Animal = name_ref Dog, imports.%int_1.e7b [concrete = constants.%int_1.e7b]
|
||||
// CHECK:STDOUT: %.loc17: type = splice_block %Animal.ref.loc17 [concrete = constants.%Animal] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc17: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc17: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: %.loc11: type = splice_block %Animal.ref.loc11 [concrete = constants.%Animal] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Zoo.ref.loc11: type = name_ref Zoo, imports.%Zoo.decl [concrete = constants.%Zoo]
|
||||
// CHECK:STDOUT: %Animal.ref.loc11: type = name_ref Animal, imports.%Animal.decl [concrete = constants.%Animal]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %pet2: %Animal = wrapper_binding pet2, %Dog.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
|
||||
Reference in new issue
Block a user