Rename and rearrange entities in tests to avoid name reuse (#7656)

Fix a bunch of cases where we use the same external name to mean
multiple different things in the same test. We've historically gotten
away with this, but under `--share-cpp-ast`, it becomes an error, at
least if the entity is either defined in, or used from, C++ code.

Assisted-by: Gemini via Antigravity (original change) and Claude Code
(suggested edits in review)

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
Richard Smith
2026-08-21 01:36:40 +00:00
committed by GitHub
co-authored by Chandler Carruth
parent 6eb900dff5
commit c588eadb57
53 changed files with 7794 additions and 7705 deletions
+56 -56
View File
@@ -32,23 +32,23 @@ library "[[@TEST_NAME]]";
import Cpp;
base class A {
base class LookupBase {
fn F();
fn G(n: i32);
}
class B {
extend base: A;
class LookupDerived {
extend base: LookupBase;
fn G();
}
inline Cpp '''
void Qualified() {
Carbon::B::F();
Carbon::B::G();
Carbon::LookupDerived::F();
Carbon::LookupDerived::G();
}
void MemberAccess(Carbon::A *a, Carbon::B *b) {
void MemberAccess(Carbon::LookupBase *a, Carbon::LookupDerived *b) {
b->F();
b->G();
}
@@ -59,17 +59,17 @@ library "[[@TEST_NAME]]";
import Cpp;
class Final {}
class FinalClass {}
inline Cpp '''
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+7]]:12: error: base 'Final' is marked 'final' [CppInteropParseError]
// CHECK:STDERR: 15 | struct A : Carbon::Final {};
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+7]]:12: error: base 'FinalClass' is marked 'final' [CppInteropParseError]
// CHECK:STDERR: 15 | struct A : Carbon::FinalClass {};
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE-6]]:13: note: 'Final' declared here [CppInteropParseNote]
// CHECK:STDERR: 5 | class Final {}
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE-6]]:18: note: 'FinalClass' declared here [CppInteropParseNote]
// CHECK:STDERR: 5 | class FinalClass {}
// CHECK:STDERR: | ^
// CHECK:STDERR:
struct A : Carbon::Final {};
struct A : Carbon::FinalClass {};
''';
// --- fail_abstract.carbon
@@ -84,23 +84,23 @@ struct VirtualDestructor {
};
''';
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `Abstract` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class Abstract {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractWithVdtor` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class AbstractWithVdtor {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
abstract class Abstract {
abstract class AbstractWithVdtor {
extend base: Cpp.VirtualDestructor;
}
inline Cpp '''
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+7]]:18: error: variable type 'Carbon::Abstract' is an abstract class [CppInteropParseError]
// CHECK:STDERR: 28 | Carbon::Abstract x;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_abstract.carbon:[[@LINE-8]]:25: note: unimplemented pure virtual method '~Abstract' in 'Abstract' [CppInteropParseNote]
// CHECK:STDERR: 16 | abstract class Abstract {
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+7]]:27: error: variable type 'Carbon::AbstractWithVdtor' is an abstract class [CppInteropParseError]
// CHECK:STDERR: 28 | Carbon::AbstractWithVdtor x;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_abstract.carbon:[[@LINE-8]]:34: note: unimplemented pure virtual method '~AbstractWithVdtor' in 'AbstractWithVdtor' [CppInteropParseNote]
// CHECK:STDERR: 16 | abstract class AbstractWithVdtor {
// CHECK:STDERR: | ^
// CHECK:STDERR:
Carbon::Abstract x;
Carbon::AbstractWithVdtor x;
''';
// --- fail_todo_abstract_nonvirtual_dtor.carbon
@@ -111,17 +111,17 @@ import Cpp;
// TODO: Find a way to export this to C++ as an abstract class, despite not
// having a vptr.
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor.carbon:[[@LINE+8]]:1: error: semantics TODO: `exporting abstract class with no abstract methods and non-virtual destructor to C++` [SemanticsTodo]
// CHECK:STDERR: abstract class Abstract {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: abstract class AbstractNonvirtualDtor {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `Abstract` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class Abstract {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractNonvirtualDtor` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class AbstractNonvirtualDtor {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
abstract class Abstract {}
abstract class AbstractNonvirtualDtor {}
inline Cpp '''
class Derived : public Carbon::Abstract {};
class DerivedNonvirtualDtor : public Carbon::AbstractNonvirtualDtor {};
''';
// --- fail_todo_abstract_nonvirtual_dtor_but_virtual_fns.carbon
@@ -132,16 +132,16 @@ import Cpp;
// TODO: We should support generating a base subobject destructor for an
// abstract class, even though we refuse to generate a complete object
// destructor.
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor_but_virtual_fns.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `Abstract` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class Abstract {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_abstract_nonvirtual_dtor_but_virtual_fns.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractWithMethodNoVptr` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class AbstractWithMethodNoVptr {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
abstract class Abstract {
abstract class AbstractWithMethodNoVptr {
abstract fn F(self);
}
inline Cpp '''
class Derived : public Carbon::Abstract {
class DerivedWithMethodNoVptr : public Carbon::AbstractWithMethodNoVptr {
};
''';
@@ -153,23 +153,23 @@ import Cpp;
// TODO: We should support generating a base subobject destructor for an
// abstract class, even though we refuse to generate a complete object
// destructor.
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `Abstract` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class Abstract {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractWithMethod` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class AbstractWithMethod {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
abstract class Abstract {
abstract class AbstractWithMethod {
abstract fn F(self);
}
inline Cpp '''
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE+7]]:18: error: variable type 'Carbon::Abstract' is an abstract class [CppInteropParseError]
// CHECK:STDERR: 24 | Carbon::Abstract x;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE-7]]:22: note: unimplemented pure virtual method 'F' in 'Abstract' [CppInteropParseNote]
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE+7]]:28: error: variable type 'Carbon::AbstractWithMethod' is an abstract class [CppInteropParseError]
// CHECK:STDERR: 24 | Carbon::AbstractWithMethod x_abstract;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_variable_with_abstract_method.carbon:[[@LINE-7]]:22: note: unimplemented pure virtual method 'F' in 'AbstractWithMethod' [CppInteropParseNote]
// CHECK:STDERR: 13 | abstract fn F(self);
// CHECK:STDERR: | ^
// CHECK:STDERR:
Carbon::Abstract x;
Carbon::AbstractWithMethod x_abstract;
''';
// --- fail_todo_abstract_method_overridden_in_cpp.carbon
@@ -180,20 +180,20 @@ import Cpp;
// TODO: We should support generating a base subobject destructor for an
// abstract class, even though we refuse to generate a complete object
// destructor.
// CHECK:STDERR: fail_todo_abstract_method_overridden_in_cpp.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `Abstract` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class Abstract {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_abstract_method_overridden_in_cpp.carbon:[[@LINE+4]]:1: error: cannot access member of interface `Core.Destroy` in type `AbstractToOverride` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: abstract class AbstractToOverride {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
abstract class Abstract {
abstract class AbstractToOverride {
abstract fn F(ref self);
}
// A C++ class that overrides the abstract method can be instantiated.
inline Cpp '''
struct Derived : Carbon::Abstract {
struct DerivedOverriding : Carbon::AbstractToOverride {
void F() & override {}
};
Derived d;
DerivedOverriding d;
''';
// --- override_virtual_dtor.carbon
@@ -202,15 +202,15 @@ library "[[@TEST_NAME]]";
import Cpp;
inline Cpp '''
struct A {
virtual ~A() = 0;
struct BaseWithPureVdtor {
virtual ~BaseWithPureVdtor() = 0;
};
''';
class B {
extend base: Cpp.A;
class DerivedWithVdtor {
extend base: Cpp.BaseWithPureVdtor;
}
inline Cpp '''
Carbon::B b;
Carbon::DerivedWithVdtor b;
''';
@@ -15,13 +15,13 @@ library "[[@TEST_NAME]]";
import Cpp;
class A {
class StaticMembers {
fn F() {}
}
inline Cpp '''
void G() {
Carbon::A::F();
void CallStaticMember() {
Carbon::StaticMembers::F();
}
''';
@@ -30,16 +30,16 @@ library "[[@TEST_NAME]]";
import Cpp;
class A {
class B {
class C {
class OuterA {
class InnerB {
class NestedC {
}
}
}
inline Cpp '''
void G() {
Carbon::A::B::C *p = nullptr;
void TestNested() {
Carbon::OuterA::InnerB::NestedC *nested_p = nullptr;
}
''';
@@ -48,10 +48,10 @@ library "[[@TEST_NAME]]";
import Cpp;
class A;
class IncompleteA;
inline Cpp '''
Carbon::A *p = nullptr;
Carbon::IncompleteA *incomplete_p = nullptr;
''';
// --- fail_incomplete_concrete.carbon
@@ -60,20 +60,20 @@ library "[[@TEST_NAME]]";
import Cpp;
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE+4]]:1: error: class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: class A;
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR: class IncompleteConcreteA;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
class A;
class IncompleteConcreteA;
inline Cpp '''
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE+7]]:11: error: variable has incomplete type 'Carbon::A' [CppInteropParseError]
// CHECK:STDERR: 19 | Carbon::A a;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE-6]]:8: note: forward declaration of 'Carbon::A' [CppInteropParseNote]
// CHECK:STDERR: 9 | class A;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE+7]]:29: error: variable has incomplete type 'Carbon::IncompleteConcreteA' [CppInteropParseError]
// CHECK:STDERR: 19 | Carbon::IncompleteConcreteA incomplete_concrete_a;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_incomplete_concrete.carbon:[[@LINE-6]]:26: note: forward declaration of 'Carbon::IncompleteConcreteA' [CppInteropParseNote]
// CHECK:STDERR: 9 | class IncompleteConcreteA;
// CHECK:STDERR: | ^
// CHECK:STDERR:
Carbon::A a;
Carbon::IncompleteConcreteA incomplete_concrete_a;
''';
// --- fail_todo_monomorphization_failure.carbon
@@ -14,14 +14,14 @@
library "[[@TEST_NAME]]";
import Cpp;
class A {
class TwoIntFields {
var x: i32;
var y: i32;
}
inline Cpp '''
void F() {
Carbon::A a;
void AccessTwoFields() {
Carbon::TwoIntFields a;
a.x = 12;
a.y = 34;
}
@@ -31,18 +31,18 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
base class A {
base class BaseWithField {
var x: i32;
}
class B {
extend base: A;
class DerivedWithField {
extend base: BaseWithField;
var y: i32;
}
inline Cpp '''
void F() {
Carbon::B b;
void AccessInheritedField() {
Carbon::DerivedWithField b;
b.x = 12;
b.y = 34;
}
@@ -70,17 +70,17 @@ void g() {
library "[[@TEST_NAME]]";
import Cpp;
class A {}
class EmptyClass {}
inline Cpp '''
void F() {
Carbon::A a;
// CHECK:STDERR: fail_nonexistent_field.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::A' [CppInteropParseError]
void AccessNonexistentField() {
Carbon::EmptyClass a;
// CHECK:STDERR: fail_nonexistent_field.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::EmptyClass' [CppInteropParseError]
// CHECK:STDERR: 13 | a.x = 12;
// CHECK:STDERR: | ~ ^
// CHECK:STDERR:
a.x = 12;
// CHECK:STDERR: fail_nonexistent_field.carbon:[[@LINE+4]]:5: error: no member named 'y' in 'Carbon::A' [CppInteropParseError]
// CHECK:STDERR: fail_nonexistent_field.carbon:[[@LINE+4]]:5: error: no member named 'y' in 'Carbon::EmptyClass' [CppInteropParseError]
// CHECK:STDERR: 18 | a.y = 34;
// CHECK:STDERR: | ~ ^
// CHECK:STDERR:
@@ -92,7 +92,7 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class A {
class UnsupportedFieldType {
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:7: error: semantics TODO: `failed to map Carbon type to C++` [SemanticsTodo]
// CHECK:STDERR: var x: ();
// CHECK:STDERR: ^~~~~
@@ -106,14 +106,14 @@ class A {
}
inline Cpp '''
void F() {
Carbon::A a;
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::A' [CppInteropParseError]
void AccessUnsupportedField() {
Carbon::UnsupportedFieldType a;
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::UnsupportedFieldType' [CppInteropParseError]
// CHECK:STDERR: 24 | a.x;
// CHECK:STDERR: | ~ ^
// CHECK:STDERR:
a.x;
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:5: error: no member named 'y' in 'Carbon::A' [CppInteropParseError]
// CHECK:STDERR: fail_unsupported_field_type.carbon:[[@LINE+4]]:5: error: no member named 'y' in 'Carbon::UnsupportedFieldType' [CppInteropParseError]
// CHECK:STDERR: 29 | a.y;
// CHECK:STDERR: | ~ ^
// CHECK:STDERR:
@@ -125,14 +125,14 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class A {
class AdaptedClass {
adapt ();
}
inline Cpp '''
void F() {
Carbon::A a;
// CHECK:STDERR: fail_adapter.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::A' [CppInteropParseError]
void AccessAdaptedField() {
Carbon::AdaptedClass a;
// CHECK:STDERR: fail_adapter.carbon:[[@LINE+4]]:5: error: no member named 'x' in 'Carbon::AdaptedClass' [CppInteropParseError]
// CHECK:STDERR: 15 | a.x = 12;
// CHECK:STDERR: | ~ ^
// CHECK:STDERR:
@@ -145,7 +145,7 @@ library "[[@TEST_NAME]]";
import Cpp;
// This should not cause a crash.
class A {
class InvalidBaseClass {
// CHECK:STDERR: fail_invalid.carbon:[[@LINE+4]]:16: error: name `Whoops` not found [NameNotFound]
// CHECK:STDERR: extend base: Whoops;
// CHECK:STDERR: ^~~~~~
@@ -154,15 +154,15 @@ class A {
}
inline Cpp '''
Carbon::A x;
Carbon::InvalidBaseClass invalid_x;
''';
// --- fail_private_field.carbon
library "[[@TEST_NAME]]";
import Cpp;
class C {
fn Make() -> C {
class ClassWithPrivateField {
fn Make() -> ClassWithPrivateField {
return {.x = 123};
}
@@ -170,9 +170,9 @@ class C {
}
inline Cpp '''
int F() {
auto c = Carbon::C::Make();
// CHECK:STDERR: fail_private_field.carbon:[[@LINE+7]]:12: error: 'x' is a private member of 'Carbon::C' [CppInteropParseError]
int AccessPrivateField() {
auto c = Carbon::ClassWithPrivateField::Make();
// CHECK:STDERR: fail_private_field.carbon:[[@LINE+7]]:12: error: 'x' is a private member of 'Carbon::ClassWithPrivateField' [CppInteropParseError]
// CHECK:STDERR: 22 | return c.x;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_private_field.carbon:[[@LINE-9]]:16: note: implicitly declared private here [CppInteropParseNote]
@@ -14,13 +14,13 @@
library "[[@TEST_NAME]]";
import Cpp;
class C(T: type) {
class GenericClass(T: type) {
var t: T;
}
inline Cpp '''
void F() {
Carbon::C<int> c;
void FGeneric() {
Carbon::GenericClass<int> c;
c.t = 123;
}
''';
@@ -29,14 +29,14 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class C(T: type) {
class SpecificClass(T: type) {
var t: T;
}
alias A = C(i32);
alias AliasInt = SpecificClass(i32);
inline Cpp '''
void F() {
Carbon::A a;
void FSpecific() {
Carbon::AliasInt a;
a.t = 123;
}
''';
@@ -46,25 +46,25 @@ library "[[@TEST_NAME]]";
import Cpp;
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+4]]:1: error: semantics TODO: `failed to map specific type arg to C++` [SemanticsTodo]
// CHECK:STDERR: class C(T: type) {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
// CHECK:STDERR: class UnsupportedClass(T: type) {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
class C(T: type) {
class UnsupportedClass(T: type) {
var t: T;
}
alias A = C(());
alias AliasEmptyTuple = UnsupportedClass(());
inline Cpp '''
void F() {
void FUnsupported() {
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+8]]:11: error: semantics TODO: `interop with unsupported type` [SemanticsTodo]
// CHECK:STDERR: Carbon::A a;
// CHECK:STDERR: Carbon::AliasEmptyTuple a;
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+4]]:11: error: no type named 'A' in namespace 'Carbon' [CppInteropParseError]
// CHECK:STDERR: 23 | Carbon::A a;
// CHECK:STDERR: fail_unsupported_specific_arg.carbon:[[@LINE+4]]:11: error: no type named 'AliasEmptyTuple' in namespace 'Carbon' [CppInteropParseError]
// CHECK:STDERR: 23 | Carbon::AliasEmptyTuple a;
// CHECK:STDERR: | ~~~~~~~~^
// CHECK:STDERR:
Carbon::A a;
Carbon::AliasEmptyTuple a;
a.t = 123;
}
''';
@@ -73,7 +73,7 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class C(T: type) {
class ClassWithMethod(T: type) {
// CHECK:STDERR: fail_todo_generic_class_method_call.carbon:[[@LINE+4]]:3: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
// CHECK:STDERR: fn M(unused ref self) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
@@ -82,9 +82,9 @@ class C(T: type) {
}
inline Cpp '''
void F() {
Carbon::C<int> c;
// CHECK:STDERR: fail_todo_generic_class_method_call.carbon:[[@LINE+4]]:5: error: no member named 'M' in 'Carbon::C<int>' [CppInteropParseError]
void FMethodCall() {
Carbon::ClassWithMethod<int> c;
// CHECK:STDERR: fail_todo_generic_class_method_call.carbon:[[@LINE+4]]:5: error: no member named 'M' in 'Carbon::ClassWithMethod<int>' [CppInteropParseError]
// CHECK:STDERR: 19 | c.M();
// CHECK:STDERR: | ~ ^
// CHECK:STDERR:
@@ -15,15 +15,15 @@ library "[[@TEST_NAME]]";
import Cpp;
class C {
class ThreeInts {
var a: i32;
var b: i32;
var c: i32;
}
inline Cpp '''c++
static_assert(sizeof(Carbon::C) == 12);
static_assert(alignof(Carbon::C) == 4);
static_assert(sizeof(Carbon::ThreeInts) == 12);
static_assert(alignof(Carbon::ThreeInts) == 4);
''';
// --- packed.carbon
@@ -31,19 +31,19 @@ library "[[@TEST_NAME]]";
import Cpp;
class C {
class PointerInt {
var a: i32*;
var b: i32;
}
class D {
var c: C;
class PointerIntInt {
var c: PointerInt;
var d: i32;
}
inline Cpp '''c++
static_assert(sizeof(Carbon::C) == 12);
static_assert(alignof(Carbon::C) == 8);
static_assert(sizeof(Carbon::D) == 16);
static_assert(alignof(Carbon::D) == 8);
static_assert(sizeof(Carbon::PointerInt) == 12);
static_assert(alignof(Carbon::PointerInt) == 8);
static_assert(sizeof(Carbon::PointerIntInt) == 16);
static_assert(alignof(Carbon::PointerIntInt) == 8);
''';
@@ -14,13 +14,13 @@
library "[[@TEST_NAME]]";
import Cpp;
class C {
class StaticMethodClass {
fn M();
}
inline Cpp '''
void F() {
Carbon::C::M();
void StaticMethod() {
Carbon::StaticMethodClass::M();
}
''';
@@ -28,13 +28,13 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class C {
class MethodLValueClass {
fn M(self);
}
inline Cpp '''
void F() {
Carbon::C c;
void MethodLValue() {
Carbon::MethodLValueClass c;
c.M();
}
''';
@@ -43,13 +43,13 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class C {
class MethodRValueClass {
fn M(self);
}
inline Cpp '''
void F() {
Carbon::C().M();
void MethodRValue() {
Carbon::MethodRValueClass().M();
}
''';
@@ -57,12 +57,12 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class C {
class MethodConstLValueClass {
fn M(self);
}
inline Cpp '''
void F(const Carbon::C& c) {
void MethodConstLValue(const Carbon::MethodConstLValueClass& c) {
c.M();
}
''';
@@ -71,13 +71,13 @@ void F(const Carbon::C& c) {
library "[[@TEST_NAME]]";
import Cpp;
class C {
class RefMethodLValueClass {
fn M(ref self);
}
inline Cpp '''
void F() {
Carbon::C c;
void RefMethodLValue() {
Carbon::RefMethodLValueClass c;
c.M();
}
''';
@@ -86,20 +86,20 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class C {
class RefMethodRValueClass {
fn M(ref self);
}
inline Cpp '''
void F() {
void RefMethodRValue() {
// CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE+7]]:3: error: 'this' argument to member function 'M' is an rvalue, but function has non-const lvalue ref-qualifier [CppInteropParseError]
// CHECK:STDERR: 17 | Carbon::C().M();
// CHECK:STDERR: 17 | Carbon::RefMethodRValueClass().M();
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_ref_method_rvalue.carbon:[[@LINE-8]]:17: note: 'M' declared here [CppInteropParseNote]
// CHECK:STDERR: 5 | fn M(ref self);
// CHECK:STDERR: | ^
// CHECK:STDERR:
Carbon::C().M();
Carbon::RefMethodRValueClass().M();
}
''';
@@ -107,13 +107,13 @@ void F() {
library "[[@TEST_NAME]]";
import Cpp;
class C {
class RefMethodConstLValueClass {
fn M(ref self);
}
inline Cpp '''
void F(const Carbon::C& c) {
// CHECK:STDERR: fail_ref_method_const_lvalue.carbon:[[@LINE+7]]:3: error: 'this' argument to member function 'M' has type 'const Carbon::C', but function is not marked const [CppInteropParseError]
void RefMethodConstLValue(const Carbon::RefMethodConstLValueClass& c) {
// CHECK:STDERR: fail_ref_method_const_lvalue.carbon:[[@LINE+7]]:3: error: 'this' argument to member function 'M' has type 'const Carbon::RefMethodConstLValueClass', but function is not marked const [CppInteropParseError]
// CHECK:STDERR: 17 | c.M();
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_ref_method_const_lvalue.carbon:[[@LINE-8]]:17: note: 'M' declared here [CppInteropParseNote]
@@ -14,13 +14,13 @@
library "[[@TEST_NAME]]";
import Cpp;
class C {
class PublicClass {
static var x: i32 = 123;
}
inline Cpp '''
int F() {
return Carbon::C::x;
int PublicStatic() {
return Carbon::PublicClass::x;
}
''';
@@ -28,19 +28,19 @@ int F() {
library "[[@TEST_NAME]]";
import Cpp;
class C {
class PrivateClass {
private static var x: i32 = 123;
}
inline Cpp '''
int F() {
// CHECK:STDERR: fail_static_private.carbon:[[@LINE+7]]:21: error: 'x' is a private member of 'Carbon::C' [CppInteropParseError]
// CHECK:STDERR: 17 | return Carbon::C::x;
// CHECK:STDERR: | ^
int PrivateStatic() {
// CHECK:STDERR: fail_static_private.carbon:[[@LINE+7]]:32: error: 'x' is a private member of 'Carbon::PrivateClass' [CppInteropParseError]
// CHECK:STDERR: 17 | return Carbon::PrivateClass::x;
// CHECK:STDERR: | ^
// CHECK:STDERR: fail_static_private.carbon:[[@LINE-8]]:23: note: implicitly declared private here [CppInteropParseNote]
// CHECK:STDERR: 5 | private static var x: i32 = 123;
// CHECK:STDERR: | ^
// CHECK:STDERR:
return Carbon::C::x;
return Carbon::PrivateClass::x;
}
''';
File diff suppressed because it is too large Load Diff
+160 -160
View File
@@ -37,12 +37,12 @@ fn ConvertVal(d: Cpp.Derived) {
// --- static_member.h
class Base {
class StaticBase {
public:
static auto base_fn() -> void;
};
class Derived : public Base {
class StaticDerived : public StaticBase {
public:
static auto derived_fn() -> void;
};
@@ -55,20 +55,20 @@ import Cpp library "static_member.h";
fn MyF() {
//@dump-sem-ir-begin
Cpp.Base.base_fn();
Cpp.Derived.base_fn();
Cpp.Derived.derived_fn();
Cpp.StaticBase.base_fn();
Cpp.StaticDerived.base_fn();
Cpp.StaticDerived.derived_fn();
//@dump-sem-ir-end
}
// --- base_field.h
struct Base {
struct FieldBase {
int a;
int b;
};
struct Derived : Base {
struct FieldDerived : FieldBase {
int b;
};
@@ -78,26 +78,26 @@ library "[[@TEST_NAME]]";
import Cpp library "base_field.h";
fn AccessDirect(d: Cpp.Derived) -> i32 {
fn AccessDirect(d: Cpp.FieldDerived) -> i32 {
//@dump-sem-ir-begin
return d.a;
//@dump-sem-ir-end
}
fn AccessQualified(d: Cpp.Derived) -> i32 {
fn AccessQualified(d: Cpp.FieldDerived) -> i32 {
//@dump-sem-ir-begin
return d.(Cpp.Base.b);
return d.(Cpp.FieldBase.b);
//@dump-sem-ir-end
}
// --- base_method.h
struct Base {
struct MethodBase {
void f() const;
void g() const;
};
struct Derived : Base {
struct MethodDerived : MethodBase {
void g() const;
};
@@ -107,25 +107,25 @@ library "[[@TEST_NAME]]";
import Cpp library "base_method.h";
fn CallDirect(d: Cpp.Derived) {
fn CallDirect(d: Cpp.MethodDerived) {
//@dump-sem-ir-begin
d.f();
//@dump-sem-ir-end
}
fn CallQualified(d: Cpp.Derived) {
fn CallQualified(d: Cpp.MethodDerived) {
//@dump-sem-ir-begin
d.(Cpp.Base.g)();
d.(Cpp.MethodBase.g)();
//@dump-sem-ir-end
}
fn CallBaseQualifiedByDerived(d: Cpp.Derived, b: Cpp.Base) {
fn CallBaseQualifiedByDerived(d: Cpp.MethodDerived, b: Cpp.MethodBase) {
//@dump-sem-ir-begin
// `Cpp.Derived.f` names a member of `Cpp.Base`, so we allow that to be used
// when `self` is a `Cpp.Base` or anything that implicitly converts to
// `Cpp.Base`, such as `Cpp.Derived`.
d.(Cpp.Derived.f)();
b.(Cpp.Derived.f)();
// `Cpp.MethodDerived.f` names a member of `Cpp.MethodBase`, so we allow
// that to be used when `self` is a `Cpp.MethodBase` or anything that
// implicitly converts to `Cpp.MethodBase`, such as `Cpp.MethodDerived`.
d.(Cpp.MethodDerived.f)();
b.(Cpp.MethodDerived.f)();
//@dump-sem-ir-end
}
@@ -285,10 +285,10 @@ fn ConvertOnePolymorphicBaseToPolymorphic1(p: Cpp.OnePolymorphicBase*) -> Cpp.Po
// --- virtual_inheritance.h
struct A { int a; };
struct B : virtual A {};
struct VirtA { int a; };
struct VirtB : virtual VirtA {};
void UseB(B * _Nonnull p);
void UseB(VirtB * _Nonnull p);
// --- use_virtual_inheritance_incomplete.carbon
@@ -296,8 +296,8 @@ library "[[@TEST_NAME]]";
import Cpp library "virtual_inheritance.h";
fn Convert(p: Cpp.B*) {
// OK, doesn't require `Cpp.B` to be a complete type.
fn Convert(p: Cpp.VirtB*) {
// OK, doesn't require `Cpp.VirtB` to be a complete type.
Cpp.UseB(p);
}
@@ -307,11 +307,11 @@ library "[[@TEST_NAME]]";
import Cpp library "virtual_inheritance.h";
fn Convert(p: Cpp.B*) -> Cpp.A* {
// CHECK:STDERR: fail_todo_use_virtual_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.B*` to `Cpp.A*` [ConversionFailure]
fn Convert(p: Cpp.VirtB*) -> Cpp.VirtA* {
// CHECK:STDERR: fail_todo_use_virtual_inheritance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.VirtB*` to `Cpp.VirtA*` [ConversionFailure]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_todo_use_virtual_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.B*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fail_todo_use_virtual_inheritance.carbon:[[@LINE+4]]:3: note: type `Cpp.VirtB*` does not implement interface `Core.ImplicitAs(Cpp.VirtA*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
@@ -320,19 +320,19 @@ fn Convert(p: Cpp.B*) -> Cpp.A* {
// --- diamond.h
struct A {
struct DiamondA {
int a;
};
struct B : virtual A {
struct DiamondB : virtual DiamondA {
int b;
};
struct C : virtual A {
struct DiamondC : virtual DiamondA {
int c;
};
struct D : B, C {
struct DiamondD : DiamondB, DiamondC {
int d;
};
@@ -342,88 +342,88 @@ library "[[@TEST_NAME]]";
import Cpp library "diamond.h";
fn ConvertBA(p: Cpp.B*) -> Cpp.A* {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.B*` to `Cpp.A*` [ConversionFailure]
fn ConvertBA(p: Cpp.DiamondB*) -> Cpp.DiamondA* {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.DiamondB*` to `Cpp.DiamondA*` [ConversionFailure]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.B*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.DiamondB*` does not implement interface `Core.ImplicitAs(Cpp.DiamondA*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
return p;
}
fn ConvertCA(p: Cpp.C*) -> Cpp.A* {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.C*` to `Cpp.A*` [ConversionFailure]
fn ConvertCA(p: Cpp.DiamondC*) -> Cpp.DiamondA* {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.DiamondC*` to `Cpp.DiamondA*` [ConversionFailure]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.C*` does not implement interface `Core.ImplicitAs(Cpp.A*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.DiamondC*` does not implement interface `Core.ImplicitAs(Cpp.DiamondA*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
return p;
}
fn ConvertDB(p: Cpp.D*) -> Cpp.B* {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.D*` to `Cpp.B*` [ConversionFailure]
fn ConvertDB(p: Cpp.DiamondD*) -> Cpp.DiamondB* {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.DiamondD*` to `Cpp.DiamondB*` [ConversionFailure]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.D*` does not implement interface `Core.ImplicitAs(Cpp.B*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.DiamondD*` does not implement interface `Core.ImplicitAs(Cpp.DiamondB*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
return p;
}
fn ConvertDC(p: Cpp.D*) -> Cpp.C* {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.D*` to `Cpp.C*` [ConversionFailure]
fn ConvertDC(p: Cpp.DiamondD*) -> Cpp.DiamondC* {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Cpp.DiamondD*` to `Cpp.DiamondC*` [ConversionFailure]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.D*` does not implement interface `Core.ImplicitAs(Cpp.C*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:3: note: type `Cpp.DiamondD*` does not implement interface `Core.ImplicitAs(Cpp.DiamondC*)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return p;
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
return p;
}
fn AccessBA(d: Cpp.D) -> i32 {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:11: error: cannot convert expression of type `Cpp.D` to `Cpp.B` with `as` [ConversionFailure]
// CHECK:STDERR: return (d as Cpp.B).b;
// CHECK:STDERR: ^~~~~~~~~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:11: note: type `Cpp.D` does not implement interface `Core.As(Cpp.B)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return (d as Cpp.B).b;
// CHECK:STDERR: ^~~~~~~~~~
fn AccessBA(d: Cpp.DiamondD) -> i32 {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:11: error: cannot convert expression of type `Cpp.DiamondD` to `Cpp.DiamondB` with `as` [ConversionFailure]
// CHECK:STDERR: return (d as Cpp.DiamondB).b;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:11: note: type `Cpp.DiamondD` does not implement interface `Core.As(Cpp.DiamondB)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return (d as Cpp.DiamondB).b;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR:
return (d as Cpp.B).b;
return (d as Cpp.DiamondB).b;
}
fn AccessCA(d: Cpp.D) -> i32 {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:11: error: cannot convert expression of type `Cpp.D` to `Cpp.C` with `as` [ConversionFailure]
// CHECK:STDERR: return (d as Cpp.C).b;
// CHECK:STDERR: ^~~~~~~~~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:11: note: type `Cpp.D` does not implement interface `Core.As(Cpp.C)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return (d as Cpp.C).b;
// CHECK:STDERR: ^~~~~~~~~~
fn AccessCA(d: Cpp.DiamondD) -> i32 {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:11: error: cannot convert expression of type `Cpp.DiamondD` to `Cpp.DiamondC` with `as` [ConversionFailure]
// CHECK:STDERR: return (d as Cpp.DiamondC).b;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:11: note: type `Cpp.DiamondD` does not implement interface `Core.As(Cpp.DiamondC)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return (d as Cpp.DiamondC).b;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
// CHECK:STDERR:
return (d as Cpp.C).b;
return (d as Cpp.DiamondC).b;
}
fn AccessDB(d: Cpp.D) -> i32 {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:10: error: cannot implicitly convert expression of type `Cpp.D` to `Cpp.B` [ConversionFailure]
fn AccessDB(d: Cpp.DiamondD) -> i32 {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:10: error: cannot implicitly convert expression of type `Cpp.DiamondD` to `Cpp.DiamondB` [ConversionFailure]
// CHECK:STDERR: return d.b;
// CHECK:STDERR: ^~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:10: note: type `Cpp.D` does not implement interface `Core.ImplicitAs(Cpp.B)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:10: note: type `Cpp.DiamondD` does not implement interface `Core.ImplicitAs(Cpp.DiamondB)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return d.b;
// CHECK:STDERR: ^~~
// CHECK:STDERR:
return d.b;
}
fn AccessDC(d: Cpp.D) -> i32 {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:10: error: cannot implicitly convert expression of type `Cpp.D` to `Cpp.C` [ConversionFailure]
fn AccessDC(d: Cpp.DiamondD) -> i32 {
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+7]]:10: error: cannot implicitly convert expression of type `Cpp.DiamondD` to `Cpp.DiamondC` [ConversionFailure]
// CHECK:STDERR: return d.c;
// CHECK:STDERR: ^~~
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:10: note: type `Cpp.D` does not implement interface `Core.ImplicitAs(Cpp.C)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fail_todo_use_diamond.carbon:[[@LINE+4]]:10: note: type `Cpp.DiamondD` does not implement interface `Core.ImplicitAs(Cpp.DiamondC)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: return d.c;
// CHECK:STDERR: ^~~
// CHECK:STDERR:
@@ -432,7 +432,7 @@ fn AccessDC(d: Cpp.D) -> i32 {
// --- final.h
struct A final {};
struct FinalA final {};
// --- fail_derive_from_final.carbon
@@ -441,11 +441,11 @@ library "[[@TEST_NAME]]";
import Cpp library "final.h";
class B {
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+4]]:16: error: deriving from final type `A`; base type must be an `abstract` or `base` class [BaseIsFinal]
// CHECK:STDERR: extend base: Cpp.A;
// CHECK:STDERR: ^~~~~
// CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+4]]:16: error: deriving from final type `FinalA`; base type must be an `abstract` or `base` class [BaseIsFinal]
// CHECK:STDERR: extend base: Cpp.FinalA;
// CHECK:STDERR: ^~~~~~~~~~
// CHECK:STDERR:
extend base: Cpp.A;
extend base: Cpp.FinalA;
}
// --- union.h
@@ -580,61 +580,61 @@ class V {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %Base: type = class_type @Base [concrete]
// CHECK:STDOUT: %Base.base_fn.cpp_overload_set.type: type = cpp_overload_set_type @Base.base_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %Base.base_fn.cpp_overload_set.value: %Base.base_fn.cpp_overload_set.type = cpp_overload_set_value @Base.base_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %Base.base_fn.type: type = fn_type @Base.base_fn [concrete]
// CHECK:STDOUT: %Base.base_fn: %Base.base_fn.type = struct_value () [concrete]
// CHECK:STDOUT: %Derived: type = class_type @Derived [concrete]
// CHECK:STDOUT: %Derived.base_fn.cpp_overload_set.type: type = cpp_overload_set_type @Derived.base_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %Derived.base_fn.cpp_overload_set.value: %Derived.base_fn.cpp_overload_set.type = cpp_overload_set_value @Derived.base_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %Derived.derived_fn.cpp_overload_set.type: type = cpp_overload_set_type @Derived.derived_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %Derived.derived_fn.cpp_overload_set.value: %Derived.derived_fn.cpp_overload_set.type = cpp_overload_set_value @Derived.derived_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %Derived.derived_fn.type: type = fn_type @Derived.derived_fn [concrete]
// CHECK:STDOUT: %Derived.derived_fn: %Derived.derived_fn.type = struct_value () [concrete]
// CHECK:STDOUT: %StaticBase: type = class_type @StaticBase [concrete]
// CHECK:STDOUT: %StaticBase.base_fn.cpp_overload_set.type: type = cpp_overload_set_type @StaticBase.base_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticBase.base_fn.cpp_overload_set.value: %StaticBase.base_fn.cpp_overload_set.type = cpp_overload_set_value @StaticBase.base_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticBase.base_fn.type: type = fn_type @StaticBase.base_fn [concrete]
// CHECK:STDOUT: %StaticBase.base_fn: %StaticBase.base_fn.type = struct_value () [concrete]
// CHECK:STDOUT: %StaticDerived: type = class_type @StaticDerived [concrete]
// CHECK:STDOUT: %StaticDerived.base_fn.cpp_overload_set.type: type = cpp_overload_set_type @StaticDerived.base_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticDerived.base_fn.cpp_overload_set.value: %StaticDerived.base_fn.cpp_overload_set.type = cpp_overload_set_value @StaticDerived.base_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticDerived.derived_fn.cpp_overload_set.type: type = cpp_overload_set_type @StaticDerived.derived_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticDerived.derived_fn.cpp_overload_set.value: %StaticDerived.derived_fn.cpp_overload_set.type = cpp_overload_set_value @StaticDerived.derived_fn.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticDerived.derived_fn.type: type = fn_type @StaticDerived.derived_fn [concrete]
// CHECK:STDOUT: %StaticDerived.derived_fn: %StaticDerived.derived_fn.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Base = %Base.decl
// CHECK:STDOUT: .Derived = %Derived.decl
// CHECK:STDOUT: .StaticBase = %StaticBase.decl
// CHECK:STDOUT: .StaticDerived = %StaticDerived.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Base.decl: type = class_decl @Base [concrete = constants.%Base] {} {}
// CHECK:STDOUT: %Base.base_fn.cpp_overload_set.value: %Base.base_fn.cpp_overload_set.type = cpp_overload_set_value @Base.base_fn.cpp_overload_set [concrete = constants.%Base.base_fn.cpp_overload_set.value]
// CHECK:STDOUT: %Base.base_fn.decl: %Base.base_fn.type = fn_decl @Base.base_fn [concrete = constants.%Base.base_fn] {} {}
// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [concrete = constants.%Derived] {} {}
// CHECK:STDOUT: %Derived.base_fn.cpp_overload_set.value: %Derived.base_fn.cpp_overload_set.type = cpp_overload_set_value @Derived.base_fn.cpp_overload_set [concrete = constants.%Derived.base_fn.cpp_overload_set.value]
// CHECK:STDOUT: %Derived.derived_fn.cpp_overload_set.value: %Derived.derived_fn.cpp_overload_set.type = cpp_overload_set_value @Derived.derived_fn.cpp_overload_set [concrete = constants.%Derived.derived_fn.cpp_overload_set.value]
// CHECK:STDOUT: %Derived.derived_fn.decl: %Derived.derived_fn.type = fn_decl @Derived.derived_fn [concrete = constants.%Derived.derived_fn] {} {}
// CHECK:STDOUT: %StaticBase.decl: type = class_decl @StaticBase [concrete = constants.%StaticBase] {} {}
// CHECK:STDOUT: %StaticBase.base_fn.cpp_overload_set.value: %StaticBase.base_fn.cpp_overload_set.type = cpp_overload_set_value @StaticBase.base_fn.cpp_overload_set [concrete = constants.%StaticBase.base_fn.cpp_overload_set.value]
// CHECK:STDOUT: %StaticBase.base_fn.decl: %StaticBase.base_fn.type = fn_decl @StaticBase.base_fn [concrete = constants.%StaticBase.base_fn] {} {}
// CHECK:STDOUT: %StaticDerived.decl: type = class_decl @StaticDerived [concrete = constants.%StaticDerived] {} {}
// CHECK:STDOUT: %StaticDerived.base_fn.cpp_overload_set.value: %StaticDerived.base_fn.cpp_overload_set.type = cpp_overload_set_value @StaticDerived.base_fn.cpp_overload_set [concrete = constants.%StaticDerived.base_fn.cpp_overload_set.value]
// CHECK:STDOUT: %StaticDerived.derived_fn.cpp_overload_set.value: %StaticDerived.derived_fn.cpp_overload_set.type = cpp_overload_set_value @StaticDerived.derived_fn.cpp_overload_set [concrete = constants.%StaticDerived.derived_fn.cpp_overload_set.value]
// CHECK:STDOUT: %StaticDerived.derived_fn.decl: %StaticDerived.derived_fn.type = fn_decl @StaticDerived.derived_fn [concrete = constants.%StaticDerived.derived_fn] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, imports.%Base.decl [concrete = constants.%Base]
// CHECK:STDOUT: %base_fn.ref.loc8: %Base.base_fn.cpp_overload_set.type = name_ref base_fn, imports.%Base.base_fn.cpp_overload_set.value [concrete = constants.%Base.base_fn.cpp_overload_set.value]
// CHECK:STDOUT: %Base.base_fn.call.loc8: init %empty_tuple.type = call imports.%Base.base_fn.decl()
// CHECK:STDOUT: %StaticBase.ref: type = name_ref StaticBase, imports.%StaticBase.decl [concrete = constants.%StaticBase]
// CHECK:STDOUT: %base_fn.ref.loc8: %StaticBase.base_fn.cpp_overload_set.type = name_ref base_fn, imports.%StaticBase.base_fn.cpp_overload_set.value [concrete = constants.%StaticBase.base_fn.cpp_overload_set.value]
// CHECK:STDOUT: %StaticBase.base_fn.call.loc8: init %empty_tuple.type = call imports.%StaticBase.base_fn.decl()
// CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Derived.ref.loc9: type = name_ref Derived, imports.%Derived.decl [concrete = constants.%Derived]
// CHECK:STDOUT: %base_fn.ref.loc9: %Derived.base_fn.cpp_overload_set.type = name_ref base_fn, imports.%Derived.base_fn.cpp_overload_set.value [concrete = constants.%Derived.base_fn.cpp_overload_set.value]
// CHECK:STDOUT: %Base.base_fn.call.loc9: init %empty_tuple.type = call imports.%Base.base_fn.decl()
// CHECK:STDOUT: %StaticDerived.ref.loc9: type = name_ref StaticDerived, imports.%StaticDerived.decl [concrete = constants.%StaticDerived]
// CHECK:STDOUT: %base_fn.ref.loc9: %StaticDerived.base_fn.cpp_overload_set.type = name_ref base_fn, imports.%StaticDerived.base_fn.cpp_overload_set.value [concrete = constants.%StaticDerived.base_fn.cpp_overload_set.value]
// CHECK:STDOUT: %StaticBase.base_fn.call.loc9: init %empty_tuple.type = call imports.%StaticBase.base_fn.decl()
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Derived.ref.loc10: type = name_ref Derived, imports.%Derived.decl [concrete = constants.%Derived]
// CHECK:STDOUT: %derived_fn.ref: %Derived.derived_fn.cpp_overload_set.type = name_ref derived_fn, imports.%Derived.derived_fn.cpp_overload_set.value [concrete = constants.%Derived.derived_fn.cpp_overload_set.value]
// CHECK:STDOUT: %Derived.derived_fn.call: init %empty_tuple.type = call imports.%Derived.derived_fn.decl()
// CHECK:STDOUT: %StaticDerived.ref.loc10: type = name_ref StaticDerived, imports.%StaticDerived.decl [concrete = constants.%StaticDerived]
// CHECK:STDOUT: %derived_fn.ref: %StaticDerived.derived_fn.cpp_overload_set.type = name_ref derived_fn, imports.%StaticDerived.derived_fn.cpp_overload_set.value [concrete = constants.%StaticDerived.derived_fn.cpp_overload_set.value]
// CHECK:STDOUT: %StaticDerived.derived_fn.call: init %empty_tuple.type = call imports.%StaticDerived.derived_fn.decl()
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- use_base_field.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Derived: type = class_type @Derived [concrete]
// CHECK:STDOUT: %FieldDerived: type = class_type @FieldDerived [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %Base: type = class_type @Base [concrete]
// CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [concrete]
// CHECK:STDOUT: %FieldBase: type = class_type @FieldBase [concrete]
// CHECK:STDOUT: %FieldBase.elem: type = unbound_element_type %FieldBase, %i32 [concrete]
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic]
@@ -649,23 +649,23 @@ class V {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Derived = %Derived.decl
// CHECK:STDOUT: .Base = %Base.decl
// CHECK:STDOUT: .FieldDerived = %FieldDerived.decl
// CHECK:STDOUT: .FieldBase = %FieldBase.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [concrete = constants.%Derived] {} {}
// CHECK:STDOUT: %Base.decl: type = class_decl @Base [concrete = constants.%Base] {} {}
// CHECK:STDOUT: %FieldDerived.decl: type = class_decl @FieldDerived [concrete = constants.%FieldDerived] {} {}
// CHECK:STDOUT: %FieldBase.decl: type = class_decl @FieldBase [concrete = constants.%FieldBase] {} {}
// 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.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AccessDirect(%d.param: %Derived) -> out %return.param: %i32 {
// CHECK:STDOUT: fn @AccessDirect(%d.param: %FieldDerived) -> out %return.param: %i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
// CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.1 [concrete = @Base.%.1]
// CHECK:STDOUT: %.loc8_11.1: %Base = as_compatible %d.ref
// CHECK:STDOUT: %.loc8_11.2: ref %Base = class_element_access %.loc8_11.1, element0
// CHECK:STDOUT: %.loc8_11.3: ref %Base = converted %d.ref, %.loc8_11.2
// CHECK:STDOUT: %d.ref: %FieldDerived = name_ref d, %d
// CHECK:STDOUT: %a.ref: %FieldBase.elem = name_ref a, @FieldBase.%.1 [concrete = @FieldBase.%.1]
// CHECK:STDOUT: %.loc8_11.1: %FieldBase = as_compatible %d.ref
// CHECK:STDOUT: %.loc8_11.2: ref %FieldBase = class_element_access %.loc8_11.1, element0
// CHECK:STDOUT: %.loc8_11.3: ref %FieldBase = converted %d.ref, %.loc8_11.2
// CHECK:STDOUT: %.loc8_11.4: ref %i32 = class_element_access %.loc8_11.3, element0
// CHECK:STDOUT: %.loc8_11.5: %i32 = acquire_value %.loc8_11.4
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
@@ -676,15 +676,15 @@ class V {
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AccessQualified(%d.param: %Derived) -> out %return.param: %i32 {
// CHECK:STDOUT: fn @AccessQualified(%d.param: %FieldDerived) -> out %return.param: %i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
// CHECK:STDOUT: %d.ref: %FieldDerived = name_ref d, %d
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, imports.%Base.decl [concrete = constants.%Base]
// CHECK:STDOUT: %b.ref: %Base.elem = name_ref b, @Base.%.2 [concrete = @Base.%.2]
// CHECK:STDOUT: %.loc14_11.1: %Base = as_compatible %d.ref
// CHECK:STDOUT: %.loc14_11.2: ref %Base = class_element_access %.loc14_11.1, element0
// CHECK:STDOUT: %.loc14_11.3: ref %Base = converted %d.ref, %.loc14_11.2
// CHECK:STDOUT: %FieldBase.ref: type = name_ref FieldBase, imports.%FieldBase.decl [concrete = constants.%FieldBase]
// CHECK:STDOUT: %b.ref: %FieldBase.elem = name_ref b, @FieldBase.%.2 [concrete = @FieldBase.%.2]
// CHECK:STDOUT: %.loc14_11.1: %FieldBase = as_compatible %d.ref
// CHECK:STDOUT: %.loc14_11.2: ref %FieldBase = class_element_access %.loc14_11.1, element0
// CHECK:STDOUT: %.loc14_11.3: ref %FieldBase = converted %d.ref, %.loc14_11.2
// CHECK:STDOUT: %.loc14_11.4: ref %i32 = class_element_access %.loc14_11.3, element1
// CHECK:STDOUT: %.loc14_11.5: %i32 = acquire_value %.loc14_11.4
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
@@ -698,34 +698,34 @@ class V {
// CHECK:STDOUT: --- use_base_method.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Derived: type = class_type @Derived [concrete]
// CHECK:STDOUT: %MethodDerived: type = class_type @MethodDerived [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %Base: type = class_type @Base [concrete]
// CHECK:STDOUT: %Derived.f.cpp_overload_set.type: type = cpp_overload_set_type @Derived.f.cpp_overload_set [concrete]
// CHECK:STDOUT: %Derived.f.cpp_overload_set.value: %Derived.f.cpp_overload_set.type = cpp_overload_set_value @Derived.f.cpp_overload_set [concrete]
// CHECK:STDOUT: %MethodBase: type = class_type @MethodBase [concrete]
// CHECK:STDOUT: %MethodDerived.f.cpp_overload_set.type: type = cpp_overload_set_type @MethodDerived.f.cpp_overload_set [concrete]
// CHECK:STDOUT: %MethodDerived.f.cpp_overload_set.value: %MethodDerived.f.cpp_overload_set.type = cpp_overload_set_value @MethodDerived.f.cpp_overload_set [concrete]
// CHECK:STDOUT: %f__carbon_thunk.type: type = fn_type @f__carbon_thunk [concrete]
// CHECK:STDOUT: %f__carbon_thunk: %f__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %Base.g.cpp_overload_set.type: type = cpp_overload_set_type @Base.g.cpp_overload_set [concrete]
// CHECK:STDOUT: %Base.g.cpp_overload_set.value: %Base.g.cpp_overload_set.type = cpp_overload_set_value @Base.g.cpp_overload_set [concrete]
// CHECK:STDOUT: %MethodBase.g.cpp_overload_set.type: type = cpp_overload_set_type @MethodBase.g.cpp_overload_set [concrete]
// CHECK:STDOUT: %MethodBase.g.cpp_overload_set.value: %MethodBase.g.cpp_overload_set.type = cpp_overload_set_value @MethodBase.g.cpp_overload_set [concrete]
// CHECK:STDOUT: %g__carbon_thunk.type: type = fn_type @g__carbon_thunk [concrete]
// CHECK:STDOUT: %g__carbon_thunk: %g__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Derived = %Derived.decl
// CHECK:STDOUT: .Base = %Base.decl
// CHECK:STDOUT: .MethodDerived = %MethodDerived.decl
// CHECK:STDOUT: .MethodBase = %MethodBase.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [concrete = constants.%Derived] {} {}
// CHECK:STDOUT: %Base.decl: type = class_decl @Base [concrete = constants.%Base] {} {}
// CHECK:STDOUT: %Derived.f.cpp_overload_set.value: %Derived.f.cpp_overload_set.type = cpp_overload_set_value @Derived.f.cpp_overload_set [concrete = constants.%Derived.f.cpp_overload_set.value]
// CHECK:STDOUT: %MethodDerived.decl: type = class_decl @MethodDerived [concrete = constants.%MethodDerived] {} {}
// CHECK:STDOUT: %MethodBase.decl: type = class_decl @MethodBase [concrete = constants.%MethodBase] {} {}
// CHECK:STDOUT: %MethodDerived.f.cpp_overload_set.value: %MethodDerived.f.cpp_overload_set.type = cpp_overload_set_value @MethodDerived.f.cpp_overload_set [concrete = constants.%MethodDerived.f.cpp_overload_set.value]
// CHECK:STDOUT: %f__carbon_thunk.decl: %f__carbon_thunk.type = fn_decl @f__carbon_thunk [concrete = constants.%f__carbon_thunk] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Base.g.cpp_overload_set.value: %Base.g.cpp_overload_set.type = cpp_overload_set_value @Base.g.cpp_overload_set [concrete = constants.%Base.g.cpp_overload_set.value]
// CHECK:STDOUT: %MethodBase.g.cpp_overload_set.value: %MethodBase.g.cpp_overload_set.type = cpp_overload_set_value @MethodBase.g.cpp_overload_set [concrete = constants.%MethodBase.g.cpp_overload_set.value]
// CHECK:STDOUT: %g__carbon_thunk.decl: %g__carbon_thunk.type = fn_decl @g__carbon_thunk [concrete = constants.%g__carbon_thunk] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
@@ -733,50 +733,50 @@ class V {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallDirect(%d.param: %Derived) {
// CHECK:STDOUT: fn @CallDirect(%d.param: %MethodDerived) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
// CHECK:STDOUT: %f.ref: %Derived.f.cpp_overload_set.type = name_ref f, imports.%Derived.f.cpp_overload_set.value [concrete = constants.%Derived.f.cpp_overload_set.value]
// CHECK:STDOUT: %d.ref: %MethodDerived = name_ref d, %d
// CHECK:STDOUT: %f.ref: %MethodDerived.f.cpp_overload_set.type = name_ref f, imports.%MethodDerived.f.cpp_overload_set.value [concrete = constants.%MethodDerived.f.cpp_overload_set.value]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %d.ref, %f.ref
// CHECK:STDOUT: %.loc8_3.1: %Base = as_compatible %d.ref
// CHECK:STDOUT: %.loc8_3.2: ref %Base = class_element_access %.loc8_3.1, element0
// CHECK:STDOUT: %.loc8_3.3: ref %Base = converted %d.ref, %.loc8_3.2
// CHECK:STDOUT: %.loc8_3.4: %Base = acquire_value %.loc8_3.3
// CHECK:STDOUT: %.loc8_3.1: %MethodBase = as_compatible %d.ref
// CHECK:STDOUT: %.loc8_3.2: ref %MethodBase = class_element_access %.loc8_3.1, element0
// CHECK:STDOUT: %.loc8_3.3: ref %MethodBase = converted %d.ref, %.loc8_3.2
// CHECK:STDOUT: %.loc8_3.4: %MethodBase = acquire_value %.loc8_3.3
// CHECK:STDOUT: %f__carbon_thunk.call: init %empty_tuple.type = call imports.%f__carbon_thunk.decl(%.loc8_3.4)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallQualified(%d.param: %Derived) {
// CHECK:STDOUT: fn @CallQualified(%d.param: %MethodDerived) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
// CHECK:STDOUT: %d.ref: %MethodDerived = name_ref d, %d
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Base.ref: type = name_ref Base, imports.%Base.decl [concrete = constants.%Base]
// CHECK:STDOUT: %g.ref: %Base.g.cpp_overload_set.type = name_ref g, imports.%Base.g.cpp_overload_set.value [concrete = constants.%Base.g.cpp_overload_set.value]
// CHECK:STDOUT: %MethodBase.ref: type = name_ref MethodBase, imports.%MethodBase.decl [concrete = constants.%MethodBase]
// CHECK:STDOUT: %g.ref: %MethodBase.g.cpp_overload_set.type = name_ref g, imports.%MethodBase.g.cpp_overload_set.value [concrete = constants.%MethodBase.g.cpp_overload_set.value]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %d.ref, %g.ref
// CHECK:STDOUT: %.loc14_3.1: %Base = as_compatible %d.ref
// CHECK:STDOUT: %.loc14_3.2: ref %Base = class_element_access %.loc14_3.1, element0
// CHECK:STDOUT: %.loc14_3.3: ref %Base = converted %d.ref, %.loc14_3.2
// CHECK:STDOUT: %.loc14_3.4: %Base = acquire_value %.loc14_3.3
// CHECK:STDOUT: %.loc14_3.1: %MethodBase = as_compatible %d.ref
// CHECK:STDOUT: %.loc14_3.2: ref %MethodBase = class_element_access %.loc14_3.1, element0
// CHECK:STDOUT: %.loc14_3.3: ref %MethodBase = converted %d.ref, %.loc14_3.2
// CHECK:STDOUT: %.loc14_3.4: %MethodBase = acquire_value %.loc14_3.3
// CHECK:STDOUT: %g__carbon_thunk.call: init %empty_tuple.type = call imports.%g__carbon_thunk.decl(%.loc14_3.4)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallBaseQualifiedByDerived(%d.param: %Derived, %b.param: %Base) {
// CHECK:STDOUT: fn @CallBaseQualifiedByDerived(%d.param: %MethodDerived, %b.param: %MethodBase) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
// CHECK:STDOUT: %d.ref: %MethodDerived = name_ref d, %d
// CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Derived.ref.loc23: type = name_ref Derived, imports.%Derived.decl [concrete = constants.%Derived]
// CHECK:STDOUT: %f.ref.loc23: %Derived.f.cpp_overload_set.type = name_ref f, imports.%Derived.f.cpp_overload_set.value [concrete = constants.%Derived.f.cpp_overload_set.value]
// CHECK:STDOUT: %MethodDerived.ref.loc23: type = name_ref MethodDerived, imports.%MethodDerived.decl [concrete = constants.%MethodDerived]
// CHECK:STDOUT: %f.ref.loc23: %MethodDerived.f.cpp_overload_set.type = name_ref f, imports.%MethodDerived.f.cpp_overload_set.value [concrete = constants.%MethodDerived.f.cpp_overload_set.value]
// CHECK:STDOUT: %bound_method.loc23: <bound method> = bound_method %d.ref, %f.ref.loc23
// CHECK:STDOUT: %.loc23_3.1: %Base = as_compatible %d.ref
// CHECK:STDOUT: %.loc23_3.2: ref %Base = class_element_access %.loc23_3.1, element0
// CHECK:STDOUT: %.loc23_3.3: ref %Base = converted %d.ref, %.loc23_3.2
// CHECK:STDOUT: %.loc23_3.4: %Base = acquire_value %.loc23_3.3
// CHECK:STDOUT: %.loc23_3.1: %MethodBase = as_compatible %d.ref
// CHECK:STDOUT: %.loc23_3.2: ref %MethodBase = class_element_access %.loc23_3.1, element0
// CHECK:STDOUT: %.loc23_3.3: ref %MethodBase = converted %d.ref, %.loc23_3.2
// CHECK:STDOUT: %.loc23_3.4: %MethodBase = acquire_value %.loc23_3.3
// CHECK:STDOUT: %f__carbon_thunk.call.loc23: init %empty_tuple.type = call imports.%f__carbon_thunk.decl(%.loc23_3.4)
// CHECK:STDOUT: %b.ref: %Base = name_ref b, %b
// CHECK:STDOUT: %b.ref: %MethodBase = name_ref b, %b
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Derived.ref.loc24: type = name_ref Derived, imports.%Derived.decl [concrete = constants.%Derived]
// CHECK:STDOUT: %f.ref.loc24: %Derived.f.cpp_overload_set.type = name_ref f, imports.%Derived.f.cpp_overload_set.value [concrete = constants.%Derived.f.cpp_overload_set.value]
// CHECK:STDOUT: %MethodDerived.ref.loc24: type = name_ref MethodDerived, imports.%MethodDerived.decl [concrete = constants.%MethodDerived]
// CHECK:STDOUT: %f.ref.loc24: %MethodDerived.f.cpp_overload_set.type = name_ref f, imports.%MethodDerived.f.cpp_overload_set.value [concrete = constants.%MethodDerived.f.cpp_overload_set.value]
// CHECK:STDOUT: %bound_method.loc24: <bound method> = bound_method %b.ref, %f.ref.loc24
// CHECK:STDOUT: %f__carbon_thunk.call.loc24: init %empty_tuple.type = call imports.%f__carbon_thunk.decl(%b.ref)
// CHECK:STDOUT: <elided>
+148 -148
View File
@@ -16,7 +16,7 @@
// --- declaration.h
class Bar;
class DeclBar;
// --- import_declaration.carbon
@@ -25,7 +25,7 @@ library "[[@TEST_NAME]]";
import Cpp library "declaration.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar*);
fn MyF(bar: Cpp.DeclBar*);
//@dump-sem-ir-end
// --- fail_use_declaration_as_definition.carbon
@@ -35,15 +35,15 @@ library "[[@TEST_NAME]]";
import Cpp library "declaration.h";
fn MyF() {
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:19: error: binding pattern has incomplete type `Bar` in name binding declaration [IncompleteTypeInBindingDecl]
// CHECK:STDERR: var unused bar: Cpp.Bar;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:19: error: binding pattern has incomplete type `DeclBar` in name binding declaration [IncompleteTypeInBindingDecl]
// CHECK:STDERR: var unused bar: Cpp.DeclBar;
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
// CHECK:STDERR: ./declaration.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: class Bar;
// CHECK:STDERR: class DeclBar;
// CHECK:STDERR: ^
// CHECK:STDERR:
var unused bar: Cpp.Bar;
var unused bar: Cpp.DeclBar;
}
// ============================================================================
@@ -52,7 +52,7 @@ fn MyF() {
// --- definition.h
class Bar {};
class DefBar {};
// --- import_definition.carbon
@@ -61,7 +61,7 @@ library "[[@TEST_NAME]]";
import Cpp library "definition.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar*);
fn MyF(bar: Cpp.DefBar*);
//@dump-sem-ir-end
// ============================================================================
@@ -70,8 +70,8 @@ fn MyF(bar: Cpp.Bar*);
// --- declaration_and_definition.h
class Bar;
class Bar {};
class DeclDefBar;
class DeclDefBar {};
// --- import_declaration_and_definition.carbon
@@ -80,7 +80,7 @@ library "[[@TEST_NAME]]";
import Cpp library "declaration_and_definition.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar*);
fn MyF(bar: Cpp.DeclDefBar*);
//@dump-sem-ir-end
// ============================================================================
@@ -89,7 +89,7 @@ fn MyF(bar: Cpp.Bar*);
// --- static_member_function.h
class Bar {
class StaticMemberFnBar {
public:
static auto foo() -> void;
};
@@ -102,7 +102,7 @@ import Cpp library "static_member_function.h";
fn MyF() {
//@dump-sem-ir-begin
Cpp.Bar.foo();
Cpp.StaticMemberFnBar.foo();
//@dump-sem-ir-end
}
@@ -112,9 +112,9 @@ fn MyF() {
// --- static_data_member.h
class Bar {
class StaticDataMemberBar {
public:
static Bar* _Nonnull foo;
static StaticDataMemberBar* _Nonnull foo;
};
// --- import_static_data_member.carbon
@@ -125,7 +125,7 @@ import Cpp library "static_data_member.h";
fn MyF() {
//@dump-sem-ir-begin
let unused bar: Cpp.Bar* = Cpp.Bar.foo;
let unused bar: Cpp.StaticDataMemberBar* = Cpp.StaticDataMemberBar.foo;
//@dump-sem-ir-end
}
@@ -135,9 +135,9 @@ fn MyF() {
// --- data_member.h
class Bar {
class DataMemberBar {
public:
Bar* _Nonnull foo;
DataMemberBar* _Nonnull foo;
};
// --- import_data_member.carbon
@@ -147,8 +147,8 @@ library "[[@TEST_NAME]]";
import Cpp library "data_member.h";
//@dump-sem-ir-begin
fn MyF(bar : Cpp.Bar*) {
let unused foo_bar: Cpp.Bar* = bar->foo;
fn MyF(bar : Cpp.DataMemberBar*) {
let unused foo_bar: Cpp.DataMemberBar* = bar->foo;
}
//@dump-sem-ir-end
@@ -158,9 +158,9 @@ fn MyF(bar : Cpp.Bar*) {
// --- dynamic.h
class Bar {
class DynamicBar {
public:
virtual ~Bar();
virtual ~DynamicBar();
virtual void f();
};
@@ -171,7 +171,7 @@ library "[[@TEST_NAME]]";
import Cpp library "dynamic.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar*) {
fn MyF(bar: Cpp.DynamicBar*) {
bar->f();
}
//@dump-sem-ir-end
@@ -182,7 +182,7 @@ fn MyF(bar: Cpp.Bar*) {
// --- to_inherit_public.h
class Bar {
class ToInheritBar {
public:
static auto foo() -> void;
};
@@ -195,7 +195,7 @@ import Cpp library "to_inherit_public.h";
//@dump-sem-ir-begin
class Derived {
extend base: Cpp.Bar;
extend base: Cpp.ToInheritBar;
}
fn MyF() {
@@ -212,7 +212,7 @@ fn MyF() {
struct X {};
template<typename T>
class Bar {};
class TemplateBar {};
// --- import_template.carbon
@@ -221,7 +221,7 @@ library "[[@TEST_NAME]]";
import Cpp library "template.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar(Cpp.X)*);
fn MyF(bar: Cpp.TemplateBar(Cpp.X)*);
//@dump-sem-ir-end
// --- fail_copy_witness_of_incomplete_class.carbon
@@ -255,8 +255,8 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: --- import_declaration.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %DeclBar: type = class_type @DeclBar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %DeclBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
@@ -266,10 +266,10 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DeclBar = %DeclBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %DeclBar.decl: type = class_decl @DeclBar [concrete = constants.%DeclBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -280,8 +280,8 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: %bar.param: %ptr = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: %DeclBar.ref: type = name_ref DeclBar, imports.%DeclBar.decl [concrete = constants.%DeclBar]
// CHECK:STDOUT: %ptr: type = ptr_type %DeclBar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
@@ -292,8 +292,8 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: --- import_definition.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %DefBar: type = class_type @DefBar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %DefBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
@@ -303,10 +303,10 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DefBar = %DefBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %DefBar.decl: type = class_decl @DefBar [concrete = constants.%DefBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -317,8 +317,8 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: %bar.param: %ptr = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: %DefBar.ref: type = name_ref DefBar, imports.%DefBar.decl [concrete = constants.%DefBar]
// CHECK:STDOUT: %ptr: type = ptr_type %DefBar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
@@ -329,8 +329,8 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: --- import_declaration_and_definition.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %DeclDefBar: type = class_type @DeclDefBar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %DeclDefBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
@@ -340,10 +340,10 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DeclDefBar = %DeclDefBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %DeclDefBar.decl: type = class_decl @DeclDefBar [concrete = constants.%DeclDefBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -354,8 +354,8 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: %bar.param: %ptr = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: %DeclDefBar.ref: type = name_ref DeclDefBar, imports.%DeclDefBar.decl [concrete = constants.%DeclDefBar]
// CHECK:STDOUT: %ptr: type = ptr_type %DeclDefBar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
@@ -367,38 +367,38 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.type: type = cpp_overload_set_type @Bar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.value: %Bar.foo.cpp_overload_set.type = cpp_overload_set_value @Bar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %Bar.foo.type: type = fn_type @Bar.foo [concrete]
// CHECK:STDOUT: %Bar.foo: %Bar.foo.type = struct_value () [concrete]
// CHECK:STDOUT: %StaticMemberFnBar: type = class_type @StaticMemberFnBar [concrete]
// CHECK:STDOUT: %StaticMemberFnBar.foo.cpp_overload_set.type: type = cpp_overload_set_type @StaticMemberFnBar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticMemberFnBar.foo.cpp_overload_set.value: %StaticMemberFnBar.foo.cpp_overload_set.type = cpp_overload_set_value @StaticMemberFnBar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticMemberFnBar.foo.type: type = fn_type @StaticMemberFnBar.foo [concrete]
// CHECK:STDOUT: %StaticMemberFnBar.foo: %StaticMemberFnBar.foo.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .StaticMemberFnBar = %StaticMemberFnBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.value: %Bar.foo.cpp_overload_set.type = cpp_overload_set_value @Bar.foo.cpp_overload_set [concrete = constants.%Bar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %Bar.foo.decl: %Bar.foo.type = fn_decl @Bar.foo [concrete = constants.%Bar.foo] {} {}
// CHECK:STDOUT: %StaticMemberFnBar.decl: type = class_decl @StaticMemberFnBar [concrete = constants.%StaticMemberFnBar] {} {}
// CHECK:STDOUT: %StaticMemberFnBar.foo.cpp_overload_set.value: %StaticMemberFnBar.foo.cpp_overload_set.type = cpp_overload_set_value @StaticMemberFnBar.foo.cpp_overload_set [concrete = constants.%StaticMemberFnBar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %StaticMemberFnBar.foo.decl: %StaticMemberFnBar.foo.type = fn_decl @StaticMemberFnBar.foo [concrete = constants.%StaticMemberFnBar.foo] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %foo.ref: %Bar.foo.cpp_overload_set.type = name_ref foo, imports.%Bar.foo.cpp_overload_set.value [concrete = constants.%Bar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %Bar.foo.call: init %empty_tuple.type = call imports.%Bar.foo.decl()
// CHECK:STDOUT: %StaticMemberFnBar.ref: type = name_ref StaticMemberFnBar, imports.%StaticMemberFnBar.decl [concrete = constants.%StaticMemberFnBar]
// CHECK:STDOUT: %foo.ref: %StaticMemberFnBar.foo.cpp_overload_set.type = name_ref foo, imports.%StaticMemberFnBar.foo.cpp_overload_set.value [concrete = constants.%StaticMemberFnBar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %StaticMemberFnBar.foo.call: init %empty_tuple.type = call imports.%StaticMemberFnBar.foo.decl()
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_static_data_member.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr.227: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.227 [concrete]
// CHECK:STDOUT: %StaticDataMemberBar: type = class_type @StaticDataMemberBar [concrete]
// CHECK:STDOUT: %ptr.a89: type = ptr_type %StaticDataMemberBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.a89 [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = value_binding_pattern bar [concrete]
// CHECK:STDOUT: %foo.patt: %pattern_type = ref_binding_pattern foo [concrete]
// CHECK:STDOUT: %foo.var_patt: %pattern_type = var_pattern %foo.patt [concrete]
@@ -406,27 +406,27 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .StaticDataMemberBar = %StaticDataMemberBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %StaticDataMemberBar.decl: type = class_decl @StaticDataMemberBar [concrete = constants.%StaticDataMemberBar] {} {}
// CHECK:STDOUT: %foo.patt: %pattern_type = ref_binding_pattern foo [concrete = constants.%foo.patt]
// CHECK:STDOUT: %foo.var_patt: %pattern_type = var_pattern %foo.patt [concrete = constants.%foo.var_patt]
// CHECK:STDOUT: %foo.var: ref %ptr.227 = var_storage %foo.var_patt [concrete]
// CHECK:STDOUT: %foo.var: ref %ptr.a89 = var_storage %foo.var_patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cpp.ref.loc8_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref.loc8_33: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %foo.ref: ref %ptr.227 = name_ref foo, imports.%foo.var [concrete = imports.%foo.var]
// CHECK:STDOUT: %.loc8_37: %ptr.227 = acquire_value %foo.ref
// CHECK:STDOUT: %.loc8_26: type = splice_block %ptr [concrete = constants.%ptr.227] {
// CHECK:STDOUT: %Cpp.ref.loc8_46: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %StaticDataMemberBar.ref.loc8_49: type = name_ref StaticDataMemberBar, imports.%StaticDataMemberBar.decl [concrete = constants.%StaticDataMemberBar]
// CHECK:STDOUT: %foo.ref: ref %ptr.a89 = name_ref foo, imports.%foo.var [concrete = imports.%foo.var]
// CHECK:STDOUT: %.loc8_69: %ptr.a89 = acquire_value %foo.ref
// CHECK:STDOUT: %.loc8_42: type = splice_block %ptr [concrete = constants.%ptr.a89] {
// CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref.loc8_22: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref.loc8_22 [concrete = constants.%ptr.227]
// CHECK:STDOUT: %StaticDataMemberBar.ref.loc8_22: type = name_ref StaticDataMemberBar, imports.%StaticDataMemberBar.decl [concrete = constants.%StaticDataMemberBar]
// CHECK:STDOUT: %ptr: type = ptr_type %StaticDataMemberBar.ref.loc8_22 [concrete = constants.%ptr.a89]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr.227 = wrapper_binding bar, %.loc8_37
// CHECK:STDOUT: %bar: %ptr.a89 = wrapper_binding bar, %.loc8_69
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %bar.patt: %pattern_type = value_binding_pattern bar [concrete = constants.%bar.patt]
// CHECK:STDOUT: }
@@ -436,23 +436,23 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: --- import_data_member.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr.227: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.227 [concrete]
// CHECK:STDOUT: %DataMemberBar: type = class_type @DataMemberBar [concrete]
// CHECK:STDOUT: %ptr.ec1: type = ptr_type %DataMemberBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.ec1 [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
// CHECK:STDOUT: %MyF.type: type = fn_type @MyF [concrete]
// CHECK:STDOUT: %MyF: %MyF.type = struct_value () [concrete]
// CHECK:STDOUT: %foo_bar.patt: %pattern_type = value_binding_pattern foo_bar [concrete]
// CHECK:STDOUT: %Bar.elem: type = unbound_element_type %Bar, %ptr.227 [concrete]
// CHECK:STDOUT: %DataMemberBar.elem: type = unbound_element_type %DataMemberBar, %ptr.ec1 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DataMemberBar = %DataMemberBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %DataMemberBar.decl: type = class_decl @DataMemberBar [concrete = constants.%DataMemberBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -460,29 +460,29 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete = constants.%bar.param_patt]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete = constants.%bar.patt]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %bar.param: %ptr.227 = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr.loc7 [concrete = constants.%ptr.227] {
// CHECK:STDOUT: %bar.param: %ptr.ec1 = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr.loc7 [concrete = constants.%ptr.ec1] {
// CHECK:STDOUT: %Cpp.ref.loc7: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref.loc7: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr.loc7: type = ptr_type %Bar.ref.loc7 [concrete = constants.%ptr.227]
// CHECK:STDOUT: %DataMemberBar.ref.loc7: type = name_ref DataMemberBar, imports.%DataMemberBar.decl [concrete = constants.%DataMemberBar]
// CHECK:STDOUT: %ptr.loc7: type = ptr_type %DataMemberBar.ref.loc7 [concrete = constants.%ptr.ec1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr.227 = wrapper_binding bar, %bar.param
// CHECK:STDOUT: %bar: %ptr.ec1 = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF(%bar.param: %ptr.227) {
// CHECK:STDOUT: fn @MyF(%bar.param: %ptr.ec1) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %bar.ref: %ptr.227 = name_ref bar, %bar
// CHECK:STDOUT: %.loc8_37.1: ref %Bar = deref %bar.ref
// CHECK:STDOUT: %foo.ref: %Bar.elem = name_ref foo, @Bar.%.1 [concrete = @Bar.%.1]
// CHECK:STDOUT: %.loc8_37.2: ref %ptr.227 = class_element_access %.loc8_37.1, element0
// CHECK:STDOUT: %.loc8_37.3: %ptr.227 = acquire_value %.loc8_37.2
// CHECK:STDOUT: %.loc8_30: type = splice_block %ptr.loc8 [concrete = constants.%ptr.227] {
// CHECK:STDOUT: %bar.ref: %ptr.ec1 = name_ref bar, %bar
// CHECK:STDOUT: %.loc8_47.1: ref %DataMemberBar = deref %bar.ref
// CHECK:STDOUT: %foo.ref: %DataMemberBar.elem = name_ref foo, @DataMemberBar.%.1 [concrete = @DataMemberBar.%.1]
// CHECK:STDOUT: %.loc8_47.2: ref %ptr.ec1 = class_element_access %.loc8_47.1, element0
// CHECK:STDOUT: %.loc8_47.3: %ptr.ec1 = acquire_value %.loc8_47.2
// CHECK:STDOUT: %.loc8_40: type = splice_block %ptr.loc8 [concrete = constants.%ptr.ec1] {
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref.loc8: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr.loc8: type = ptr_type %Bar.ref.loc8 [concrete = constants.%ptr.227]
// CHECK:STDOUT: %DataMemberBar.ref.loc8: type = name_ref DataMemberBar, imports.%DataMemberBar.decl [concrete = constants.%DataMemberBar]
// CHECK:STDOUT: %ptr.loc8: type = ptr_type %DataMemberBar.ref.loc8 [concrete = constants.%ptr.ec1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %foo_bar: %ptr.227 = wrapper_binding foo_bar, %.loc8_37.3
// CHECK:STDOUT: %foo_bar: %ptr.ec1 = wrapper_binding foo_bar, %.loc8_47.3
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %foo_bar.patt: %pattern_type = value_binding_pattern foo_bar [concrete = constants.%foo_bar.patt]
// CHECK:STDOUT: }
@@ -492,62 +492,62 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: --- call_dynamic.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr.227: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %pattern_type.1b6: type = pattern_type %ptr.227 [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type.1b6 = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type.1b6 = wrapper_binding_pattern bar, %bar.param_patt [concrete]
// CHECK:STDOUT: %DynamicBar: type = class_type @DynamicBar [concrete]
// CHECK:STDOUT: %ptr.077: type = ptr_type %DynamicBar [concrete]
// CHECK:STDOUT: %pattern_type.e8d: type = pattern_type %ptr.077 [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type.e8d = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type.e8d = wrapper_binding_pattern bar, %bar.param_patt [concrete]
// CHECK:STDOUT: %MyF.type: type = fn_type @MyF [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %MyF: %MyF.type = struct_value () [concrete]
// CHECK:STDOUT: %Bar.f.type: type = fn_type @Bar.f [concrete]
// CHECK:STDOUT: %Bar.f: %Bar.f.type = struct_value () [concrete]
// CHECK:STDOUT: %Bar.f.cpp_overload_set.type: type = cpp_overload_set_type @Bar.f.cpp_overload_set [concrete]
// CHECK:STDOUT: %Bar.f.cpp_overload_set.value: %Bar.f.cpp_overload_set.type = cpp_overload_set_value @Bar.f.cpp_overload_set [concrete]
// CHECK:STDOUT: %DynamicBar.f.type: type = fn_type @DynamicBar.f [concrete]
// CHECK:STDOUT: %DynamicBar.f: %DynamicBar.f.type = struct_value () [concrete]
// CHECK:STDOUT: %DynamicBar.f.cpp_overload_set.type: type = cpp_overload_set_type @DynamicBar.f.cpp_overload_set [concrete]
// CHECK:STDOUT: %DynamicBar.f.cpp_overload_set.value: %DynamicBar.f.cpp_overload_set.type = cpp_overload_set_value @DynamicBar.f.cpp_overload_set [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DynamicBar = %DynamicBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %Bar.f.decl: %Bar.f.type = fn_decl @Bar.f [concrete = constants.%Bar.f] {
// CHECK:STDOUT: %DynamicBar.decl: type = class_decl @DynamicBar [concrete = constants.%DynamicBar] {} {}
// CHECK:STDOUT: %DynamicBar.f.decl: %DynamicBar.f.type = fn_decl @DynamicBar.f [concrete = constants.%DynamicBar.f] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.f.cpp_overload_set.value: %Bar.f.cpp_overload_set.type = cpp_overload_set_value @Bar.f.cpp_overload_set [concrete = constants.%Bar.f.cpp_overload_set.value]
// CHECK:STDOUT: %DynamicBar.f.cpp_overload_set.value: %DynamicBar.f.cpp_overload_set.type = cpp_overload_set_value @DynamicBar.f.cpp_overload_set [concrete = constants.%DynamicBar.f.cpp_overload_set.value]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %MyF.decl: %MyF.type = fn_decl @MyF [concrete = constants.%MyF] {
// CHECK:STDOUT: %bar.param_patt: %pattern_type.1b6 = value_param_pattern [concrete = constants.%bar.param_patt]
// CHECK:STDOUT: %bar.patt: %pattern_type.1b6 = wrapper_binding_pattern bar, %bar.param_patt [concrete = constants.%bar.patt]
// CHECK:STDOUT: %bar.param_patt: %pattern_type.e8d = value_param_pattern [concrete = constants.%bar.param_patt]
// CHECK:STDOUT: %bar.patt: %pattern_type.e8d = wrapper_binding_pattern bar, %bar.param_patt [concrete = constants.%bar.patt]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %bar.param: %ptr.227 = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr.227] {
// CHECK:STDOUT: %bar.param: %ptr.077 = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr.077] {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref [concrete = constants.%ptr.227]
// CHECK:STDOUT: %DynamicBar.ref: type = name_ref DynamicBar, imports.%DynamicBar.decl [concrete = constants.%DynamicBar]
// CHECK:STDOUT: %ptr: type = ptr_type %DynamicBar.ref [concrete = constants.%ptr.077]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr.227 = wrapper_binding bar, %bar.param
// CHECK:STDOUT: %bar: %ptr.077 = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: vtable @Bar.vtable {
// CHECK:STDOUT: vtable @DynamicBar.vtable {
// CHECK:STDOUT: invalid
// CHECK:STDOUT: invalid
// CHECK:STDOUT: imports.%Bar.f.decl
// CHECK:STDOUT: imports.%DynamicBar.f.decl
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF(%bar.param: %ptr.227) {
// CHECK:STDOUT: fn @MyF(%bar.param: %ptr.077) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %bar.ref: %ptr.227 = name_ref bar, %bar
// CHECK:STDOUT: %.loc8: ref %Bar = deref %bar.ref
// CHECK:STDOUT: %f.ref: %Bar.f.cpp_overload_set.type = name_ref f, imports.%Bar.f.cpp_overload_set.value [concrete = constants.%Bar.f.cpp_overload_set.value]
// CHECK:STDOUT: %bar.ref: %ptr.077 = name_ref bar, %bar
// CHECK:STDOUT: %.loc8: ref %DynamicBar = deref %bar.ref
// CHECK:STDOUT: %f.ref: %DynamicBar.f.cpp_overload_set.type = name_ref f, imports.%DynamicBar.f.cpp_overload_set.value [concrete = constants.%DynamicBar.f.cpp_overload_set.value]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc8, %f.ref
// CHECK:STDOUT: %Bar.f.call: init %empty_tuple.type = call imports.%Bar.f.decl(%.loc8)
// CHECK:STDOUT: %DynamicBar.f.call: init %empty_tuple.type = call imports.%DynamicBar.f.decl(%.loc8)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -555,27 +555,27 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Derived: type = class_type @Derived [concrete]
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ToInheritBar: type = class_type @ToInheritBar [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Bar [concrete]
// CHECK:STDOUT: %struct_type.base.825: type = struct_type {.base: %Bar} [concrete]
// CHECK:STDOUT: %complete_type.cb3: <witness> = complete_type_witness %struct_type.base.825 [concrete]
// CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %ToInheritBar [concrete]
// CHECK:STDOUT: %struct_type.base.188: type = struct_type {.base: %ToInheritBar} [concrete]
// CHECK:STDOUT: %complete_type.439: <witness> = complete_type_witness %struct_type.base.188 [concrete]
// CHECK:STDOUT: %MyF.type: type = fn_type @MyF [concrete]
// CHECK:STDOUT: %MyF: %MyF.type = struct_value () [concrete]
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.type: type = cpp_overload_set_type @Bar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.value: %Bar.foo.cpp_overload_set.type = cpp_overload_set_value @Bar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %Bar.foo.type: type = fn_type @Bar.foo [concrete]
// CHECK:STDOUT: %Bar.foo: %Bar.foo.type = struct_value () [concrete]
// CHECK:STDOUT: %ToInheritBar.foo.cpp_overload_set.type: type = cpp_overload_set_type @ToInheritBar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %ToInheritBar.foo.cpp_overload_set.value: %ToInheritBar.foo.cpp_overload_set.type = cpp_overload_set_value @ToInheritBar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %ToInheritBar.foo.type: type = fn_type @ToInheritBar.foo [concrete]
// CHECK:STDOUT: %ToInheritBar.foo: %ToInheritBar.foo.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .ToInheritBar = %ToInheritBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.value: %Bar.foo.cpp_overload_set.type = cpp_overload_set_value @Bar.foo.cpp_overload_set [concrete = constants.%Bar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %Bar.foo.decl: %Bar.foo.type = fn_decl @Bar.foo [concrete = constants.%Bar.foo] {} {}
// CHECK:STDOUT: %ToInheritBar.decl: type = class_decl @ToInheritBar [concrete = constants.%ToInheritBar] {} {}
// CHECK:STDOUT: %ToInheritBar.foo.cpp_overload_set.value: %ToInheritBar.foo.cpp_overload_set.type = cpp_overload_set_value @ToInheritBar.foo.cpp_overload_set [concrete = constants.%ToInheritBar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %ToInheritBar.foo.decl: %ToInheritBar.foo.type = fn_decl @ToInheritBar.foo [concrete = constants.%ToInheritBar.foo] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -585,34 +585,34 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %.loc8: %Derived.elem = base_decl %Bar.ref, element0 [concrete]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.825 [concrete = constants.%complete_type.cb3]
// CHECK:STDOUT: %ToInheritBar.ref: type = name_ref ToInheritBar, imports.%ToInheritBar.decl [concrete = constants.%ToInheritBar]
// CHECK:STDOUT: %.loc8: %Derived.elem = base_decl %ToInheritBar.ref, element0 [concrete]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.188 [concrete = constants.%complete_type.439]
// CHECK:STDOUT: complete_type_witness = %complete_type
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = constants.%Derived
// CHECK:STDOUT: .base = %.loc8
// CHECK:STDOUT: .foo = <poisoned>
// CHECK:STDOUT: extend %Bar.ref
// CHECK:STDOUT: extend %ToInheritBar.ref
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived]
// CHECK:STDOUT: %foo.ref: %Bar.foo.cpp_overload_set.type = name_ref foo, imports.%Bar.foo.cpp_overload_set.value [concrete = constants.%Bar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %Bar.foo.call: init %empty_tuple.type = call imports.%Bar.foo.decl()
// CHECK:STDOUT: %foo.ref: %ToInheritBar.foo.cpp_overload_set.type = name_ref foo, imports.%ToInheritBar.foo.cpp_overload_set.value [concrete = constants.%ToInheritBar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %ToInheritBar.foo.call: init %empty_tuple.type = call imports.%ToInheritBar.foo.decl()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_template.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar.type: type = cpp_type_template_type Bar [concrete]
// CHECK:STDOUT: %Bar.template: %Bar.type = struct_value () [concrete]
// CHECK:STDOUT: %TemplateBar.type: type = cpp_type_template_type TemplateBar [concrete]
// CHECK:STDOUT: %TemplateBar.template: %TemplateBar.type = struct_value () [concrete]
// CHECK:STDOUT: %X: type = class_type @X [concrete]
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %TemplateBar: type = class_type @TemplateBar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %TemplateBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
@@ -622,13 +622,13 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.template
// CHECK:STDOUT: .TemplateBar = %TemplateBar.template
// CHECK:STDOUT: .X = %X.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.template: %Bar.type = struct_value () [concrete = constants.%Bar.template]
// CHECK:STDOUT: %TemplateBar.template: %TemplateBar.type = struct_value () [concrete = constants.%TemplateBar.template]
// CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %TemplateBar.decl: type = class_decl @TemplateBar [concrete = constants.%TemplateBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -639,10 +639,10 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: %bar.param: %ptr = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref.loc7_13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: %Bar.type = name_ref Bar, imports.%Bar.template [concrete = constants.%Bar.template]
// CHECK:STDOUT: %Cpp.ref.loc7_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %TemplateBar.ref: %TemplateBar.type = name_ref TemplateBar, imports.%TemplateBar.template [concrete = constants.%TemplateBar.template]
// CHECK:STDOUT: %Cpp.ref.loc7_29: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %X.ref: type = name_ref X, imports.%X.decl [concrete = constants.%X]
// CHECK:STDOUT: %ptr: type = ptr_type imports.%Bar.decl [concrete = constants.%ptr]
// CHECK:STDOUT: %ptr: type = ptr_type imports.%TemplateBar.decl [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
File diff suppressed because it is too large Load Diff
@@ -93,12 +93,12 @@ fn GetF(a: Cpp.A) -> i32 { return a.f_4; }
// --- with_bitfields.h
struct Struct {
struct BitfieldStruct {
int a;
int b : 2;
};
union Union {
union BitfieldUnion {
int c;
int d : 3;
};
@@ -109,13 +109,13 @@ library "[[@TEST_NAME]]";
import Cpp library "with_bitfields.h";
fn F(s: Cpp.Struct) -> i32 {
fn F(s: Cpp.BitfieldStruct) -> i32 {
//@dump-sem-ir-begin
return s.a;
//@dump-sem-ir-end
}
fn G(s: Cpp.Union) -> i32 {
fn G(s: Cpp.BitfieldUnion) -> i32 {
//@dump-sem-ir-begin
return s.c;
//@dump-sem-ir-end
@@ -131,7 +131,7 @@ library "[[@TEST_NAME]]";
// CHECK:STDERR: ^
import Cpp library "with_bitfields.h";
fn F(s: Cpp.Struct) -> i32 {
fn F(s: Cpp.BitfieldStruct) -> i32 {
//@dump-sem-ir-begin
// CHECK:STDERR: fail_todo_use_bitfields.carbon:[[@LINE+8]]:10: note: in `Cpp` name lookup for `b` [InCppNameLookup]
// CHECK:STDERR: return s.b;
@@ -145,7 +145,7 @@ fn F(s: Cpp.Struct) -> i32 {
//@dump-sem-ir-end
}
fn G(s: Cpp.Union) -> i32 {
fn G(s: Cpp.BitfieldUnion) -> i32 {
//@dump-sem-ir-begin
// CHECK:STDERR: fail_todo_use_bitfields.carbon:[[@LINE+4]]:10: note: in `Cpp` name lookup for `d` [InCppNameLookup]
// CHECK:STDERR: return s.d;
@@ -405,11 +405,11 @@ fn Test(m: Cpp.UnsupportedMembers*) {
// CHECK:STDOUT: --- use_non_bitfields_in_type_with_bitfields.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Struct: type = class_type @Struct [concrete]
// CHECK:STDOUT: %BitfieldStruct: type = class_type @BitfieldStruct [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %Struct.elem: type = unbound_element_type %Struct, %i32 [concrete]
// CHECK:STDOUT: %BitfieldStruct.elem: type = unbound_element_type %BitfieldStruct, %i32 [concrete]
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic]
@@ -420,8 +420,8 @@ fn Test(m: Cpp.UnsupportedMembers*) {
// CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
// CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete]
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete]
// CHECK:STDOUT: %Union: type = class_type @Union [concrete]
// CHECK:STDOUT: %Union.elem: type = unbound_element_type %Union, %i32 [concrete]
// CHECK:STDOUT: %BitfieldUnion: type = class_type @BitfieldUnion [concrete]
// CHECK:STDOUT: %BitfieldUnion.elem: type = unbound_element_type %BitfieldUnion, %i32 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -429,10 +429,10 @@ fn Test(m: Cpp.UnsupportedMembers*) {
// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%s.param: %Struct) -> out %return.param: %i32 {
// CHECK:STDOUT: fn @F(%s.param: %BitfieldStruct) -> out %return.param: %i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %s.ref: %Struct = name_ref s, %s
// CHECK:STDOUT: %a.ref: %Struct.elem = name_ref a, @Struct.%.1 [concrete = @Struct.%.1]
// CHECK:STDOUT: %s.ref: %BitfieldStruct = name_ref s, %s
// CHECK:STDOUT: %a.ref: %BitfieldStruct.elem = name_ref a, @BitfieldStruct.%.1 [concrete = @BitfieldStruct.%.1]
// CHECK:STDOUT: %.loc8_11.1: ref %i32 = class_element_access %s.ref, element0
// CHECK:STDOUT: %.loc8_11.2: %i32 = acquire_value %.loc8_11.1
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
@@ -443,10 +443,10 @@ fn Test(m: Cpp.UnsupportedMembers*) {
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G(%s.param: %Union) -> out %return.param: %i32 {
// CHECK:STDOUT: fn @G(%s.param: %BitfieldUnion) -> out %return.param: %i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %s.ref: %Union = name_ref s, %s
// CHECK:STDOUT: %c.ref: %Union.elem = name_ref c, @Union.%.1 [concrete = @Union.%.1]
// CHECK:STDOUT: %s.ref: %BitfieldUnion = name_ref s, %s
// CHECK:STDOUT: %c.ref: %BitfieldUnion.elem = name_ref c, @BitfieldUnion.%.1 [concrete = @BitfieldUnion.%.1]
// CHECK:STDOUT: %.loc14_11.1: ref %i32 = class_element_access %s.ref, element0
// CHECK:STDOUT: %.loc14_11.2: %i32 = acquire_value %.loc14_11.1
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
@@ -460,22 +460,22 @@ fn Test(m: Cpp.UnsupportedMembers*) {
// CHECK:STDOUT: --- fail_todo_use_bitfields.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Struct: type = class_type @Struct [concrete]
// CHECK:STDOUT: %BitfieldStruct: type = class_type @BitfieldStruct [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %Union: type = class_type @Union [concrete]
// CHECK:STDOUT: %BitfieldUnion: type = class_type @BitfieldUnion [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%s.param: %Struct) -> out %return.param: %i32 {
// CHECK:STDOUT: fn @F(%s.param: %BitfieldStruct) -> out %return.param: %i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %s.ref: %Struct = name_ref s, %s
// CHECK:STDOUT: %s.ref: %BitfieldStruct = name_ref s, %s
// CHECK:STDOUT: %b.ref: <error> = name_ref b, <error> [concrete = <error>]
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G(%s.param: %Union) -> out %return.param: %i32 {
// CHECK:STDOUT: fn @G(%s.param: %BitfieldUnion) -> out %return.param: %i32 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %s.ref: %Union = name_ref s, %s
// CHECK:STDOUT: %s.ref: %BitfieldUnion = name_ref s, %s
// CHECK:STDOUT: %d.ref: <error> = name_ref d, <error> [concrete = <error>]
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
@@ -228,28 +228,28 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
library "[[@TEST_NAME]]";
import Cpp inline '''
struct ExplicitObjectParam {
void F(this ExplicitObjectParam, _BitInt(23) x);
struct ExplicitObjectParamUnsupported {
void F(this ExplicitObjectParamUnsupported, _BitInt(23) x);
};
''';
fn Call(e: Cpp.ExplicitObjectParam) {
fn Call(e: Cpp.ExplicitObjectParamUnsupported) {
// CHECK:STDERR: fail_call_explicit_object_param_with_unsupported_type_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
// CHECK:STDERR: e.(Cpp.ExplicitObjectParam.F)(1);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: e.(Cpp.ExplicitObjectParamUnsupported.F)(1);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
e.(Cpp.ExplicitObjectParam.F)(1);
e.(Cpp.ExplicitObjectParamUnsupported.F)(1);
}
// --- explicit_object_param_overloaded.h
struct Another {
struct AnotherOverloaded {
};
struct ExplicitObjectParam {
void F(this ExplicitObjectParam);
struct ExplicitObjectParamOverloaded {
void F(this ExplicitObjectParamOverloaded);
void F(this int);
void F(this Another);
void F(this AnotherOverloaded);
};
// --- call_explicit_object_param_overloaded.carbon
@@ -258,11 +258,11 @@ library "[[@TEST_NAME]]";
import Cpp library "explicit_object_param_overloaded.h";
fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) {
//@dump-sem-ir-begin
e.F();
n.(Cpp.ExplicitObjectParam.F)();
a.(Cpp.ExplicitObjectParam.F)();
n.(Cpp.ExplicitObjectParamOverloaded.F)();
a.(Cpp.ExplicitObjectParamOverloaded.F)();
//@dump-sem-ir-end
}
@@ -721,32 +721,32 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
// CHECK:STDOUT: --- call_explicit_object_param_overloaded.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %ExplicitObjectParam: type = class_type @ExplicitObjectParam [concrete]
// CHECK:STDOUT: %ExplicitObjectParamOverloaded: type = class_type @ExplicitObjectParamOverloaded [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %Another: type = class_type @Another [concrete]
// CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.type: type = cpp_overload_set_type @ExplicitObjectParam.F.cpp_overload_set [concrete]
// CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.value: %ExplicitObjectParam.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.F.cpp_overload_set [concrete]
// CHECK:STDOUT: %ptr.900: type = ptr_type %ExplicitObjectParam [concrete]
// CHECK:STDOUT: %AnotherOverloaded: type = class_type @AnotherOverloaded [concrete]
// CHECK:STDOUT: %ExplicitObjectParamOverloaded.F.cpp_overload_set.type: type = cpp_overload_set_type @ExplicitObjectParamOverloaded.F.cpp_overload_set [concrete]
// CHECK:STDOUT: %ExplicitObjectParamOverloaded.F.cpp_overload_set.value: %ExplicitObjectParamOverloaded.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParamOverloaded.F.cpp_overload_set [concrete]
// CHECK:STDOUT: %ptr.fb2: type = ptr_type %ExplicitObjectParamOverloaded [concrete]
// CHECK:STDOUT: %F__carbon_thunk.type.8cce43.1: type = fn_type @F__carbon_thunk.1 [concrete]
// CHECK:STDOUT: %F__carbon_thunk.a92106.1: %F__carbon_thunk.type.8cce43.1 = struct_value () [concrete]
// CHECK:STDOUT: %F__carbon_thunk.type.8cce43.2: type = fn_type @F__carbon_thunk.2 [concrete]
// CHECK:STDOUT: %F__carbon_thunk.a92106.2: %F__carbon_thunk.type.8cce43.2 = struct_value () [concrete]
// CHECK:STDOUT: %ptr.bad: type = ptr_type %Another [concrete]
// CHECK:STDOUT: %ptr.9e5: type = ptr_type %AnotherOverloaded [concrete]
// CHECK:STDOUT: %F__carbon_thunk.type.8cce43.3: type = fn_type @F__carbon_thunk.3 [concrete]
// CHECK:STDOUT: %F__carbon_thunk.a92106.3: %F__carbon_thunk.type.8cce43.3 = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .ExplicitObjectParam = %ExplicitObjectParam.decl
// CHECK:STDOUT: .Another = %Another.decl
// CHECK:STDOUT: .ExplicitObjectParamOverloaded = %ExplicitObjectParamOverloaded.decl
// CHECK:STDOUT: .AnotherOverloaded = %AnotherOverloaded.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %ExplicitObjectParam.decl: type = class_decl @ExplicitObjectParam [concrete = constants.%ExplicitObjectParam] {} {}
// CHECK:STDOUT: %Another.decl: type = class_decl @Another [concrete = constants.%Another] {} {}
// CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.value: %ExplicitObjectParam.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.F.cpp_overload_set [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
// CHECK:STDOUT: %ExplicitObjectParamOverloaded.decl: type = class_decl @ExplicitObjectParamOverloaded [concrete = constants.%ExplicitObjectParamOverloaded] {} {}
// CHECK:STDOUT: %AnotherOverloaded.decl: type = class_decl @AnotherOverloaded [concrete = constants.%AnotherOverloaded] {} {}
// CHECK:STDOUT: %ExplicitObjectParamOverloaded.F.cpp_overload_set.value: %ExplicitObjectParamOverloaded.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParamOverloaded.F.cpp_overload_set [concrete = constants.%ExplicitObjectParamOverloaded.F.cpp_overload_set.value]
// CHECK:STDOUT: %F__carbon_thunk.decl.828b0d.1: %F__carbon_thunk.type.8cce43.1 = fn_decl @F__carbon_thunk.1 [concrete = constants.%F__carbon_thunk.a92106.1] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
@@ -764,27 +764,27 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Call(%e.param: %ExplicitObjectParam, %n.param: %i32, %a.param: %Another) {
// CHECK:STDOUT: fn @Call(%e.param: %ExplicitObjectParamOverloaded, %n.param: %i32, %a.param: %AnotherOverloaded) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %e.ref: %ExplicitObjectParam = name_ref e, %e
// CHECK:STDOUT: %F.ref.loc8: %ExplicitObjectParam.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParam.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
// CHECK:STDOUT: %e.ref: %ExplicitObjectParamOverloaded = name_ref e, %e
// CHECK:STDOUT: %F.ref.loc8: %ExplicitObjectParamOverloaded.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParamOverloaded.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParamOverloaded.F.cpp_overload_set.value]
// CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %e.ref, %F.ref.loc8
// CHECK:STDOUT: %.loc8: ref %ExplicitObjectParam = value_as_ref %e.ref
// CHECK:STDOUT: %addr.loc8: %ptr.900 = addr_of %.loc8
// CHECK:STDOUT: %.loc8: ref %ExplicitObjectParamOverloaded = value_as_ref %e.ref
// CHECK:STDOUT: %addr.loc8: %ptr.fb2 = addr_of %.loc8
// CHECK:STDOUT: %F__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%F__carbon_thunk.decl.828b0d.1(%addr.loc8)
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
// CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %ExplicitObjectParam.ref.loc9: type = name_ref ExplicitObjectParam, imports.%ExplicitObjectParam.decl [concrete = constants.%ExplicitObjectParam]
// CHECK:STDOUT: %F.ref.loc9: %ExplicitObjectParam.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParam.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
// CHECK:STDOUT: %ExplicitObjectParamOverloaded.ref.loc9: type = name_ref ExplicitObjectParamOverloaded, imports.%ExplicitObjectParamOverloaded.decl [concrete = constants.%ExplicitObjectParamOverloaded]
// CHECK:STDOUT: %F.ref.loc9: %ExplicitObjectParamOverloaded.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParamOverloaded.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParamOverloaded.F.cpp_overload_set.value]
// CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %n.ref, %F.ref.loc9
// CHECK:STDOUT: %F__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%F__carbon_thunk.decl.828b0d.2(%n.ref)
// CHECK:STDOUT: %a.ref: %Another = name_ref a, %a
// CHECK:STDOUT: %a.ref: %AnotherOverloaded = name_ref a, %a
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %ExplicitObjectParam.ref.loc10: type = name_ref ExplicitObjectParam, imports.%ExplicitObjectParam.decl [concrete = constants.%ExplicitObjectParam]
// CHECK:STDOUT: %F.ref.loc10: %ExplicitObjectParam.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParam.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
// CHECK:STDOUT: %ExplicitObjectParamOverloaded.ref.loc10: type = name_ref ExplicitObjectParamOverloaded, imports.%ExplicitObjectParamOverloaded.decl [concrete = constants.%ExplicitObjectParamOverloaded]
// CHECK:STDOUT: %F.ref.loc10: %ExplicitObjectParamOverloaded.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParamOverloaded.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParamOverloaded.F.cpp_overload_set.value]
// CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %a.ref, %F.ref.loc10
// CHECK:STDOUT: %.loc10: ref %Another = value_as_ref %a.ref
// CHECK:STDOUT: %addr.loc10: %ptr.bad = addr_of %.loc10
// CHECK:STDOUT: %.loc10: ref %AnotherOverloaded = value_as_ref %a.ref
// CHECK:STDOUT: %addr.loc10: %ptr.9e5 = addr_of %.loc10
// CHECK:STDOUT: %F__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%F__carbon_thunk.decl.828b0d.3(%addr.loc10)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
@@ -16,7 +16,7 @@
// --- declaration.h
union Bar;
union DeclBar;
// --- import_declaration.carbon
@@ -25,7 +25,7 @@ library "[[@TEST_NAME]]";
import Cpp library "declaration.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar*);
fn MyF(bar: Cpp.DeclBar*);
//@dump-sem-ir-end
// --- fail_use_declaration_as_definition.carbon
@@ -35,15 +35,15 @@ library "[[@TEST_NAME]]";
import Cpp library "declaration.h";
fn MyF() {
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:19: error: binding pattern has incomplete type `Bar` in name binding declaration [IncompleteTypeInBindingDecl]
// CHECK:STDERR: var unused bar: Cpp.Bar;
// CHECK:STDERR: ^~~~~~~
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE+8]]:19: error: binding pattern has incomplete type `DeclBar` in name binding declaration [IncompleteTypeInBindingDecl]
// CHECK:STDERR: var unused bar: Cpp.DeclBar;
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: fail_use_declaration_as_definition.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
// CHECK:STDERR: ./declaration.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
// CHECK:STDERR: union Bar;
// CHECK:STDERR: union DeclBar;
// CHECK:STDERR: ^
// CHECK:STDERR:
var unused bar: Cpp.Bar;
var unused bar: Cpp.DeclBar;
}
// ============================================================================
@@ -52,7 +52,7 @@ fn MyF() {
// --- definition.h
union Bar {};
union DefBar {};
// --- import_definition.carbon
@@ -61,7 +61,7 @@ library "[[@TEST_NAME]]";
import Cpp library "definition.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar*);
fn MyF(bar: Cpp.DefBar*);
//@dump-sem-ir-end
// ============================================================================
@@ -70,8 +70,8 @@ fn MyF(bar: Cpp.Bar*);
// --- declaration_and_definition.h
union Bar;
union Bar {};
union DeclDefBar;
union DeclDefBar {};
// --- import_declaration_and_definition.carbon
@@ -80,7 +80,7 @@ library "[[@TEST_NAME]]";
import Cpp library "declaration_and_definition.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar*);
fn MyF(bar: Cpp.DeclDefBar*);
//@dump-sem-ir-end
// ============================================================================
@@ -89,7 +89,7 @@ fn MyF(bar: Cpp.Bar*);
// --- static_member_function.h
union Bar {
union StaticMemberFnBar {
public:
static auto foo() -> void;
};
@@ -102,7 +102,7 @@ import Cpp library "static_member_function.h";
fn MyF() {
//@dump-sem-ir-begin
Cpp.Bar.foo();
Cpp.StaticMemberFnBar.foo();
//@dump-sem-ir-end
}
@@ -112,9 +112,9 @@ fn MyF() {
// --- static_data_member.h
union Bar {
union StaticDataMemberBar {
public:
static Bar* _Nonnull foo;
static StaticDataMemberBar* _Nonnull foo;
};
// --- import_static_data_member.carbon
@@ -125,7 +125,7 @@ import Cpp library "static_data_member.h";
fn MyF() {
//@dump-sem-ir-begin
let unused bar: Cpp.Bar* = Cpp.Bar.foo;
let unused bar: Cpp.StaticDataMemberBar* = Cpp.StaticDataMemberBar.foo;
//@dump-sem-ir-end
}
@@ -135,9 +135,9 @@ fn MyF() {
// --- data_member.h
union Bar {
union DataMemberBar {
public:
Bar* _Nonnull foo;
DataMemberBar* _Nonnull foo;
};
// --- import_data_member.carbon
@@ -147,8 +147,8 @@ library "[[@TEST_NAME]]";
import Cpp library "data_member.h";
//@dump-sem-ir-begin
fn MyF(bar : Cpp.Bar*) {
let unused foo_bar: Cpp.Bar* = bar->foo;
fn MyF(bar : Cpp.DataMemberBar*) {
let unused foo_bar: Cpp.DataMemberBar* = bar->foo;
}
//@dump-sem-ir-end
@@ -161,7 +161,7 @@ fn MyF(bar : Cpp.Bar*) {
struct X {};
template<typename T>
union Bar {};
union TemplateBar {};
// --- import_template.carbon
@@ -170,14 +170,14 @@ library "[[@TEST_NAME]]";
import Cpp library "template.h";
//@dump-sem-ir-begin
fn MyF(bar: Cpp.Bar(Cpp.X)*);
fn MyF(bar: Cpp.TemplateBar(Cpp.X)*);
//@dump-sem-ir-end
// CHECK:STDOUT: --- import_declaration.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %DeclBar: type = class_type @DeclBar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %DeclBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
@@ -187,10 +187,10 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DeclBar = %DeclBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %DeclBar.decl: type = class_decl @DeclBar [concrete = constants.%DeclBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -201,8 +201,8 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: %bar.param: %ptr = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: %DeclBar.ref: type = name_ref DeclBar, imports.%DeclBar.decl [concrete = constants.%DeclBar]
// CHECK:STDOUT: %ptr: type = ptr_type %DeclBar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
@@ -213,8 +213,8 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: --- import_definition.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %DefBar: type = class_type @DefBar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %DefBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
@@ -224,10 +224,10 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DefBar = %DefBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %DefBar.decl: type = class_decl @DefBar [concrete = constants.%DefBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -238,8 +238,8 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: %bar.param: %ptr = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: %DefBar.ref: type = name_ref DefBar, imports.%DefBar.decl [concrete = constants.%DefBar]
// CHECK:STDOUT: %ptr: type = ptr_type %DefBar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
@@ -250,8 +250,8 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: --- import_declaration_and_definition.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %DeclDefBar: type = class_type @DeclDefBar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %DeclDefBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
@@ -261,10 +261,10 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DeclDefBar = %DeclDefBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %DeclDefBar.decl: type = class_decl @DeclDefBar [concrete = constants.%DeclDefBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -275,8 +275,8 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: %bar.param: %ptr = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: %DeclDefBar.ref: type = name_ref DeclDefBar, imports.%DeclDefBar.decl [concrete = constants.%DeclDefBar]
// CHECK:STDOUT: %ptr: type = ptr_type %DeclDefBar.ref [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
@@ -288,38 +288,38 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.type: type = cpp_overload_set_type @Bar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.value: %Bar.foo.cpp_overload_set.type = cpp_overload_set_value @Bar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %Bar.foo.type: type = fn_type @Bar.foo [concrete]
// CHECK:STDOUT: %Bar.foo: %Bar.foo.type = struct_value () [concrete]
// CHECK:STDOUT: %StaticMemberFnBar: type = class_type @StaticMemberFnBar [concrete]
// CHECK:STDOUT: %StaticMemberFnBar.foo.cpp_overload_set.type: type = cpp_overload_set_type @StaticMemberFnBar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticMemberFnBar.foo.cpp_overload_set.value: %StaticMemberFnBar.foo.cpp_overload_set.type = cpp_overload_set_value @StaticMemberFnBar.foo.cpp_overload_set [concrete]
// CHECK:STDOUT: %StaticMemberFnBar.foo.type: type = fn_type @StaticMemberFnBar.foo [concrete]
// CHECK:STDOUT: %StaticMemberFnBar.foo: %StaticMemberFnBar.foo.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .StaticMemberFnBar = %StaticMemberFnBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %Bar.foo.cpp_overload_set.value: %Bar.foo.cpp_overload_set.type = cpp_overload_set_value @Bar.foo.cpp_overload_set [concrete = constants.%Bar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %Bar.foo.decl: %Bar.foo.type = fn_decl @Bar.foo [concrete = constants.%Bar.foo] {} {}
// CHECK:STDOUT: %StaticMemberFnBar.decl: type = class_decl @StaticMemberFnBar [concrete = constants.%StaticMemberFnBar] {} {}
// CHECK:STDOUT: %StaticMemberFnBar.foo.cpp_overload_set.value: %StaticMemberFnBar.foo.cpp_overload_set.type = cpp_overload_set_value @StaticMemberFnBar.foo.cpp_overload_set [concrete = constants.%StaticMemberFnBar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %StaticMemberFnBar.foo.decl: %StaticMemberFnBar.foo.type = fn_decl @StaticMemberFnBar.foo [concrete = constants.%StaticMemberFnBar.foo] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %foo.ref: %Bar.foo.cpp_overload_set.type = name_ref foo, imports.%Bar.foo.cpp_overload_set.value [concrete = constants.%Bar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %Bar.foo.call: init %empty_tuple.type = call imports.%Bar.foo.decl()
// CHECK:STDOUT: %StaticMemberFnBar.ref: type = name_ref StaticMemberFnBar, imports.%StaticMemberFnBar.decl [concrete = constants.%StaticMemberFnBar]
// CHECK:STDOUT: %foo.ref: %StaticMemberFnBar.foo.cpp_overload_set.type = name_ref foo, imports.%StaticMemberFnBar.foo.cpp_overload_set.value [concrete = constants.%StaticMemberFnBar.foo.cpp_overload_set.value]
// CHECK:STDOUT: %StaticMemberFnBar.foo.call: init %empty_tuple.type = call imports.%StaticMemberFnBar.foo.decl()
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_static_data_member.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr.227: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.227 [concrete]
// CHECK:STDOUT: %StaticDataMemberBar: type = class_type @StaticDataMemberBar [concrete]
// CHECK:STDOUT: %ptr.a89: type = ptr_type %StaticDataMemberBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.a89 [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = value_binding_pattern bar [concrete]
// CHECK:STDOUT: %foo.patt: %pattern_type = ref_binding_pattern foo [concrete]
// CHECK:STDOUT: %foo.var_patt: %pattern_type = var_pattern %foo.patt [concrete]
@@ -327,27 +327,27 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .StaticDataMemberBar = %StaticDataMemberBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %StaticDataMemberBar.decl: type = class_decl @StaticDataMemberBar [concrete = constants.%StaticDataMemberBar] {} {}
// CHECK:STDOUT: %foo.patt: %pattern_type = ref_binding_pattern foo [concrete = constants.%foo.patt]
// CHECK:STDOUT: %foo.var_patt: %pattern_type = var_pattern %foo.patt [concrete = constants.%foo.var_patt]
// CHECK:STDOUT: %foo.var: ref %ptr.227 = var_storage %foo.var_patt [concrete]
// CHECK:STDOUT: %foo.var: ref %ptr.a89 = var_storage %foo.var_patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cpp.ref.loc8_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref.loc8_33: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %foo.ref: ref %ptr.227 = name_ref foo, imports.%foo.var [concrete = imports.%foo.var]
// CHECK:STDOUT: %.loc8_37: %ptr.227 = acquire_value %foo.ref
// CHECK:STDOUT: %.loc8_26: type = splice_block %ptr [concrete = constants.%ptr.227] {
// CHECK:STDOUT: %Cpp.ref.loc8_46: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %StaticDataMemberBar.ref.loc8_49: type = name_ref StaticDataMemberBar, imports.%StaticDataMemberBar.decl [concrete = constants.%StaticDataMemberBar]
// CHECK:STDOUT: %foo.ref: ref %ptr.a89 = name_ref foo, imports.%foo.var [concrete = imports.%foo.var]
// CHECK:STDOUT: %.loc8_69: %ptr.a89 = acquire_value %foo.ref
// CHECK:STDOUT: %.loc8_42: type = splice_block %ptr [concrete = constants.%ptr.a89] {
// CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref.loc8_22: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar.ref.loc8_22 [concrete = constants.%ptr.227]
// CHECK:STDOUT: %StaticDataMemberBar.ref.loc8_22: type = name_ref StaticDataMemberBar, imports.%StaticDataMemberBar.decl [concrete = constants.%StaticDataMemberBar]
// CHECK:STDOUT: %ptr: type = ptr_type %StaticDataMemberBar.ref.loc8_22 [concrete = constants.%ptr.a89]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr.227 = wrapper_binding bar, %.loc8_37
// CHECK:STDOUT: %bar: %ptr.a89 = wrapper_binding bar, %.loc8_69
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %bar.patt: %pattern_type = value_binding_pattern bar [concrete = constants.%bar.patt]
// CHECK:STDOUT: }
@@ -357,23 +357,23 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: --- import_data_member.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr.227: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.227 [concrete]
// CHECK:STDOUT: %DataMemberBar: type = class_type @DataMemberBar [concrete]
// CHECK:STDOUT: %ptr.ec1: type = ptr_type %DataMemberBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.ec1 [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
// CHECK:STDOUT: %MyF.type: type = fn_type @MyF [concrete]
// CHECK:STDOUT: %MyF: %MyF.type = struct_value () [concrete]
// CHECK:STDOUT: %foo_bar.patt: %pattern_type = value_binding_pattern foo_bar [concrete]
// CHECK:STDOUT: %Bar.elem: type = unbound_element_type %Bar, %ptr.227 [concrete]
// CHECK:STDOUT: %DataMemberBar.elem: type = unbound_element_type %DataMemberBar, %ptr.ec1 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.decl
// CHECK:STDOUT: .DataMemberBar = %DataMemberBar.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %DataMemberBar.decl: type = class_decl @DataMemberBar [concrete = constants.%DataMemberBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -381,29 +381,29 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete = constants.%bar.param_patt]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete = constants.%bar.patt]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %bar.param: %ptr.227 = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr.loc7 [concrete = constants.%ptr.227] {
// CHECK:STDOUT: %bar.param: %ptr.ec1 = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr.loc7 [concrete = constants.%ptr.ec1] {
// CHECK:STDOUT: %Cpp.ref.loc7: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref.loc7: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr.loc7: type = ptr_type %Bar.ref.loc7 [concrete = constants.%ptr.227]
// CHECK:STDOUT: %DataMemberBar.ref.loc7: type = name_ref DataMemberBar, imports.%DataMemberBar.decl [concrete = constants.%DataMemberBar]
// CHECK:STDOUT: %ptr.loc7: type = ptr_type %DataMemberBar.ref.loc7 [concrete = constants.%ptr.ec1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr.227 = wrapper_binding bar, %bar.param
// CHECK:STDOUT: %bar: %ptr.ec1 = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @MyF(%bar.param: %ptr.227) {
// CHECK:STDOUT: fn @MyF(%bar.param: %ptr.ec1) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %bar.ref: %ptr.227 = name_ref bar, %bar
// CHECK:STDOUT: %.loc8_37.1: ref %Bar = deref %bar.ref
// CHECK:STDOUT: %foo.ref: %Bar.elem = name_ref foo, @Bar.%.1 [concrete = @Bar.%.1]
// CHECK:STDOUT: %.loc8_37.2: ref %ptr.227 = class_element_access %.loc8_37.1, element0
// CHECK:STDOUT: %.loc8_37.3: %ptr.227 = acquire_value %.loc8_37.2
// CHECK:STDOUT: %.loc8_30: type = splice_block %ptr.loc8 [concrete = constants.%ptr.227] {
// CHECK:STDOUT: %bar.ref: %ptr.ec1 = name_ref bar, %bar
// CHECK:STDOUT: %.loc8_47.1: ref %DataMemberBar = deref %bar.ref
// CHECK:STDOUT: %foo.ref: %DataMemberBar.elem = name_ref foo, @DataMemberBar.%.1 [concrete = @DataMemberBar.%.1]
// CHECK:STDOUT: %.loc8_47.2: ref %ptr.ec1 = class_element_access %.loc8_47.1, element0
// CHECK:STDOUT: %.loc8_47.3: %ptr.ec1 = acquire_value %.loc8_47.2
// CHECK:STDOUT: %.loc8_40: type = splice_block %ptr.loc8 [concrete = constants.%ptr.ec1] {
// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref.loc8: type = name_ref Bar, imports.%Bar.decl [concrete = constants.%Bar]
// CHECK:STDOUT: %ptr.loc8: type = ptr_type %Bar.ref.loc8 [concrete = constants.%ptr.227]
// CHECK:STDOUT: %DataMemberBar.ref.loc8: type = name_ref DataMemberBar, imports.%DataMemberBar.decl [concrete = constants.%DataMemberBar]
// CHECK:STDOUT: %ptr.loc8: type = ptr_type %DataMemberBar.ref.loc8 [concrete = constants.%ptr.ec1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %foo_bar: %ptr.227 = wrapper_binding foo_bar, %.loc8_37.3
// CHECK:STDOUT: %foo_bar: %ptr.ec1 = wrapper_binding foo_bar, %.loc8_47.3
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %foo_bar.patt: %pattern_type = value_binding_pattern foo_bar [concrete = constants.%foo_bar.patt]
// CHECK:STDOUT: }
@@ -413,11 +413,11 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: --- import_template.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bar.type: type = cpp_type_template_type Bar [concrete]
// CHECK:STDOUT: %Bar.template: %Bar.type = struct_value () [concrete]
// CHECK:STDOUT: %TemplateBar.type: type = cpp_type_template_type TemplateBar [concrete]
// CHECK:STDOUT: %TemplateBar.template: %TemplateBar.type = struct_value () [concrete]
// CHECK:STDOUT: %X: type = class_type @X [concrete]
// CHECK:STDOUT: %Bar: type = class_type @Bar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %Bar [concrete]
// CHECK:STDOUT: %TemplateBar: type = class_type @TemplateBar [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %TemplateBar [concrete]
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
// CHECK:STDOUT: %bar.param_patt: %pattern_type = value_param_pattern [concrete]
// CHECK:STDOUT: %bar.patt: %pattern_type = wrapper_binding_pattern bar, %bar.param_patt [concrete]
@@ -427,13 +427,13 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .Bar = %Bar.template
// CHECK:STDOUT: .TemplateBar = %TemplateBar.template
// CHECK:STDOUT: .X = %X.decl
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Bar.template: %Bar.type = struct_value () [concrete = constants.%Bar.template]
// CHECK:STDOUT: %TemplateBar.template: %TemplateBar.type = struct_value () [concrete = constants.%TemplateBar.template]
// CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
// CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {}
// CHECK:STDOUT: %TemplateBar.decl: type = class_decl @TemplateBar [concrete = constants.%TemplateBar] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -444,10 +444,10 @@ fn MyF(bar: Cpp.Bar(Cpp.X)*);
// CHECK:STDOUT: %bar.param: %ptr = value_param call_param0
// CHECK:STDOUT: %.loc7: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %Cpp.ref.loc7_13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %Bar.ref: %Bar.type = name_ref Bar, imports.%Bar.template [concrete = constants.%Bar.template]
// CHECK:STDOUT: %Cpp.ref.loc7_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %TemplateBar.ref: %TemplateBar.type = name_ref TemplateBar, imports.%TemplateBar.template [concrete = constants.%TemplateBar.template]
// CHECK:STDOUT: %Cpp.ref.loc7_29: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %X.ref: type = name_ref X, imports.%X.decl [concrete = constants.%X]
// CHECK:STDOUT: %ptr: type = ptr_type imports.%Bar.decl [concrete = constants.%ptr]
// CHECK:STDOUT: %ptr: type = ptr_type imports.%TemplateBar.decl [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %bar: %ptr = wrapper_binding bar, %bar.param
// CHECK:STDOUT: }