mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 18:30:30 +01:00
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:
co-authored by
Chandler Carruth
parent
6eb900dff5
commit
c588eadb57
@@ -180,88 +180,115 @@ import Cpp library "multiple_errors_and_multiple_warnings.h";
|
||||
// Multiple files with warnings
|
||||
// ============================================================================
|
||||
|
||||
// --- multi_one_warning.h
|
||||
|
||||
#warning "warning1"
|
||||
|
||||
// --- multi_multiple_warnings.h
|
||||
|
||||
#warning "warning1"
|
||||
#warning "warning2"
|
||||
#warning "warning3"
|
||||
|
||||
// --- import_multiple_cpp_files_with_warnings.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./multi_one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "one_warning.h";
|
||||
import Cpp library "multi_one_warning.h";
|
||||
// CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_warnings.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./multi_multiple_warnings.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_warnings.h:3:2: warning: "warning2" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./multi_multiple_warnings.h:3:2: warning: "warning2" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 3 | #warning "warning2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: import_multiple_cpp_files_with_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_warnings.h:4:2: warning: "warning3" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./multi_multiple_warnings.h:4:2: warning: "warning3" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 4 | #warning "warning3"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multiple_warnings.h";
|
||||
import Cpp library "multi_multiple_warnings.h";
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// ============================================================================
|
||||
// Multiple files with errors and warnings
|
||||
// ============================================================================
|
||||
|
||||
// --- multi_one_error_and_one_warning.h
|
||||
|
||||
#error "error1"
|
||||
#warning "warning1"
|
||||
|
||||
// --- multi_multiple_errors_and_multiple_warnings.h
|
||||
|
||||
#error "error1"
|
||||
#error "error2"
|
||||
#warning "warning1"
|
||||
#warning "warning2"
|
||||
#warning "warning3"
|
||||
|
||||
// --- fail_import_multiple_cpp_files_with_errors_and_warnings.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./one_error_and_one_warning.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: ./multi_one_error_and_one_warning.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./one_error_and_one_warning.h:3:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./multi_one_error_and_one_warning.h:3:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 3 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "one_error_and_one_warning.h";
|
||||
import Cpp library "multi_one_error_and_one_warning.h";
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+25]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+20]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:3:2: error: "error2" [CppInteropParseError]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:3:2: error: "error2" [CppInteropParseError]
|
||||
// CHECK:STDERR: 3 | #error "error2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+15]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:4:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:4:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 4 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:5:2: warning: "warning2" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:5:2: warning: "warning2" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 5 | #warning "warning2"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_multiple_cpp_files_with_errors_and_warnings.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./multiple_errors_and_multiple_warnings.h:6:2: warning: "warning3" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./multi_multiple_errors_and_multiple_warnings.h:6:2: warning: "warning3" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | #warning "warning3"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "multiple_errors_and_multiple_warnings.h";
|
||||
import Cpp library "multi_multiple_errors_and_multiple_warnings.h";
|
||||
|
||||
// ============================================================================
|
||||
// Indirect error
|
||||
// ============================================================================
|
||||
|
||||
// --- indirect_one_error.h
|
||||
|
||||
#error "error1"
|
||||
|
||||
// --- indirect_error.h
|
||||
|
||||
#include "one_error.h"
|
||||
#include "indirect_one_error.h"
|
||||
|
||||
// --- fail_import_indirect_error.carbon
|
||||
|
||||
@@ -269,7 +296,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_indirect_error.carbon:[[@LINE+6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./indirect_error.h:2:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./one_error.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: ./indirect_one_error.h:2:2: error: "error1" [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | #error "error1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
@@ -279,9 +306,13 @@ import Cpp library "indirect_error.h";
|
||||
// Indirect warning
|
||||
// ============================================================================
|
||||
|
||||
// --- indirect_one_warning.h
|
||||
|
||||
#warning "warning1"
|
||||
|
||||
// --- indirect_warning.h
|
||||
|
||||
#include "one_warning.h"
|
||||
#include "indirect_one_warning.h"
|
||||
|
||||
// --- import_indirect_warning.carbon
|
||||
|
||||
@@ -290,7 +321,7 @@ library "[[@TEST_NAME]]";
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: import_indirect_warning.carbon:[[@LINE+6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./indirect_warning.h:2:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./indirect_one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
@@ -301,6 +332,10 @@ import Cpp library "indirect_warning.h";
|
||||
// Lexer error before import
|
||||
// ============================================================================
|
||||
|
||||
// --- lexer_error_one_warning.h
|
||||
|
||||
#warning "warning1"
|
||||
|
||||
// --- fail_import_cpp_library_lexer_error.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
@@ -309,7 +344,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: Move this warning to be after the lexer error.
|
||||
// CHECK:STDERR: fail_import_cpp_library_lexer_error.carbon:[[@LINE+9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: ./lexer_error_one_warning.h:2:2: warning: "warning1" [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 2 | #warning "warning1"
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
@@ -317,7 +352,7 @@ library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: //!Lexer error: whitespace is required after the comment introducer.
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "one_warning.h";
|
||||
import Cpp library "lexer_error_one_warning.h";
|
||||
|
||||
// ============================================================================
|
||||
// Diagnostic with fix-it hints
|
||||
@@ -465,8 +500,8 @@ void f(const int n) {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
|
||||
// CHECK:STDOUT: import Cpp "one_warning.h"
|
||||
// CHECK:STDOUT: import Cpp "multiple_warnings.h"
|
||||
// CHECK:STDOUT: import Cpp "multi_one_warning.h"
|
||||
// CHECK:STDOUT: import Cpp "multi_multiple_warnings.h"
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -38,21 +38,21 @@ library "[[@TEST_NAME]]";
|
||||
// TODO: This diagnostic isn't very good.
|
||||
import Cpp inline '''
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+15]]:1: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | module Foo;
|
||||
// CHECK:STDERR: 21 | module Bar;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+11]]:1: error: module declaration must occur at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | module Foo;
|
||||
// CHECK:STDERR: 21 | module Bar;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: add 'module;' to the start of the file to introduce a global module fragment [CppInteropParseNote]
|
||||
// CHECK:STDERR: 1 | ;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+4]]:8: error: module 'Foo' not found [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | module Foo;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_module_in_inline_cpp.carbon:[[@LINE+4]]:8: error: module name 'Foo' specified on command line does not match name of module [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | module Bar;
|
||||
// CHECK:STDERR: | ^~~
|
||||
// CHECK:STDERR:
|
||||
module Foo;
|
||||
module Bar;
|
||||
''';
|
||||
|
||||
// --- fail_global_module_in_inline_cpp.carbon
|
||||
@@ -74,21 +74,21 @@ module;
|
||||
int n;
|
||||
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+15]]:1: error: module declaration must not come from an #include directive [CppInteropParseError]
|
||||
// CHECK:STDERR: 33 | module Foo;
|
||||
// CHECK:STDERR: 33 | module Baz;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+11]]:1: error: module declaration must occur at the start of the translation unit [CppInteropParseError]
|
||||
// CHECK:STDERR: 33 | module Foo;
|
||||
// CHECK:STDERR: 33 | module Baz;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: <carbon Cpp imports>:1:1: note: add 'module;' to the start of the file to introduce a global module fragment [CppInteropParseNote]
|
||||
// CHECK:STDERR: 1 | ;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+4]]:8: error: module 'Foo' not found [CppInteropParseError]
|
||||
// CHECK:STDERR: 33 | module Foo;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_global_module_in_inline_cpp.carbon:[[@LINE+4]]:8: error: module name 'Foo' specified on command line does not match name of module [CppInteropParseError]
|
||||
// CHECK:STDERR: 33 | module Baz;
|
||||
// CHECK:STDERR: | ^~~
|
||||
// CHECK:STDERR:
|
||||
module Foo;
|
||||
module Baz;
|
||||
''';
|
||||
|
||||
// --- fail_import_in_inline_cpp.carbon
|
||||
|
||||
+56
-56
@@ -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;
|
||||
''';
|
||||
|
||||
+20
-20
@@ -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
|
||||
|
||||
+29
-29
@@ -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:
|
||||
|
||||
+10
-10
@@ -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);
|
||||
''';
|
||||
|
||||
+21
-21
@@ -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;
|
||||
}
|
||||
''';
|
||||
|
||||
+401
-402
File diff suppressed because it is too large
Load Diff
+160
-160
@@ -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
@@ -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: }
|
||||
|
||||
+507
-508
File diff suppressed because it is too large
Load Diff
+22
-22
@@ -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: }
|
||||
|
||||
+36
-36
@@ -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: }
|
||||
|
||||
+98
-98
@@ -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: }
|
||||
|
||||
@@ -15,19 +15,19 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
fn F(a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
fn FArrayValueParam(a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
|
||||
inline Cpp '''
|
||||
int G() {
|
||||
int GArrayValueParam() {
|
||||
int arr[5];
|
||||
//@dump-sem-ir-begin
|
||||
return Carbon::F(arr);
|
||||
return Carbon::FArrayValueParam(arr);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
int H() {
|
||||
int HArrayValueParam() {
|
||||
//@dump-sem-ir-begin
|
||||
return Carbon::F({1, 2, 3, 4, 5});
|
||||
return Carbon::FArrayValueParam({1, 2, 3, 4, 5});
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
''';
|
||||
@@ -44,23 +44,34 @@ import Cpp;
|
||||
|
||||
// TODO: These diagnostics are very bad.
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+8]]:1: error: semantics TODO: `by-var array parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn F(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+4]]:1: error: semantics TODO: `failed to map C++ type to Carbon` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn F(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
|
||||
inline Cpp '''
|
||||
int G() {
|
||||
int GArrayVarParam() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+4]]:18: error: no member named 'F' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | return Carbon::F({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+15]]:10: error: no member named 'FArrayVarParam' in namespace 'Carbon'; did you mean 'GArrayVarParam'? [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: | GArrayVarParam
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-6]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | int GArrayVarParam() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
return Carbon::F({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+7]]:33: error: too many arguments to function call, expected 0, have 1 [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-13]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | int GArrayVarParam() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
''';
|
||||
@@ -75,20 +86,28 @@ import Cpp;
|
||||
// TODO: Support this, perhaps by returning a `std::array`.
|
||||
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:1: error: semantics TODO: `array return type` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn F() -> array(i32, 5) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn FArrayReturn() -> array(i32, 5) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F() -> array(i32, 5) {
|
||||
fn FArrayReturn() -> array(i32, 5) {
|
||||
return (1, 2, 3, 4, 5);
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
int G() {
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:24: error: no member named 'F' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 23 | auto &&arr = Carbon::F();
|
||||
// CHECK:STDERR: | ^
|
||||
int GArrayReturn() {
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+8]]:16: error: no member named 'FArrayReturn' in namespace 'Carbon'; did you mean 'GArrayReturn'? [CppInteropParseError]
|
||||
// CHECK:STDERR: 27 | auto &&arr = Carbon::FArrayReturn();
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: | GArrayReturn
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE-5]]:5: note: 'GArrayReturn' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 18 | int GArrayReturn() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
auto &&arr = Carbon::FArrayReturn();
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:13: error: subscripted value is not an array, pointer, or vector [CppInteropParseError]
|
||||
// CHECK:STDERR: 32 | return arr[0];
|
||||
// CHECK:STDERR: | ~~~^~
|
||||
// CHECK:STDERR:
|
||||
auto &&arr = Carbon::F();
|
||||
return arr[0];
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -20,7 +20,7 @@ class OneArg {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
void CallOneArg() {
|
||||
Carbon::OneArg a(42);
|
||||
}
|
||||
''';
|
||||
@@ -30,26 +30,26 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class OneArg {
|
||||
fn OneArg(self, i: i32) -> Self;
|
||||
class FactoryIsMethod {
|
||||
fn FactoryIsMethod(self, i: i32) -> Self;
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE+13]]:18: error: no matching constructor for initialization of 'Carbon::OneArg' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::OneArg a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-9]]:14: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-12]]:14: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-15]]:14: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
void CallFactoryIsMethod() {
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE+13]]:27: error: no matching constructor for initialization of 'Carbon::FactoryIsMethod' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryIsMethod a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-9]]:23: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-12]]:23: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-15]]:23: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Carbon::OneArg a(42);
|
||||
Carbon::FactoryIsMethod a(42);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -58,26 +58,26 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class OneArg {
|
||||
fn OneArg(i: i32) -> i32;
|
||||
class FactoryDoesntReturnSelf {
|
||||
fn FactoryDoesntReturnSelf(i: i32) -> i32;
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE+13]]:18: error: no matching constructor for initialization of 'Carbon::OneArg' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::OneArg a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-9]]:14: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-12]]:14: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-15]]:14: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
void CallFactoryDoesntReturnSelf() {
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE+13]]:35: error: no matching constructor for initialization of 'Carbon::FactoryDoesntReturnSelf' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryDoesntReturnSelf a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-9]]:31: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-12]]:31: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-15]]:31: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Carbon::OneArg a(42);
|
||||
Carbon::FactoryDoesntReturnSelf a(42);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -86,26 +86,26 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class OneArg {
|
||||
fn OneArg(i: i32) -> ref Self;
|
||||
class FactoryReturnsByRef {
|
||||
fn FactoryReturnsByRef(i: i32) -> ref Self;
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE+13]]:18: error: no matching constructor for initialization of 'Carbon::OneArg' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::OneArg a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-9]]:14: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-12]]:14: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-15]]:14: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
void CallFactoryReturnsByRef() {
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE+13]]:31: error: no matching constructor for initialization of 'Carbon::FactoryReturnsByRef' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryReturnsByRef a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-9]]:27: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-12]]:27: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-15]]:27: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Carbon::OneArg a(42);
|
||||
Carbon::FactoryReturnsByRef a(42);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -125,7 +125,7 @@ class GenericConstructor {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
void CallGenericConstructor() {
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+13]]:30: error: no matching constructor for initialization of 'Carbon::GenericConstructor' [CppInteropParseError]
|
||||
// CHECK:STDERR: 30 | Carbon::GenericConstructor b(0);
|
||||
// CHECK:STDERR: | ^ ~
|
||||
@@ -159,7 +159,7 @@ class GenericClass(T: type) {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
void CallGenericClass() {
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+13]]:29: error: no matching constructor for initialization of 'Carbon::GenericClass<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 30 | Carbon::GenericClass<int> c(0);
|
||||
// CHECK:STDERR: | ^ ~
|
||||
|
||||
@@ -10,46 +10,51 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/export/function.carbon
|
||||
|
||||
// --- other.carbon
|
||||
// --- other_function.carbon
|
||||
|
||||
package Other;
|
||||
package OtherFunction;
|
||||
fn F1() {}
|
||||
fn F2() -> i32 { return 0; }
|
||||
fn F3(_: i32) {}
|
||||
|
||||
fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
fn HasDeducedArg[T: type](a: T) { a; }
|
||||
|
||||
// --- function.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Other;
|
||||
import OtherFunction;
|
||||
import Cpp inline '''
|
||||
void G() {
|
||||
Carbon::Other::F1();
|
||||
void CallF1() {
|
||||
Carbon::OtherFunction::F1();
|
||||
}
|
||||
''';
|
||||
|
||||
// --- other_return_int.carbon
|
||||
|
||||
package OtherReturnInt;
|
||||
fn F2() -> i32 { return 0; }
|
||||
|
||||
// --- return_int.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Other;
|
||||
import OtherReturnInt;
|
||||
import Cpp inline '''
|
||||
int G() {
|
||||
return Carbon::Other::F2();
|
||||
int CallF2() {
|
||||
return Carbon::OtherReturnInt::F2();
|
||||
}
|
||||
''';
|
||||
|
||||
// --- other_args.carbon
|
||||
|
||||
package OtherArgs;
|
||||
fn F3(_: i32) {}
|
||||
|
||||
// --- args.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Other;
|
||||
import OtherArgs;
|
||||
import Cpp inline '''
|
||||
void G() {
|
||||
Carbon::Other::F3(123);
|
||||
void CallF3() {
|
||||
Carbon::OtherArgs::F3(123);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -59,12 +64,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
fn F(ref n: i32);
|
||||
fn RefF(ref n: i32);
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
void CallRefF() {
|
||||
int n = 0;
|
||||
Carbon::F(n);
|
||||
Carbon::RefF(n);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -74,40 +79,50 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
fn F();
|
||||
fn UsingF();
|
||||
|
||||
inline Cpp '''
|
||||
using Carbon::F;
|
||||
void G() { F(); }
|
||||
using Carbon::UsingF;
|
||||
void CallUsingF() { UsingF(); }
|
||||
''';
|
||||
|
||||
// --- other_generic.carbon
|
||||
|
||||
package OtherGeneric;
|
||||
fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
|
||||
// --- fail_todo_generic.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+9]]:1: in import [InImport]
|
||||
// CHECK:STDERR: other.carbon:7:1: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: other.carbon:7:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
import Other;
|
||||
import OtherGeneric;
|
||||
import Cpp inline '''
|
||||
void G() {
|
||||
Carbon::Other::HasGenericArg<int>(123);
|
||||
void CallHasGenericArg() {
|
||||
Carbon::OtherGeneric::HasGenericArg<int>(123);
|
||||
}
|
||||
''';
|
||||
|
||||
// --- other_deduced.carbon
|
||||
|
||||
package OtherDeduced;
|
||||
fn HasDeducedArg[T: type](a: T) { a; }
|
||||
|
||||
// --- deduced.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Other;
|
||||
import OtherDeduced;
|
||||
import Cpp inline '''
|
||||
void G() {
|
||||
Carbon::Other::HasDeducedArg(123);
|
||||
void CallHasDeducedArg() {
|
||||
Carbon::OtherDeduced::HasDeducedArg(123);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -39,7 +39,7 @@ fn F[T: I](t: T) -> T {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
Carbon::B G() {
|
||||
Carbon::B CallInterfaceF() {
|
||||
Carbon::A a;
|
||||
Carbon::B b;
|
||||
Carbon::F(a);
|
||||
@@ -53,22 +53,22 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:1: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn F[unused N: i32]() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn NonTypeF[unused N: i32]() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F[unused N: i32]() {}
|
||||
fn NonTypeF[unused N: i32]() {}
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+8]]:11: error: no member named 'F' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::F<3>();
|
||||
// CHECK:STDERR: | ^
|
||||
void CallNonTypeF() {
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+8]]:11: error: no member named 'NonTypeF' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::NonTypeF<3>();
|
||||
// CHECK:STDERR: | ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:16: error: expected expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::F<3>();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:23: error: expected expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::NonTypeF<3>();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Carbon::F<3>();
|
||||
Carbon::NonTypeF<3>();
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -76,13 +76,13 @@ void G() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
fn F[T: type](unused t: T*) {}
|
||||
fn PointerF[T: type](unused t: T*) {}
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
void CallPointerF() {
|
||||
int x = 0;
|
||||
int* _Nonnull p = &x;
|
||||
Carbon::F(p);
|
||||
Carbon::PointerF(p);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -90,26 +90,26 @@ void G() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class A(T: type) {
|
||||
class EnclosingA(T: type) {
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:3: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn F[U: type](x: T, y: U);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn MemberF[U: type](x: T, y: U);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F[U: type](x: T, y: U);
|
||||
fn MemberF[U: type](x: T, y: U);
|
||||
}
|
||||
alias B = A(i32);
|
||||
alias EnclosingB = EnclosingA(i32);
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
// TODO: this currently fails because `B` can't be imported, but the intent
|
||||
void CallEnclosingF() {
|
||||
// TODO: this currently fails because `EnclosingB` can't be imported, but the intent
|
||||
// is to test a generic function within an enclosing generic scope.
|
||||
//
|
||||
Carbon::B b;
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:5: error: no member named 'F' in 'Carbon::A<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 23 | b.F(1, 2);
|
||||
Carbon::EnclosingB b;
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:5: error: no member named 'MemberF' in 'Carbon::EnclosingA<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 23 | b.MemberF(1, 2);
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR:
|
||||
b.F(1, 2);
|
||||
b.MemberF(1, 2);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -118,22 +118,22 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+4]]:1: error: semantics TODO: `failed to import C++ type` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn F[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn UnsupportedF[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F[T: type](unused t: T) {}
|
||||
fn UnsupportedF[T: type](unused t: T) {}
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
void CallUnsupportedF() {
|
||||
volatile int x;
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+7]]:3: error: no matching function for call to 'F' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::F(x);
|
||||
// CHECK:STDERR: | ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE-8]]:28: note: candidate template ignored: substitution failure [with T = volatile int] [CppInteropParseNote]
|
||||
// CHECK:STDERR: 8 | fn F[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+7]]:3: error: no matching function for call to 'UnsupportedF' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::UnsupportedF(x);
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE-8]]:39: note: candidate template ignored: substitution failure [with T = volatile int] [CppInteropParseNote]
|
||||
// CHECK:STDERR: 8 | fn UnsupportedF[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Carbon::F(x);
|
||||
Carbon::UnsupportedF(x);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -274,7 +274,7 @@ void G() {
|
||||
// CHECK:STDOUT: %.loc24_23.1: %I.type = converted %A.decl, %I.facet.loc24_23.1 [concrete = constants.%I.facet.f31]
|
||||
// CHECK:STDOUT: %I.facet.loc24_23.2: %I.type = facet_value %B.decl, (constants.%I.impl_witness.b14) [concrete = constants.%I.facet.a68]
|
||||
// CHECK:STDOUT: %.loc24_23.2: %I.type = converted %B.decl, %I.facet.loc24_23.2 [concrete = constants.%I.facet.a68]
|
||||
// CHECK:STDOUT: inline_cpp "Carbon::B G() {\n Carbon::A a;\n Carbon::B b;\n Carbon::F(a);\n return Carbon::F(b);\n}\n"
|
||||
// CHECK:STDOUT: inline_cpp "Carbon::B CallInterfaceF() {\n Carbon::A a;\n Carbon::B b;\n Carbon::F(a);\n return Carbon::F(b);\n}\n"
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
|
||||
+466
-466
File diff suppressed because it is too large
Load Diff
@@ -16,41 +16,41 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int f(int a, int b) { return a + b; }
|
||||
constexpr int add(int a, int b) { return a + b; }
|
||||
''';
|
||||
|
||||
let a: array(i32, Cpp.f(1, 2)) = (1, 2, 3);
|
||||
let a: array(i32, Cpp.add(1, 2)) = (1, 2, 3);
|
||||
|
||||
// --- bool_param.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int f(bool b) {
|
||||
constexpr int bool_fn(bool b) {
|
||||
return b ? 3 : 0;
|
||||
}
|
||||
''';
|
||||
|
||||
let a: array(i32, Cpp.f(true)) = (1, 2, 3);
|
||||
let a: array(i32, Cpp.bool_fn(true)) = (1, 2, 3);
|
||||
|
||||
// --- float_param.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int f(float b) {
|
||||
constexpr int float_fn(float b) {
|
||||
return static_cast<int>(b);
|
||||
}
|
||||
''';
|
||||
|
||||
let a: array(i32, Cpp.f(3.0)) = (1, 2, 3);
|
||||
let a: array(i32, Cpp.float_fn(3.0)) = (1, 2, 3);
|
||||
|
||||
// --- return_bool.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr bool f() {
|
||||
constexpr bool return_bool_fn() {
|
||||
return true;
|
||||
}
|
||||
''';
|
||||
@@ -59,7 +59,7 @@ musteval fn F(b: bool) -> i32 {
|
||||
return if b then 3 else 0;
|
||||
}
|
||||
|
||||
let a: array(i32, F(Cpp.f())) = (1, 2, 3);
|
||||
let a: array(i32, F(Cpp.return_bool_fn())) = (1, 2, 3);
|
||||
|
||||
// --- fail_invalid_constant_eval.carbon
|
||||
|
||||
@@ -67,16 +67,16 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int arr[1] = {0};
|
||||
constexpr int f(int a) {
|
||||
constexpr int invalid_const_fn(int a) {
|
||||
return arr[a];
|
||||
}
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_invalid_constant_eval.carbon:[[@LINE+4]]:19: error: array bound is not a constant [InvalidArrayExpr]
|
||||
// CHECK:STDERR: let a: array(i32, Cpp.f(5)) = (1, 2, 3);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: let a: array(i32, Cpp.invalid_const_fn(5)) = (1, 2, 3);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
let a: array(i32, Cpp.f(5)) = (1, 2, 3);
|
||||
let a: array(i32, Cpp.invalid_const_fn(5)) = (1, 2, 3);
|
||||
|
||||
// --- nonconstant_constexpr_call.carbon
|
||||
|
||||
@@ -87,11 +87,11 @@ import Cpp;
|
||||
var a: i32 = 0;
|
||||
|
||||
inline Cpp '''
|
||||
constexpr int f(const int &r) { return r; }
|
||||
constexpr int nonconst_constexpr_fn(const int &r) { return r; }
|
||||
''';
|
||||
|
||||
// OK, runtime call.
|
||||
var b: i32 = Cpp.f(a);
|
||||
var b: i32 = Cpp.nonconst_constexpr_fn(a);
|
||||
|
||||
// --- fail_nonconstant_consteval_call.carbon
|
||||
|
||||
@@ -103,30 +103,30 @@ var a: i32 = 0;
|
||||
|
||||
// TODO: This is failing when building the thunk, not when calling it.
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+9]]:15: error: call to consteval function 'f' is not a constant expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | consteval int f(const int &r) { return r; }
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+9]]:15: error: call to consteval function 'nonconst_consteval_fn' is not a constant expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+6]]:15: note: function parameter 'r' with unknown value cannot be used in a constant expression [CppInteropParseNote]
|
||||
// CHECK:STDERR: 19 | consteval int f(const int &r) { return r; }
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+3]]:15: note: declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 19 | consteval int f(const int &r) { return r; }
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
consteval int f(const int &r) { return r; }
|
||||
consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+11]]:14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: var b: i32 = Cpp.f(a);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+7]]:14: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: var b: i32 = Cpp.f(a);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE-10]]:15: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: consteval int f(const int &r) { return r; }
|
||||
// CHECK:STDERR: consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = Cpp.f(a);
|
||||
var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
|
||||
// --- fail_todo_constructor.carbon
|
||||
|
||||
@@ -135,8 +135,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
inline Cpp '''
|
||||
struct C {
|
||||
constexpr C(int a) : a(a) {}
|
||||
struct ConstexprC {
|
||||
constexpr ConstexprC(int a) : a(a) {}
|
||||
int a;
|
||||
};
|
||||
''';
|
||||
@@ -144,10 +144,10 @@ struct C {
|
||||
// TODO: This should probably be allowed.
|
||||
eval fn F() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+3]]:18: error: expression is runtime; expected constant [EvalRequiresConstantValue]
|
||||
// CHECK:STDERR: let c: Cpp.C = 3;
|
||||
// CHECK:STDERR: ^
|
||||
let c: Cpp.C = 3;
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+3]]:27: error: expression is runtime; expected constant [EvalRequiresConstantValue]
|
||||
// CHECK:STDERR: let c: Cpp.ConstexprC = 3;
|
||||
// CHECK:STDERR: ^
|
||||
let c: Cpp.ConstexprC = 3;
|
||||
return c.a;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
@@ -165,14 +165,14 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.bbc: type = pattern_type %C [concrete]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.bbc = value_binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC: type = class_type @ConstexprC [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.elem: type = unbound_element_type %ConstexprC, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.3cc: type = pattern_type %ConstexprC [concrete]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.3cc = value_binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %ptr.0a2: type = ptr_type %C [concrete]
|
||||
// CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.0b8: type = ptr_type %ConstexprC [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.type: type = fn_type @ConstexprC__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk: %ConstexprC__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl.0e9(%To) [symbolic]
|
||||
@@ -197,19 +197,19 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// 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: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete]
|
||||
// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.type: type = fn_type @ConstexprC.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor: %ConstexprC.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.Op.type: type = fn_type @ConstexprC.Op [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.Op: %ConstexprC.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .ConstexprC = %ConstexprC.decl
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
|
||||
// CHECK:STDOUT: %ConstexprC.decl: type = class_decl @ConstexprC [concrete = constants.%ConstexprC] {} {}
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.decl: %ConstexprC__carbon_thunk.type = fn_decl @ConstexprC__carbon_thunk [concrete = constants.%ConstexprC__carbon_thunk] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -218,7 +218,7 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl.0e9 [concrete]
|
||||
// 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/types/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: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] {
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.decl: %ConstexprC.cpp_destructor.type = fn_decl @ConstexprC.cpp_destructor [concrete = constants.%ConstexprC.cpp_destructor] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -228,30 +228,30 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: fn @F() -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc19_18.1: ref %C = temporary_storage
|
||||
// CHECK:STDOUT: %.loc19_27.1: ref %ConstexprC = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc19: %.b7a = impl_witness_access constants.%ImplicitAs.impl_witness.a2a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39]
|
||||
// CHECK:STDOUT: %bound_method.loc19_18.1: <bound method> = bound_method %int_3, %impl.elem0.loc19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc19_27.1: <bound method> = bound_method %int_3, %impl.elem0.loc19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc19: <specific function> = specific_function %impl.elem0.loc19, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc19_18.2: <bound method> = bound_method %int_3, %specific_fn.loc19 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc19_18.2(%int_3) [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %.loc19_18.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %.loc19_18.3: %i32 = converted %int_3, %.loc19_18.2 [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %addr: %ptr.0a2 = addr_of %.loc19_18.1
|
||||
// CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc19_18.3, %addr)
|
||||
// CHECK:STDOUT: %.loc19_18.4: init %C to %.loc19_18.1 = mark_in_place_init %C__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc19_18.5: init %C = converted %int_3, %.loc19_18.4
|
||||
// CHECK:STDOUT: %.loc19_18.6: ref %C = temporary %.loc19_18.1, %.loc19_18.5
|
||||
// CHECK:STDOUT: %.loc19_18.7: %C = acquire_value %.loc19_18.6
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %C.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %bound_method.loc19_27.2: <bound method> = bound_method %int_3, %specific_fn.loc19 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc19_27.2(%int_3) [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %.loc19_27.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %.loc19_27.3: %i32 = converted %int_3, %.loc19_27.2 [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %addr: %ptr.0b8 = addr_of %.loc19_27.1
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.call: init %empty_tuple.type = call imports.%ConstexprC__carbon_thunk.decl(%.loc19_27.3, %addr)
|
||||
// CHECK:STDOUT: %.loc19_27.4: init %ConstexprC to %.loc19_27.1 = mark_in_place_init %ConstexprC__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc19_27.5: init %ConstexprC = converted %int_3, %.loc19_27.4
|
||||
// CHECK:STDOUT: %.loc19_27.6: ref %ConstexprC = temporary %.loc19_27.1, %.loc19_27.5
|
||||
// CHECK:STDOUT: %.loc19_27.7: %ConstexprC = acquire_value %.loc19_27.6
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %ConstexprC.ref [concrete = constants.%ConstexprC] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %ConstexprC.ref: type = name_ref ConstexprC, imports.%ConstexprC.decl [concrete = constants.%ConstexprC]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: %C = wrapper_binding c, %.loc19_18.7
|
||||
// CHECK:STDOUT: %c: %ConstexprC = wrapper_binding c, %.loc19_27.7
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.bbc = value_binding_pattern c [concrete = constants.%c.patt]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.3cc = value_binding_pattern c [concrete = constants.%c.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
|
||||
// CHECK:STDOUT: %a.ref: %C.elem = name_ref a, @C.%.1 [concrete = @C.%.1]
|
||||
// CHECK:STDOUT: %c.ref: %ConstexprC = name_ref c, %c
|
||||
// CHECK:STDOUT: %a.ref: %ConstexprC.elem = name_ref a, @ConstexprC.%.1 [concrete = @ConstexprC.%.1]
|
||||
// CHECK:STDOUT: %.loc20_11.1: ref %i32 = class_element_access %c.ref, element0
|
||||
// CHECK:STDOUT: %.loc20_11.2: %i32 = acquire_value %.loc20_11.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc20: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
@@ -260,10 +260,10 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: %bound_method.loc20_11.2: <bound method> = bound_method %.loc20_11.2, %specific_fn.loc20
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_11.2(%.loc20_11.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %C.Op.bound: <bound method> = bound_method %.loc19_18.6, constants.%C.Op
|
||||
// CHECK:STDOUT: %Op.ref: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor]
|
||||
// CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc19_18.6, %Op.ref
|
||||
// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc19_18.6)
|
||||
// CHECK:STDOUT: %ConstexprC.Op.bound: <bound method> = bound_method %.loc19_27.6, constants.%ConstexprC.Op
|
||||
// CHECK:STDOUT: %Op.ref: %ConstexprC.cpp_destructor.type = name_ref Op, imports.%ConstexprC.cpp_destructor.decl [concrete = constants.%ConstexprC.cpp_destructor]
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.bound: <bound method> = bound_method %.loc19_27.6, %Op.ref
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.call: init %empty_tuple.type = call %ConstexprC.cpp_destructor.bound(%.loc19_27.6)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
extern "C" void foo();
|
||||
extern "C" void foo_c_fn();
|
||||
''';
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.foo_c_fn();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ fn MyF() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
extern "C" void foo();
|
||||
void foo(int x);
|
||||
extern "C" void foo_c_overloaded();
|
||||
void foo_c_overloaded(int x);
|
||||
''';
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.foo(5);
|
||||
Cpp.foo_c_overloaded();
|
||||
Cpp.foo_c_overloaded(5);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ fn MyF() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
extern "C" int foo;
|
||||
extern "C" int foo_c_var;
|
||||
''';
|
||||
|
||||
fn MyF() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
return Cpp.foo;
|
||||
return Cpp.foo_c_var;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -73,26 +73,26 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_c_fn.cpp_overload_set.type: type = cpp_overload_set_type @foo_c_fn.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_c_fn.cpp_overload_set.value: %foo_c_fn.cpp_overload_set.type = cpp_overload_set_value @foo_c_fn.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_c_fn.type: type = fn_type @foo_c_fn [concrete]
|
||||
// CHECK:STDOUT: %foo_c_fn: %foo_c_fn.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_c_fn = %foo_c_fn.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %foo_c_fn.cpp_overload_set.value: %foo_c_fn.cpp_overload_set.type = cpp_overload_set_value @foo_c_fn.cpp_overload_set [concrete = constants.%foo_c_fn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_fn.decl: %foo_c_fn.type = fn_decl @foo_c_fn [concrete = constants.%foo_c_fn] {} {}
|
||||
// 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: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %foo_c_fn.ref: %foo_c_fn.cpp_overload_set.type = name_ref foo_c_fn, imports.%foo_c_fn.cpp_overload_set.value [concrete = constants.%foo_c_fn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_fn.call: init %empty_tuple.type = call imports.%foo_c_fn.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -100,15 +100,15 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type.6d9caa.1: type = fn_type @foo.1 [concrete]
|
||||
// CHECK:STDOUT: %foo.627376.1: %foo.type.6d9caa.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.cpp_overload_set.type: type = cpp_overload_set_type @foo_c_overloaded.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.cpp_overload_set.value: %foo_c_overloaded.cpp_overload_set.type = cpp_overload_set_value @foo_c_overloaded.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.type.7eb664.1: type = fn_type @foo_c_overloaded.1 [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.fee3ce.1: %foo_c_overloaded.type.7eb664.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %foo.type.6d9caa.2: type = fn_type @foo.2 [concrete]
|
||||
// CHECK:STDOUT: %foo.627376.2: %foo.type.6d9caa.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.type.7eb664.2: type = fn_type @foo_c_overloaded.2 [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.fee3ce.2: %foo_c_overloaded.type.7eb664.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
|
||||
@@ -127,12 +127,12 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_c_overloaded = %foo_c_overloaded.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl.6431a3.1: %foo.type.6d9caa.1 = fn_decl @foo.1 [concrete = constants.%foo.627376.1] {} {}
|
||||
// CHECK:STDOUT: %foo.decl.6431a3.2: %foo.type.6d9caa.2 = fn_decl @foo.2 [concrete = constants.%foo.627376.2] {
|
||||
// CHECK:STDOUT: %foo_c_overloaded.cpp_overload_set.value: %foo_c_overloaded.cpp_overload_set.type = cpp_overload_set_value @foo_c_overloaded.cpp_overload_set [concrete = constants.%foo_c_overloaded.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.decl.9ccf4c.1: %foo_c_overloaded.type.7eb664.1 = fn_decl @foo_c_overloaded.1 [concrete = constants.%foo_c_overloaded.fee3ce.1] {} {}
|
||||
// CHECK:STDOUT: %foo_c_overloaded.decl.9ccf4c.2: %foo_c_overloaded.type.7eb664.2 = fn_decl @foo_c_overloaded.2 [concrete = constants.%foo_c_overloaded.fee3ce.2] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -144,19 +144,19 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref.loc11: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call.loc11: init %empty_tuple.type = call imports.%foo.decl.6431a3.1()
|
||||
// CHECK:STDOUT: %foo_c_overloaded.ref.loc11: %foo_c_overloaded.cpp_overload_set.type = name_ref foo_c_overloaded, imports.%foo_c_overloaded.cpp_overload_set.value [concrete = constants.%foo_c_overloaded.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.call.loc11: init %empty_tuple.type = call imports.%foo_c_overloaded.decl.9ccf4c.1()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref.loc12: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.ref.loc12: %foo_c_overloaded.cpp_overload_set.type = name_ref foo_c_overloaded, imports.%foo_c_overloaded.cpp_overload_set.value [concrete = constants.%foo_c_overloaded.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
|
||||
// CHECK:STDOUT: %impl.elem0: %.b7a = impl_witness_access constants.%ImplicitAs.impl_witness.a2a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39]
|
||||
// CHECK:STDOUT: %bound_method.loc12_11.1: <bound method> = bound_method %int_5, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc12_24.1: <bound method> = bound_method %int_5, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc12_11.2: <bound method> = bound_method %int_5, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc12_11.2(%int_5) [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_5, %.loc12_11.1 [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %foo.call.loc12: init %empty_tuple.type = call imports.%foo.decl.6431a3.2(%.loc12_11.2)
|
||||
// CHECK:STDOUT: %bound_method.loc12_24.2: <bound method> = bound_method %int_5, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc12_24.2(%int_5) [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %.loc12_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %.loc12_24.2: %i32 = converted %int_5, %.loc12_24.1 [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.call.loc12: init %empty_tuple.type = call imports.%foo_c_overloaded.decl.9ccf4c.2(%.loc12_24.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -167,8 +167,8 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %foo.patt: %pattern_type.6b6 = ref_binding_pattern foo [concrete]
|
||||
// CHECK:STDOUT: %foo.var_patt: %pattern_type.6b6 = var_pattern %foo.patt [concrete]
|
||||
// CHECK:STDOUT: %foo_c_var.patt: %pattern_type.6b6 = ref_binding_pattern foo_c_var [concrete]
|
||||
// CHECK:STDOUT: %foo_c_var.var_patt: %pattern_type.6b6 = var_pattern %foo_c_var.patt [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]
|
||||
@@ -183,12 +183,12 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.var
|
||||
// CHECK:STDOUT: .foo_c_var = %foo_c_var.var
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.patt: %pattern_type.6b6 = ref_binding_pattern foo [concrete = constants.%foo.patt]
|
||||
// CHECK:STDOUT: %foo.var_patt: %pattern_type.6b6 = var_pattern %foo.patt [concrete = constants.%foo.var_patt]
|
||||
// CHECK:STDOUT: %foo.var: ref %i32 = var_storage %foo.var_patt [concrete]
|
||||
// CHECK:STDOUT: %foo_c_var.patt: %pattern_type.6b6 = ref_binding_pattern foo_c_var [concrete = constants.%foo_c_var.patt]
|
||||
// CHECK:STDOUT: %foo_c_var.var_patt: %pattern_type.6b6 = var_pattern %foo_c_var.patt [concrete = constants.%foo_c_var.var_patt]
|
||||
// CHECK:STDOUT: %foo_c_var.var: ref %i32 = var_storage %foo_c_var.var_patt [concrete]
|
||||
// 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: }
|
||||
@@ -197,8 +197,8 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %foo.ref: ref %i32 = name_ref foo, imports.%foo.var [concrete = imports.%foo.var]
|
||||
// CHECK:STDOUT: %.loc10: %i32 = acquire_value %foo.ref
|
||||
// CHECK:STDOUT: %foo_c_var.ref: ref %i32 = name_ref foo_c_var, imports.%foo_c_var.var [concrete = imports.%foo_c_var.var]
|
||||
// CHECK:STDOUT: %.loc10: %i32 = acquire_value %foo_c_var.ref
|
||||
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
// CHECK:STDOUT: %bound_method.loc10_13.1: <bound method> = bound_method %.loc10, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// --- global.h
|
||||
|
||||
auto foo() -> void;
|
||||
auto global_foo() -> void;
|
||||
|
||||
// --- import_global.carbon
|
||||
|
||||
@@ -26,7 +26,7 @@ import Cpp library "global.h";
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.global_foo();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ fn MyF() {
|
||||
|
||||
// --- overloaded.h
|
||||
|
||||
auto foo() -> void;
|
||||
auto foo(int value) -> void;
|
||||
auto overloaded_foo() -> void;
|
||||
auto overloaded_foo(int value) -> void;
|
||||
|
||||
// --- import_overloaded.carbon
|
||||
|
||||
@@ -95,7 +95,7 @@ import Cpp library "overloaded.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.overloaded_foo();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ fn F() {
|
||||
|
||||
// --- variadic.h
|
||||
|
||||
auto foo(int x, ...) -> void;
|
||||
auto variadic_foo(int x, ...) -> void;
|
||||
|
||||
// --- fail_todo_import_variadic.carbon
|
||||
|
||||
@@ -116,10 +116,10 @@ import Cpp library "variadic.h";
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_variadic.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: Variadic function` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(8);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: Cpp.variadic_foo(8);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(8);
|
||||
Cpp.variadic_foo(8);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -130,10 +130,10 @@ fn F() {
|
||||
// --- static.h
|
||||
|
||||
// TODO: Promote this warning to an error by default.
|
||||
// CHECK:STDERR: ./static.h:[[@LINE+3]]:13: warning: function 'foo' has internal linkage but is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | static auto foo() -> void;
|
||||
// CHECK:STDERR: ./static.h:[[@LINE+3]]:13: warning: function 'static_foo' has internal linkage but is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | static auto static_foo() -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
static auto foo() -> void;
|
||||
static auto static_foo() -> void;
|
||||
|
||||
// --- todo_fail_import_static.carbon
|
||||
|
||||
@@ -143,21 +143,21 @@ import Cpp library "static.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: todo_fail_import_static.carbon:[[@LINE+4]]:11: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.foo();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: todo_fail_import_static.carbon:[[@LINE+4]]:18: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.static_foo();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo();
|
||||
Cpp.static_foo();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// --- template_function.h
|
||||
|
||||
template<typename T>
|
||||
auto foo(T a) -> void;
|
||||
auto template_foo(T a) -> void;
|
||||
|
||||
template<typename T>
|
||||
auto bar(T a) -> T;
|
||||
auto template_bar(T a) -> T;
|
||||
|
||||
// --- import_template_function.carbon
|
||||
|
||||
@@ -167,13 +167,13 @@ import Cpp library "template_function.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.template_foo(1 as i32);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
fn G() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
return Cpp.bar(1 as i32);
|
||||
return Cpp.template_bar(1 as i32);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -185,26 +185,26 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %global_foo.cpp_overload_set.type: type = cpp_overload_set_type @global_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %global_foo.cpp_overload_set.value: %global_foo.cpp_overload_set.type = cpp_overload_set_value @global_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %global_foo.type: type = fn_type @global_foo [concrete]
|
||||
// CHECK:STDOUT: %global_foo: %global_foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .global_foo = %global_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %global_foo.cpp_overload_set.value: %global_foo.cpp_overload_set.type = cpp_overload_set_value @global_foo.cpp_overload_set [concrete = constants.%global_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %global_foo.decl: %global_foo.type = fn_decl @global_foo [concrete = constants.%global_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: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %global_foo.ref: %global_foo.cpp_overload_set.type = name_ref global_foo, imports.%global_foo.cpp_overload_set.value [concrete = constants.%global_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %global_foo.call: init %empty_tuple.type = call imports.%global_foo.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -239,49 +239,49 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %overloaded_foo.cpp_overload_set.type: type = cpp_overload_set_type @overloaded_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %overloaded_foo.cpp_overload_set.value: %overloaded_foo.cpp_overload_set.type = cpp_overload_set_value @overloaded_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %overloaded_foo.type: type = fn_type @overloaded_foo [concrete]
|
||||
// CHECK:STDOUT: %overloaded_foo: %overloaded_foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .overloaded_foo = %overloaded_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %overloaded_foo.cpp_overload_set.value: %overloaded_foo.cpp_overload_set.type = cpp_overload_set_value @overloaded_foo.cpp_overload_set [concrete = constants.%overloaded_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %overloaded_foo.decl: %overloaded_foo.type = fn_decl @overloaded_foo [concrete = constants.%overloaded_foo] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %overloaded_foo.ref: %overloaded_foo.cpp_overload_set.type = name_ref overloaded_foo, imports.%overloaded_foo.cpp_overload_set.value [concrete = constants.%overloaded_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %overloaded_foo.call: init %empty_tuple.type = call imports.%overloaded_foo.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_import_variadic.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %variadic_foo.cpp_overload_set.type: type = cpp_overload_set_type @variadic_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %variadic_foo.cpp_overload_set.value: %variadic_foo.cpp_overload_set.type = cpp_overload_set_value @variadic_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .variadic_foo = %variadic_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %variadic_foo.cpp_overload_set.value: %variadic_foo.cpp_overload_set.type = cpp_overload_set_value @variadic_foo.cpp_overload_set [concrete = constants.%variadic_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %variadic_foo.ref: %variadic_foo.cpp_overload_set.type = name_ref variadic_foo, imports.%variadic_foo.cpp_overload_set.value [concrete = constants.%variadic_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
@@ -290,26 +290,26 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %static_foo.cpp_overload_set.type: type = cpp_overload_set_type @static_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %static_foo.cpp_overload_set.value: %static_foo.cpp_overload_set.type = cpp_overload_set_value @static_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %static_foo.type: type = fn_type @static_foo [concrete]
|
||||
// CHECK:STDOUT: %static_foo: %static_foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .static_foo = %static_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %static_foo.cpp_overload_set.value: %static_foo.cpp_overload_set.type = cpp_overload_set_value @static_foo.cpp_overload_set [concrete = constants.%static_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %static_foo.decl: %static_foo.type = fn_decl @static_foo [concrete = constants.%static_foo] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %static_foo.ref: %static_foo.cpp_overload_set.type = name_ref static_foo, imports.%static_foo.cpp_overload_set.value [concrete = constants.%static_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %static_foo.call: init %empty_tuple.type = call imports.%static_foo.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -317,8 +317,8 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %template_foo.cpp_overload_set.type: type = cpp_overload_set_type @template_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %template_foo.cpp_overload_set.value: %template_foo.cpp_overload_set.type = cpp_overload_set_value @template_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
@@ -336,30 +336,30 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.8a4, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %bar.cpp_overload_set.type: type = cpp_overload_set_type @bar.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %bar.cpp_overload_set.value: %bar.cpp_overload_set.type = cpp_overload_set_value @bar.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %bar.type: type = fn_type @bar [concrete]
|
||||
// CHECK:STDOUT: %bar: %bar.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %template_foo.type: type = fn_type @template_foo [concrete]
|
||||
// CHECK:STDOUT: %template_foo: %template_foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %template_bar.cpp_overload_set.type: type = cpp_overload_set_type @template_bar.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %template_bar.cpp_overload_set.value: %template_bar.cpp_overload_set.type = cpp_overload_set_value @template_bar.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %template_bar.type: type = fn_type @template_bar [concrete]
|
||||
// CHECK:STDOUT: %template_bar: %template_bar.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .bar = %bar.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .template_foo = %template_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .template_bar = %template_bar.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %template_foo.cpp_overload_set.value: %template_foo.cpp_overload_set.type = cpp_overload_set_value @template_foo.cpp_overload_set [concrete = constants.%template_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Core.import_ref.64b: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.c5d) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.6ee)]
|
||||
// CHECK:STDOUT: %As.impl_witness_table.d22 = impl_witness_table (%Core.import_ref.64b), @Core.IntLiteral.as.As.impl [concrete]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %template_foo.decl: %template_foo.type = fn_decl @template_foo [concrete = constants.%template_foo] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %bar.cpp_overload_set.value: %bar.cpp_overload_set.type = cpp_overload_set_value @bar.cpp_overload_set [concrete = constants.%bar.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bar.decl: %bar.type = fn_decl @bar [concrete = constants.%bar] {
|
||||
// CHECK:STDOUT: %template_bar.cpp_overload_set.value: %template_bar.cpp_overload_set.type = cpp_overload_set_value @template_bar.cpp_overload_set [concrete = constants.%template_bar.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %template_bar.decl: %template_bar.type = fn_decl @template_bar [concrete = constants.%template_bar] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -369,34 +369,34 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %template_foo.ref: %template_foo.cpp_overload_set.type = name_ref template_foo, imports.%template_foo.cpp_overload_set.value [concrete = constants.%template_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0: %.453 = impl_witness_access constants.%As.impl_witness.e7f, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.8a4]
|
||||
// CHECK:STDOUT: %bound_method.loc8_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc8_22.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc8_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc8_13.2(%int_1) [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc8_13.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc8_13.2: %i32 = converted %int_1, %.loc8_13.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc8_13.2)
|
||||
// CHECK:STDOUT: %bound_method.loc8_22.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc8_22.2(%int_1) [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc8_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc8_22.2: %i32 = converted %int_1, %.loc8_22.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %template_foo.call: init %empty_tuple.type = call imports.%template_foo.decl(%.loc8_22.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %bar.ref: %bar.cpp_overload_set.type = name_ref bar, imports.%bar.cpp_overload_set.value [concrete = constants.%bar.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %template_bar.ref: %template_bar.cpp_overload_set.type = name_ref template_bar, imports.%template_bar.cpp_overload_set.value [concrete = constants.%template_bar.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %i32.loc14: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0: %.453 = impl_witness_access constants.%As.impl_witness.e7f, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.8a4]
|
||||
// CHECK:STDOUT: %bound_method.loc14_20.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc14_29.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc14_20.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc14_20.2(%int_1) [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc14_20.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc14_20.2: %i32 = converted %int_1, %.loc14_20.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %bar.call: init %i32 = call imports.%bar.decl(%.loc14_20.2)
|
||||
// CHECK:STDOUT: return %bar.call
|
||||
// CHECK:STDOUT: %bound_method.loc14_29.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc14_29.2(%int_1) [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc14_29.2: %i32 = converted %int_1, %.loc14_29.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %template_bar.call: init %i32 = call imports.%template_bar.decl(%.loc14_29.2)
|
||||
// CHECK:STDOUT: return %template_bar.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// --- with_definition.h
|
||||
|
||||
inline void foo() {}
|
||||
inline void inline_with_def() {}
|
||||
|
||||
// --- import_with_definition.carbon
|
||||
|
||||
@@ -26,7 +26,7 @@ import Cpp library "with_definition.h";
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.inline_with_def();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ fn MyF() {
|
||||
// --- without_definition.h
|
||||
|
||||
// TODO: Promote this warning to an error by default.
|
||||
// CHECK:STDERR: ./without_definition.h:[[@LINE+3]]:13: warning: inline function 'foo' is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | inline void foo();
|
||||
// CHECK:STDERR: ./without_definition.h:[[@LINE+3]]:13: warning: inline function 'inline_without_def' is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | inline void inline_without_def();
|
||||
// CHECK:STDERR: | ^
|
||||
inline void foo();
|
||||
inline void inline_without_def();
|
||||
|
||||
// --- todo_fail_import_without_definition.carbon
|
||||
|
||||
@@ -50,14 +50,14 @@ import Cpp library "without_definition.h";
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: todo_fail_import_without_definition.carbon:[[@LINE+4]]:11: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.foo();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: todo_fail_import_without_definition.carbon:[[@LINE+4]]:26: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.inline_without_def();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo();
|
||||
Cpp.inline_without_def();
|
||||
|
||||
// Don't error on repeated calls.
|
||||
Cpp.foo();
|
||||
Cpp.inline_without_def();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -89,26 +89,26 @@ fn MyF() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %inline_with_def.cpp_overload_set.type: type = cpp_overload_set_type @inline_with_def.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %inline_with_def.cpp_overload_set.value: %inline_with_def.cpp_overload_set.type = cpp_overload_set_value @inline_with_def.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %inline_with_def.type: type = fn_type @inline_with_def [concrete]
|
||||
// CHECK:STDOUT: %inline_with_def: %inline_with_def.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .inline_with_def = %inline_with_def.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %inline_with_def.cpp_overload_set.value: %inline_with_def.cpp_overload_set.type = cpp_overload_set_value @inline_with_def.cpp_overload_set [concrete = constants.%inline_with_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_with_def.decl: %inline_with_def.type = fn_decl @inline_with_def [concrete = constants.%inline_with_def] {} {}
|
||||
// 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: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %inline_with_def.ref: %inline_with_def.cpp_overload_set.type = name_ref inline_with_def, imports.%inline_with_def.cpp_overload_set.value [concrete = constants.%inline_with_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_with_def.call: init %empty_tuple.type = call imports.%inline_with_def.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -116,29 +116,29 @@ fn MyF() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %inline_without_def.cpp_overload_set.type: type = cpp_overload_set_type @inline_without_def.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %inline_without_def.cpp_overload_set.value: %inline_without_def.cpp_overload_set.type = cpp_overload_set_value @inline_without_def.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %inline_without_def.type: type = fn_type @inline_without_def [concrete]
|
||||
// CHECK:STDOUT: %inline_without_def: %inline_without_def.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .inline_without_def = %inline_without_def.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %inline_without_def.cpp_overload_set.value: %inline_without_def.cpp_overload_set.type = cpp_overload_set_value @inline_without_def.cpp_overload_set [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.decl: %inline_without_def.type = fn_decl @inline_without_def [concrete = constants.%inline_without_def] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref.loc12: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call.loc12: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc12: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc12: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref.loc15: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call.loc15: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc15: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc15: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+115
-115
@@ -16,8 +16,8 @@
|
||||
|
||||
// --- multiple_functions_no_overloads.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto bar(short a) -> void;
|
||||
auto no_overloads_foo(short a) -> void;
|
||||
auto no_overloads_bar(short a) -> void;
|
||||
|
||||
// --- import_multiple_functions_no_overloads.carbon
|
||||
|
||||
@@ -26,13 +26,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "multiple_functions_no_overloads.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.bar(1 as i16);
|
||||
Cpp.no_overloads_bar(1 as i16);
|
||||
}
|
||||
|
||||
// --- overloaded_functions.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto overloaded_foo(short a) -> void;
|
||||
auto overloaded_foo(int a) -> void;
|
||||
|
||||
// --- import_overloaded_functions.carbon
|
||||
|
||||
@@ -41,13 +41,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "overloaded_functions.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.overloaded_foo(1 as i32);
|
||||
}
|
||||
|
||||
// --- both_overloaded_functions_called.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto both_called_foo(short a) -> void;
|
||||
auto both_called_foo(int a) -> void;
|
||||
|
||||
// --- import_both_overloaded_functions_called.carbon
|
||||
|
||||
@@ -56,17 +56,17 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "both_overloaded_functions_called.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.foo(1 as i16);
|
||||
Cpp.both_called_foo(1 as i32);
|
||||
Cpp.both_called_foo(1 as i16);
|
||||
}
|
||||
|
||||
// --- multiple_overloaded_sets.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto multi_set_foo(short a) -> void;
|
||||
auto multi_set_foo(int a) -> void;
|
||||
|
||||
auto bar(long a) -> void;
|
||||
auto bar(int a) -> void;
|
||||
auto multi_set_bar(long a) -> void;
|
||||
auto multi_set_bar(int a) -> void;
|
||||
|
||||
// --- import_multiple_overloaded_sets.carbon
|
||||
|
||||
@@ -75,8 +75,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "multiple_overloaded_sets.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.bar(1 as i32);
|
||||
Cpp.multi_set_foo(1 as i32);
|
||||
Cpp.multi_set_bar(1 as i32);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -85,17 +85,17 @@ fn F() {
|
||||
|
||||
// --- int_literal.h
|
||||
|
||||
auto foo(int a) -> int;
|
||||
auto foo(unsigned int a) -> unsigned int;
|
||||
auto int_literal_foo(int a) -> int;
|
||||
auto int_literal_foo(unsigned int a) -> unsigned int;
|
||||
|
||||
auto foo(long a) -> long;
|
||||
auto foo(unsigned long a) -> unsigned long;
|
||||
auto int_literal_foo(long a) -> long;
|
||||
auto int_literal_foo(unsigned long a) -> unsigned long;
|
||||
|
||||
auto foo(long long a) -> long long;
|
||||
auto foo(unsigned long long a) -> unsigned long long;
|
||||
auto int_literal_foo(long long a) -> long long;
|
||||
auto int_literal_foo(unsigned long long a) -> unsigned long long;
|
||||
|
||||
auto foo(__int128 a) -> __int128;
|
||||
auto foo(unsigned __int128 a) -> unsigned __int128;
|
||||
auto int_literal_foo(__int128 a) -> __int128;
|
||||
auto int_literal_foo(unsigned __int128 a) -> unsigned __int128;
|
||||
|
||||
// --- import_int_literal.carbon
|
||||
|
||||
@@ -105,30 +105,30 @@ import Cpp library "int_literal.h";
|
||||
|
||||
fn F() {
|
||||
// i32_max
|
||||
let unused a: i32 = Cpp.foo(2147483647);
|
||||
let unused a: i32 = Cpp.int_literal_foo(2147483647);
|
||||
|
||||
// i32_max + 1
|
||||
// It could fit to unsigned int, but only signed integers are considered, so assigned to long.
|
||||
// Decimal, hexadecimal and binary integer literals are treated the same when assigning a C++ type.
|
||||
let unused b: i64 = Cpp.foo(2147483648);
|
||||
let unused b_hexa: i64 = Cpp.foo(0x8000_0000);
|
||||
let unused b_binary: i64 = Cpp.foo(0b1000_0000_0000_0000_0000_0000_0000_0000);
|
||||
let unused b: i64 = Cpp.int_literal_foo(2147483648);
|
||||
let unused b_hexa: i64 = Cpp.int_literal_foo(0x8000_0000);
|
||||
let unused b_binary: i64 = Cpp.int_literal_foo(0b1000_0000_0000_0000_0000_0000_0000_0000);
|
||||
|
||||
// i64_max
|
||||
let unused c: i64 = Cpp.foo(9223372036854775807);
|
||||
let unused c: i64 = Cpp.int_literal_foo(9223372036854775807);
|
||||
|
||||
// i64_max + 1
|
||||
// Could fit to unsigned long, but only signed integers are considered, so fitted to _int128.
|
||||
let unused d: i128 = Cpp.foo(9223372036854775808);
|
||||
let unused d: i128 = Cpp.int_literal_foo(9223372036854775808);
|
||||
|
||||
// u64_max
|
||||
let unused e: i128 = Cpp.foo(18446744073709551615);
|
||||
let unused e: i128 = Cpp.int_literal_foo(18446744073709551615);
|
||||
|
||||
// u64_max + 1
|
||||
let unused f: i128 = Cpp.foo(18446744073709551616);
|
||||
let unused f: i128 = Cpp.int_literal_foo(18446744073709551616);
|
||||
|
||||
// i128_max
|
||||
let unused g: i128 = Cpp.foo(170141183460469231731687303715884105727);
|
||||
let unused g: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105727);
|
||||
}
|
||||
|
||||
// --- fail_import_large_int_literal.carbon
|
||||
@@ -140,21 +140,21 @@ import Cpp library "int_literal.h";
|
||||
fn F() {
|
||||
// TODO: get rid of the second error message here.
|
||||
// i128_max + 1
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+8]]:32: error: integer value 170141183460469231731687303715884105728 too large to fit in a signed C++ integer type; requires 129 bits, but max is 128 [IntTooLargeForCppType]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+8]]:44: error: integer value 170141183460469231731687303715884105728 too large to fit in a signed C++ integer type; requires 129 bits, but max is 128 [IntTooLargeForCppType]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:32: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:44: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
let unused h: i128 = Cpp.foo(170141183460469231731687303715884105728);
|
||||
let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
}
|
||||
|
||||
// --- negative_int_literal.h
|
||||
|
||||
auto foo(long a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto neg_literal_foo(long a) -> void;
|
||||
auto neg_literal_foo(int a) -> void;
|
||||
|
||||
// --- import_negative_int_literal.carbon
|
||||
|
||||
@@ -163,13 +163,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "negative_int_literal.h";
|
||||
|
||||
fn F() {
|
||||
// selects `auto foo(int a) -> void;`
|
||||
Cpp.foo(-1);
|
||||
// selects `auto neg_literal_foo(int a) -> void;`
|
||||
Cpp.neg_literal_foo(-1);
|
||||
}
|
||||
|
||||
// --- negative_literal_passed_to_unsigned.h
|
||||
|
||||
auto foo(unsigned int a) -> void;
|
||||
auto neg_to_unsigned_foo(unsigned int a) -> void;
|
||||
|
||||
// --- fail_import_negative_literal_passed_to_unsigned.carbon
|
||||
|
||||
@@ -178,21 +178,21 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "negative_literal_passed_to_unsigned.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+8]]:11: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: Cpp.foo(-1);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+8]]:27: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: Cpp.neg_to_unsigned_foo(-1);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./negative_literal_passed_to_unsigned.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ./negative_literal_passed_to_unsigned.h:2:39: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto neg_to_unsigned_foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-1);
|
||||
Cpp.neg_to_unsigned_foo(-1);
|
||||
}
|
||||
|
||||
// --- floating_point_literal.h
|
||||
|
||||
auto foo(float a) -> float;
|
||||
auto foo(double a) -> double;
|
||||
auto float_literal_foo(float a) -> float;
|
||||
auto float_literal_foo(double a) -> double;
|
||||
|
||||
// --- import_floating_point_literal.carbon
|
||||
|
||||
@@ -201,7 +201,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "floating_point_literal.h";
|
||||
|
||||
fn F() {
|
||||
let unused d: f64 = Cpp.foo(1.0);
|
||||
let unused d: f64 = Cpp.float_literal_foo(1.0);
|
||||
}
|
||||
|
||||
// --- fail_import_large_floating_point_literal.carbon
|
||||
@@ -211,15 +211,15 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "floating_point_literal.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+8]]:11: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(1.8e+308);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+8]]:25: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.float_literal_foo(1.8e+308);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./floating_point_literal.h:3:17: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(double a) -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ./floating_point_literal.h:3:31: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto float_literal_foo(double a) -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1.8e+308);
|
||||
Cpp.float_literal_foo(1.8e+308);
|
||||
}
|
||||
|
||||
// --- struct_init.h
|
||||
@@ -630,7 +630,7 @@ fn F() {
|
||||
|
||||
// --- upsizing.h
|
||||
|
||||
auto foo(int a) -> void;
|
||||
auto upsizing_foo(int a) -> void;
|
||||
|
||||
// --- upsizing.carbon
|
||||
|
||||
@@ -639,12 +639,12 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "upsizing.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.foo(1 as i16);
|
||||
Cpp.upsizing_foo(1 as i16);
|
||||
}
|
||||
|
||||
// --- signedness_change.h
|
||||
|
||||
auto foo(unsigned int a) -> void;
|
||||
auto signedness_foo(unsigned int a) -> void;
|
||||
|
||||
// --- fail_signedness_change_rejected.carbon
|
||||
|
||||
@@ -653,23 +653,23 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "signedness_change.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+11]]:11: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+8]]:11: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.signedness_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+8]]:22: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.signedness_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./signedness_change.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ./signedness_change.h:2:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto signedness_foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.signedness_foo(1 as i32);
|
||||
}
|
||||
|
||||
// --- downsizing_rejected.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto downsizing_foo(short a) -> void;
|
||||
|
||||
// --- fail_import_downsizing_rejected.carbon
|
||||
|
||||
@@ -678,18 +678,18 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "downsizing_rejected.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+11]]:11: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+8]]:11: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.downsizing_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+8]]:22: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.downsizing_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./downsizing_rejected.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ./downsizing_rejected.h:2:27: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto downsizing_foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.downsizing_foo(1 as i32);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -698,7 +698,7 @@ fn F() {
|
||||
|
||||
// --- no_viable_function.h
|
||||
|
||||
auto foo(short a, int b) -> void;
|
||||
auto no_viable_foo(short a, int b) -> void;
|
||||
|
||||
// --- fail_import_no_viable_function.carbon
|
||||
|
||||
@@ -707,15 +707,15 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "no_viable_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+8]]:19: error: no matching function for call to 'foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+8]]:29: error: no matching function for call to 'no_viable_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.no_viable_foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:6: note: candidate function not viable: requires 2 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto foo(short a, int b) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: 2 | auto no_viable_foo(short a, int b) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i64);
|
||||
Cpp.no_viable_foo(1 as i64);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -724,8 +724,8 @@ fn F() {
|
||||
|
||||
// --- ambiguous_overload.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto ambiguous_foo(short a) -> void;
|
||||
auto ambiguous_foo(int a) -> void;
|
||||
|
||||
// --- fail_import_ambiguous_overload.carbon
|
||||
|
||||
@@ -734,19 +734,19 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "ambiguous_overload.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+12]]:19: error: call to 'foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+12]]:29: error: call to 'ambiguous_foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.ambiguous_foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./ambiguous_overload.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto foo(short a) -> void;
|
||||
// CHECK:STDERR: 2 | auto ambiguous_foo(short a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./ambiguous_overload.h:3:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto foo(int a) -> void;
|
||||
// CHECK:STDERR: 3 | auto ambiguous_foo(int a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i64);
|
||||
Cpp.ambiguous_foo(1 as i64);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -755,8 +755,8 @@ fn F() {
|
||||
|
||||
// --- deleted_function.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void = delete;
|
||||
auto deleted_foo(short a) -> void;
|
||||
auto deleted_foo(int a) -> void = delete;
|
||||
|
||||
// --- fail_import_deleted_function.carbon
|
||||
|
||||
@@ -765,27 +765,27 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "deleted_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+12]]:19: error: call to deleted function 'foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+12]]:27: error: call to deleted function 'deleted_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.deleted_foo(1 as i32);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted_function.h:3:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto foo(int a) -> void = delete;
|
||||
// CHECK:STDERR: 3 | auto deleted_foo(int a) -> void = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted_function.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto foo(short a) -> void;
|
||||
// CHECK:STDERR: 2 | auto deleted_foo(short a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.deleted_foo(1 as i32);
|
||||
}
|
||||
|
||||
// --- fail_missing_impl.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
void foo();
|
||||
void foo(int);
|
||||
void missing_impl_foo();
|
||||
void missing_impl_foo(int);
|
||||
''';
|
||||
|
||||
interface I {}
|
||||
@@ -793,12 +793,12 @@ interface I {}
|
||||
fn EchoValue[ValueT: I](unused generic value: ValueT) {}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE+7]]:3: error: cannot convert type `<type of Cpp.foo>` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EchoValue(Cpp.foo);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE+7]]:3: error: cannot convert type `<type of Cpp.missing_impl_foo>` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EchoValue(Cpp.missing_impl_foo);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EchoValue[ValueT: I](unused generic value: ValueT) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
EchoValue(Cpp.foo);
|
||||
EchoValue(Cpp.missing_impl_foo);
|
||||
}
|
||||
|
||||
+836
-836
File diff suppressed because it is too large
Load Diff
@@ -462,23 +462,23 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class X {}
|
||||
class XByRef {}
|
||||
|
||||
inline Cpp '''c++
|
||||
template<typename T> void TakeAnything_ExpectConstLRef(T&&) {
|
||||
static_assert(__is_same(T, const Carbon::X&));
|
||||
template<typename T> void TakeAnything_ExpectConstLRef_ByRef(T&&) {
|
||||
static_assert(__is_same(T, const Carbon::XByRef&));
|
||||
}
|
||||
''';
|
||||
|
||||
fn PassConstRef(ref x: const X) {
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE+7]]:36: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: Cpp.TakeAnything_ExpectConstLRef(ref x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE-9]]:59: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: template<typename T> void TakeAnything_ExpectConstLRef(T&&) {
|
||||
// CHECK:STDERR: ^
|
||||
fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE+7]]:42: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: Cpp.TakeAnything_ExpectConstLRef_ByRef(ref x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE-9]]:65: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: template<typename T> void TakeAnything_ExpectConstLRef_ByRef(T&&) {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakeAnything_ExpectConstLRef(ref x);
|
||||
Cpp.TakeAnything_ExpectConstLRef_ByRef(ref x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+394
-394
File diff suppressed because it is too large
Load Diff
@@ -29,9 +29,9 @@ let min_explicit_literal: i32 = Cpp.min(i32, 1, 2);
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<typename> struct X;
|
||||
template<typename> struct Y;
|
||||
template<template<typename> typename... TT, typename... T> void f(T ...a) {}
|
||||
template<typename> struct TemplateTemplateX;
|
||||
template<typename> struct TemplateTemplateY;
|
||||
template<template<typename> typename... TT, typename... T> void template_template_fn(T ...a) {}
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
@@ -40,15 +40,15 @@ fn Call() {
|
||||
|
||||
// `a` and `b` are not classified as template arguments, so are passed as the
|
||||
// function parameter pack `a...`.
|
||||
Cpp.f(a, b);
|
||||
Cpp.template_template_fn(a, b);
|
||||
|
||||
// `Cpp.X` and `Cpp.Y` are classified as template template arguments, so they
|
||||
// `Cpp.TemplateTemplateX` and `Cpp.TemplateTemplateY` are classified as template template arguments, so they
|
||||
// are passed as the template parameter pack `TT...`.
|
||||
Cpp.f(Cpp.X, Cpp.Y);
|
||||
Cpp.template_template_fn(Cpp.TemplateTemplateX, Cpp.TemplateTemplateY);
|
||||
|
||||
// Pass some template arguments followed by some function arguments.
|
||||
Cpp.f(Cpp.X, Cpp.Y, a, b);
|
||||
Cpp.f(Cpp.X, a, b, a);
|
||||
Cpp.template_template_fn(Cpp.TemplateTemplateX, Cpp.TemplateTemplateY, a, b);
|
||||
Cpp.template_template_fn(Cpp.TemplateTemplateX, a, b, a);
|
||||
}
|
||||
|
||||
// --- nontype_template_arg.carbon
|
||||
@@ -56,25 +56,25 @@ fn Call() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<int... I, typename... T> void f(T ...a) {}
|
||||
template<int I = 0, int J = 0, typename = void, typename... T> void g(T ...a) {}
|
||||
template<int... I, typename... T> void nontype_f(T ...a) {}
|
||||
template<int I = 0, int J = 0, typename = void, typename... T> void nontype_g(T ...a) {}
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
let a: i32 = 0;
|
||||
let b: i32 = 0;
|
||||
|
||||
Cpp.f(a, b);
|
||||
Cpp.nontype_f(a, b);
|
||||
// TODO: There should be a way to indicate that the arguments are template
|
||||
// arguments, not function arguments, when calling `f`.
|
||||
Cpp.f(1, 2);
|
||||
// arguments, not function arguments, when calling `nontype_f`.
|
||||
Cpp.nontype_f(1, 2);
|
||||
|
||||
// Two function arguments.
|
||||
Cpp.g(1, 2);
|
||||
Cpp.nontype_g(1, 2);
|
||||
// Three template arguments.
|
||||
Cpp.g(1, 2, i32);
|
||||
Cpp.nontype_g(1, 2, i32);
|
||||
// Three template arguments and two function arguments.
|
||||
Cpp.g(1, 2, i32, 3, 4);
|
||||
Cpp.nontype_g(1, 2, i32, 3, 4);
|
||||
}
|
||||
|
||||
// --- fail_function_arg_not_template_arg.carbon
|
||||
@@ -82,19 +82,19 @@ fn Call() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<int N> void f();
|
||||
template<int N> void fn_arg_not_template_arg_f();
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
// We treat this as a function argument, even though that makes the call fail.
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE+7]]:10: error: no matching function for call to 'f' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.f(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE+7]]:34: error: no matching function for call to 'fn_arg_not_template_arg_f' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.fn_arg_not_template_arg_f(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE-8]]:22: note: candidate function template not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | template<int N> void f();
|
||||
// CHECK:STDERR: 5 | template<int N> void fn_arg_not_template_arg_f();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.f(1);
|
||||
Cpp.fn_arg_not_template_arg_f(1);
|
||||
}
|
||||
|
||||
// --- function_arg_not_template_arg_overloaded.carbon
|
||||
@@ -102,12 +102,12 @@ fn Call() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<int N> void f();
|
||||
void f(int n);
|
||||
template<int N> void overloaded_f();
|
||||
void overloaded_f(int n);
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
Cpp.f(1);
|
||||
Cpp.overloaded_f(1);
|
||||
}
|
||||
|
||||
// --- overloaded_with_different_template_params.carbon
|
||||
@@ -115,18 +115,18 @@ fn Call() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<typename T> struct X;
|
||||
struct Y;
|
||||
template<typename T> struct OverloadedTemplateX;
|
||||
struct OverloadedNonTemplateY;
|
||||
|
||||
template<int N, typename T> void f();
|
||||
template<typename T> void f();
|
||||
template<template<typename> typename T> void f();
|
||||
template<int N, typename T> void different_template_params_f();
|
||||
template<typename T> void different_template_params_f();
|
||||
template<template<typename> typename T> void different_template_params_f();
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
Cpp.f(1, i32);
|
||||
Cpp.f(Cpp.X);
|
||||
Cpp.f(Cpp.Y);
|
||||
Cpp.different_template_params_f(1, i32);
|
||||
Cpp.different_template_params_f(Cpp.OverloadedTemplateX);
|
||||
Cpp.different_template_params_f(Cpp.OverloadedNonTemplateY);
|
||||
}
|
||||
|
||||
// --- only_call_templates_when_given_template_args.carbon
|
||||
@@ -137,13 +137,13 @@ import Cpp inline '''
|
||||
struct NonTemplate {};
|
||||
struct Template {};
|
||||
|
||||
NonTemplate f(unsigned char, unsigned char);
|
||||
template<typename = void> Template f(unsigned char, int = 0);
|
||||
NonTemplate only_call_templates_f(unsigned char, unsigned char);
|
||||
template<typename = void> Template only_call_templates_f(unsigned char, int = 0);
|
||||
''';
|
||||
|
||||
// Prefers the non-template because it has a better match for the second parameter.
|
||||
let x: Cpp.NonTemplate = Cpp.f(1 as u8, 2 as u8);
|
||||
let x: Cpp.NonTemplate = Cpp.only_call_templates_f(1 as u8, 2 as u8);
|
||||
|
||||
// Calls the template; the non-template is not considered due to the template
|
||||
// argument `i32`.
|
||||
let y: Cpp.Template = Cpp.f(i32, 1 as u8);
|
||||
let y: Cpp.Template = Cpp.only_call_templates_f(i32, 1 as u8);
|
||||
|
||||
+365
-365
File diff suppressed because it is too large
Load Diff
+144
-144
@@ -15,12 +15,12 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo(void* _Nonnull x) -> void;
|
||||
auto foo_non_nullable_param(void* _Nonnull x) -> void;
|
||||
''';
|
||||
|
||||
fn F(input: Cpp.void*) {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo(input);
|
||||
Cpp.foo_non_nullable_param(input);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -29,12 +29,12 @@ fn F(input: Cpp.void*) {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo() -> void* _Nonnull;
|
||||
auto foo_non_nullable_return() -> void* _Nonnull;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
let unused output: Cpp.void* = Cpp.foo();
|
||||
let unused output: Cpp.void* = Cpp.foo_non_nullable_return();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -43,12 +43,12 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo(void* x) -> void;
|
||||
auto foo_nullable_param(void* x) -> void;
|
||||
''';
|
||||
|
||||
fn F(input: Cpp.void*) {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo(input);
|
||||
Cpp.foo_nullable_param(input);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -57,12 +57,12 @@ fn F(input: Cpp.void*) {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo(void* x) -> void;
|
||||
auto foo_null_param(void* x) -> void;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo(Core.Optional(Cpp.void*).None());
|
||||
Cpp.foo_null_param(Core.Optional(Cpp.void*).None());
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -71,12 +71,12 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo() -> void*;
|
||||
auto foo_nullable_return() -> void*;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
let unused output: Core.Optional(Cpp.void*) = Cpp.foo();
|
||||
let unused output: Core.Optional(Cpp.void*) = Cpp.foo_nullable_return();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -85,14 +85,14 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto Return() -> void* _Nonnull* _Nonnull;
|
||||
auto Invoke(void* _Nonnull* _Nonnull) -> void;
|
||||
auto Return_pointer() -> void* _Nonnull* _Nonnull;
|
||||
auto Invoke_pointer(void* _Nonnull* _Nonnull) -> void;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var non_nullable_pointer: Cpp.void** = Cpp.Return();
|
||||
Cpp.Invoke(non_nullable_pointer);
|
||||
var non_nullable_pointer: Cpp.void** = Cpp.Return_pointer();
|
||||
Cpp.Invoke_pointer(non_nullable_pointer);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -101,14 +101,14 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto Return() -> const void* _Nonnull;
|
||||
auto Invoke(const void* _Nonnull) -> void;
|
||||
auto Return_const() -> const void* _Nonnull;
|
||||
auto Invoke_const(const void* _Nonnull) -> void;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var const_void_pointer: const Cpp.void* = Cpp.Return();
|
||||
Cpp.Invoke(const_void_pointer);
|
||||
var const_void_pointer: const Cpp.void* = Cpp.Return_const();
|
||||
Cpp.Invoke_const(const_void_pointer);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -118,20 +118,20 @@ fn F() {
|
||||
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Cpp.void [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.cpp_overload_set.type: type = cpp_overload_set_type @foo_non_nullable_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.cpp_overload_set.value: %foo_non_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_non_nullable_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.type: type = fn_type @foo_non_nullable_param [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param: %foo_non_nullable_param.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_non_nullable_param = %foo_non_nullable_param.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.cpp_overload_set.value: %foo_non_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_non_nullable_param.cpp_overload_set [concrete = constants.%foo_non_nullable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.decl: %foo_non_nullable_param.type = fn_decl @foo_non_nullable_param [concrete = constants.%foo_non_nullable_param] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -141,9 +141,9 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F(%input.param: %ptr) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.ref: %foo_non_nullable_param.cpp_overload_set.type = name_ref foo_non_nullable_param, imports.%foo_non_nullable_param.cpp_overload_set.value [concrete = constants.%foo_non_nullable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %input.ref: %ptr = name_ref input, %input
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%input.ref)
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.call: init %empty_tuple.type = call imports.%foo_non_nullable_param.decl(%input.ref)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -154,20 +154,20 @@ fn F() {
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Cpp.void [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
|
||||
// CHECK:STDOUT: %output.patt: %pattern_type = value_binding_pattern output [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.cpp_overload_set.type: type = cpp_overload_set_type @foo_non_nullable_return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.cpp_overload_set.value: %foo_non_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_non_nullable_return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.type: type = fn_type @foo_non_nullable_return [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return: %foo_non_nullable_return.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_non_nullable_return = %foo_non_nullable_return.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.cpp_overload_set.value: %foo_non_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_non_nullable_return.cpp_overload_set [concrete = constants.%foo_non_nullable_return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.decl: %foo_non_nullable_return.type = fn_decl @foo_non_nullable_return [concrete = constants.%foo_non_nullable_return] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -177,16 +177,16 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_34: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call: init %ptr = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %.loc10_42.1: %ptr = value_of_initializer %foo.call
|
||||
// CHECK:STDOUT: %.loc10_42.2: %ptr = converted %foo.call, %.loc10_42.1
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.ref: %foo_non_nullable_return.cpp_overload_set.type = name_ref foo_non_nullable_return, imports.%foo_non_nullable_return.cpp_overload_set.value [concrete = constants.%foo_non_nullable_return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.call: init %ptr = call imports.%foo_non_nullable_return.decl()
|
||||
// CHECK:STDOUT: %.loc10_62.1: %ptr = value_of_initializer %foo_non_nullable_return.call
|
||||
// CHECK:STDOUT: %.loc10_62.2: %ptr = converted %foo_non_nullable_return.call, %.loc10_62.1
|
||||
// CHECK:STDOUT: %.loc10_30: type = splice_block %ptr [concrete = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %output: %ptr = wrapper_binding output, %.loc10_42.2
|
||||
// CHECK:STDOUT: %output: %ptr = wrapper_binding output, %.loc10_62.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %output.patt: %pattern_type = value_binding_pattern output [concrete = constants.%output.patt]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -199,8 +199,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %ptr.00a: type = ptr_type %Cpp.void [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_param.cpp_overload_set.type: type = cpp_overload_set_type @foo_nullable_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_param.cpp_overload_set.value: %foo_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete]
|
||||
// CHECK:STDOUT: %T.220: %OptionalStorage.type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
@@ -220,8 +220,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete]
|
||||
// CHECK:STDOUT: %OptionalStorage.facet.427: %OptionalStorage.type = facet_value %ptr.00a, (%OptionalStorage.impl_witness.d51) [concrete]
|
||||
// CHECK:STDOUT: %Optional.14b: type = class_type @Optional, @Optional(%OptionalStorage.facet.427) [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_param.type: type = fn_type @foo_nullable_param [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_param: %foo_nullable_param.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.8e0: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.14b)> [concrete]
|
||||
// CHECK:STDOUT: %OptionalAs.type.3b8: type = facet_type <@OptionalAs, @OptionalAs(%T.220)> [symbolic]
|
||||
// CHECK:STDOUT: %U.042: %OptionalAs.type.3b8 = symbolic_binding U, 1 [symbolic]
|
||||
@@ -239,17 +239,17 @@ fn F() {
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.002: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.14b, %ImplicitAs.facet.3be) [concrete]
|
||||
// CHECK:STDOUT: %.fde: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.002, %ImplicitAs.facet.3be [concrete]
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %U.as_type.as.ImplicitAs.impl.Convert.f63, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.427, %OptionalAs.facet) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_11.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_26.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_nullable_param = %foo_nullable_param.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_nullable_param.cpp_overload_set.value: %foo_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_param.cpp_overload_set [concrete = constants.%foo_nullable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddb)]
|
||||
// CHECK:STDOUT: %Core.import_ref.105 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.fa7: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some.type (%ptr.as.OptionalStorage.impl.Some.type.71e) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some (constants.%ptr.as.OptionalStorage.impl.Some.caa)]
|
||||
@@ -257,13 +257,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %Core.import_ref.306 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.3e3 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %OptionalStorage.impl_witness_table.110 = impl_witness_table (%Core.import_ref.509, %Core.import_ref.105, %Core.import_ref.fa7, %Core.import_ref.a90, %Core.import_ref.306, %Core.import_ref.3e3), @ptr.as.OptionalStorage.impl [concrete]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_nullable_param.decl: %foo_nullable_param.type = fn_decl @foo_nullable_param [concrete = constants.%foo_nullable_param] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc10_16.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %.loc10_31.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.00a, (constants.%OptionalStorage.impl_witness.d51) [concrete = constants.%OptionalStorage.facet.427]
|
||||
// CHECK:STDOUT: %.loc10_16.2: %OptionalStorage.type = converted constants.%ptr.00a, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet.427]
|
||||
// CHECK:STDOUT: %.loc10_31.2: %OptionalStorage.type = converted constants.%ptr.00a, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet.427]
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.427) [concrete = constants.%Optional.14b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -277,34 +277,34 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F(%input.param: %ptr.00a) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_nullable_param.ref: %foo_nullable_param.cpp_overload_set.type = name_ref foo_nullable_param, imports.%foo_nullable_param.cpp_overload_set.value [concrete = constants.%foo_nullable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %input.ref: %ptr.00a = name_ref input, %input
|
||||
// CHECK:STDOUT: %impl.elem0: %.fde = impl_witness_access constants.%ImplicitAs.impl_witness.50c, element0 [concrete = constants.%U.as_type.as.ImplicitAs.impl.Convert.f63]
|
||||
// CHECK:STDOUT: %bound_method.loc10_11.1: <bound method> = bound_method %input.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %bound_method.loc10_26.1: <bound method> = bound_method %input.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @U.as_type.as.ImplicitAs.impl.Convert.2(constants.%OptionalStorage.facet.427, constants.%OptionalAs.facet) [concrete = constants.%U.as_type.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc10_11.2: <bound method> = bound_method %input.ref, %specific_fn
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call: init %Optional.14b = call %bound_method.loc10_11.2(%input.ref)
|
||||
// CHECK:STDOUT: %.loc10_11.1: init %Optional.14b = converted %input.ref, %U.as_type.as.ImplicitAs.impl.Convert.call
|
||||
// CHECK:STDOUT: %.loc10_11.2: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_11.3: ref %Optional.14b = temporary %.loc10_11.2, %.loc10_11.1
|
||||
// CHECK:STDOUT: %.loc10_11.4: %Optional.14b = acquire_value %.loc10_11.3
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc10_11.4)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_11.3, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_11.3)
|
||||
// CHECK:STDOUT: %bound_method.loc10_26.2: <bound method> = bound_method %input.ref, %specific_fn
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call: init %Optional.14b = call %bound_method.loc10_26.2(%input.ref)
|
||||
// CHECK:STDOUT: %.loc10_26.1: init %Optional.14b = converted %input.ref, %U.as_type.as.ImplicitAs.impl.Convert.call
|
||||
// CHECK:STDOUT: %.loc10_26.2: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_26.3: ref %Optional.14b = temporary %.loc10_26.2, %.loc10_26.1
|
||||
// CHECK:STDOUT: %.loc10_26.4: %Optional.14b = acquire_value %.loc10_26.3
|
||||
// CHECK:STDOUT: %foo_nullable_param.call: init %empty_tuple.type = call imports.%foo_nullable_param.decl(%.loc10_26.4)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_26.3, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_26.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_11.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_26.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_11.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_26.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_11.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_26.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -313,8 +313,8 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_null_param.cpp_overload_set.type: type = cpp_overload_set_type @foo_null_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_null_param.cpp_overload_set.value: %foo_null_param.cpp_overload_set.type = cpp_overload_set_value @foo_null_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Optional.type: type = generic_class_type @Optional [concrete]
|
||||
// CHECK:STDOUT: %Optional.generic: %Optional.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete]
|
||||
@@ -343,9 +343,9 @@ fn F() {
|
||||
// CHECK:STDOUT: %Optional.None.type.18e: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet) [concrete]
|
||||
// CHECK:STDOUT: %Optional.None.aa9: %Optional.None.type.18e = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Optional.None.specific_fn: <specific function> = specific_function %Optional.None.aa9, @Optional.None(%OptionalStorage.facet) [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_41.3 [concrete]
|
||||
// CHECK:STDOUT: %foo_null_param.type: type = fn_type @foo_null_param [concrete]
|
||||
// CHECK:STDOUT: %foo_null_param: %foo_null_param.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_52.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -358,11 +358,11 @@ fn F() {
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_null_param = %foo_null_param.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_null_param.cpp_overload_set.value: %foo_null_param.cpp_overload_set.type = cpp_overload_set_value @foo_null_param.cpp_overload_set [concrete = constants.%foo_null_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Core.Optional: %Optional.type = import_ref Core//prelude/types/optional, Optional, loaded [concrete = constants.%Optional.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.e9f: @Optional.%Optional.None.type (%Optional.None.type.bdc) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @Optional.%Optional.None (constants.%Optional.None.01e)]
|
||||
// CHECK:STDOUT: %Core.CppCompat: <namespace> = import_ref Core//prelude, CppCompat, loaded
|
||||
@@ -379,13 +379,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %Core.import_ref.306 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.3e3 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %OptionalStorage.impl_witness_table.110 = impl_witness_table (%Core.import_ref.509, %Core.import_ref.307, %Core.import_ref.c9a, %Core.import_ref.a90, %Core.import_ref.306, %Core.import_ref.3e3), @ptr.as.OptionalStorage.impl [concrete]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_null_param.decl: %foo_null_param.type = fn_decl @foo_null_param [concrete = constants.%foo_null_param] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc10_42.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %.loc10_53.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.00a, (constants.%OptionalStorage.impl_witness.d51) [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %.loc10_42.2: %OptionalStorage.type = converted constants.%ptr.00a, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %.loc10_53.2: %OptionalStorage.type = converted constants.%ptr.00a, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.14b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -396,39 +396,39 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_null_param.ref: %foo_null_param.cpp_overload_set.type = name_ref foo_null_param, imports.%foo_null_param.cpp_overload_set.value [concrete = constants.%foo_null_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Optional.ref: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_36: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr.00a]
|
||||
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr, (constants.%OptionalStorage.impl_witness.d51) [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %.loc10_34: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %.loc10_45: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.14b]
|
||||
// CHECK:STDOUT: %.loc10_35: %Optional.None.type.18e = specific_constant imports.%Core.import_ref.e9f, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.aa9]
|
||||
// CHECK:STDOUT: %None.ref: %Optional.None.type.18e = name_ref None, %.loc10_35 [concrete = constants.%Optional.None.aa9]
|
||||
// CHECK:STDOUT: %.loc10_46: %Optional.None.type.18e = specific_constant imports.%Core.import_ref.e9f, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.aa9]
|
||||
// CHECK:STDOUT: %None.ref: %Optional.None.type.18e = name_ref None, %.loc10_46 [concrete = constants.%Optional.None.aa9]
|
||||
// CHECK:STDOUT: %Optional.None.specific_fn: <specific function> = specific_function %None.ref, @Optional.None(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.specific_fn]
|
||||
// CHECK:STDOUT: %Optional.None.call: init %Optional.14b = call %Optional.None.specific_fn()
|
||||
// CHECK:STDOUT: %.loc10_41.1: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_41.2: ref %Optional.14b = temporary %.loc10_41.1, %Optional.None.call
|
||||
// CHECK:STDOUT: %.loc10_41.3: %Optional.14b = acquire_value %.loc10_41.2
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc10_41.3)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_41.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_41.2)
|
||||
// CHECK:STDOUT: %.loc10_52.1: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_52.2: ref %Optional.14b = temporary %.loc10_52.1, %Optional.None.call
|
||||
// CHECK:STDOUT: %.loc10_52.3: %Optional.14b = acquire_value %.loc10_52.2
|
||||
// CHECK:STDOUT: %foo_null_param.call: init %empty_tuple.type = call imports.%foo_null_param.decl(%.loc10_52.3)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_52.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_52.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_41.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_52.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_41.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_52.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_41.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_52.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -459,11 +459,11 @@ fn F() {
|
||||
// CHECK:STDOUT: %Optional.14b: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.65e: type = pattern_type %Optional.14b [concrete]
|
||||
// CHECK:STDOUT: %output.patt: %pattern_type.65e = value_binding_pattern output [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_57.3 [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_return.cpp_overload_set.type: type = cpp_overload_set_type @foo_nullable_return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_return.cpp_overload_set.value: %foo_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_return.type: type = fn_type @foo_nullable_return [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_return: %foo_nullable_return.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_73.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -477,7 +477,7 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_nullable_return = %foo_nullable_return.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Optional: %Optional.type = import_ref Core//prelude/types/optional, Optional, loaded [concrete = constants.%Optional.generic]
|
||||
@@ -495,8 +495,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %Core.import_ref.306 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.3e3 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %OptionalStorage.impl_witness_table.110 = impl_witness_table (%Core.import_ref.509, %Core.import_ref.105, %Core.import_ref.c9a, %Core.import_ref.a90, %Core.import_ref.306, %Core.import_ref.3e3), @ptr.as.OptionalStorage.impl [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_nullable_return.cpp_overload_set.value: %foo_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_return.cpp_overload_set [concrete = constants.%foo_nullable_return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_nullable_return.decl: %foo_nullable_return.type = fn_decl @foo_nullable_return [concrete = constants.%foo_nullable_return] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.00a, (constants.%OptionalStorage.impl_witness.d51) [concrete = constants.%OptionalStorage.facet]
|
||||
@@ -510,11 +510,11 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_49: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call: init %Optional.14b = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %.loc10_57.1: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_57.2: ref %Optional.14b = temporary %.loc10_57.1, %foo.call
|
||||
// CHECK:STDOUT: %.loc10_57.3: %Optional.14b = acquire_value %.loc10_57.2
|
||||
// CHECK:STDOUT: %foo_nullable_return.ref: %foo_nullable_return.cpp_overload_set.type = name_ref foo_nullable_return, imports.%foo_nullable_return.cpp_overload_set.value [concrete = constants.%foo_nullable_return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_nullable_return.call: init %Optional.14b = call imports.%foo_nullable_return.decl()
|
||||
// CHECK:STDOUT: %.loc10_73.1: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_73.2: ref %Optional.14b = temporary %.loc10_73.1, %foo_nullable_return.call
|
||||
// CHECK:STDOUT: %.loc10_73.3: %Optional.14b = acquire_value %.loc10_73.2
|
||||
// CHECK:STDOUT: %.loc10_45.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Optional.ref: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic]
|
||||
@@ -525,26 +525,26 @@ fn F() {
|
||||
// CHECK:STDOUT: %.loc10_45.2: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.14b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %output: %Optional.14b = wrapper_binding output, %.loc10_57.3
|
||||
// CHECK:STDOUT: %output: %Optional.14b = wrapper_binding output, %.loc10_73.3
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %output.patt: %pattern_type.65e = value_binding_pattern output [concrete = constants.%output.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_57.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_57.2)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_73.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_73.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_57.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_73.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_57.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_73.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_57.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_73.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -559,14 +559,14 @@ fn F() {
|
||||
// CHECK:STDOUT: %pattern_type.c1e: type = pattern_type %ptr.6f9 [concrete]
|
||||
// CHECK:STDOUT: %non_nullable_pointer.patt: %pattern_type.c1e = ref_binding_pattern non_nullable_pointer [concrete]
|
||||
// CHECK:STDOUT: %non_nullable_pointer.var_patt: %pattern_type.c1e = var_pattern %non_nullable_pointer.patt [concrete]
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.type: type = cpp_overload_set_type @Return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return.type: type = fn_type @Return [concrete]
|
||||
// CHECK:STDOUT: %Return: %Return.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.type: type = cpp_overload_set_type @Invoke.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.value: %Invoke.cpp_overload_set.type = cpp_overload_set_value @Invoke.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke.type: type = fn_type @Invoke [concrete]
|
||||
// CHECK:STDOUT: %Invoke: %Invoke.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Return_pointer.cpp_overload_set.type: type = cpp_overload_set_type @Return_pointer.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return_pointer.cpp_overload_set.value: %Return_pointer.cpp_overload_set.type = cpp_overload_set_value @Return_pointer.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return_pointer.type: type = fn_type @Return_pointer [concrete]
|
||||
// CHECK:STDOUT: %Return_pointer: %Return_pointer.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Invoke_pointer.cpp_overload_set.type: type = cpp_overload_set_type @Invoke_pointer.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke_pointer.cpp_overload_set.value: %Invoke_pointer.cpp_overload_set.type = cpp_overload_set_value @Invoke_pointer.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke_pointer.type: type = fn_type @Invoke_pointer [concrete]
|
||||
// CHECK:STDOUT: %Invoke_pointer: %Invoke_pointer.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -574,18 +574,18 @@ fn F() {
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .Return = %Return.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Invoke = %Invoke.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Return_pointer = %Return_pointer.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Invoke_pointer = %Invoke_pointer.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete = constants.%Return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return.decl: %Return.type = fn_decl @Return [concrete = constants.%Return] {
|
||||
// CHECK:STDOUT: %Return_pointer.cpp_overload_set.value: %Return_pointer.cpp_overload_set.type = cpp_overload_set_value @Return_pointer.cpp_overload_set [concrete = constants.%Return_pointer.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return_pointer.decl: %Return_pointer.type = fn_decl @Return_pointer [concrete = constants.%Return_pointer] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.value: %Invoke.cpp_overload_set.type = cpp_overload_set_value @Invoke.cpp_overload_set [concrete = constants.%Invoke.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke.decl: %Invoke.type = fn_decl @Invoke [concrete = constants.%Invoke] {
|
||||
// CHECK:STDOUT: %Invoke_pointer.cpp_overload_set.value: %Invoke_pointer.cpp_overload_set.type = cpp_overload_set_value @Invoke_pointer.cpp_overload_set [concrete = constants.%Invoke_pointer.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke_pointer.decl: %Invoke_pointer.type = fn_decl @Invoke_pointer [concrete = constants.%Invoke_pointer] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -596,9 +596,9 @@ fn F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %non_nullable_pointer.var: ref %ptr.6f9 = var_storage %non_nullable_pointer.var_patt
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Return.ref: %Return.cpp_overload_set.type = name_ref Return, imports.%Return.cpp_overload_set.value [concrete = constants.%Return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return.call: init %ptr.6f9 = call imports.%Return.decl()
|
||||
// CHECK:STDOUT: assign %non_nullable_pointer.var, %Return.call
|
||||
// CHECK:STDOUT: %Return_pointer.ref: %Return_pointer.cpp_overload_set.type = name_ref Return_pointer, imports.%Return_pointer.cpp_overload_set.value [concrete = constants.%Return_pointer.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return_pointer.call: init %ptr.6f9 = call imports.%Return_pointer.decl()
|
||||
// CHECK:STDOUT: assign %non_nullable_pointer.var, %Return_pointer.call
|
||||
// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_38 [concrete = constants.%ptr.6f9] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_29: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
|
||||
@@ -611,10 +611,10 @@ fn F() {
|
||||
// CHECK:STDOUT: %non_nullable_pointer.var_patt: %pattern_type.c1e = var_pattern %non_nullable_pointer.patt [concrete = constants.%non_nullable_pointer.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Invoke.ref: %Invoke.cpp_overload_set.type = name_ref Invoke, imports.%Invoke.cpp_overload_set.value [concrete = constants.%Invoke.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke_pointer.ref: %Invoke_pointer.cpp_overload_set.type = name_ref Invoke_pointer, imports.%Invoke_pointer.cpp_overload_set.value [concrete = constants.%Invoke_pointer.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %non_nullable_pointer.ref: ref %ptr.6f9 = name_ref non_nullable_pointer, %non_nullable_pointer
|
||||
// CHECK:STDOUT: %.loc12: %ptr.6f9 = acquire_value %non_nullable_pointer.ref
|
||||
// CHECK:STDOUT: %Invoke.call: init %empty_tuple.type = call imports.%Invoke.decl(%.loc12)
|
||||
// CHECK:STDOUT: %Invoke_pointer.call: init %empty_tuple.type = call imports.%Invoke_pointer.decl(%.loc12)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %non_nullable_pointer.var, constants.%Destroy.Op
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%non_nullable_pointer.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -632,14 +632,14 @@ fn F() {
|
||||
// CHECK:STDOUT: %pattern_type.c83: type = pattern_type %ptr [concrete]
|
||||
// CHECK:STDOUT: %const_void_pointer.patt: %pattern_type.c83 = ref_binding_pattern const_void_pointer [concrete]
|
||||
// CHECK:STDOUT: %const_void_pointer.var_patt: %pattern_type.c83 = var_pattern %const_void_pointer.patt [concrete]
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.type: type = cpp_overload_set_type @Return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return.type: type = fn_type @Return [concrete]
|
||||
// CHECK:STDOUT: %Return: %Return.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.type: type = cpp_overload_set_type @Invoke.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.value: %Invoke.cpp_overload_set.type = cpp_overload_set_value @Invoke.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke.type: type = fn_type @Invoke [concrete]
|
||||
// CHECK:STDOUT: %Invoke: %Invoke.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Return_const.cpp_overload_set.type: type = cpp_overload_set_type @Return_const.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return_const.cpp_overload_set.value: %Return_const.cpp_overload_set.type = cpp_overload_set_value @Return_const.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return_const.type: type = fn_type @Return_const [concrete]
|
||||
// CHECK:STDOUT: %Return_const: %Return_const.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Invoke_const.cpp_overload_set.type: type = cpp_overload_set_type @Invoke_const.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke_const.cpp_overload_set.value: %Invoke_const.cpp_overload_set.type = cpp_overload_set_value @Invoke_const.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke_const.type: type = fn_type @Invoke_const [concrete]
|
||||
// CHECK:STDOUT: %Invoke_const: %Invoke_const.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -647,18 +647,18 @@ fn F() {
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .Return = %Return.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Invoke = %Invoke.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Return_const = %Return_const.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Invoke_const = %Invoke_const.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete = constants.%Return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return.decl: %Return.type = fn_decl @Return [concrete = constants.%Return] {
|
||||
// CHECK:STDOUT: %Return_const.cpp_overload_set.value: %Return_const.cpp_overload_set.type = cpp_overload_set_value @Return_const.cpp_overload_set [concrete = constants.%Return_const.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return_const.decl: %Return_const.type = fn_decl @Return_const [concrete = constants.%Return_const] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.value: %Invoke.cpp_overload_set.type = cpp_overload_set_value @Invoke.cpp_overload_set [concrete = constants.%Invoke.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke.decl: %Invoke.type = fn_decl @Invoke [concrete = constants.%Invoke] {
|
||||
// CHECK:STDOUT: %Invoke_const.cpp_overload_set.value: %Invoke_const.cpp_overload_set.type = cpp_overload_set_value @Invoke_const.cpp_overload_set [concrete = constants.%Invoke_const.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke_const.decl: %Invoke_const.type = fn_decl @Invoke_const [concrete = constants.%Invoke_const] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -669,9 +669,9 @@ fn F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %const_void_pointer.var: ref %ptr = var_storage %const_void_pointer.var_patt
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_45: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Return.ref: %Return.cpp_overload_set.type = name_ref Return, imports.%Return.cpp_overload_set.value [concrete = constants.%Return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return.call: init %ptr = call imports.%Return.decl()
|
||||
// CHECK:STDOUT: assign %const_void_pointer.var, %Return.call
|
||||
// CHECK:STDOUT: %Return_const.ref: %Return_const.cpp_overload_set.type = name_ref Return_const, imports.%Return_const.cpp_overload_set.value [concrete = constants.%Return_const.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return_const.call: init %ptr = call imports.%Return_const.decl()
|
||||
// CHECK:STDOUT: assign %const_void_pointer.var, %Return_const.call
|
||||
// CHECK:STDOUT: %.loc11: type = splice_block %ptr [concrete = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_33: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
|
||||
@@ -684,10 +684,10 @@ fn F() {
|
||||
// CHECK:STDOUT: %const_void_pointer.var_patt: %pattern_type.c83 = var_pattern %const_void_pointer.patt [concrete = constants.%const_void_pointer.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Invoke.ref: %Invoke.cpp_overload_set.type = name_ref Invoke, imports.%Invoke.cpp_overload_set.value [concrete = constants.%Invoke.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke_const.ref: %Invoke_const.cpp_overload_set.type = name_ref Invoke_const, imports.%Invoke_const.cpp_overload_set.value [concrete = constants.%Invoke_const.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %const_void_pointer.ref: ref %ptr = name_ref const_void_pointer, %const_void_pointer
|
||||
// CHECK:STDOUT: %.loc12: %ptr = acquire_value %const_void_pointer.ref
|
||||
// CHECK:STDOUT: %Invoke.call: init %empty_tuple.type = call imports.%Invoke.decl(%.loc12)
|
||||
// CHECK:STDOUT: %Invoke_const.call: init %empty_tuple.type = call imports.%Invoke_const.decl(%.loc12)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %const_void_pointer.var, constants.%Destroy.Op
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%const_void_pointer.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
|
||||
+32
-32
@@ -650,8 +650,8 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
enum A { a = 1, b = 2 };
|
||||
#define M_A_NO_SCOPE a
|
||||
enum A_NoScope { a_no_scope = 1, b_no_scope = 2 };
|
||||
#define M_A_NO_SCOPE a_no_scope
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
@@ -691,8 +691,8 @@ let p: const i32* = &Cpp.N;
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int a = 1;
|
||||
#define M_CONSTEXPR_NO_SCOPE a
|
||||
constexpr int a_no_scope = 1;
|
||||
#define M_CONSTEXPR_NO_SCOPE a_no_scope
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
@@ -892,8 +892,8 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
int v = 1;
|
||||
#define m &v
|
||||
int v_ptr = 1;
|
||||
#define m &v_ptr
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
@@ -905,14 +905,14 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
struct B {
|
||||
struct SubB {
|
||||
int c;
|
||||
};
|
||||
struct A {
|
||||
B b;
|
||||
struct SubA {
|
||||
SubB b;
|
||||
};
|
||||
A a;
|
||||
#define m a.b.c
|
||||
SubA a_obj;
|
||||
#define m a_obj.b.c
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
@@ -956,11 +956,11 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
struct A {
|
||||
struct BaseA {
|
||||
int n;
|
||||
};
|
||||
struct B : A {} b;
|
||||
#define m b.n
|
||||
struct DerivedB : BaseA {} b_obj;
|
||||
#define m b_obj.n
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
@@ -2182,15 +2182,15 @@ let _: C(1) = {} as C(Cpp.COUNT);
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.3fa: type = pattern_type %A [concrete]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.3fa = ref_binding_pattern a [concrete]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.3fa = var_pattern %a.patt [concrete]
|
||||
// CHECK:STDOUT: %B: type = class_type @B [concrete]
|
||||
// CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %B [concrete]
|
||||
// CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %i32 [concrete]
|
||||
// CHECK:STDOUT: %.401: ref %B = class_element_access imports.%a.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %.8f5: ref %i32 = class_element_access %.401, element0 [concrete]
|
||||
// CHECK:STDOUT: %SubA: type = class_type @SubA [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.0f5: type = pattern_type %SubA [concrete]
|
||||
// CHECK:STDOUT: %a_obj.patt: %pattern_type.0f5 = ref_binding_pattern a_obj [concrete]
|
||||
// CHECK:STDOUT: %a_obj.var_patt: %pattern_type.0f5 = var_pattern %a_obj.patt [concrete]
|
||||
// CHECK:STDOUT: %SubB: type = class_type @SubB [concrete]
|
||||
// CHECK:STDOUT: %SubA.elem: type = unbound_element_type %SubA, %SubB [concrete]
|
||||
// CHECK:STDOUT: %SubB.elem: type = unbound_element_type %SubB, %i32 [concrete]
|
||||
// CHECK:STDOUT: %.d13: ref %SubB = class_element_access imports.%a_obj.var, element0 [concrete]
|
||||
// CHECK:STDOUT: %.010: ref %i32 = class_element_access %.d13, element0 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
||||
@@ -2210,12 +2210,12 @@ let _: C(1) = {} as C(Cpp.COUNT);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .m = constants.%.8f5
|
||||
// CHECK:STDOUT: .m = constants.%.010
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.3fa = ref_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.3fa = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: %a.var: ref %A = var_storage %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %a_obj.patt: %pattern_type.0f5 = ref_binding_pattern a_obj [concrete = constants.%a_obj.patt]
|
||||
// CHECK:STDOUT: %a_obj.var_patt: %pattern_type.0f5 = var_pattern %a_obj.patt [concrete = constants.%a_obj.var_patt]
|
||||
// CHECK:STDOUT: %a_obj.var: ref %SubA = var_storage %a_obj.var_patt [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl.0e9 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -2224,11 +2224,11 @@ let _: C(1) = {} as C(Cpp.COUNT);
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %b.ref: %A.elem = name_ref b, @A.%.1 [concrete = @A.%.1]
|
||||
// CHECK:STDOUT: %.loc17_6.1: ref %B = class_element_access imports.%a.var, element0 [concrete = constants.%.401]
|
||||
// CHECK:STDOUT: %c.ref: %B.elem = name_ref c, @B.%.1 [concrete = @B.%.1]
|
||||
// CHECK:STDOUT: %.loc17_6.2: ref %i32 = class_element_access %.loc17_6.1, element0 [concrete = constants.%.8f5]
|
||||
// CHECK:STDOUT: %m.ref: ref %i32 = name_ref m, constants.%.8f5 [concrete = constants.%.8f5]
|
||||
// CHECK:STDOUT: %b.ref: %SubA.elem = name_ref b, @SubA.%.1 [concrete = @SubA.%.1]
|
||||
// CHECK:STDOUT: %.loc17_6.1: ref %SubB = class_element_access imports.%a_obj.var, element0 [concrete = constants.%.d13]
|
||||
// CHECK:STDOUT: %c.ref: %SubB.elem = name_ref c, @SubB.%.1 [concrete = @SubB.%.1]
|
||||
// CHECK:STDOUT: %.loc17_6.2: ref %i32 = class_element_access %.loc17_6.1, element0 [concrete = constants.%.010]
|
||||
// CHECK:STDOUT: %m.ref: ref %i32 = name_ref m, constants.%.010 [concrete = constants.%.010]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %impl.elem0: %.b7a = impl_witness_access constants.%ImplicitAs.impl_witness.a2a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39]
|
||||
// CHECK:STDOUT: %bound_method.loc17_9.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
|
||||
@@ -84,17 +84,17 @@ import Cpp;
|
||||
alias r#Cpp = Cpp;
|
||||
|
||||
inline Cpp '''
|
||||
void F();
|
||||
void FRaw();
|
||||
|
||||
void G() {
|
||||
void GRaw() {
|
||||
// CHECK:STDERR: fail_carbon_raw_cpp.carbon:[[@LINE+8]]:16: error: semantics TODO: `interop with translation unit decl` [SemanticsTodo]
|
||||
// CHECK:STDERR: Carbon::Cpp::F();
|
||||
// CHECK:STDERR: Carbon::Cpp::FRaw();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_carbon_raw_cpp.carbon:[[@LINE+4]]:11: error: no member named 'Cpp' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Carbon::Cpp::F();
|
||||
// CHECK:STDERR: 19 | Carbon::Cpp::FRaw();
|
||||
// CHECK:STDERR: | ~~~~~~~~^
|
||||
// CHECK:STDERR:
|
||||
Carbon::Cpp::F();
|
||||
Carbon::Cpp::FRaw();
|
||||
}
|
||||
''';
|
||||
|
||||
+896
-896
File diff suppressed because it is too large
Load Diff
+1431
-1431
File diff suppressed because it is too large
Load Diff
@@ -83,33 +83,34 @@ var s: Cpp.Simple({} as C) = Cpp.MakeSimple123();
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<bool B> struct Struct {};
|
||||
Struct<true> MakeStruct() { return Struct<true>(); }
|
||||
template<bool B> struct BoolStruct {};
|
||||
BoolStruct<true> MakeBoolStruct() { return BoolStruct<true>(); }
|
||||
''';
|
||||
|
||||
var s: Cpp.Struct(true) = Cpp.MakeStruct();
|
||||
var s: Cpp.BoolStruct(true) = Cpp.MakeBoolStruct();
|
||||
|
||||
// --- float.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<float N> struct Struct {};
|
||||
Struct<123.5f> MakeStruct() { return Struct<123.5f>(); }
|
||||
template<float N> struct FloatStruct {};
|
||||
FloatStruct<123.5f> MakeFloatStruct() { return FloatStruct<123.5f>(); }
|
||||
''';
|
||||
let v: Cpp.Struct(123.5) = Cpp.MakeStruct();
|
||||
|
||||
let v: Cpp.FloatStruct(123.5) = Cpp.MakeFloatStruct();
|
||||
|
||||
// --- pointer.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<const int* _Nonnull P> struct Struct {};
|
||||
template<const int* _Nonnull P> struct PtrStruct {};
|
||||
static int i = 123;
|
||||
Struct<&i> MakeStruct() { return Struct<&i>(); }
|
||||
PtrStruct<&i> MakePtrStruct() { return PtrStruct<&i>(); }
|
||||
''';
|
||||
|
||||
let xyz: Cpp.Struct(&Cpp.i) = Cpp.MakeStruct();
|
||||
let xyz: Cpp.PtrStruct(&Cpp.i) = Cpp.MakePtrStruct();
|
||||
|
||||
// --- valid.carbon
|
||||
|
||||
|
||||
@@ -29,17 +29,17 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_var_unsupported_type.carbon:[[@LINE+4]]:5: error: semantics TODO: `failed to map Carbon type to C++` [SemanticsTodo]
|
||||
// CHECK:STDERR: var x: () = ();
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: var unsupported_x: () = ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: () = ();
|
||||
var unsupported_x: () = ();
|
||||
|
||||
inline Cpp '''
|
||||
void F() {
|
||||
// CHECK:STDERR: fail_var_unsupported_type.carbon:[[@LINE+4]]:11: error: no member named 'x' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Carbon::x;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_var_unsupported_type.carbon:[[@LINE+4]]:11: error: no member named 'unsupported_x' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Carbon::unsupported_x;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Carbon::x;
|
||||
Carbon::unsupported_x;
|
||||
}
|
||||
''';
|
||||
|
||||
+10
-10
@@ -42,7 +42,7 @@ fn MyF() {
|
||||
// --- unsupported_type.h
|
||||
|
||||
using UnusupportedType = _BitInt(23);
|
||||
UnusupportedType global;
|
||||
UnusupportedType unsupported_global;
|
||||
|
||||
// --- fail_import_unsupported_type.carbon
|
||||
|
||||
@@ -56,17 +56,17 @@ import Cpp library "unsupported_type.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+11]]:21: note: in `Cpp` name lookup for `UnusupportedType` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.global;
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.unsupported_global;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+7]]:44: error: semantics TODO: `Unsupported: var type: UnusupportedType` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.global;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+4]]:44: note: in `Cpp` name lookup for `global` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.global;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.unsupported_global;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsupported_type.carbon:[[@LINE+4]]:44: note: in `Cpp` name lookup for `unsupported_global` [InCppNameLookup]
|
||||
// CHECK:STDERR: let unused local: Cpp.UnusupportedType = Cpp.unsupported_global;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
let unused local: Cpp.UnusupportedType = Cpp.global;
|
||||
let unused local: Cpp.UnusupportedType = Cpp.unsupported_global;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- import_global_scope.carbon
|
||||
@@ -198,7 +198,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .UnusupportedType = <error>
|
||||
// CHECK:STDOUT: .global = <error>
|
||||
// CHECK:STDOUT: .unsupported_global = <error>
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -219,7 +219,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_44: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %global.ref: <error> = name_ref global, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %unsupported_global.ref: <error> = name_ref unsupported_global, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %UnusupportedType.ref: <error> = name_ref UnusupportedType, <error> [concrete = <error>]
|
||||
|
||||
+102
-102
@@ -34,40 +34,40 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
base class A {
|
||||
base class LayoutA {
|
||||
var x: i32*;
|
||||
var y: i32;
|
||||
}
|
||||
|
||||
class B {
|
||||
var a: A;
|
||||
class LayoutB {
|
||||
var a: LayoutA;
|
||||
var b: i32;
|
||||
}
|
||||
|
||||
class C {
|
||||
extend base: A;
|
||||
class LayoutC {
|
||||
extend base: LayoutA;
|
||||
var c: i32;
|
||||
}
|
||||
|
||||
fn CallA(a: A*);
|
||||
fn CallB(b: B*);
|
||||
fn CallC(b: C*);
|
||||
fn CallLayoutA(a: LayoutA*);
|
||||
fn CallLayoutB(b: LayoutB*);
|
||||
fn CallLayoutC(b: LayoutC*);
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
Carbon::A a;
|
||||
Carbon::CallA(&a);
|
||||
Carbon::LayoutA a;
|
||||
Carbon::CallLayoutA(&a);
|
||||
}
|
||||
|
||||
void g() {
|
||||
Carbon::B b;
|
||||
Carbon::CallB(&b);
|
||||
Carbon::LayoutB b;
|
||||
Carbon::CallLayoutB(&b);
|
||||
}
|
||||
|
||||
void h() {
|
||||
Carbon::C c;
|
||||
Carbon::CallC(&c);
|
||||
Carbon::CallA(&c);
|
||||
Carbon::LayoutC c;
|
||||
Carbon::CallLayoutC(&c);
|
||||
Carbon::CallLayoutA(&c);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -77,20 +77,20 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class C {
|
||||
class FieldC {
|
||||
var a: i32;
|
||||
var b: i32;
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void F(Carbon::C& c) {
|
||||
void F(Carbon::FieldC& c) {
|
||||
c.a = 12;
|
||||
c.b = 34;
|
||||
}
|
||||
''';
|
||||
|
||||
fn G() {
|
||||
var c: C = {.a = 0, .b = 0};
|
||||
var c: FieldC = {.a = 0, .b = 0};
|
||||
Cpp.F(ref c);
|
||||
}
|
||||
|
||||
@@ -157,23 +157,23 @@ fn G() {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %"class.Carbon::A" = type <{ ptr, i32 }>
|
||||
// CHECK:STDOUT: %"class.Carbon::B" = type { %"class.Carbon::A", i32 }
|
||||
// CHECK:STDOUT: %"class.Carbon::C" = type { %"class.Carbon::A", i32 }
|
||||
// CHECK:STDOUT: %"class.Carbon::LayoutA" = type <{ ptr, i32 }>
|
||||
// CHECK:STDOUT: %"class.Carbon::LayoutB" = type { %"class.Carbon::LayoutA", i32 }
|
||||
// CHECK:STDOUT: %"class.Carbon::LayoutC" = type { %"class.Carbon::LayoutA", i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN6Carbon1AD2Ev = comdat any
|
||||
// CHECK:STDOUT: $_ZN6Carbon7LayoutAD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN6Carbon1BD2Ev = comdat any
|
||||
// CHECK:STDOUT: $_ZN6Carbon7LayoutBD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN6Carbon1CD2Ev = comdat any
|
||||
// CHECK:STDOUT: $_ZN6Carbon7LayoutCD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local void @_Z1fv() #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a = alloca %"class.Carbon::A", align 8
|
||||
// CHECK:STDOUT: %a = alloca %"class.Carbon::LayoutA", align 8
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a) #5
|
||||
// CHECK:STDOUT: call void @_ZN6CarbonL5CallAEPNS_1AE(ptr noundef %a)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %a) #5
|
||||
// CHECK:STDOUT: call void @_ZN6CarbonL11CallLayoutAEPNS_7LayoutAE(ptr noundef %a)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %a) #5
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.end.p0(ptr %a) #5
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -182,21 +182,21 @@ fn G() {
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN6CarbonL5CallAEPNS_1AE(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutAEPNS_7LayoutAE(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: call void @_CCallA__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
|
||||
// CHECK:STDOUT: call void @_CCallLayoutA__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 8 dereferenceable(12) %this1)
|
||||
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr noundef nonnull align 8 dereferenceable(12) %this1)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -206,77 +206,77 @@ fn G() {
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local void @_Z1gv() #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %b = alloca %"class.Carbon::B", align 8
|
||||
// CHECK:STDOUT: %b = alloca %"class.Carbon::LayoutB", align 8
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b) #5
|
||||
// CHECK:STDOUT: call void @_ZN6CarbonL5CallBEPNS_1BE(ptr noundef %b)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon1BD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %b) #5
|
||||
// CHECK:STDOUT: call void @_ZN6CarbonL11CallLayoutBEPNS_7LayoutBE(ptr noundef %b)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon7LayoutBD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %b) #5
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.end.p0(ptr %b) #5
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN6CarbonL5CallBEPNS_1BE(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutBEPNS_7LayoutBE(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !15
|
||||
// CHECK:STDOUT: call void @_CCallB__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
|
||||
// CHECK:STDOUT: call void @_CCallLayoutB__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1BD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutBD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !15
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.B.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1)
|
||||
// CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::B", ptr %this1, i32 0, i32 0
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %a) #5
|
||||
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1)
|
||||
// CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::LayoutB", ptr %this1, i32 0, i32 0
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %a) #5
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local void @_Z1hv() #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %c = alloca %"class.Carbon::C", align 8
|
||||
// CHECK:STDOUT: %c = alloca %"class.Carbon::LayoutC", align 8
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c) #5
|
||||
// CHECK:STDOUT: call void @_ZN6CarbonL5CallCEPNS_1CE(ptr noundef %c)
|
||||
// CHECK:STDOUT: call void @_ZN6CarbonL5CallAEPNS_1AE(ptr noundef %c)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon1CD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %c) #5
|
||||
// CHECK:STDOUT: call void @_ZN6CarbonL11CallLayoutCEPNS_7LayoutCE(ptr noundef %c)
|
||||
// CHECK:STDOUT: call void @_ZN6CarbonL11CallLayoutAEPNS_7LayoutAE(ptr noundef %c)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon7LayoutCD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %c) #5
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.end.p0(ptr %c) #5
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN6CarbonL5CallCEPNS_1CE(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutCEPNS_7LayoutCE(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: call void @_CCallC__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
|
||||
// CHECK:STDOUT: call void @_CCallLayoutC__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1CD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutCD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.C.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this1) #5
|
||||
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this1) #5
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_CCallA.Main(ptr)
|
||||
// CHECK:STDOUT: declare void @_CCallLayoutA.Main(ptr)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_CCallB.Main(ptr)
|
||||
// CHECK:STDOUT: declare void @_CCallLayoutB.Main(ptr)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_CCallC.Main(ptr)
|
||||
// CHECK:STDOUT: declare void @_CCallLayoutC.Main(ptr)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #4 !dbg !19 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr %self) #4 !dbg !19 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @"_COp.e649d414b9e7644a:core.Destroy.Core"(ptr %self), !dbg !25
|
||||
// CHECK:STDOUT: call void @"_COp.576418bb54cb7290:core.Destroy.Core"(ptr %self), !dbg !25
|
||||
// CHECK:STDOUT: ret void, !dbg !25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -293,75 +293,75 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.e649d414b9e7644a:core.Destroy.Core"(ptr %self) #5 !dbg !37 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.576418bb54cb7290:core.Destroy.Core"(ptr %self) #5 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !40
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCallA__carbon_thunk.Main(ptr %_) #5 !dbg !41 {
|
||||
// CHECK:STDOUT: define void @_CCallLayoutA__carbon_thunk.Main(ptr %_) #5 !dbg !41 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !44
|
||||
// CHECK:STDOUT: call void @_CCallA.Main(ptr %.loc21), !dbg !44
|
||||
// CHECK:STDOUT: call void @_CCallLayoutA.Main(ptr %.loc21), !dbg !44
|
||||
// CHECK:STDOUT: ret void, !dbg !44
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #4 !dbg !45 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr %self) #4 !dbg !45 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @"_COp.535580a8a7a96b3b:core.Destroy.Core"(ptr %self), !dbg !48
|
||||
// CHECK:STDOUT: call void @"_COp.1e05456dbecd0195:core.Destroy.Core"(ptr %self), !dbg !48
|
||||
// CHECK:STDOUT: ret void, !dbg !48
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.8e58843eeaf37d77:core.Destroy.Core"(ptr %self) #5 !dbg !49 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.ed90af642ee14836:core.Destroy.Core"(ptr %self) #5 !dbg !49 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !52
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.535580a8a7a96b3b:core.Destroy.Core"(ptr %self) #5 !dbg !53 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.1e05456dbecd0195:core.Destroy.Core"(ptr %self) #5 !dbg !53 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !56
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCallB__carbon_thunk.Main(ptr %_) #5 !dbg !57 {
|
||||
// CHECK:STDOUT: define void @_CCallLayoutB__carbon_thunk.Main(ptr %_) #5 !dbg !57 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !60
|
||||
// CHECK:STDOUT: call void @_CCallB.Main(ptr %.loc22), !dbg !60
|
||||
// CHECK:STDOUT: call void @_CCallLayoutB.Main(ptr %.loc22), !dbg !60
|
||||
// CHECK:STDOUT: ret void, !dbg !60
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #4 !dbg !61 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr %self) #4 !dbg !61 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @"_COp.cbd14a388b4a1c25:core.Destroy.Core"(ptr %self), !dbg !64
|
||||
// CHECK:STDOUT: call void @"_COp.51e6fd9285cd1110:core.Destroy.Core"(ptr %self), !dbg !64
|
||||
// CHECK:STDOUT: ret void, !dbg !64
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.cf9748c540fa2b51:core.Destroy.Core"(ptr %self) #5 !dbg !65 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.16bee2ebebabb5ed:core.Destroy.Core"(ptr %self) #5 !dbg !65 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !68
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.cbd14a388b4a1c25:core.Destroy.Core"(ptr %self) #5 !dbg !69 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.51e6fd9285cd1110:core.Destroy.Core"(ptr %self) #5 !dbg !69 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !72
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCallC__carbon_thunk.Main(ptr %_) #5 !dbg !73 {
|
||||
// CHECK:STDOUT: define void @_CCallLayoutC__carbon_thunk.Main(ptr %_) #5 !dbg !73 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !76
|
||||
// CHECK:STDOUT: call void @_CCallC.Main(ptr %.loc23), !dbg !76
|
||||
// CHECK:STDOUT: call void @_CCallLayoutC.Main(ptr %.loc23), !dbg !76
|
||||
// CHECK:STDOUT: ret void, !dbg !76
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN6Carbon1AD2Ev, { 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN6Carbon7LayoutAD2Ev, { 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
@@ -387,13 +387,13 @@ fn G() {
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = !{!13, !13, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1AE", !14, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon7LayoutAE", !14, i64 0}
|
||||
// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !15 = !{!16, !16, i64 0}
|
||||
// CHECK:STDOUT: !16 = !{!"p1 _ZTSN6Carbon1BE", !14, i64 0}
|
||||
// CHECK:STDOUT: !16 = !{!"p1 _ZTSN6Carbon7LayoutBE", !14, i64 0}
|
||||
// CHECK:STDOUT: !17 = !{!18, !18, i64 0}
|
||||
// CHECK:STDOUT: !18 = !{!"p1 _ZTSN6Carbon1CE", !14, i64 0}
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23)
|
||||
// CHECK:STDOUT: !18 = !{!"p1 _ZTSN6Carbon7LayoutCE", !14, i64 0}
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutA.Main", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23)
|
||||
// CHECK:STDOUT: !20 = !DISubroutineType(types: !21)
|
||||
// CHECK:STDOUT: !21 = !{null, !22}
|
||||
// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
@@ -411,43 +411,43 @@ fn G() {
|
||||
// CHECK:STDOUT: !34 = !{!35}
|
||||
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !22)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 6, column: 1, scope: !33)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e649d414b9e7644a:core.Destroy.Core", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.576418bb54cb7290:core.Destroy.Core", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !38 = !{!39}
|
||||
// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !22)
|
||||
// CHECK:STDOUT: !40 = !DILocation(line: 6, column: 1, scope: !37)
|
||||
// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "CallA__carbon_thunk", linkageName: "_CCallA__carbon_thunk.Main", scope: null, file: !1, line: 21, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42)
|
||||
// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "CallLayoutA__carbon_thunk", linkageName: "_CCallLayoutA__carbon_thunk.Main", scope: null, file: !1, line: 21, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42)
|
||||
// CHECK:STDOUT: !42 = !{!43}
|
||||
// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !22)
|
||||
// CHECK:STDOUT: !44 = !DILocation(line: 21, column: 1, scope: !41)
|
||||
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !46)
|
||||
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutB.Main", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !46)
|
||||
// CHECK:STDOUT: !46 = !{!47}
|
||||
// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !22)
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 11, column: 1, scope: !45)
|
||||
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8e58843eeaf37d77:core.Destroy.Core", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !50)
|
||||
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ed90af642ee14836:core.Destroy.Core", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !50)
|
||||
// CHECK:STDOUT: !50 = !{!51}
|
||||
// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !22)
|
||||
// CHECK:STDOUT: !52 = !DILocation(line: 11, column: 1, scope: !49)
|
||||
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.535580a8a7a96b3b:core.Destroy.Core", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54)
|
||||
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1e05456dbecd0195:core.Destroy.Core", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54)
|
||||
// CHECK:STDOUT: !54 = !{!55}
|
||||
// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !22)
|
||||
// CHECK:STDOUT: !56 = !DILocation(line: 11, column: 1, scope: !53)
|
||||
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "CallB__carbon_thunk", linkageName: "_CCallB__carbon_thunk.Main", scope: null, file: !1, line: 22, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58)
|
||||
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "CallLayoutB__carbon_thunk", linkageName: "_CCallLayoutB__carbon_thunk.Main", scope: null, file: !1, line: 22, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58)
|
||||
// CHECK:STDOUT: !58 = !{!59}
|
||||
// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !22)
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 22, column: 1, scope: !57)
|
||||
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !62)
|
||||
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutC.Main", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !62)
|
||||
// CHECK:STDOUT: !62 = !{!63}
|
||||
// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !61, type: !22)
|
||||
// CHECK:STDOUT: !64 = !DILocation(line: 16, column: 1, scope: !61)
|
||||
// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.cf9748c540fa2b51:core.Destroy.Core", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !66)
|
||||
// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.16bee2ebebabb5ed:core.Destroy.Core", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !66)
|
||||
// CHECK:STDOUT: !66 = !{!67}
|
||||
// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !22)
|
||||
// CHECK:STDOUT: !68 = !DILocation(line: 16, column: 1, scope: !65)
|
||||
// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.cbd14a388b4a1c25:core.Destroy.Core", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !70)
|
||||
// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51e6fd9285cd1110:core.Destroy.Core", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !70)
|
||||
// CHECK:STDOUT: !70 = !{!71}
|
||||
// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !69, type: !22)
|
||||
// CHECK:STDOUT: !72 = !DILocation(line: 16, column: 1, scope: !69)
|
||||
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "CallC__carbon_thunk", linkageName: "_CCallC__carbon_thunk.Main", scope: null, file: !1, line: 23, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !74)
|
||||
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "CallLayoutC__carbon_thunk", linkageName: "_CCallLayoutC__carbon_thunk.Main", scope: null, file: !1, line: 23, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !74)
|
||||
// CHECK:STDOUT: !74 = !{!75}
|
||||
// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !22)
|
||||
// CHECK:STDOUT: !76 = !DILocation(line: 23, column: 1, scope: !73)
|
||||
@@ -458,28 +458,28 @@ fn G() {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %"class.Carbon::C.0" = type { i32, i32 }
|
||||
// CHECK:STDOUT: %"class.Carbon::FieldC" = type { i32, i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @C.val.loc19_3 = internal constant { i32, i32 } zeroinitializer
|
||||
// CHECK:STDOUT: @FieldC.val.loc19_3 = internal constant { i32, i32 } zeroinitializer
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local void @_Z1FRN6Carbon1CE(ptr noundef nonnull align 4 dereferenceable(8) %c) #0 {
|
||||
// CHECK:STDOUT: define dso_local void @_Z1FRN6Carbon6FieldCE(ptr noundef nonnull align 4 dereferenceable(8) %c) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %c.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %c.addr, align 8, !tbaa !12, !nonnull !15, !align !16
|
||||
// CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::C.0", ptr %0, i32 0, i32 0
|
||||
// CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::FieldC", ptr %0, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 12, ptr %a, align 4, !tbaa !17
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !12, !nonnull !15, !align !16
|
||||
// CHECK:STDOUT: %b = getelementptr inbounds nuw %"class.Carbon::C.0", ptr %1, i32 0, i32 1
|
||||
// CHECK:STDOUT: %b = getelementptr inbounds nuw %"class.Carbon::FieldC", ptr %1, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i32 34, ptr %b, align 4, !tbaa !19
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !20 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.FieldC.Main"(ptr %self) #1 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @"_COp.cbd14a388b4a1c25:core.Destroy.Core"(ptr %self), !dbg !26
|
||||
// CHECK:STDOUT: call void @"_COp.a5500aaf922cc288:core.Destroy.Core"(ptr %self), !dbg !26
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -496,7 +496,7 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.cbd14a388b4a1c25:core.Destroy.Core"(ptr %self) #2 !dbg !38 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.a5500aaf922cc288:core.Destroy.Core"(ptr %self) #2 !dbg !38 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !41
|
||||
// CHECK:STDOUT: }
|
||||
@@ -506,11 +506,11 @@ fn G() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !45
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !45
|
||||
// CHECK:STDOUT: %.loc19_29.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !46
|
||||
// CHECK:STDOUT: %.loc19_29.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !46
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.loc19_3, i64 8, i1 false), !dbg !45
|
||||
// CHECK:STDOUT: call void @_Z1FRN6Carbon1CE(ptr %c.var), !dbg !47
|
||||
// CHECK:STDOUT: call void @"_COp.cbd14a388b4a1c25:core.Destroy.Core"(ptr %c.var), !dbg !45
|
||||
// CHECK:STDOUT: %.loc19_34.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !46
|
||||
// CHECK:STDOUT: %.loc19_34.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !46
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @FieldC.val.loc19_3, i64 8, i1 false), !dbg !45
|
||||
// CHECK:STDOUT: call void @_Z1FRN6Carbon6FieldCE(ptr %c.var), !dbg !47
|
||||
// CHECK:STDOUT: call void @"_COp.a5500aaf922cc288:core.Destroy.Core"(ptr %c.var), !dbg !45
|
||||
// CHECK:STDOUT: ret void, !dbg !48
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -542,14 +542,14 @@ fn G() {
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = !{!13, !13, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1CE", !14, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon6FieldCE", !14, i64 0}
|
||||
// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !15 = !{}
|
||||
// CHECK:STDOUT: !16 = !{i64 4}
|
||||
// CHECK:STDOUT: !17 = !{!18, !9, i64 0}
|
||||
// CHECK:STDOUT: !18 = !{!"_ZTSN6Carbon1CE", !9, i64 0, !9, i64 4}
|
||||
// CHECK:STDOUT: !18 = !{!"_ZTSN6Carbon6FieldCE", !9, i64 0, !9, i64 4}
|
||||
// CHECK:STDOUT: !19 = !{!18, !9, i64 4}
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !1, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.FieldC.Main", scope: null, file: !1, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24)
|
||||
// CHECK:STDOUT: !21 = !DISubroutineType(types: !22)
|
||||
// CHECK:STDOUT: !22 = !{null, !23}
|
||||
// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
@@ -567,7 +567,7 @@ fn G() {
|
||||
// CHECK:STDOUT: !35 = !{!36}
|
||||
// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !23)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 6, column: 1, scope: !34)
|
||||
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.cbd14a388b4a1c25:core.Destroy.Core", scope: null, file: !1, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39)
|
||||
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a5500aaf922cc288:core.Destroy.Core", scope: null, file: !1, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39)
|
||||
// CHECK:STDOUT: !39 = !{!40}
|
||||
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !23)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 6, column: 1, scope: !38)
|
||||
@@ -575,7 +575,7 @@ fn G() {
|
||||
// CHECK:STDOUT: !43 = !DISubroutineType(types: !44)
|
||||
// CHECK:STDOUT: !44 = !{null}
|
||||
// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 3, scope: !42)
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 14, scope: !42)
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 19, scope: !42)
|
||||
// CHECK:STDOUT: !47 = !DILocation(line: 20, column: 3, scope: !42)
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 18, column: 1, scope: !42)
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+47
-47
@@ -31,7 +31,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class A {
|
||||
class ArgsA {
|
||||
fn F(self, a: i32) -> i32 {
|
||||
self;
|
||||
return a;
|
||||
@@ -39,29 +39,29 @@ class A {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
int CallF() {
|
||||
return Carbon::A().F(123);
|
||||
int CallArgsF() {
|
||||
return Carbon::ArgsA().F(123);
|
||||
}
|
||||
''';
|
||||
|
||||
fn CallCallF() -> i32 { return Cpp.CallF(); }
|
||||
fn CallCallF() -> i32 { return Cpp.CallArgsF(); }
|
||||
|
||||
// --- static.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class A {
|
||||
class StaticA {
|
||||
fn F() {}
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void CallF() {
|
||||
Carbon::A::F();
|
||||
void CallStaticF() {
|
||||
Carbon::StaticA::F();
|
||||
}
|
||||
''';
|
||||
|
||||
fn CallCallF() { Cpp.CallF(); }
|
||||
fn CallCallF() { Cpp.CallStaticF(); }
|
||||
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'method.carbon'
|
||||
@@ -188,17 +188,17 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %"class.Carbon::A.0" = type {}
|
||||
// CHECK:STDOUT: %"class.Carbon::ArgsA" = type {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN6Carbon1AD2Ev = comdat any
|
||||
// CHECK:STDOUT: $_ZN6Carbon5ArgsAD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local noundef i32 @_Z5CallFv() #0 {
|
||||
// CHECK:STDOUT: define dso_local noundef i32 @_Z9CallArgsFv() #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ref.tmp = alloca %"class.Carbon::A.0", align 1
|
||||
// CHECK:STDOUT: %ref.tmp = alloca %"class.Carbon::ArgsA", align 1
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ref.tmp) #4
|
||||
// CHECK:STDOUT: %call = call noundef i32 @_ZNK6Carbon1A1FEi(ptr noundef nonnull align 1 %ref.tmp, i32 noundef 123)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %ref.tmp) #4
|
||||
// CHECK:STDOUT: %call = call noundef i32 @_ZNK6Carbon5ArgsA1FEi(ptr noundef nonnull align 1 %ref.tmp, i32 noundef 123)
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon5ArgsAD2Ev(ptr noundef nonnull align 1 %ref.tmp) #4
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.end.p0(ptr %ref.tmp) #4
|
||||
// CHECK:STDOUT: ret i32 %call
|
||||
// CHECK:STDOUT: }
|
||||
@@ -207,7 +207,7 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal noundef i32 @_ZNK6Carbon1A1FEi(ptr noundef nonnull align 1 %this, i32 noundef %0) #2 align 2 {
|
||||
// CHECK:STDOUT: define internal noundef i32 @_ZNK6Carbon5ArgsA1FEi(ptr noundef nonnull align 1 %this, i32 noundef %0) #2 align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %retval = alloca i32, align 4
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
@@ -215,18 +215,18 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !15
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: call void @_CF__carbon_thunk.A.Main(ptr noundef nonnull align 1 %this1, ptr noundef nonnull align 4 dereferenceable(4) %.addr, ptr noundef nonnull align 4 dereferenceable(4) %retval)
|
||||
// CHECK:STDOUT: call void @_CF__carbon_thunk.ArgsA.Main(ptr noundef nonnull align 1 %this1, ptr noundef nonnull align 4 dereferenceable(4) %.addr, ptr noundef nonnull align 4 dereferenceable(4) %retval)
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %retval, align 4
|
||||
// CHECK:STDOUT: ret i32 %1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon5ArgsAD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 1 %this1)
|
||||
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr noundef nonnull align 1 %this1)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -234,38 +234,38 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.end.p0(ptr captures(none)) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CF.A.Main(ptr %self, i32 %a) #4 !dbg !16 {
|
||||
// CHECK:STDOUT: define i32 @_CF.ArgsA.Main(ptr %self, i32 %a) #4 !dbg !16 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret i32 %a, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !25 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr %self) #5 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @"_COp.e649d414b9e7644a:core.Destroy.Core"(ptr %self), !dbg !30
|
||||
// CHECK:STDOUT: call void @"_COp.433c867dbc0ac54b:core.Destroy.Core"(ptr %self), !dbg !30
|
||||
// CHECK:STDOUT: ret void, !dbg !30
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.e649d414b9e7644a:core.Destroy.Core"(ptr %self) #4 !dbg !31 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.433c867dbc0ac54b:core.Destroy.Core"(ptr %self) #4 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !35 {
|
||||
// CHECK:STDOUT: define void @_CF__carbon_thunk.ArgsA.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !35 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !42
|
||||
// CHECK:STDOUT: %A.F.call = call i32 @_CF.A.Main(ptr %self, i32 %.loc6_29.2), !dbg !42
|
||||
// CHECK:STDOUT: store i32 %A.F.call, ptr %_1, align 4, !dbg !42
|
||||
// CHECK:STDOUT: %ArgsA.F.call = call i32 @_CF.ArgsA.Main(ptr %self, i32 %.loc6_29.2), !dbg !42
|
||||
// CHECK:STDOUT: store i32 %ArgsA.F.call, ptr %_1, align 4, !dbg !42
|
||||
// CHECK:STDOUT: ret void, !dbg !42
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !43 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %CallF.call = call i32 @_Z5CallFv(), !dbg !46
|
||||
// CHECK:STDOUT: ret i32 %CallF.call, !dbg !47
|
||||
// CHECK:STDOUT: %CallArgsF.call = call i32 @_Z9CallArgsFv(), !dbg !46
|
||||
// CHECK:STDOUT: ret i32 %CallArgsF.call, !dbg !47
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
@@ -292,10 +292,10 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = !{!13, !13, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1AE", !14, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon5ArgsAE", !14, i64 0}
|
||||
// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !15 = !{!9, !9, i64 0}
|
||||
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main", scope: null, file: !1, line: 6, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21)
|
||||
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "F", linkageName: "_CF.ArgsA.Main", scope: null, file: !1, line: 6, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21)
|
||||
// CHECK:STDOUT: !17 = !DISubroutineType(types: !18)
|
||||
// CHECK:STDOUT: !18 = !{!19, !20, !19}
|
||||
// CHECK:STDOUT: !19 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
@@ -304,17 +304,17 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !16, type: !20)
|
||||
// CHECK:STDOUT: !23 = !DILocalVariable(arg: 2, scope: !16, type: !19)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 8, column: 5, scope: !16)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 5, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.ArgsA.Main", scope: null, file: !1, line: 5, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28)
|
||||
// CHECK:STDOUT: !26 = !DISubroutineType(types: !27)
|
||||
// CHECK:STDOUT: !27 = !{null, !20}
|
||||
// CHECK:STDOUT: !28 = !{!29}
|
||||
// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !25, type: !20)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 5, column: 1, scope: !25)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e649d414b9e7644a:core.Destroy.Core", scope: null, file: !1, line: 5, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.433c867dbc0ac54b:core.Destroy.Core", scope: null, file: !1, line: 5, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32)
|
||||
// CHECK:STDOUT: !32 = !{!33}
|
||||
// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !20)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 5, column: 1, scope: !31)
|
||||
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !1, line: 6, type: !36, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.ArgsA.Main", scope: null, file: !1, line: 6, type: !36, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !36 = !DISubroutineType(types: !37)
|
||||
// CHECK:STDOUT: !37 = !{null, !20, !19, !19}
|
||||
// CHECK:STDOUT: !38 = !{!39, !40, !41}
|
||||
@@ -335,49 +335,49 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local void @_Z5CallFv() #0 {
|
||||
// CHECK:STDOUT: define dso_local void @_Z11CallStaticFv() #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon1A1FEv()
|
||||
// CHECK:STDOUT: call void @_ZN6Carbon7StaticA1FEv()
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN6Carbon1A1FEv() #1 align 2 {
|
||||
// CHECK:STDOUT: define internal void @_ZN6Carbon7StaticA1FEv() #1 align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_CF__carbon_thunk.A.Main()
|
||||
// CHECK:STDOUT: call void @_CF__carbon_thunk.StaticA.Main()
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CF.A.Main() #2 !dbg !12 {
|
||||
// CHECK:STDOUT: define void @_CF.StaticA.Main() #2 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #3 !dbg !16 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.StaticA.Main"(ptr %self) #3 !dbg !16 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @"_COp.e649d414b9e7644a:core.Destroy.Core"(ptr %self), !dbg !22
|
||||
// CHECK:STDOUT: call void @"_COp.f6473606999de44c:core.Destroy.Core"(ptr %self), !dbg !22
|
||||
// CHECK:STDOUT: ret void, !dbg !22
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.e649d414b9e7644a:core.Destroy.Core"(ptr %self) #2 !dbg !23 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.f6473606999de44c:core.Destroy.Core"(ptr %self) #2 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main() #2 !dbg !27 {
|
||||
// CHECK:STDOUT: define void @_CF__carbon_thunk.StaticA.Main() #2 !dbg !27 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_CF.A.Main(), !dbg !28
|
||||
// CHECK:STDOUT: call void @_CF.StaticA.Main(), !dbg !28
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !29 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z5CallFv(), !dbg !30
|
||||
// CHECK:STDOUT: call void @_Z11CallStaticFv(), !dbg !30
|
||||
// CHECK:STDOUT: ret void, !dbg !31
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -402,22 +402,22 @@ fn CallCallF() { Cpp.CallF(); }
|
||||
// CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.StaticA.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{null}
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 5, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20)
|
||||
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.StaticA.Main", scope: null, file: !1, line: 5, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20)
|
||||
// CHECK:STDOUT: !17 = !DISubroutineType(types: !18)
|
||||
// CHECK:STDOUT: !18 = !{null, !19}
|
||||
// CHECK:STDOUT: !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !20 = !{!21}
|
||||
// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !16, type: !19)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 5, column: 1, scope: !16)
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e649d414b9e7644a:core.Destroy.Core", scope: null, file: !1, line: 5, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24)
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f6473606999de44c:core.Destroy.Core", scope: null, file: !1, line: 5, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24)
|
||||
// CHECK:STDOUT: !24 = !{!25}
|
||||
// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !23, type: !19)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 5, column: 1, scope: !23)
|
||||
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.StaticA.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 6, column: 3, scope: !27)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !1, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 15, column: 18, scope: !29)
|
||||
|
||||
@@ -127,12 +127,12 @@ fn F() {
|
||||
|
||||
// --- multi_argument.h
|
||||
|
||||
class C {
|
||||
class MultiArgC {
|
||||
public:
|
||||
C() {}
|
||||
C(int) {}
|
||||
C(int, int) {}
|
||||
C(int, int, int, int = 0) {}
|
||||
MultiArgC() {}
|
||||
MultiArgC(int) {}
|
||||
MultiArgC(int, int) {}
|
||||
MultiArgC(int, int, int, int = 0) {}
|
||||
};
|
||||
|
||||
// --- call_multi_argument.carbon
|
||||
@@ -142,29 +142,29 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "multi_argument.h";
|
||||
|
||||
fn Zero() {
|
||||
let _: Cpp.C = Cpp.C.C();
|
||||
let _: Cpp.C = ();
|
||||
let _: Cpp.MultiArgC = Cpp.MultiArgC.MultiArgC();
|
||||
let _: Cpp.MultiArgC = ();
|
||||
}
|
||||
|
||||
fn One() {
|
||||
let _: Cpp.C = Cpp.C.C(1);
|
||||
let _: Cpp.C = 2;
|
||||
let _: Cpp.C = (3,);
|
||||
let _: Cpp.MultiArgC = Cpp.MultiArgC.MultiArgC(1);
|
||||
let _: Cpp.MultiArgC = 2;
|
||||
let _: Cpp.MultiArgC = (3,);
|
||||
}
|
||||
|
||||
fn Two() {
|
||||
let _: Cpp.C = Cpp.C.C(1, 2);
|
||||
let _: Cpp.C = (3, 4);
|
||||
let _: Cpp.MultiArgC = Cpp.MultiArgC.MultiArgC(1, 2);
|
||||
let _: Cpp.MultiArgC = (3, 4);
|
||||
}
|
||||
|
||||
fn Three() {
|
||||
let _: Cpp.C = Cpp.C.C(1, 2, 3);
|
||||
let _: Cpp.C = (4, 5, 6);
|
||||
let _: Cpp.MultiArgC = Cpp.MultiArgC.MultiArgC(1, 2, 3);
|
||||
let _: Cpp.MultiArgC = (4, 5, 6);
|
||||
}
|
||||
|
||||
fn Four() {
|
||||
let _: Cpp.C = Cpp.C.C(1, 2, 3, 4);
|
||||
let _: Cpp.C = (5, 6, 7, 8);
|
||||
let _: Cpp.MultiArgC = Cpp.MultiArgC.MultiArgC(1, 2, 3, 4);
|
||||
let _: Cpp.MultiArgC = (5, 6, 7, 8);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ---
|
||||
@@ -711,63 +711,63 @@ fn Four() {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN1CC2Ev = comdat any
|
||||
// CHECK:STDOUT: $_ZN9MultiArgCC2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN1CC2Ei = comdat any
|
||||
// CHECK:STDOUT: $_ZN9MultiArgCC2Ei = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN1CC2Eii = comdat any
|
||||
// CHECK:STDOUT: $_ZN9MultiArgCC2Eii = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN1CC2Eiiii = comdat any
|
||||
// CHECK:STDOUT: $_ZN9MultiArgCC2Eiiii = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CZero.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_26.1.temp = alloca [1 x i8], align 1, !dbg !15
|
||||
// CHECK:STDOUT: %.loc8_19.2.temp = alloca [1 x i8], align 1, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc7_26.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_19.2.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc8_19.2.temp), !dbg !16
|
||||
// CHECK:STDOUT: %.loc7_50.1.temp = alloca [1 x i8], align 1, !dbg !15
|
||||
// CHECK:STDOUT: %.loc8_27.2.temp = alloca [1 x i8], align 1, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_50.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk.(ptr %.loc7_50.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_27.2.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk_tuple.(ptr %.loc8_27.2.temp), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Ev.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_COne.Main() #0 !dbg !21 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc12_27.1.temp = alloca [1 x i8], align 1, !dbg !22
|
||||
// CHECK:STDOUT: %.loc13_18.1.temp = alloca [1 x i8], align 1, !dbg !23
|
||||
// CHECK:STDOUT: %.loc14_21.2.temp = alloca [1 x i8], align 1, !dbg !24
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_27.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk._(i32 1, ptr %.loc12_27.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_18.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk._(i32 2, ptr %.loc13_18.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_21.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_21.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: %.loc12_51.1.temp = alloca [1 x i8], align 1, !dbg !22
|
||||
// CHECK:STDOUT: %.loc13_26.1.temp = alloca [1 x i8], align 1, !dbg !23
|
||||
// CHECK:STDOUT: %.loc14_29.2.temp = alloca [1 x i8], align 1, !dbg !24
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_51.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 1, ptr %.loc12_51.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_26.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 2, ptr %.loc13_26.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_29.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_29.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: ret void, !dbg !25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Ei.carbon_thunk._(i32 noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
@@ -775,12 +775,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Ei.carbon_thunk_tuple._(i32 noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Ei.carbon_thunk_tuple._(i32 noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
@@ -788,24 +788,24 @@ fn Four() {
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CTwo.Main() #0 !dbg !27 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc18_30.1.temp = alloca [1 x i8], align 1, !dbg !28
|
||||
// CHECK:STDOUT: %.loc19_23.2.temp = alloca [1 x i8], align 1, !dbg !29
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_30.1.temp), !dbg !28
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_30.1.temp), !dbg !28
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_23.2.temp), !dbg !29
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_23.2.temp), !dbg !29
|
||||
// CHECK:STDOUT: %.loc18_54.1.temp = alloca [1 x i8], align 1, !dbg !28
|
||||
// CHECK:STDOUT: %.loc19_31.2.temp = alloca [1 x i8], align 1, !dbg !29
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_54.1.temp), !dbg !28
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_54.1.temp), !dbg !28
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_31.2.temp), !dbg !29
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_31.2.temp), !dbg !29
|
||||
// CHECK:STDOUT: ret void, !dbg !30
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eii.carbon_thunk.__(i32 noundef %0, i32 noundef %1, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Eii.carbon_thunk.__(i32 noundef %0, i32 noundef %1, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
|
||||
@@ -816,12 +816,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eii.carbon_thunk_tuple.__(i32 noundef %0, i32 noundef %1, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Eii.carbon_thunk_tuple.__(i32 noundef %0, i32 noundef %1, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
|
||||
@@ -832,24 +832,24 @@ fn Four() {
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !18
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CThree.Main() #0 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc23_33.1.temp = alloca [1 x i8], align 1, !dbg !32
|
||||
// CHECK:STDOUT: %.loc24_26.2.temp = alloca [1 x i8], align 1, !dbg !33
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_33.1.temp), !dbg !32
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_33.1.temp), !dbg !32
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_26.2.temp), !dbg !33
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_26.2.temp), !dbg !33
|
||||
// CHECK:STDOUT: %.loc23_57.1.temp = alloca [1 x i8], align 1, !dbg !32
|
||||
// CHECK:STDOUT: %.loc24_34.2.temp = alloca [1 x i8], align 1, !dbg !33
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_57.1.temp), !dbg !32
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_57.1.temp), !dbg !32
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_34.2.temp), !dbg !33
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_34.2.temp), !dbg !33
|
||||
// CHECK:STDOUT: ret void, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eiiii.carbon_thunk.___(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Eiiii.carbon_thunk.___(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
|
||||
@@ -863,12 +863,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef 0)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef 0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eiiii.carbon_thunk_tuple.___(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.___(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
|
||||
@@ -882,24 +882,24 @@ fn Four() {
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef 0)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef 0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CFour.Main() #0 !dbg !35 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc28_36.1.temp = alloca [1 x i8], align 1, !dbg !36
|
||||
// CHECK:STDOUT: %.loc29_29.2.temp = alloca [1 x i8], align 1, !dbg !37
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_36.1.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_36.1.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_29.2.temp), !dbg !37
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_29.2.temp), !dbg !37
|
||||
// CHECK:STDOUT: %.loc28_60.1.temp = alloca [1 x i8], align 1, !dbg !36
|
||||
// CHECK:STDOUT: %.loc29_37.2.temp = alloca [1 x i8], align 1, !dbg !37
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_60.1.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_60.1.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_37.2.temp), !dbg !37
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_37.2.temp), !dbg !37
|
||||
// CHECK:STDOUT: ret void, !dbg !38
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eiiii.carbon_thunk.____(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Eiiii.carbon_thunk.____(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
|
||||
@@ -916,12 +916,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eiiii.carbon_thunk_tuple.____(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.____(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
|
||||
@@ -938,7 +938,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8)
|
||||
// CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -946,7 +946,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN9MultiArgCC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !18
|
||||
@@ -955,7 +955,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %this, i32 noundef %0) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN9MultiArgCC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %this, i32 noundef %0) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
@@ -966,7 +966,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %this, i32 noundef %0, i32 noundef %1) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN9MultiArgCC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %this, i32 noundef %0, i32 noundef %1) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
@@ -979,7 +979,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %this, i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %this, i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) unnamed_addr #3 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr = alloca i32, align 4
|
||||
@@ -996,7 +996,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN1CC1Ei.carbon_thunk._, { 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN9MultiArgCC1Ei.carbon_thunk._, { 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -1023,28 +1023,28 @@ fn Four() {
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Zero", linkageName: "_CZero.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{null}
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 18, scope: !12)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 18, scope: !12)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 26, scope: !12)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 26, scope: !12)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !18 = !{!19, !19, i64 0}
|
||||
// CHECK:STDOUT: !19 = !{!"p1 _ZTS1C", !20, i64 0}
|
||||
// CHECK:STDOUT: !19 = !{!"p1 _ZTS9MultiArgC", !20, i64 0}
|
||||
// CHECK:STDOUT: !20 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "One", linkageName: "_COne.Main", scope: null, file: !1, line: 11, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 12, column: 18, scope: !21)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 18, scope: !21)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 14, column: 18, scope: !21)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 12, column: 26, scope: !21)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 26, scope: !21)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 14, column: 26, scope: !21)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 11, column: 1, scope: !21)
|
||||
// CHECK:STDOUT: !26 = !{!9, !9, i64 0}
|
||||
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Two", linkageName: "_CTwo.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 18, column: 18, scope: !27)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 19, column: 18, scope: !27)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 18, column: 26, scope: !27)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 19, column: 26, scope: !27)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 17, column: 1, scope: !27)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Three", linkageName: "_CThree.Main", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 23, column: 18, scope: !31)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 24, column: 18, scope: !31)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 23, column: 26, scope: !31)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 24, column: 26, scope: !31)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 22, column: 1, scope: !31)
|
||||
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Four", linkageName: "_CFour.Main", scope: null, file: !1, line: 27, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 28, column: 18, scope: !35)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 29, column: 18, scope: !35)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 28, column: 26, scope: !35)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 29, column: 26, scope: !35)
|
||||
// CHECK:STDOUT: !38 = !DILocation(line: 27, column: 1, scope: !35)
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -41,18 +41,18 @@ import Cpp;
|
||||
inline Cpp '''
|
||||
enum S : short {};
|
||||
enum I : short {};
|
||||
struct B {
|
||||
struct EnumB {
|
||||
operator S() const;
|
||||
operator I() const;
|
||||
};
|
||||
''';
|
||||
|
||||
fn ConvertToVar(b: Cpp.B) {
|
||||
fn ConvertToVar(b: Cpp.EnumB) {
|
||||
var unused s: Cpp.S = b;
|
||||
var unused i: Cpp.I = b;
|
||||
}
|
||||
|
||||
fn ConvertToValue(b: Cpp.B) {
|
||||
fn ConvertToValue(b: Cpp.EnumB) {
|
||||
let unused s: Cpp.S = b;
|
||||
let unused i: Cpp.I = b;
|
||||
}
|
||||
@@ -63,16 +63,16 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
inline Cpp '''
|
||||
struct B {
|
||||
struct IntB {
|
||||
operator int() const;
|
||||
};
|
||||
''';
|
||||
|
||||
fn ConvertToVar(b: Cpp.B) {
|
||||
fn ConvertToVar(b: Cpp.IntB) {
|
||||
var unused a: Cpp.int = b;
|
||||
}
|
||||
|
||||
fn ConvertToValue(b: Cpp.B) {
|
||||
fn ConvertToValue(b: Cpp.IntB) {
|
||||
let unused a: Cpp.int = b;
|
||||
}
|
||||
|
||||
@@ -182,14 +182,14 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !18
|
||||
// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !18
|
||||
// CHECK:STDOUT: call void @_ZNK1Bcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !18
|
||||
// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !19
|
||||
// CHECK:STDOUT: call void @_ZNK1Bcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !19
|
||||
// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !19
|
||||
// CHECK:STDOUT: ret void, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZNK1Bcv1SEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
@@ -197,13 +197,13 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !21, !nonnull !25
|
||||
// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK1Bcv1SEv(ptr noundef nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK5EnumBcv1SEv(ptr noundef nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !26
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZNK1Bcv1IEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
@@ -211,7 +211,7 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !21, !nonnull !25
|
||||
// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK1Bcv1IEv(ptr noundef nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK5EnumBcv1IEv(ptr noundef nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !28
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -222,10 +222,10 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !33
|
||||
// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !34
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !33
|
||||
// CHECK:STDOUT: call void @_ZNK1Bcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !33
|
||||
// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !33
|
||||
// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !33
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_ZNK1Bcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !34
|
||||
// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !34
|
||||
// CHECK:STDOUT: ret void, !dbg !35
|
||||
// CHECK:STDOUT: }
|
||||
@@ -233,9 +233,9 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef signext i16 @_ZNK1Bcv1SEv(ptr noundef nonnull align 1 dereferenceable(1)) #3
|
||||
// CHECK:STDOUT: declare noundef signext i16 @_ZNK5EnumBcv1SEv(ptr noundef nonnull align 1 dereferenceable(1)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef signext i16 @_ZNK1Bcv1IEv(ptr noundef nonnull align 1 dereferenceable(1)) #3
|
||||
// CHECK:STDOUT: declare noundef signext i16 @_ZNK5EnumBcv1IEv(ptr noundef nonnull align 1 dereferenceable(1)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 }
|
||||
@@ -271,7 +271,7 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 14, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !21 = !{!22, !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"p1 _ZTS1B", !23, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"p1 _ZTS5EnumB", !23, i64 0}
|
||||
// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !24 = !{!23, !23, i64 0}
|
||||
// CHECK:STDOUT: !25 = !{}
|
||||
@@ -297,19 +297,19 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !18
|
||||
// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK1BcviEv.carbon_thunk._(ptr %b), !dbg !18
|
||||
// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !18
|
||||
// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.70db2d92ffddbef7:core.Destroy.Core"(ptr %a.var), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef i32 @_ZNK1BcviEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this) #1 {
|
||||
// CHECK:STDOUT: define internal noundef i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !20, !nonnull !23
|
||||
// CHECK:STDOUT: %call = call noundef i32 @_ZNK1BcviEv(ptr noundef nonnull align 1 dereferenceable(1) %0)
|
||||
// CHECK:STDOUT: %call = call noundef i32 @_ZNK4IntBcviEv(ptr noundef nonnull align 1 dereferenceable(1) %0)
|
||||
// CHECK:STDOUT: ret i32 %call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -322,14 +322,14 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK1BcviEv.carbon_thunk._(ptr %b), !dbg !34
|
||||
// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !34
|
||||
// CHECK:STDOUT: ret void, !dbg !35
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef i32 @_ZNK1BcviEv(ptr noundef nonnull align 1 dereferenceable(1)) #3
|
||||
// CHECK:STDOUT: declare noundef i32 @_ZNK4IntBcviEv(ptr noundef nonnull align 1 dereferenceable(1)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
@@ -361,7 +361,7 @@ fn ConvertToValue(b: Cpp.B) {
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !{!21, !21, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"p1 _ZTS1B", !22, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"p1 _ZTS4IntB", !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !23 = !{}
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.70db2d92ffddbef7:core.Destroy.Core", scope: null, file: !1, line: 12, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28)
|
||||
|
||||
@@ -21,26 +21,26 @@ struct Copyable {
|
||||
Copyable& operator=(const Copyable&);
|
||||
~Copyable();
|
||||
};
|
||||
Copyable make();
|
||||
void pass(Copyable);
|
||||
Copyable make_copyable();
|
||||
void pass_copyable(Copyable);
|
||||
''';
|
||||
|
||||
var c: Cpp.Copyable = Cpp.make();
|
||||
var c: Cpp.Copyable = Cpp.make_copyable();
|
||||
|
||||
fn PassGlobal() {
|
||||
Cpp.pass(c);
|
||||
Cpp.pass_copyable(c);
|
||||
}
|
||||
|
||||
fn PassTemporary() {
|
||||
Cpp.pass(Cpp.make());
|
||||
Cpp.pass_copyable(Cpp.make_copyable());
|
||||
}
|
||||
|
||||
fn PassValue(c: Cpp.Copyable) {
|
||||
Cpp.pass(c);
|
||||
Cpp.pass_copyable(c);
|
||||
}
|
||||
|
||||
fn PassRef(ref c: Cpp.Copyable) {
|
||||
Cpp.pass(c);
|
||||
Cpp.pass_copyable(c);
|
||||
}
|
||||
|
||||
// --- copy_or_move.carbon
|
||||
@@ -55,26 +55,26 @@ struct CopyOrMove {
|
||||
CopyOrMove& operator=(CopyOrMove&&);
|
||||
~CopyOrMove();
|
||||
};
|
||||
CopyOrMove make();
|
||||
void pass(CopyOrMove);
|
||||
CopyOrMove make_copy_or_move();
|
||||
void pass_copy_or_move(CopyOrMove);
|
||||
''';
|
||||
|
||||
var c: Cpp.CopyOrMove = Cpp.make();
|
||||
var c: Cpp.CopyOrMove = Cpp.make_copy_or_move();
|
||||
|
||||
fn PassGlobal() {
|
||||
Cpp.pass(c);
|
||||
Cpp.pass_copy_or_move(c);
|
||||
}
|
||||
|
||||
fn PassTemporary() {
|
||||
Cpp.pass(Cpp.make());
|
||||
Cpp.pass_copy_or_move(Cpp.make_copy_or_move());
|
||||
}
|
||||
|
||||
fn PassValue(c: Cpp.CopyOrMove) {
|
||||
Cpp.pass(c);
|
||||
Cpp.pass_copy_or_move(c);
|
||||
}
|
||||
|
||||
fn PassRef(ref c: Cpp.CopyOrMove) {
|
||||
Cpp.pass(c);
|
||||
Cpp.pass_copy_or_move(c);
|
||||
}
|
||||
|
||||
// --- move_only.carbon
|
||||
@@ -93,19 +93,19 @@ struct MoveOnly {
|
||||
MoveOnly& operator=(MoveOnly&&);
|
||||
~MoveOnly();
|
||||
};
|
||||
MoveOnly make();
|
||||
void pass(MoveOnly);
|
||||
MoveOnly make_move_only();
|
||||
void pass_move_only(MoveOnly);
|
||||
''';
|
||||
|
||||
var c: Cpp.MoveOnly = Cpp.make();
|
||||
var c: Cpp.MoveOnly = Cpp.make_move_only();
|
||||
|
||||
fn PassGlobalByMove() {
|
||||
// TODO: This should be accepted.
|
||||
// Cpp.pass(Cpp.std.move(ref c));
|
||||
// Cpp.pass_move_only(Cpp.std.move(ref c));
|
||||
}
|
||||
|
||||
fn PassTemporary() {
|
||||
Cpp.pass(Cpp.make());
|
||||
Cpp.pass_move_only(Cpp.make_move_only());
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ---
|
||||
@@ -120,31 +120,31 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4makev.carbon_thunk.(ptr noundef %return) #0 {
|
||||
// CHECK:STDOUT: define internal void @_Z13make_copyablev.carbon_thunk.(ptr noundef %return) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: call void @_Z4makev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1 %0)
|
||||
// CHECK:STDOUT: call void @_Z13make_copyablev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1 %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !15 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr @_Cc.Main), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr @_Cc.Main), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4pass8Copyable.carbon_thunk._(ptr noundef %0) #0 {
|
||||
// CHECK:STDOUT: define internal void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr noundef %0) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.Copyable, align 1
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: call void @_ZN8CopyableC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable(ptr noundef align 1 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable(ptr noundef align 1 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -152,11 +152,11 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc21_21.1.temp = alloca [1 x i8], align 1, !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_21.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %.loc21_21.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %.loc21_21.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %.loc21_21.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: %.loc21_39.1.temp = alloca [1 x i8], align 1, !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_39.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z13make_copyablev.carbon_thunk.(ptr %.loc21_39.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %.loc21_39.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %.loc21_39.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: ret void, !dbg !23
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -166,14 +166,14 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !24 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %c), !dbg !30
|
||||
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !30
|
||||
// CHECK:STDOUT: ret void, !dbg !31
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !32 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %c), !dbg !35
|
||||
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !35
|
||||
// CHECK:STDOUT: ret void, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -183,13 +183,13 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !38
|
||||
// CHECK:STDOUT: call void @_Z13make_copyablev.carbon_thunk.(ptr @_Cc.Main), !dbg !38
|
||||
// CHECK:STDOUT: ret void, !dbg !39
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1) #4
|
||||
// CHECK:STDOUT: declare void @_Z13make_copyablev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4pass8Copyable(ptr noundef align 1) #4
|
||||
// CHECK:STDOUT: declare void @_Z13pass_copyable8Copyable(ptr noundef align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_ZN8CopyableC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4
|
||||
// CHECK:STDOUT:
|
||||
@@ -224,7 +224,7 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 1, scope: !15)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 20, type: !16, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 21, column: 12, scope: !20)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 21, column: 21, scope: !20)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 21, column: 3, scope: !20)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 20, column: 1, scope: !20)
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !1, line: 24, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28)
|
||||
@@ -256,31 +256,31 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4makev.carbon_thunk.(ptr noundef %return) #0 {
|
||||
// CHECK:STDOUT: define internal void @_Z17make_copy_or_movev.carbon_thunk.(ptr noundef %return) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: call void @_Z4makev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1 %0)
|
||||
// CHECK:STDOUT: call void @_Z17make_copy_or_movev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1 %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !15 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4pass10CopyOrMove.carbon_thunk._(ptr noundef %0) #0 {
|
||||
// CHECK:STDOUT: define internal void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr noundef %0) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.CopyOrMove, align 1
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: call void @_ZN10CopyOrMoveC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: call void @_Z4pass10CopyOrMove(ptr noundef align 1 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove(ptr noundef align 1 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -290,21 +290,21 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %_.var), !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !23
|
||||
// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr %_.var), !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !23
|
||||
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %_.var), !dbg !21
|
||||
// CHECK:STDOUT: ret void, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4pass10CopyOrMove.carbon_thunk.v(ptr noundef %0) #0 {
|
||||
// CHECK:STDOUT: define internal void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk.v(ptr noundef %0) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.CopyOrMove, align 1
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: call void @_ZN10CopyOrMoveC1EOS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: call void @_Z4pass10CopyOrMove(ptr noundef align 1 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove(ptr noundef align 1 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -315,14 +315,14 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr %c), !dbg !31
|
||||
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !31
|
||||
// CHECK:STDOUT: ret void, !dbg !32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !33 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr %c), !dbg !36
|
||||
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !36
|
||||
// CHECK:STDOUT: ret void, !dbg !37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -332,13 +332,13 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !38 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !39
|
||||
// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr @_Cc.Main), !dbg !39
|
||||
// CHECK:STDOUT: ret void, !dbg !40
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1) #4
|
||||
// CHECK:STDOUT: declare void @_Z17make_copy_or_movev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4pass10CopyOrMove(ptr noundef align 1) #4
|
||||
// CHECK:STDOUT: declare void @_Z17pass_copy_or_move10CopyOrMove(ptr noundef align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_ZN10CopyOrMoveC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4
|
||||
// CHECK:STDOUT:
|
||||
@@ -346,7 +346,7 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN10CopyOrMoveD1Ev, { 1, 2, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z4pass10CopyOrMove, { 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z17pass_copy_or_move10CopyOrMove, { 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #1 = { nounwind }
|
||||
@@ -379,8 +379,8 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 19, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 18, column: 1, scope: !15)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 22, type: !16, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 21, scope: !20)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 23, column: 12, scope: !20)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 34, scope: !20)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 23, column: 25, scope: !20)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 23, column: 3, scope: !20)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 22, column: 1, scope: !20)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !1, line: 26, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29)
|
||||
@@ -412,12 +412,12 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4makev.carbon_thunk.(ptr noundef %return) #0 {
|
||||
// CHECK:STDOUT: define internal void @_Z14make_move_onlyv.carbon_thunk.(ptr noundef %return) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: call void @_Z4makev(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1 %0)
|
||||
// CHECK:STDOUT: call void @_Z14make_move_onlyv(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1 %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -432,21 +432,21 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !20
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %_.var), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z4pass8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr %_.var), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !22
|
||||
// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %_.var), !dbg !20
|
||||
// CHECK:STDOUT: ret void, !dbg !23
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4pass8MoveOnly.carbon_thunk.v(ptr noundef %0) #0 {
|
||||
// CHECK:STDOUT: define internal void @_Z14pass_move_only8MoveOnly.carbon_thunk.v(ptr noundef %0) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.MoveOnly, align 1
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12
|
||||
// CHECK:STDOUT: call void @_ZN8MoveOnlyC1EOS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: call void @_Z4pass8MoveOnly(ptr noundef align 1 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly(ptr noundef align 1 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -460,13 +460,13 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !24 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr @_Cc.Main), !dbg !25
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1) #4
|
||||
// CHECK:STDOUT: declare void @_Z14make_move_onlyv(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4pass8MoveOnly(ptr noundef align 1) #4
|
||||
// CHECK:STDOUT: declare void @_Z14pass_move_only8MoveOnly(ptr noundef align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_ZN8MoveOnlyC1EOS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4
|
||||
// CHECK:STDOUT:
|
||||
@@ -503,8 +503,8 @@ fn PassTemporary() {
|
||||
// CHECK:STDOUT: !17 = !{null}
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 1, scope: !15)
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 27, type: !16, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 17, column: 19, scope: !19)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 28, column: 12, scope: !19)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 17, column: 29, scope: !19)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 28, column: 22, scope: !19)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 28, column: 3, scope: !19)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 27, column: 1, scope: !19)
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !16, spFlags: DISPFlagDefinition, unit: !0)
|
||||
|
||||
+13
-13
@@ -12,7 +12,7 @@
|
||||
|
||||
// --- struct.h
|
||||
|
||||
struct A {
|
||||
struct StructA {
|
||||
int n;
|
||||
alignas(16) int m;
|
||||
};
|
||||
@@ -25,11 +25,11 @@ import Cpp library "struct.h";
|
||||
|
||||
// TODO: We generate 4-byte-aligned loads here, and should generate
|
||||
// 16-byte-aligned loads as Clang does.
|
||||
fn AccessN(a: Cpp.A) -> i32 {
|
||||
fn AccessN(a: Cpp.StructA) -> i32 {
|
||||
return a.n;
|
||||
}
|
||||
|
||||
fn AccessM(a: Cpp.A) -> i32 {
|
||||
fn AccessM(a: Cpp.StructA) -> i32 {
|
||||
return a.m;
|
||||
}
|
||||
|
||||
@@ -41,17 +41,17 @@ import Cpp library "struct.h";
|
||||
|
||||
// TODO: We generate 4-byte-aligned stores here, and should generate
|
||||
// 16-byte-aligned stores as Clang does.
|
||||
fn AssignN(p: Cpp.A*) {
|
||||
fn AssignN(p: Cpp.StructA*) {
|
||||
p->n = 1;
|
||||
}
|
||||
|
||||
fn AssignM(p: Cpp.A*) {
|
||||
fn AssignM(p: Cpp.StructA*) {
|
||||
p->m = 1;
|
||||
}
|
||||
|
||||
// --- union.h
|
||||
|
||||
union A {
|
||||
union UnionA {
|
||||
int n;
|
||||
int m;
|
||||
};
|
||||
@@ -62,11 +62,11 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "union.h";
|
||||
|
||||
fn AccessN(a: Cpp.A) -> i32 {
|
||||
fn AccessN(a: Cpp.UnionA) -> i32 {
|
||||
return a.n;
|
||||
}
|
||||
|
||||
fn AccessM(a: Cpp.A) -> i32 {
|
||||
fn AccessM(a: Cpp.UnionA) -> i32 {
|
||||
return a.m;
|
||||
}
|
||||
|
||||
@@ -76,17 +76,17 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "union.h";
|
||||
|
||||
fn AssignN(p: Cpp.A*) {
|
||||
fn AssignN(p: Cpp.UnionA*) {
|
||||
p->n = 1;
|
||||
}
|
||||
|
||||
fn AssignM(p: Cpp.A*) {
|
||||
fn AssignM(p: Cpp.UnionA*) {
|
||||
p->m = 1;
|
||||
}
|
||||
|
||||
// --- anon_union.h
|
||||
|
||||
struct A {
|
||||
struct AnonUnionA {
|
||||
int x;
|
||||
union {
|
||||
int n;
|
||||
@@ -100,11 +100,11 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "anon_union.h";
|
||||
|
||||
fn AccessN(a: Cpp.A) -> i32 {
|
||||
fn AccessN(a: Cpp.AnonUnionA) -> i32 {
|
||||
return a.n;
|
||||
}
|
||||
|
||||
fn AccessP(a: Cpp.A) -> i32 {
|
||||
fn AccessP(a: Cpp.AnonUnionA) -> i32 {
|
||||
return *a.p;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,12 +79,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
inline Cpp '''
|
||||
struct A {
|
||||
struct RefSelfA {
|
||||
void f(int x, int y);
|
||||
};
|
||||
''';
|
||||
|
||||
fn F(ref r: Cpp.A) {
|
||||
fn F(ref r: Cpp.RefSelfA) {
|
||||
r.f(1, 2);
|
||||
}
|
||||
|
||||
@@ -443,11 +443,11 @@ fn F(ref r: Cpp.A) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CF.Main(ptr %r) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1A1fEii(ptr %r, i32 1, i32 2), !dbg !18
|
||||
// CHECK:STDOUT: call void @_ZN8RefSelfA1fEii(ptr %r, i32 1, i32 2), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_ZN1A1fEii(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) #1
|
||||
// CHECK:STDOUT: declare void @_ZN8RefSelfA1fEii(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
|
||||
+6
-6
@@ -52,7 +52,7 @@ fn MyF() {
|
||||
|
||||
// --- extern_c_variable.h
|
||||
|
||||
extern "C" int foo;
|
||||
extern "C" int foo_var;
|
||||
|
||||
// --- import_extern_c_variable.carbon
|
||||
|
||||
@@ -61,7 +61,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "extern_c_variable.h";
|
||||
|
||||
fn MyF() -> i32 {
|
||||
return Cpp.foo;
|
||||
return Cpp.foo_var;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -90,7 +90,7 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
|
||||
// --- extern_c_with_asm_label.h
|
||||
|
||||
extern "C" void foo() __asm__("bar");
|
||||
extern "C" void foo_with_asm_label() __asm__("bar");
|
||||
|
||||
// --- import_extern_c_with_asm_label.carbon
|
||||
|
||||
@@ -99,7 +99,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "extern_c_with_asm_label.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.foo();
|
||||
Cpp.foo_with_asm_label();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ---
|
||||
@@ -192,12 +192,12 @@ fn MyF() {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @foo = external global i32, align 4
|
||||
// CHECK:STDOUT: @foo_var = external global i32, align 4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7 = load i32, ptr @foo, align 4, !dbg !16
|
||||
// CHECK:STDOUT: %.loc7 = load i32, ptr @foo_var, align 4, !dbg !16
|
||||
// CHECK:STDOUT: ret i32 %.loc7, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+37
-37
@@ -34,7 +34,7 @@ fn MyF() {
|
||||
|
||||
// --- inline_function_decl.h
|
||||
|
||||
inline void foo() {}
|
||||
inline void foo_inline() {}
|
||||
|
||||
// --- import_inline_function_decl.carbon
|
||||
|
||||
@@ -43,7 +43,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "inline_function_decl.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.foo();
|
||||
Cpp.foo_inline();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -52,7 +52,7 @@ fn MyF() {
|
||||
|
||||
// --- inline_used_function_decl.h
|
||||
|
||||
inline __attribute__((used)) void foo() {}
|
||||
inline __attribute__((used)) void foo_used() {}
|
||||
|
||||
// --- import_inline_used_function_decl.carbon
|
||||
|
||||
@@ -61,7 +61,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "inline_used_function_decl.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.foo();
|
||||
Cpp.foo_used();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -70,9 +70,9 @@ fn MyF() {
|
||||
|
||||
// --- multiple_inline_function_decls.h
|
||||
|
||||
inline void foo1() {}
|
||||
inline void foo2() {}
|
||||
inline void foo3() {}
|
||||
inline void multi_foo1() {}
|
||||
inline void multi_foo2() {}
|
||||
inline void multi_foo3() {}
|
||||
|
||||
// --- import_multiple_inline_function_decls.carbon
|
||||
|
||||
@@ -81,9 +81,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "multiple_inline_function_decls.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.foo1();
|
||||
Cpp.foo2();
|
||||
Cpp.foo3();
|
||||
Cpp.multi_foo1();
|
||||
Cpp.multi_foo2();
|
||||
Cpp.multi_foo3();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -92,8 +92,8 @@ fn MyF() {
|
||||
|
||||
// --- inline_recursive_function_decl.h
|
||||
|
||||
inline void foo1() {}
|
||||
inline void foo2() { foo1(); }
|
||||
inline void rec_foo1() {}
|
||||
inline void rec_foo2() { rec_foo1(); }
|
||||
|
||||
// --- import_inline_recursive_function_decl.carbon
|
||||
|
||||
@@ -102,8 +102,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "inline_recursive_function_decl.h";
|
||||
|
||||
fn MyF() {
|
||||
// This should generate the definition of the inline function `foo1()`.
|
||||
Cpp.foo2();
|
||||
// This should generate the definition of the inline function `rec_foo1()`.
|
||||
Cpp.rec_foo2();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -178,17 +178,17 @@ fn MyF() -> i32 {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z3foov = comdat any
|
||||
// CHECK:STDOUT: $_Z10foo_inlinev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z3foov(), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z10foo_inlinev(), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z3foov() #1 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z10foo_inlinev() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -224,12 +224,12 @@ fn MyF() -> i32 {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z3foov = comdat any
|
||||
// CHECK:STDOUT: $_Z8foo_usedv = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @llvm.compiler.used = appending global [1 x ptr] [ptr @_Z3foov], section "llvm.metadata"
|
||||
// CHECK:STDOUT: @llvm.compiler.used = appending global [1 x ptr] [ptr @_Z8foo_usedv], section "llvm.metadata"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z3foov() #0 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z8foo_usedv() #0 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -237,12 +237,12 @@ fn MyF() -> i32 {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #1 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z3foov(), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z8foo_usedv(), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z3foov, { 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z8foo_usedv, { 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #1 = { nounwind }
|
||||
@@ -275,35 +275,35 @@ fn MyF() -> i32 {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo1v = comdat any
|
||||
// CHECK:STDOUT: $_Z10multi_foo1v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo2v = comdat any
|
||||
// CHECK:STDOUT: $_Z10multi_foo2v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo3v = comdat any
|
||||
// CHECK:STDOUT: $_Z10multi_foo3v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4foo1v(), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z4foo2v(), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z4foo3v(), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z10multi_foo1v(), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z10multi_foo2v(), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z10multi_foo3v(), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo1v() #1 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z10multi_foo1v() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo2v() #1 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z10multi_foo2v() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo3v() #1 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z10multi_foo3v() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -341,26 +341,26 @@ fn MyF() -> i32 {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo2v = comdat any
|
||||
// CHECK:STDOUT: $_Z8rec_foo2v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo1v = comdat any
|
||||
// CHECK:STDOUT: $_Z8rec_foo1v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4foo2v(), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z8rec_foo2v(), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo2v() #1 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z8rec_foo2v() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4foo1v()
|
||||
// CHECK:STDOUT: call void @_Z8rec_foo1v()
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo1v() #2 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z8rec_foo1v() #2 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+19
-19
@@ -35,12 +35,12 @@ fn MyF() {
|
||||
|
||||
// --- inline.h
|
||||
|
||||
struct C {
|
||||
C();
|
||||
~C();
|
||||
struct InlineC {
|
||||
InlineC();
|
||||
~InlineC();
|
||||
void f();
|
||||
};
|
||||
inline C inline_global;
|
||||
inline InlineC inline_global;
|
||||
|
||||
// --- import_inline.carbon
|
||||
|
||||
@@ -132,7 +132,7 @@ fn ReadVarTemplateWithConstructor() -> Cpp.Y* {
|
||||
|
||||
// --- static_template.h
|
||||
|
||||
struct X {
|
||||
struct StaticTmplX {
|
||||
template<typename T> static T static_tmpl = T();
|
||||
};
|
||||
|
||||
@@ -147,11 +147,11 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "static_template.h";
|
||||
|
||||
fn ReadStaticVarTemplate() -> i32 {
|
||||
return Cpp.X.static_tmpl(i32);
|
||||
return Cpp.StaticTmplX.static_tmpl(i32);
|
||||
}
|
||||
|
||||
fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* {
|
||||
return &Cpp.X.static_tmpl(Cpp.Y);
|
||||
return &Cpp.StaticTmplX.static_tmpl(Cpp.Y);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ---
|
||||
@@ -199,11 +199,11 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.C = type { i8 }
|
||||
// CHECK:STDOUT: %struct.InlineC = type { i8 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $inline_global = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @inline_global = linkonce_odr dso_local global %struct.C zeroinitializer, comdat, align 1
|
||||
// CHECK:STDOUT: @inline_global = linkonce_odr dso_local global %struct.InlineC zeroinitializer, comdat, align 1
|
||||
// CHECK:STDOUT: @_ZGV13inline_global = linkonce_odr dso_local global i64 0, comdat($inline_global), align 8
|
||||
// CHECK:STDOUT: @__dso_handle = external hidden global i8
|
||||
// CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @__cxx_global_var_init, ptr @inline_global }]
|
||||
@@ -224,11 +224,11 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* {
|
||||
// CHECK:STDOUT: br i1 %tobool, label %init, label %init.end
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: init: ; preds = %init.check
|
||||
// CHECK:STDOUT: invoke void @_ZN1CC1Ev(ptr noundef nonnull align 1 dereferenceable(1) @inline_global)
|
||||
// CHECK:STDOUT: invoke void @_ZN7InlineCC1Ev(ptr noundef nonnull align 1 dereferenceable(1) @inline_global)
|
||||
// CHECK:STDOUT: to label %invoke.cont unwind label %lpad
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: invoke.cont: ; preds = %init
|
||||
// CHECK:STDOUT: %2 = call i32 @__cxa_atexit(ptr @_ZN1CD1Ev, ptr @inline_global, ptr @__dso_handle) #1
|
||||
// CHECK:STDOUT: %2 = call i32 @__cxa_atexit(ptr @_ZN7InlineCD1Ev, ptr @inline_global, ptr @__dso_handle) #1
|
||||
// CHECK:STDOUT: call void @__cxa_guard_release(ptr @_ZGV13inline_global) #1
|
||||
// CHECK:STDOUT: br label %init.end
|
||||
// CHECK:STDOUT:
|
||||
@@ -256,12 +256,12 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: declare i32 @__cxa_guard_acquire(ptr) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_ZN1CC1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2
|
||||
// CHECK:STDOUT: declare void @_ZN7InlineCC1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare i32 @__gxx_personality_v0(...)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: declare void @_ZN1CD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3
|
||||
// CHECK:STDOUT: declare void @_ZN7InlineCD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: declare i32 @__cxa_atexit(ptr, ptr, ptr) #1
|
||||
@@ -275,11 +275,11 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCallF.Main() #1 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1C1fEv(ptr @inline_global), !dbg !15
|
||||
// CHECK:STDOUT: call void @_ZN7InlineC1fEv(ptr @inline_global), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_ZN1C1fEv(ptr noundef nonnull align 1 dereferenceable(1)) #2
|
||||
// CHECK:STDOUT: declare void @_ZN7InlineC1fEv(ptr noundef nonnull align 1 dereferenceable(1)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @inline_global, { 2, 3, 4, 0, 1 }
|
||||
@@ -530,20 +530,20 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.Y.26 = type { i8 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @_ZN1X11static_tmplIiEE = external global i32, align 4
|
||||
// CHECK:STDOUT: @_ZN1X11static_tmplI1YEE = external global %struct.Y.26, align 1
|
||||
// CHECK:STDOUT: @_ZN11StaticTmplX11static_tmplIiEE = external global i32, align 4
|
||||
// CHECK:STDOUT: @_ZN11StaticTmplX11static_tmplI1YEE = external global %struct.Y.26, align 1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CReadStaticVarTemplate.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN1X11static_tmplIiEE, align 4, !dbg !16
|
||||
// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN11StaticTmplX11static_tmplIiEE, align 4, !dbg !16
|
||||
// CHECK:STDOUT: ret i32 %.loc7, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReadStaticVarTemplateWithConstructor.Main() #0 !dbg !18 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret ptr @_ZN1X11static_tmplI1YEE, !dbg !22
|
||||
// CHECK:STDOUT: ret ptr @_ZN11StaticTmplX11static_tmplI1YEE, !dbg !22
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
|
||||
+142
-142
@@ -15,14 +15,14 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''c++
|
||||
struct A {
|
||||
struct EqA {
|
||||
int value;
|
||||
|
||||
friend auto operator==(A x, A y) -> bool {
|
||||
friend auto operator==(EqA x, EqA y) -> bool {
|
||||
return x.value == y.value;
|
||||
}
|
||||
|
||||
friend auto operator!=(A x, A y) -> bool {
|
||||
friend auto operator!=(EqA x, EqA y) -> bool {
|
||||
return !(x == y);
|
||||
}
|
||||
};
|
||||
@@ -33,7 +33,7 @@ fn CheckEqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
x != y;
|
||||
}
|
||||
|
||||
fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
fn Driver(x: Cpp.EqA, y: Cpp.EqA) {
|
||||
CheckEqWith(x, y);
|
||||
}
|
||||
|
||||
@@ -42,22 +42,22 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''c++
|
||||
struct A {
|
||||
struct OrderedA {
|
||||
int value;
|
||||
|
||||
friend auto operator<(A x, A y) -> bool {
|
||||
friend auto operator<(OrderedA x, OrderedA y) -> bool {
|
||||
return x.value < y.value;
|
||||
}
|
||||
|
||||
friend auto operator>(A x, A y) -> bool {
|
||||
friend auto operator>(OrderedA x, OrderedA y) -> bool {
|
||||
return y < x;
|
||||
}
|
||||
|
||||
friend auto operator<=(A x, A y) -> bool {
|
||||
friend auto operator<=(OrderedA x, OrderedA y) -> bool {
|
||||
return !(y < x);
|
||||
}
|
||||
|
||||
friend auto operator>=(A x, A y) -> bool {
|
||||
friend auto operator>=(OrderedA x, OrderedA y) -> bool {
|
||||
return !(x < y);
|
||||
}
|
||||
};
|
||||
@@ -70,7 +70,7 @@ fn CheckOrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
x >= y;
|
||||
}
|
||||
|
||||
fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) {
|
||||
CheckOrderedWith(x, y);
|
||||
}
|
||||
|
||||
@@ -80,27 +80,27 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.A = type { i32 }
|
||||
// CHECK:STDOUT: %struct.EqA = type { i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Zeq1AS_ = comdat any
|
||||
// CHECK:STDOUT: $_Zeq3EqAS_ = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Zne1AS_ = comdat any
|
||||
// CHECK:STDOUT: $_Zne3EqAS_ = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_CCheckEqWith.Main.bdef5a2ed02e32a1(ptr %x, ptr %y), !dbg !19
|
||||
// CHECK:STDOUT: call void @_CCheckEqWith.Main.5d19350ce19a6fbd(ptr %x, ptr %y), !dbg !19
|
||||
// CHECK:STDOUT: ret void, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Zeq1AS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Zeq3EqAS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -109,24 +109,24 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.EqA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.EqA, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zeq1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zeq3EqAS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Zne1AS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Zne3EqAS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -135,41 +135,41 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.EqA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.EqA, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zne1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zne3EqAS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !30 {
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.c41e21bae407dec8.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !30 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !36
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @_Zeq1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @_Zeq3EqAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !36
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !36
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !37 {
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.c41e21bae407dec8.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !41
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !41
|
||||
// CHECK:STDOUT: call void @_Zne1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !41
|
||||
// CHECK:STDOUT: call void @_Zne3EqAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !41
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !41
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !41
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr void @_CCheckEqWith.Main.bdef5a2ed02e32a1(ptr %x, ptr %y) #0 !dbg !42 {
|
||||
// CHECK:STDOUT: define linkonce_odr void @_CCheckEqWith.Main.5d19350ce19a6fbd(ptr %x, ptr %y) #0 !dbg !42 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %x, ptr %y), !dbg !46
|
||||
// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.call = call i1 @"_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %x, ptr %y), !dbg !47
|
||||
// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.c41e21bae407dec8.Core:Cpp"(ptr %x, ptr %y), !dbg !46
|
||||
// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.call = call i1 @"_CNotEqual:thunk:EqWith.c41e21bae407dec8.Core:Cpp"(ptr %x, ptr %y), !dbg !47
|
||||
// CHECK:STDOUT: ret void, !dbg !48
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -177,17 +177,17 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zeq1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zeq3EqAS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.EqA, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.EqA, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.EqA, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !49
|
||||
// CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.EqA, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !49
|
||||
// CHECK:STDOUT: %cmp = icmp eq i32 %0, %1
|
||||
// CHECK:STDOUT: ret i1 %cmp
|
||||
@@ -197,23 +197,23 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zne1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zne3EqAS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.EqA, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.EqA, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.EqA, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.EqA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.EqA, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zeq1AS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zeq3EqAS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %lnot = xor i1 %call, true
|
||||
// CHECK:STDOUT: ret i1 %lnot
|
||||
// CHECK:STDOUT: }
|
||||
@@ -254,7 +254,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 24, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !21 = !{!22, !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"p1 _ZTS1A", !23, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"p1 _ZTS3EqA", !23, i64 0}
|
||||
// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !24 = !{!25, !25, i64 0}
|
||||
// CHECK:STDOUT: !25 = !{!"p1 bool", !23, i64 0}
|
||||
@@ -262,19 +262,19 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: !27 = !{!9, !9, i64 0}
|
||||
// CHECK:STDOUT: !28 = !{!29, !29, i64 0}
|
||||
// CHECK:STDOUT: !29 = !{!"bool", !10, i64 0}
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp", scope: null, file: !1, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33)
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.c41e21bae407dec8.Core:Cpp", scope: null, file: !1, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33)
|
||||
// CHECK:STDOUT: !31 = !DISubroutineType(types: !32)
|
||||
// CHECK:STDOUT: !32 = !{!15, !15, !15}
|
||||
// CHECK:STDOUT: !33 = !{!34, !35}
|
||||
// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !30, type: !15)
|
||||
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 2, scope: !30, type: !15)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 15, scope: !30)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp", scope: null, file: !1, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.c41e21bae407dec8.Core:Cpp", scope: null, file: !1, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !38 = !{!39, !40}
|
||||
// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !15)
|
||||
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 2, scope: !37, type: !15)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 15, scope: !37)
|
||||
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "CheckEqWith", linkageName: "_CCheckEqWith.Main.bdef5a2ed02e32a1", scope: null, file: !1, line: 18, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43)
|
||||
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "CheckEqWith", linkageName: "_CCheckEqWith.Main.5d19350ce19a6fbd", scope: null, file: !1, line: 18, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43)
|
||||
// CHECK:STDOUT: !43 = !{!44, !45}
|
||||
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !15)
|
||||
// CHECK:STDOUT: !45 = !DILocalVariable(arg: 2, scope: !42, type: !15)
|
||||
@@ -282,7 +282,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: !47 = !DILocation(line: 20, column: 3, scope: !42)
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 18, column: 1, scope: !42)
|
||||
// CHECK:STDOUT: !49 = !{!50, !9, i64 0}
|
||||
// CHECK:STDOUT: !50 = !{!"_ZTS1A", !9, i64 0}
|
||||
// CHECK:STDOUT: !50 = !{!"_ZTS3EqA", !9, i64 0}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'ordered_with.carbon'
|
||||
@@ -290,31 +290,31 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.A.4 = type { i32 }
|
||||
// CHECK:STDOUT: %struct.OrderedA = type { i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Zlt1AS_ = comdat any
|
||||
// CHECK:STDOUT: $_Zlt8OrderedAS_ = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Zle1AS_ = comdat any
|
||||
// CHECK:STDOUT: $_Zle8OrderedAS_ = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Zgt1AS_ = comdat any
|
||||
// CHECK:STDOUT: $_Zgt8OrderedAS_ = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Zge1AS_ = comdat any
|
||||
// CHECK:STDOUT: $_Zge8OrderedAS_ = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_CCheckOrderedWith.Main.c49adfa90bd18905(ptr %x, ptr %y), !dbg !19
|
||||
// CHECK:STDOUT: call void @_CCheckOrderedWith.Main.f3d1df67aae0c1db(ptr %x, ptr %y), !dbg !19
|
||||
// CHECK:STDOUT: ret void, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Zlt1AS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Zlt8OrderedAS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -323,24 +323,24 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt8OrderedAS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Zle1AS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Zle8OrderedAS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -349,24 +349,24 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zle1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zle8OrderedAS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Zgt1AS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Zgt8OrderedAS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -375,24 +375,24 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zgt1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zgt8OrderedAS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Zge1AS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Zge8OrderedAS_.carbon_thunk.__(ptr noundef %x, ptr noundef %y, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %y.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp1 = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24
|
||||
@@ -401,63 +401,63 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp1, i32 0, i32 0
|
||||
// CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zge1AS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zge8OrderedAS_(i32 %3, i32 %4)
|
||||
// CHECK:STDOUT: %storedv = zext i1 %call to i8
|
||||
// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !30 {
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CLess:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !30 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !36
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @_Zlt1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @_Zlt8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !36
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !36
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !37 {
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CLessOrEquivalent:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !41
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !41
|
||||
// CHECK:STDOUT: call void @_Zle1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !41
|
||||
// CHECK:STDOUT: call void @_Zle8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !41
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !41
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !41
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !42 {
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CGreater:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !42 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !46
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !46
|
||||
// CHECK:STDOUT: call void @_Zgt1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !46
|
||||
// CHECK:STDOUT: call void @_Zgt8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !46
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !46
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !46
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !47 {
|
||||
// CHECK:STDOUT: define weak_odr i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !47 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !51
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !51
|
||||
// CHECK:STDOUT: call void @_Zge1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !51
|
||||
// CHECK:STDOUT: call void @_Zge8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !51
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !51
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !51
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr void @_CCheckOrderedWith.Main.c49adfa90bd18905(ptr %x, ptr %y) #0 !dbg !52 {
|
||||
// CHECK:STDOUT: define linkonce_odr void @_CCheckOrderedWith.Main.f3d1df67aae0c1db(ptr %x, ptr %y) #0 !dbg !52 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call = call i1 @"_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !56
|
||||
// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call = call i1 @"_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !57
|
||||
// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call = call i1 @"_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !58
|
||||
// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call = call i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !59
|
||||
// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call = call i1 @"_CLess:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp"(ptr %x, ptr %y), !dbg !56
|
||||
// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call = call i1 @"_CGreater:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp"(ptr %x, ptr %y), !dbg !57
|
||||
// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call = call i1 @"_CLessOrEquivalent:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp"(ptr %x, ptr %y), !dbg !58
|
||||
// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call = call i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp"(ptr %x, ptr %y), !dbg !59
|
||||
// CHECK:STDOUT: ret void, !dbg !60
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -465,17 +465,17 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zlt1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zlt8OrderedAS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.4, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A.4, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.OrderedA, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.A.4, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.OrderedA, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !61
|
||||
// CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.A.4, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.OrderedA, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !61
|
||||
// CHECK:STDOUT: %cmp = icmp slt i32 %0, %1
|
||||
// CHECK:STDOUT: ret i1 %cmp
|
||||
@@ -485,66 +485,66 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zle1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zle8OrderedAS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.4, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A.4, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.OrderedA, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt8OrderedAS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %lnot = xor i1 %call, true
|
||||
// CHECK:STDOUT: ret i1 %lnot
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zgt1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zgt8OrderedAS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.4, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A.4, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.OrderedA, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt8OrderedAS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: ret i1 %call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zge1AS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local noundef zeroext i1 @_Zge8OrderedAS_(i32 %x.coerce, i32 %y.coerce) #4 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.A.4, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A.4, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: %x = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %y = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %agg.tmp2 = alloca %struct.OrderedA, align 4
|
||||
// CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %x, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A.4, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.OrderedA, ptr %y, i32 0, i32 0
|
||||
// CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A.4, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp2, i32 0, i32 0
|
||||
// CHECK:STDOUT: %1 = load i32, ptr %coerce.dive4, align 4
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt8OrderedAS_(i32 %0, i32 %1)
|
||||
// CHECK:STDOUT: %lnot = xor i1 %call, true
|
||||
// CHECK:STDOUT: ret i1 %lnot
|
||||
// CHECK:STDOUT: }
|
||||
@@ -585,7 +585,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 34, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 33, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !21 = !{!22, !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"p1 _ZTS1A", !23, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"p1 _ZTS8OrderedA", !23, i64 0}
|
||||
// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !24 = !{!25, !25, i64 0}
|
||||
// CHECK:STDOUT: !25 = !{!"p1 bool", !23, i64 0}
|
||||
@@ -593,29 +593,29 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: !27 = !{!9, !9, i64 0}
|
||||
// CHECK:STDOUT: !28 = !{!29, !29, i64 0}
|
||||
// CHECK:STDOUT: !29 = !{!"bool", !10, i64 0}
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Less", linkageName: "_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33)
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Less", linkageName: "_CLess:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp", scope: null, file: !1, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33)
|
||||
// CHECK:STDOUT: !31 = !DISubroutineType(types: !32)
|
||||
// CHECK:STDOUT: !32 = !{!15, !15, !15}
|
||||
// CHECK:STDOUT: !33 = !{!34, !35}
|
||||
// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !30, type: !15)
|
||||
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 2, scope: !30, type: !15)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 15, scope: !30)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "LessOrEquivalent", linkageName: "_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 16, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "LessOrEquivalent", linkageName: "_CLessOrEquivalent:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp", scope: null, file: !1, line: 16, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !38 = !{!39, !40}
|
||||
// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !15)
|
||||
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 2, scope: !37, type: !15)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 16, column: 15, scope: !37)
|
||||
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Greater", linkageName: "_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43)
|
||||
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Greater", linkageName: "_CGreater:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp", scope: null, file: !1, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43)
|
||||
// CHECK:STDOUT: !43 = !{!44, !45}
|
||||
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !15)
|
||||
// CHECK:STDOUT: !45 = !DILocalVariable(arg: 2, scope: !42, type: !15)
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 12, column: 15, scope: !42)
|
||||
// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "GreaterOrEquivalent", linkageName: "_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !48)
|
||||
// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "GreaterOrEquivalent", linkageName: "_CGreaterOrEquivalent:thunk:OrderedWith.f150fc1157a5293b.Core:Cpp", scope: null, file: !1, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !48)
|
||||
// CHECK:STDOUT: !48 = !{!49, !50}
|
||||
// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !15)
|
||||
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !47, type: !15)
|
||||
// CHECK:STDOUT: !51 = !DILocation(line: 20, column: 15, scope: !47)
|
||||
// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "CheckOrderedWith", linkageName: "_CCheckOrderedWith.Main.c49adfa90bd18905", scope: null, file: !1, line: 26, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !53)
|
||||
// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "CheckOrderedWith", linkageName: "_CCheckOrderedWith.Main.f3d1df67aae0c1db", scope: null, file: !1, line: 26, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !53)
|
||||
// CHECK:STDOUT: !53 = !{!54, !55}
|
||||
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !15)
|
||||
// CHECK:STDOUT: !55 = !DILocalVariable(arg: 2, scope: !52, type: !15)
|
||||
@@ -625,5 +625,5 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: !59 = !DILocation(line: 30, column: 3, scope: !52)
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 26, column: 1, scope: !52)
|
||||
// CHECK:STDOUT: !61 = !{!62, !9, i64 0}
|
||||
// CHECK:STDOUT: !62 = !{!"_ZTS1A", !9, i64 0}
|
||||
// CHECK:STDOUT: !62 = !{!"_ZTS8OrderedA", !9, i64 0}
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+163
-161
@@ -19,29 +19,29 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
class C {};
|
||||
class NonnullC {};
|
||||
|
||||
auto TakePtr(C* _Nonnull) -> void;
|
||||
auto ReturnPtr() -> C* _Nonnull;
|
||||
auto TakeNonnullPtr(NonnullC* _Nonnull) -> void;
|
||||
auto ReturnNonnullPtr() -> NonnullC* _Nonnull;
|
||||
|
||||
auto TakePtrWithThunk(C* _Nonnull, int = 0) -> void;
|
||||
auto ReturnPtrWithThunk(int = 0) -> C* _Nonnull;
|
||||
auto TakeNonnullPtrWithThunk(NonnullC* _Nonnull, int = 0) -> void;
|
||||
auto ReturnNonnullPtrWithThunk(int = 0) -> NonnullC* _Nonnull;
|
||||
''';
|
||||
|
||||
fn PassPtr(p: Cpp.C*) {
|
||||
Cpp.TakePtr(p);
|
||||
fn PassPtr(p: Cpp.NonnullC*) {
|
||||
Cpp.TakeNonnullPtr(p);
|
||||
}
|
||||
|
||||
fn ReturnPtr() -> Cpp.C* {
|
||||
return Cpp.ReturnPtr();
|
||||
fn ReturnPtr() -> Cpp.NonnullC* {
|
||||
return Cpp.ReturnNonnullPtr();
|
||||
}
|
||||
|
||||
fn PassPtrWithThunk(p: Cpp.C*) {
|
||||
Cpp.TakePtrWithThunk(p);
|
||||
fn PassPtrWithThunk(p: Cpp.NonnullC*) {
|
||||
Cpp.TakeNonnullPtrWithThunk(p);
|
||||
}
|
||||
|
||||
fn ReturnPtrWithThunk() -> Cpp.C* {
|
||||
return Cpp.ReturnPtrWithThunk();
|
||||
fn ReturnPtrWithThunk() -> Cpp.NonnullC* {
|
||||
return Cpp.ReturnNonnullPtrWithThunk();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -53,49 +53,51 @@ fn ReturnPtrWithThunk() -> Cpp.C* {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
class C {};
|
||||
class NullableC {};
|
||||
|
||||
auto TakePtr(C*) -> void;
|
||||
auto ReturnPtr() -> C*;
|
||||
auto TakeNullablePtr(NullableC*) -> void;
|
||||
auto ReturnNullablePtr() -> NullableC*;
|
||||
|
||||
auto TakePtrWithThunk(C*, int = 0) -> void;
|
||||
auto ReturnPtrWithThunk(int = 0) -> C*;
|
||||
auto TakeNullablePtrWithThunk(NullableC*, int = 0) -> void;
|
||||
auto ReturnNullablePtrWithThunk(int = 0) -> NullableC*;
|
||||
''';
|
||||
|
||||
fn PassPtr(_: Core.Optional(Cpp.C*)) {
|
||||
fn PassPtr(_: Core.Optional(Cpp.NullableC*)) {
|
||||
// TODO: Add support for passing an optional here.
|
||||
// Cpp.TakePtr(p);
|
||||
// Cpp.TakeNullablePtr(p);
|
||||
}
|
||||
|
||||
fn PassNonnullPtr(p: Cpp.C*) {
|
||||
fn PassNonnullPtr(p: Cpp.NullableC*) {
|
||||
// TODO: The `value_of_initializer` optimization doesn't get used here, so we
|
||||
// unnecessarily round-trip this value through memory.
|
||||
Cpp.TakePtr(p);
|
||||
Cpp.TakeNullablePtr(p);
|
||||
}
|
||||
|
||||
fn ReturnPtr() -> Core.Optional(Cpp.C*) {
|
||||
return Cpp.ReturnPtr();
|
||||
fn ReturnPtr() -> Core.Optional(Cpp.NullableC*) {
|
||||
return Cpp.ReturnNullablePtr();
|
||||
}
|
||||
|
||||
fn PassPtrWithThunk(_: Core.Optional(Cpp.C*)) {
|
||||
fn PassPtrWithThunk(_: Core.Optional(Cpp.NullableC*)) {
|
||||
// TODO: Add support for passing an optional here.
|
||||
// Cpp.TakePtrWithThunk(p);
|
||||
// Cpp.TakeNullablePtrWithThunk(p);
|
||||
}
|
||||
|
||||
fn PassNonnullPtrWithThunk(p: Cpp.C*) {
|
||||
Cpp.TakePtrWithThunk(p);
|
||||
fn PassNonnullPtrWithThunk(p: Cpp.NullableC*) {
|
||||
Cpp.TakeNullablePtrWithThunk(p);
|
||||
}
|
||||
|
||||
fn ReturnPtrWithThunk() -> Core.Optional(Cpp.C*) {
|
||||
return Cpp.ReturnPtrWithThunk();
|
||||
fn ReturnPtrWithThunk() -> Core.Optional(Cpp.NullableC*) {
|
||||
return Cpp.ReturnNullablePtrWithThunk();
|
||||
}
|
||||
|
||||
// --- add_const.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
class C {};
|
||||
C *make();
|
||||
void take(const C*);
|
||||
class ConstC {};
|
||||
ConstC *make();
|
||||
void take(const ConstC*);
|
||||
''';
|
||||
|
||||
fn Convert() {
|
||||
@@ -111,55 +113,55 @@ fn Convert() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %p) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %p), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z14TakeNonnullPtrP8NonnullC(ptr %p), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z7TakePtrP1C(ptr noundef) #1
|
||||
// CHECK:STDOUT: declare void @_Z14TakeNonnullPtrP8NonnullC(ptr noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !23
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !24
|
||||
// CHECK:STDOUT: %ReturnNonnullPtr.call = call ptr @_Z16ReturnNonnullPtrv(), !dbg !23
|
||||
// CHECK:STDOUT: ret ptr %ReturnNonnullPtr.call, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z9ReturnPtrv() #1
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z16ReturnNonnullPtrv() #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %p) #0 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %p), !dbg !28
|
||||
// CHECK:STDOUT: call void @_Z23TakeNonnullPtrWithThunkP8NonnullCi.carbon_thunk._(ptr %p), !dbg !28
|
||||
// CHECK:STDOUT: ret void, !dbg !29
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: define internal void @_Z23TakeNonnullPtrWithThunkP8NonnullCi.carbon_thunk._(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !30
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !30
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci(ptr noundef %1, i32 noundef 0)
|
||||
// CHECK:STDOUT: call void @_Z23TakeNonnullPtrWithThunkP8NonnullCi(ptr noundef %1, i32 noundef 0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !33 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !34
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !35
|
||||
// CHECK:STDOUT: %ReturnNonnullPtrWithThunk__carbon_thunk.call = call ptr @_Z25ReturnNonnullPtrWithThunki.carbon_thunk.(), !dbg !34
|
||||
// CHECK:STDOUT: ret ptr %ReturnNonnullPtrWithThunk__carbon_thunk.call, !dbg !35
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef ptr @_Z18ReturnPtrWithThunki.carbon_thunk.() #2 {
|
||||
// CHECK:STDOUT: define internal noundef ptr @_Z25ReturnNonnullPtrWithThunki.carbon_thunk.() #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %call = call noundef ptr @_Z18ReturnPtrWithThunki(i32 noundef 0)
|
||||
// CHECK:STDOUT: %call = call noundef ptr @_Z25ReturnNonnullPtrWithThunki(i32 noundef 0)
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z16TakePtrWithThunkP1Ci(ptr noundef, i32 noundef) #1
|
||||
// CHECK:STDOUT: declare void @_Z23TakeNonnullPtrWithThunkP8NonnullCi(ptr noundef, i32 noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z18ReturnPtrWithThunki(i32 noundef) #1
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z25ReturnNonnullPtrWithThunki(i32 noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
@@ -200,7 +202,7 @@ fn Convert() {
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 23, column: 3, scope: !25)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 22, column: 1, scope: !25)
|
||||
// CHECK:STDOUT: !30 = !{!31, !31, i64 0}
|
||||
// CHECK:STDOUT: !31 = !{!"p1 _ZTS1C", !32, i64 0}
|
||||
// CHECK:STDOUT: !31 = !{!"p1 _ZTS8NonnullC", !32, i64 0}
|
||||
// CHECK:STDOUT: !32 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !1, line: 26, type: !21, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 27, column: 10, scope: !33)
|
||||
@@ -221,32 +223,32 @@ fn Convert() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !19 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc22_15.2.temp = alloca ptr, align 8, !dbg !22
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.331b8c91728880af"(ptr %p), !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_15.2.temp), !dbg !22
|
||||
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_15.2.temp, align 8, !dbg !22
|
||||
// CHECK:STDOUT: %.loc22_15.4 = load ptr, ptr %.loc22_15.2.temp, align 8, !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %.loc22_15.4), !dbg !23
|
||||
// CHECK:STDOUT: call void @"_COp.16b2729c97ad4472:core.Destroy.Core"(ptr %.loc22_15.2.temp), !dbg !22
|
||||
// CHECK:STDOUT: %.loc22_23.2.temp = alloca ptr, align 8, !dbg !22
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.2.temp), !dbg !22
|
||||
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_23.2.temp, align 8, !dbg !22
|
||||
// CHECK:STDOUT: %.loc22_23.4 = load ptr, ptr %.loc22_23.2.temp, align 8, !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z15TakeNullablePtrP9NullableC(ptr %.loc22_23.4), !dbg !23
|
||||
// CHECK:STDOUT: call void @"_COp.af4d0379a4c35228:core.Destroy.Core"(ptr %.loc22_23.2.temp), !dbg !22
|
||||
// CHECK:STDOUT: ret void, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z7TakePtrP1C(ptr noundef) #1
|
||||
// CHECK:STDOUT: declare void @_Z15TakeNullablePtrP9NullableC(ptr noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.930f6ffe20ad4a64:core.Destroy.Core"(ptr %self) #0 !dbg !25 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.c4feefb53715d971:core.Destroy.Core"(ptr %self) #0 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.52f3be89096e2220:core.Destroy.Core"(ptr %self) #0 !dbg !29 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.1a4db661cca0482a:core.Destroy.Core"(ptr %self) #0 !dbg !29 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.16b2729c97ad4472:core.Destroy.Core"(ptr %self) #0 !dbg !33 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.af4d0379a4c35228:core.Destroy.Core"(ptr %self) #0 !dbg !33 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
@@ -254,11 +256,11 @@ fn Convert() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !40
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !41
|
||||
// CHECK:STDOUT: %ReturnNullablePtr.call = call ptr @_Z17ReturnNullablePtrv(), !dbg !40
|
||||
// CHECK:STDOUT: ret ptr %ReturnNullablePtr.call, !dbg !41
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z9ReturnPtrv() #1
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z17ReturnNullablePtrv() #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !42 {
|
||||
@@ -269,43 +271,43 @@ fn Convert() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !46 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !49
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.331b8c91728880af"(ptr %p), !dbg !49
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !49
|
||||
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !49
|
||||
// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !49
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %.loc35_24.4), !dbg !50
|
||||
// CHECK:STDOUT: call void @"_COp.16b2729c97ad4472:core.Destroy.Core"(ptr %.loc35_24.2.temp), !dbg !49
|
||||
// CHECK:STDOUT: %.loc35_32.2.temp = alloca ptr, align 8, !dbg !49
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !49
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_32.2.temp), !dbg !49
|
||||
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_32.2.temp, align 8, !dbg !49
|
||||
// CHECK:STDOUT: %.loc35_32.4 = load ptr, ptr %.loc35_32.2.temp, align 8, !dbg !49
|
||||
// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr %.loc35_32.4), !dbg !50
|
||||
// CHECK:STDOUT: call void @"_COp.af4d0379a4c35228:core.Destroy.Core"(ptr %.loc35_32.2.temp), !dbg !49
|
||||
// CHECK:STDOUT: ret void, !dbg !51
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: define internal void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !52
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !52
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci(ptr noundef %1, i32 noundef 0)
|
||||
// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi(ptr noundef %1, i32 noundef 0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !55 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !56
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !57
|
||||
// CHECK:STDOUT: %ReturnNullablePtrWithThunk__carbon_thunk.call = call ptr @_Z26ReturnNullablePtrWithThunki.carbon_thunk.(), !dbg !56
|
||||
// CHECK:STDOUT: ret ptr %ReturnNullablePtrWithThunk__carbon_thunk.call, !dbg !57
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef ptr @_Z18ReturnPtrWithThunki.carbon_thunk.() #2 {
|
||||
// CHECK:STDOUT: define internal noundef ptr @_Z26ReturnNullablePtrWithThunki.carbon_thunk.() #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %call = call noundef ptr @_Z18ReturnPtrWithThunki(i32 noundef 0)
|
||||
// CHECK:STDOUT: %call = call noundef ptr @_Z26ReturnNullablePtrWithThunki(i32 noundef 0)
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.331b8c91728880af"(ptr %self) #0 !dbg !58 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.f65d494664285214"(ptr %self), !dbg !64
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %self) #0 !dbg !58 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self), !dbg !64
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !65
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -313,34 +315,34 @@ fn Convert() {
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.f65d494664285214"(ptr %self) #0 !dbg !66 {
|
||||
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.f65d494664285214(ptr %self), !dbg !69
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self) #0 !dbg !66 {
|
||||
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %self), !dbg !69
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !70
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.f65d494664285214(ptr %value) #0 !dbg !71 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value), !dbg !74
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %value) #0 !dbg !71 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %value), !dbg !74
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !75
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self) #0 !dbg !76 {
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %self) #0 !dbg !76 {
|
||||
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !79
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !79
|
||||
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !79
|
||||
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !80
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !81
|
||||
// CHECK:STDOUT: call void @"_COp.52f3be89096e2220:core.Destroy.Core"(ptr %1), !dbg !79
|
||||
// CHECK:STDOUT: call void @"_COp.1a4db661cca0482a:core.Destroy.Core"(ptr %1), !dbg !79
|
||||
// CHECK:STDOUT: ret ptr %2, !dbg !82
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z16TakePtrWithThunkP1Ci(ptr noundef, i32 noundef) #1
|
||||
// CHECK:STDOUT: declare void @_Z24TakeNullablePtrWithThunkP9NullableCi(ptr noundef, i32 noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z18ReturnPtrWithThunki(i32 noundef) #1
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z26ReturnNullablePtrWithThunki(i32 noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.331b8c91728880af", { 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5", { 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 2, 1 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -374,21 +376,21 @@ fn Convert() {
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !1, line: 19, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20)
|
||||
// CHECK:STDOUT: !20 = !{!21}
|
||||
// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !15)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 22, column: 15, scope: !19)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 22, column: 23, scope: !19)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 22, column: 3, scope: !19)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 19, column: 1, scope: !19)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.930f6ffe20ad4a64:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c4feefb53715d971:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26)
|
||||
// CHECK:STDOUT: !26 = !{!27}
|
||||
// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !15)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 22, column: 15, scope: !25)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.52f3be89096e2220:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 22, column: 23, scope: !25)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1a4db661cca0482a:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30)
|
||||
// CHECK:STDOUT: !30 = !{!31}
|
||||
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !15)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 22, column: 15, scope: !29)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.16b2729c97ad4472:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 22, column: 23, scope: !29)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.af4d0379a4c35228:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34)
|
||||
// CHECK:STDOUT: !34 = !{!35}
|
||||
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !15)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 22, column: 15, scope: !33)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 22, column: 23, scope: !33)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !1, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !38 = !DISubroutineType(types: !39)
|
||||
// CHECK:STDOUT: !39 = !{!15}
|
||||
@@ -401,16 +403,16 @@ fn Convert() {
|
||||
// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !1, line: 34, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !47)
|
||||
// CHECK:STDOUT: !47 = !{!48}
|
||||
// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !15)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 35, column: 24, scope: !46)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 35, column: 32, scope: !46)
|
||||
// CHECK:STDOUT: !50 = !DILocation(line: 35, column: 3, scope: !46)
|
||||
// CHECK:STDOUT: !51 = !DILocation(line: 34, column: 1, scope: !46)
|
||||
// CHECK:STDOUT: !52 = !{!53, !53, i64 0}
|
||||
// CHECK:STDOUT: !53 = !{!"p1 _ZTS1C", !54, i64 0}
|
||||
// CHECK:STDOUT: !53 = !{!"p1 _ZTS9NullableC", !54, i64 0}
|
||||
// CHECK:STDOUT: !54 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !1, line: 38, type: !38, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !56 = !DILocation(line: 39, column: 10, scope: !55)
|
||||
// CHECK:STDOUT: !57 = !DILocation(line: 39, column: 3, scope: !55)
|
||||
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.331b8c91728880af", scope: null, file: !59, line: 105, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !62)
|
||||
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5", scope: null, file: !59, line: 105, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !62)
|
||||
// CHECK:STDOUT: !59 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
|
||||
// CHECK:STDOUT: !60 = !DISubroutineType(types: !61)
|
||||
// CHECK:STDOUT: !61 = !{!15, !15}
|
||||
@@ -418,17 +420,17 @@ fn Convert() {
|
||||
// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !58, type: !15)
|
||||
// CHECK:STDOUT: !64 = !DILocation(line: 106, column: 12, scope: !58)
|
||||
// CHECK:STDOUT: !65 = !DILocation(line: 106, column: 5, scope: !58)
|
||||
// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.f65d494664285214", scope: null, file: !59, line: 80, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !67)
|
||||
// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2", scope: null, file: !59, line: 80, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !67)
|
||||
// CHECK:STDOUT: !67 = !{!68}
|
||||
// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !66, type: !15)
|
||||
// CHECK:STDOUT: !69 = !DILocation(line: 81, column: 12, scope: !66)
|
||||
// CHECK:STDOUT: !70 = !DILocation(line: 81, column: 5, scope: !66)
|
||||
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.f65d494664285214", scope: null, file: !59, line: 33, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !72)
|
||||
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e83c25d1d2fd22c2", scope: null, file: !59, line: 33, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !72)
|
||||
// CHECK:STDOUT: !72 = !{!73}
|
||||
// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !71, type: !15)
|
||||
// CHECK:STDOUT: !74 = !DILocation(line: 34, column: 12, scope: !71)
|
||||
// CHECK:STDOUT: !75 = !DILocation(line: 34, column: 5, scope: !71)
|
||||
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !59, line: 166, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !77)
|
||||
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d", scope: null, file: !59, line: 166, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !77)
|
||||
// CHECK:STDOUT: !77 = !{!78}
|
||||
// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !76, type: !15)
|
||||
// CHECK:STDOUT: !79 = !DILocation(line: 167, column: 14, scope: !76)
|
||||
@@ -445,58 +447,58 @@ fn Convert() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CConvert.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc9_21.1.temp = alloca ptr, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc9_21.5.temp = alloca ptr, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc11_21.1.temp = alloca ptr, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc11_21.5.temp = alloca ptr, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: store ptr %make.call, ptr %.loc9_21.1.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc9_21.3 = load ptr, ptr %.loc9_21.1.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7a59268f02b553a8"(ptr %.loc9_21.3), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.5.temp), !dbg !15
|
||||
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc9_21.5.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc9_21.7 = load ptr, ptr %.loc9_21.5.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z4takePK1C(ptr %.loc9_21.7), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.d67a36d0f9ac97ca:core.Destroy.Core"(ptr %.loc9_21.5.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @"_COp.16b2729c97ad4472:core.Destroy.Core"(ptr %.loc9_21.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: store ptr %make.call, ptr %.loc11_21.1.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc11_21.3 = load ptr, ptr %.loc11_21.1.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.f9fd89fc1ccb531f"(ptr %.loc11_21.3), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.5.temp), !dbg !15
|
||||
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.5.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc11_21.7 = load ptr, ptr %.loc11_21.5.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z4takePK6ConstC(ptr %.loc11_21.7), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.cde1f9fdf283467b:core.Destroy.Core"(ptr %.loc11_21.5.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @"_COp.a6ac3d473017b2cc:core.Destroy.Core"(ptr %.loc11_21.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef ptr @_Z4makev() #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4takePK1C(ptr noundef) #1
|
||||
// CHECK:STDOUT: declare void @_Z4takePK6ConstC(ptr noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.bde6c3800c3f9965:core.Destroy.Core"(ptr %self) #0 !dbg !18 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.53a1c4a6a5cbb234:core.Destroy.Core"(ptr %self) #0 !dbg !18 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.8ff81f4b50934d6f:core.Destroy.Core"(ptr %self) #0 !dbg !25 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.fd6b21bba6dfd55d:core.Destroy.Core"(ptr %self) #0 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.d67a36d0f9ac97ca:core.Destroy.Core"(ptr %self) #0 !dbg !29 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.cde1f9fdf283467b:core.Destroy.Core"(ptr %self) #0 !dbg !29 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.930f6ffe20ad4a64:core.Destroy.Core"(ptr %self) #0 !dbg !33 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.fc86501cbc1f8185:core.Destroy.Core"(ptr %self) #0 !dbg !33 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.52f3be89096e2220:core.Destroy.Core"(ptr %self) #0 !dbg !37 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.b682b9cd8310efa2:core.Destroy.Core"(ptr %self) #0 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !40
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.16b2729c97ad4472:core.Destroy.Core"(ptr %self) #0 !dbg !41 {
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.a6ac3d473017b2cc:core.Destroy.Core"(ptr %self) #0 !dbg !41 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !44
|
||||
// CHECK:STDOUT: }
|
||||
@@ -505,77 +507,77 @@ fn Convert() {
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7a59268f02b553a8"(ptr %self) #0 !dbg !45 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.703e8dd9cedc135a"(ptr %self), !dbg !51
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.f9fd89fc1ccb531f"(ptr %self) #0 !dbg !45 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.3efc4c2a62f24739"(ptr %self), !dbg !51
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !52
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.703e8dd9cedc135a"(ptr %self) #0 !dbg !53 {
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.3efc4c2a62f24739"(ptr %self) #0 !dbg !53 {
|
||||
// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !56
|
||||
// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !56
|
||||
// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.f65d494664285214(ptr %self), !dbg !57
|
||||
// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !57
|
||||
// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !58
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: 2: ; preds = %0
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !56
|
||||
// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.f65d494664285214(ptr %self), !dbg !56
|
||||
// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !56
|
||||
// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !56
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !56
|
||||
// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !56
|
||||
// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !56
|
||||
// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !56
|
||||
// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.f04d7238fb50aa85(ptr %5), !dbg !59
|
||||
// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.305e266058820aa4(ptr %5), !dbg !59
|
||||
// CHECK:STDOUT: ret ptr %6, !dbg !60
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: 7: ; preds = %0
|
||||
// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.f04d7238fb50aa85(), !dbg !61
|
||||
// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.305e266058820aa4(), !dbg !61
|
||||
// CHECK:STDOUT: ret ptr %8, !dbg !62
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.f65d494664285214(ptr %self) #0 !dbg !63 {
|
||||
// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self), !dbg !66
|
||||
// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !63 {
|
||||
// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !66
|
||||
// CHECK:STDOUT: ret i1 %1, !dbg !67
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.f65d494664285214(ptr %self) #0 !dbg !68 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self), !dbg !71
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !68 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !71
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !72
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.f04d7238fb50aa85(ptr %value) #0 !dbg !73 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %value), !dbg !76
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.305e266058820aa4(ptr %value) #0 !dbg !73 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %value), !dbg !76
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !77
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.f04d7238fb50aa85() #0 !dbg !78 {
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.305e266058820aa4() #0 !dbg !78 {
|
||||
// CHECK:STDOUT: ret ptr null, !dbg !81
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !82 {
|
||||
// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !82 {
|
||||
// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !85
|
||||
// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !86
|
||||
// CHECK:STDOUT: ret i1 %2, !dbg !87
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !88 {
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !88 {
|
||||
// CHECK:STDOUT: ret ptr %value, !dbg !91
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %self) #0 !dbg !92 {
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %self) #0 !dbg !92 {
|
||||
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !95
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !95
|
||||
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !95
|
||||
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !96
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !97
|
||||
// CHECK:STDOUT: call void @"_COp.8ff81f4b50934d6f:core.Destroy.Core"(ptr %1), !dbg !95
|
||||
// CHECK:STDOUT: call void @"_COp.fd6b21bba6dfd55d:core.Destroy.Core"(ptr %1), !dbg !95
|
||||
// CHECK:STDOUT: ret ptr %2, !dbg !98
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -602,40 +604,40 @@ fn Convert() {
|
||||
// CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !1, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{null}
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 12, scope: !12)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 8, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bde6c3800c3f9965:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 11, column: 12, scope: !12)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 11, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.53a1c4a6a5cbb234:core.Destroy.Core", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22)
|
||||
// CHECK:STDOUT: !19 = !DISubroutineType(types: !20)
|
||||
// CHECK:STDOUT: !20 = !{null, !21}
|
||||
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !22 = !{!23}
|
||||
// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 9, column: 12, scope: !18)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8ff81f4b50934d6f:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 12, scope: !18)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd6b21bba6dfd55d:core.Destroy.Core", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26)
|
||||
// CHECK:STDOUT: !26 = !{!27}
|
||||
// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !21)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 9, column: 12, scope: !25)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d67a36d0f9ac97ca:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 11, column: 12, scope: !25)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.cde1f9fdf283467b:core.Destroy.Core", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30)
|
||||
// CHECK:STDOUT: !30 = !{!31}
|
||||
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !21)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 9, column: 12, scope: !29)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.930f6ffe20ad4a64:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 11, column: 12, scope: !29)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fc86501cbc1f8185:core.Destroy.Core", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34)
|
||||
// CHECK:STDOUT: !34 = !{!35}
|
||||
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !21)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 9, column: 12, scope: !33)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.52f3be89096e2220:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 11, column: 12, scope: !33)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b682b9cd8310efa2:core.Destroy.Core", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38)
|
||||
// CHECK:STDOUT: !38 = !{!39}
|
||||
// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !21)
|
||||
// CHECK:STDOUT: !40 = !DILocation(line: 9, column: 12, scope: !37)
|
||||
// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.16b2729c97ad4472:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42)
|
||||
// CHECK:STDOUT: !40 = !DILocation(line: 11, column: 12, scope: !37)
|
||||
// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a6ac3d473017b2cc:core.Destroy.Core", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42)
|
||||
// CHECK:STDOUT: !42 = !{!43}
|
||||
// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !21)
|
||||
// CHECK:STDOUT: !44 = !DILocation(line: 9, column: 12, scope: !41)
|
||||
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7a59268f02b553a8", scope: null, file: !46, line: 105, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !49)
|
||||
// CHECK:STDOUT: !44 = !DILocation(line: 11, column: 12, scope: !41)
|
||||
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.f9fd89fc1ccb531f", scope: null, file: !46, line: 105, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !49)
|
||||
// CHECK:STDOUT: !46 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
|
||||
// CHECK:STDOUT: !47 = !DISubroutineType(types: !48)
|
||||
// CHECK:STDOUT: !48 = !{!21, !21}
|
||||
@@ -643,7 +645,7 @@ fn Convert() {
|
||||
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !21)
|
||||
// CHECK:STDOUT: !51 = !DILocation(line: 106, column: 12, scope: !45)
|
||||
// CHECK:STDOUT: !52 = !DILocation(line: 106, column: 5, scope: !45)
|
||||
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.703e8dd9cedc135a", scope: null, file: !46, line: 95, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54)
|
||||
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.3efc4c2a62f24739", scope: null, file: !46, line: 95, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54)
|
||||
// CHECK:STDOUT: !54 = !{!55}
|
||||
// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !21)
|
||||
// CHECK:STDOUT: !56 = !DILocation(line: 97, column: 31, scope: !53)
|
||||
@@ -653,36 +655,36 @@ fn Convert() {
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 97, column: 7, scope: !53)
|
||||
// CHECK:STDOUT: !61 = !DILocation(line: 99, column: 12, scope: !53)
|
||||
// CHECK:STDOUT: !62 = !DILocation(line: 99, column: 5, scope: !53)
|
||||
// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.f65d494664285214", scope: null, file: !46, line: 36, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !64)
|
||||
// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.0c3518913b4fb338", scope: null, file: !46, line: 36, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !64)
|
||||
// CHECK:STDOUT: !64 = !{!65}
|
||||
// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !63, type: !21)
|
||||
// CHECK:STDOUT: !66 = !DILocation(line: 37, column: 12, scope: !63)
|
||||
// CHECK:STDOUT: !67 = !DILocation(line: 37, column: 5, scope: !63)
|
||||
// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.f65d494664285214", scope: null, file: !46, line: 39, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !69)
|
||||
// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.0c3518913b4fb338", scope: null, file: !46, line: 39, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !69)
|
||||
// CHECK:STDOUT: !69 = !{!70}
|
||||
// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !68, type: !21)
|
||||
// CHECK:STDOUT: !71 = !DILocation(line: 40, column: 12, scope: !68)
|
||||
// CHECK:STDOUT: !72 = !DILocation(line: 40, column: 5, scope: !68)
|
||||
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.f04d7238fb50aa85", scope: null, file: !46, line: 33, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !74)
|
||||
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.305e266058820aa4", scope: null, file: !46, line: 33, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !74)
|
||||
// CHECK:STDOUT: !74 = !{!75}
|
||||
// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !21)
|
||||
// CHECK:STDOUT: !76 = !DILocation(line: 34, column: 12, scope: !73)
|
||||
// CHECK:STDOUT: !77 = !DILocation(line: 34, column: 5, scope: !73)
|
||||
// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.f04d7238fb50aa85", scope: null, file: !46, line: 30, type: !79, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.305e266058820aa4", scope: null, file: !46, line: 30, type: !79, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !79 = !DISubroutineType(types: !80)
|
||||
// CHECK:STDOUT: !80 = !{!21}
|
||||
// CHECK:STDOUT: !81 = !DILocation(line: 31, column: 5, scope: !78)
|
||||
// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !46, line: 172, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !83)
|
||||
// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !46, line: 172, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !83)
|
||||
// CHECK:STDOUT: !83 = !{!84}
|
||||
// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !82, type: !21)
|
||||
// CHECK:STDOUT: !85 = !DILocation(line: 173, column: 16, scope: !82)
|
||||
// CHECK:STDOUT: !86 = !DILocation(line: 173, column: 12, scope: !82)
|
||||
// CHECK:STDOUT: !87 = !DILocation(line: 173, column: 5, scope: !82)
|
||||
// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !46, line: 175, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !89)
|
||||
// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !46, line: 175, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !89)
|
||||
// CHECK:STDOUT: !89 = !{!90}
|
||||
// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !88, type: !21)
|
||||
// CHECK:STDOUT: !91 = !DILocation(line: 176, column: 5, scope: !88)
|
||||
// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539", scope: null, file: !46, line: 166, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !93)
|
||||
// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352", scope: null, file: !46, line: 166, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !93)
|
||||
// CHECK:STDOUT: !93 = !{!94}
|
||||
// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !92, type: !21)
|
||||
// CHECK:STDOUT: !95 = !DILocation(line: 167, column: 14, scope: !92)
|
||||
|
||||
+2
-301
@@ -6,9 +6,9 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon
|
||||
|
||||
// --- initializer_list_pointer_pointer.h
|
||||
|
||||
@@ -30,26 +30,6 @@ struct vector_like {
|
||||
~vector_like() {}
|
||||
};
|
||||
|
||||
// --- initializer_list_pointer_size.h
|
||||
|
||||
namespace std {
|
||||
using size_t = decltype(sizeof(0));
|
||||
|
||||
template <typename T> class initializer_list {
|
||||
public:
|
||||
initializer_list() {}
|
||||
|
||||
private:
|
||||
T* begin_ = nullptr;
|
||||
size_t size_ = 0;
|
||||
};
|
||||
}
|
||||
|
||||
struct vector_like {
|
||||
vector_like(std::initializer_list<int> list) {}
|
||||
~vector_like() {}
|
||||
};
|
||||
|
||||
// --- nontrivial_dtor.h
|
||||
|
||||
struct nontrivial_dtor {
|
||||
@@ -84,33 +64,6 @@ fn InitNontrivialDtor() {
|
||||
WithinLifetime();
|
||||
}
|
||||
|
||||
// --- use_pointer_size.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "initializer_list_pointer_size.h";
|
||||
import Cpp library "nontrivial_dtor.h";
|
||||
|
||||
// TODO: When we support more precise modeling of temporary lifetimes, ensure
|
||||
// that this is called *before* the elements of the underlying array are
|
||||
// destroyed in the non-vector-like cases.
|
||||
fn WithinLifetime();
|
||||
|
||||
fn InitDirectly() {
|
||||
var _: Cpp.std.initializer_list(i32) = (1, 2, 3);
|
||||
WithinLifetime();
|
||||
}
|
||||
|
||||
fn InitVectorLike() {
|
||||
var _: Cpp.vector_like = (1, 2, 3);
|
||||
WithinLifetime();
|
||||
}
|
||||
|
||||
fn InitNontrivialDtor() {
|
||||
var _: Cpp.std.initializer_list(Cpp.nontrivial_dtor) = ((), (), ());
|
||||
WithinLifetime();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'use_pointer_pointer.carbon'
|
||||
// CHECK:STDOUT: source_filename = "use_pointer_pointer.carbon"
|
||||
@@ -362,255 +315,3 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !29)
|
||||
// CHECK:STDOUT: !56 = !DILocation(line: 23, column: 58, scope: !53)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'use_pointer_size.carbon'
|
||||
// CHECK:STDOUT: source_filename = "use_pointer_size.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %"class.std::initializer_list.6" = type { ptr, i64 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN11vector_likeD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN15nontrivial_dtorD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN11vector_likeC2ESt16initializer_listIiE = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN15nontrivial_dtorC2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @array = internal constant [3 x i32] [i32 1, i32 2, i32 3]
|
||||
// CHECK:STDOUT: @array.loc13_50.15 = internal constant [3 x i32] [i32 1, i32 2, i32 3]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_CWithinLifetime.Main()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CInitDirectly.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc13_50.3.temp = alloca [3 x i32], align 4, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_50.3.temp), !dbg !16
|
||||
// CHECK:STDOUT: %.loc13_50.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 0, !dbg !16
|
||||
// CHECK:STDOUT: %.loc13_50.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 1, !dbg !16
|
||||
// CHECK:STDOUT: %.loc13_50.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 2, !dbg !16
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !15
|
||||
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !15
|
||||
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !15
|
||||
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.3bc428c96004ce87:core.Destroy.Core"(ptr @array), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.70db2d92ffddbef7:core.Destroy.Core"(ptr %self) #0 !dbg !19 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.3bc428c96004ce87:core.Destroy.Core"(ptr %self) #0 !dbg !26 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !33 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !34
|
||||
// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 8, !dbg !35
|
||||
// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !35
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !34
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !35
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !35
|
||||
// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !35
|
||||
// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !35
|
||||
// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !35
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !35
|
||||
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !35
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !35
|
||||
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !35
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !34
|
||||
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !36
|
||||
// CHECK:STDOUT: call void @"_COp.3bc428c96004ce87:core.Destroy.Core"(ptr @array), !dbg !35
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !34
|
||||
// CHECK:STDOUT: ret void, !dbg !37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr noundef %list, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %list.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list.6", align 8
|
||||
// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !38
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !38
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !43
|
||||
// CHECK:STDOUT: %2 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load ptr, ptr %2, align 8
|
||||
// CHECK:STDOUT: %4 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 1
|
||||
// CHECK:STDOUT: %5 = load i64, ptr %4, align 8
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeC2ESt16initializer_listIiE(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr %3, i64 %5)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !48 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !49
|
||||
// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !50
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !49
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !50
|
||||
// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !50
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !50
|
||||
// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !50
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !50
|
||||
// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !50
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !50
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !49
|
||||
// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !49
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !49
|
||||
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !49
|
||||
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !51
|
||||
// CHECK:STDOUT: call void @"_COp.baa51490b2bdaa96:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !50
|
||||
// CHECK:STDOUT: ret void, !dbg !52
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !53
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !53
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.baa51490b2bdaa96:core.Destroy.Core"(ptr %self) #0 !dbg !55 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !58
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeC2ESt16initializer_listIiE(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr %list.coerce0, i64 %list.coerce1) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %list = alloca %"class.std::initializer_list.6", align 8
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %0 = getelementptr inbounds nuw { ptr, i64 }, ptr %list, i32 0, i32 0
|
||||
// CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8
|
||||
// CHECK:STDOUT: %1 = getelementptr inbounds nuw { ptr, i64 }, ptr %list, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i64 %list.coerce1, ptr %1, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple., { 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 6, 5, 4, 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!0}
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !6}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !1 = !DIFile(filename: "use_pointer_size.carbon", directory: "")
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !7 = !{!8, !9, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !1, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{null}
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 13, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 42, scope: !12)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 14, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.70db2d92ffddbef7:core.Destroy.Core", scope: null, file: !1, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23)
|
||||
// CHECK:STDOUT: !20 = !DISubroutineType(types: !21)
|
||||
// CHECK:STDOUT: !21 = !{null, !22}
|
||||
// CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !23 = !{!24}
|
||||
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 42, scope: !19)
|
||||
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3bc428c96004ce87:core.Destroy.Core", scope: null, file: !1, line: 13, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30)
|
||||
// CHECK:STDOUT: !27 = !DISubroutineType(types: !28)
|
||||
// CHECK:STDOUT: !28 = !{null, !29}
|
||||
// CHECK:STDOUT: !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !30 = !{!31}
|
||||
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 13, column: 42, scope: !26)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 3, scope: !33)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 18, column: 28, scope: !33)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 19, column: 3, scope: !33)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 17, column: 1, scope: !33)
|
||||
// CHECK:STDOUT: !38 = !{!39, !39, i64 0}
|
||||
// CHECK:STDOUT: !39 = !{!"p1 _ZTSSt16initializer_listIiE", !40, i64 0}
|
||||
// CHECK:STDOUT: !40 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !41 = !{!42, !42, i64 0}
|
||||
// CHECK:STDOUT: !42 = !{!"p1 _ZTS11vector_like", !40, i64 0}
|
||||
// CHECK:STDOUT: !43 = !{i64 0, i64 8, !44, i64 8, i64 8, !46}
|
||||
// CHECK:STDOUT: !44 = !{!45, !45, i64 0}
|
||||
// CHECK:STDOUT: !45 = !{!"p1 int", !40, i64 0}
|
||||
// CHECK:STDOUT: !46 = !{!47, !47, i64 0}
|
||||
// CHECK:STDOUT: !47 = !{!"long", !10, i64 0}
|
||||
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 23, column: 3, scope: !48)
|
||||
// CHECK:STDOUT: !50 = !DILocation(line: 23, column: 58, scope: !48)
|
||||
// CHECK:STDOUT: !51 = !DILocation(line: 24, column: 3, scope: !48)
|
||||
// CHECK:STDOUT: !52 = !DILocation(line: 22, column: 1, scope: !48)
|
||||
// CHECK:STDOUT: !53 = !{!54, !54, i64 0}
|
||||
// CHECK:STDOUT: !54 = !{!"p1 _ZTS15nontrivial_dtor", !40, i64 0}
|
||||
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.baa51490b2bdaa96:core.Destroy.Core", scope: null, file: !1, line: 23, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !56)
|
||||
// CHECK:STDOUT: !56 = !{!57}
|
||||
// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !29)
|
||||
// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 58, scope: !55)
|
||||
// CHECK:STDOUT:
|
||||
+318
@@ -0,0 +1,318 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon
|
||||
|
||||
// --- initializer_list_pointer_size.h
|
||||
|
||||
namespace std {
|
||||
using size_t = decltype(sizeof(0));
|
||||
|
||||
template <typename T> class initializer_list {
|
||||
public:
|
||||
initializer_list() {}
|
||||
|
||||
private:
|
||||
T* begin_ = nullptr;
|
||||
size_t size_ = 0;
|
||||
};
|
||||
}
|
||||
|
||||
struct vector_like {
|
||||
vector_like(std::initializer_list<int> list) {}
|
||||
~vector_like() {}
|
||||
};
|
||||
|
||||
// --- nontrivial_dtor.h
|
||||
|
||||
struct nontrivial_dtor {
|
||||
nontrivial_dtor() {}
|
||||
~nontrivial_dtor() {}
|
||||
};
|
||||
|
||||
// --- use_pointer_size.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "initializer_list_pointer_size.h";
|
||||
import Cpp library "nontrivial_dtor.h";
|
||||
|
||||
// TODO: When we support more precise modeling of temporary lifetimes, ensure
|
||||
// that this is called *before* the elements of the underlying array are
|
||||
// destroyed in the non-vector-like cases.
|
||||
fn WithinLifetime();
|
||||
|
||||
fn InitDirectly() {
|
||||
var _: Cpp.std.initializer_list(i32) = (1, 2, 3);
|
||||
WithinLifetime();
|
||||
}
|
||||
|
||||
fn InitVectorLike() {
|
||||
var _: Cpp.vector_like = (1, 2, 3);
|
||||
WithinLifetime();
|
||||
}
|
||||
|
||||
fn InitNontrivialDtor() {
|
||||
var _: Cpp.std.initializer_list(Cpp.nontrivial_dtor) = ((), (), ());
|
||||
WithinLifetime();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ---
|
||||
// CHECK:STDOUT: ; ModuleID = 'use_pointer_size.carbon'
|
||||
// CHECK:STDOUT: source_filename = "use_pointer_size.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %"class.std::initializer_list" = type { ptr, i64 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN11vector_likeD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN15nontrivial_dtorD2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN11vector_likeC2ESt16initializer_listIiE = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN15nontrivial_dtorC2Ev = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @array = internal constant [3 x i32] [i32 1, i32 2, i32 3]
|
||||
// CHECK:STDOUT: @array.loc13_50.15 = internal constant [3 x i32] [i32 1, i32 2, i32 3]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_CWithinLifetime.Main()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CInitDirectly.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !15
|
||||
// CHECK:STDOUT: %.loc13_50.3.temp = alloca [3 x i32], align 4, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_50.3.temp), !dbg !16
|
||||
// CHECK:STDOUT: %.loc13_50.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 0, !dbg !16
|
||||
// CHECK:STDOUT: %.loc13_50.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 1, !dbg !16
|
||||
// CHECK:STDOUT: %.loc13_50.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 2, !dbg !16
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !15
|
||||
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !15
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !15
|
||||
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !15
|
||||
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.3bc428c96004ce87:core.Destroy.Core"(ptr @array), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.70db2d92ffddbef7:core.Destroy.Core"(ptr %self) #0 !dbg !19 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.3bc428c96004ce87:core.Destroy.Core"(ptr %self) #0 !dbg !26 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !33 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !34
|
||||
// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 8, !dbg !35
|
||||
// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !35
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !34
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !35
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !35
|
||||
// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !35
|
||||
// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !35
|
||||
// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !35
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !35
|
||||
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !35
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !35
|
||||
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !35
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !34
|
||||
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !36
|
||||
// CHECK:STDOUT: call void @"_COp.3bc428c96004ce87:core.Destroy.Core"(ptr @array), !dbg !35
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !34
|
||||
// CHECK:STDOUT: ret void, !dbg !37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr noundef %list, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %list.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list", align 8
|
||||
// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !38
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !38
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !43
|
||||
// CHECK:STDOUT: %2 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load ptr, ptr %2, align 8
|
||||
// CHECK:STDOUT: %4 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 1
|
||||
// CHECK:STDOUT: %5 = load i64, ptr %4, align 8
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeC2ESt16initializer_listIiE(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr %3, i64 %5)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !48 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !49
|
||||
// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !50
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !49
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !50
|
||||
// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !50
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !50
|
||||
// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !50
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !50
|
||||
// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !50
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !50
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !49
|
||||
// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !49
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !49
|
||||
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !49
|
||||
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !51
|
||||
// CHECK:STDOUT: call void @"_COp.baa51490b2bdaa96:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !50
|
||||
// CHECK:STDOUT: ret void, !dbg !52
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !53
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !53
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.baa51490b2bdaa96:core.Destroy.Core"(ptr %self) #0 !dbg !55 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !58
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeC2ESt16initializer_listIiE(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr %list.coerce0, i64 %list.coerce1) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %list = alloca %"class.std::initializer_list", align 8
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %0 = getelementptr inbounds nuw { ptr, i64 }, ptr %list, i32 0, i32 0
|
||||
// CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8
|
||||
// CHECK:STDOUT: %1 = getelementptr inbounds nuw { ptr, i64 }, ptr %list, i32 0, i32 1
|
||||
// CHECK:STDOUT: store i64 %list.coerce1, ptr %1, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !41
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53
|
||||
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple., { 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 6, 5, 4, 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!0}
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !6}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !1 = !DIFile(filename: "use_pointer_size.carbon", directory: "")
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !7 = !{!8, !9, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
|
||||
// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !1, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{null}
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 13, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 42, scope: !12)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 14, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.70db2d92ffddbef7:core.Destroy.Core", scope: null, file: !1, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23)
|
||||
// CHECK:STDOUT: !20 = !DISubroutineType(types: !21)
|
||||
// CHECK:STDOUT: !21 = !{null, !22}
|
||||
// CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !23 = !{!24}
|
||||
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 42, scope: !19)
|
||||
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3bc428c96004ce87:core.Destroy.Core", scope: null, file: !1, line: 13, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30)
|
||||
// CHECK:STDOUT: !27 = !DISubroutineType(types: !28)
|
||||
// CHECK:STDOUT: !28 = !{null, !29}
|
||||
// CHECK:STDOUT: !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !30 = !{!31}
|
||||
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 13, column: 42, scope: !26)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 3, scope: !33)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 18, column: 28, scope: !33)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 19, column: 3, scope: !33)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 17, column: 1, scope: !33)
|
||||
// CHECK:STDOUT: !38 = !{!39, !39, i64 0}
|
||||
// CHECK:STDOUT: !39 = !{!"p1 _ZTSSt16initializer_listIiE", !40, i64 0}
|
||||
// CHECK:STDOUT: !40 = !{!"any pointer", !10, i64 0}
|
||||
// CHECK:STDOUT: !41 = !{!42, !42, i64 0}
|
||||
// CHECK:STDOUT: !42 = !{!"p1 _ZTS11vector_like", !40, i64 0}
|
||||
// CHECK:STDOUT: !43 = !{i64 0, i64 8, !44, i64 8, i64 8, !46}
|
||||
// CHECK:STDOUT: !44 = !{!45, !45, i64 0}
|
||||
// CHECK:STDOUT: !45 = !{!"p1 int", !40, i64 0}
|
||||
// CHECK:STDOUT: !46 = !{!47, !47, i64 0}
|
||||
// CHECK:STDOUT: !47 = !{!"long", !10, i64 0}
|
||||
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 23, column: 3, scope: !48)
|
||||
// CHECK:STDOUT: !50 = !DILocation(line: 23, column: 58, scope: !48)
|
||||
// CHECK:STDOUT: !51 = !DILocation(line: 24, column: 3, scope: !48)
|
||||
// CHECK:STDOUT: !52 = !DILocation(line: 22, column: 1, scope: !48)
|
||||
// CHECK:STDOUT: !53 = !{!54, !54, i64 0}
|
||||
// CHECK:STDOUT: !54 = !{!"p1 _ZTS15nontrivial_dtor", !40, i64 0}
|
||||
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.baa51490b2bdaa96:core.Destroy.Core", scope: null, file: !1, line: 23, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !56)
|
||||
// CHECK:STDOUT: !56 = !{!57}
|
||||
// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !29)
|
||||
// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 58, scope: !55)
|
||||
// CHECK:STDOUT:
|
||||
Reference in New Issue
Block a user