mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Support pass-by-move when calling a C++ function taking by value. (#7135)
Previously, we picked a single Carbon parameter pattern for each C++ parameter pattern. This doesn't work well in cases where the Carbon semantics and the C++ semantics are not perfectly aligned. In particular, when a parameter is passed by value in C++, that might mean either pass-by-move (which in Carbon would best be modeled by a `var` pattern, as no other form of parameter would perform a move) or pass-by-copy (which in Carbon would best be modeled by a value parameter, as a `var` parameter would force an extra copy). After this change, we compute a passing mode for each parameter based on the implicit conversion sequence from the argument to the parameter as determined by C++ overload resolution, and use that to determine the Carbon pattern corresponding to each C++ parameter. This results in potentially generating multiple different thunks for the same C++ function if it's called in different ways, but we already did that to handle default arguments and list-initialization. The passing modes are included in the thunk mangling. Add a new value store for clang decl signatures, which capture the information about parameter passing mode as well as the other existing information about different ways that a C++ function might be imported to Carbon. Most of the rules for computing passing modes are the same as before: const references use pass by value, non-const lvalue references use pass-by-ref, non-const rvalue references use pass-by-var. But for C++ non-reference parameters, pick between pass-by-value and pass-by-var based on whether the implicit conversion sequence was effectively performing a copy. Prefer pass-by-value if either would work and they'd do the same thing. We still use pass-by-value for const references, even when the argument is an lvalue and we could pass a reference; we may want to change this in future. For virtual functions, we try to pick a worst-case passing mode, as we can only pick a single signature for what goes in the vtable. Calls to virtual functions will still use a thunk to C++, allowing variance in the calling convention at call sites. We don't allow variance in the overriders as we don't implement support for thunks for virtual functions yet. We currently use pass-by-value for const reference parameters here, but that should probably change at some point. Assisted-by: Gemini via Antigravity
This commit is contained in:
+39
-39
@@ -181,12 +181,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_26.1.temp = alloca [8 x i8], align 1, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk(ptr %.loc7_26.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc7_26.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// 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 @_ZN1CC1Ev.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 !16
|
||||
@@ -200,12 +200,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc11_19.2.temp = alloca [8 x i8], align 1, !dbg !20
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_19.2.temp), !dbg !20
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple(ptr %.loc11_19.2.temp), !dbg !20
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc11_19.2.temp), !dbg !20
|
||||
// CHECK:STDOUT: ret void, !dbg !21
|
||||
// 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 @_ZN1CC1Ev.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 !16
|
||||
@@ -286,7 +286,7 @@ fn Four() {
|
||||
// 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 @_ZN1CC1Ev.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 !16
|
||||
@@ -298,7 +298,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Default.7b1e6a57c714cdb7.Core:C.Cpp"(ptr sret([8 x i8]) %return) #2 !dbg !19 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk(ptr %return), !dbg !24
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !24
|
||||
// CHECK:STDOUT: ret void, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -386,18 +386,18 @@ fn Four() {
|
||||
// CHECK:STDOUT: %.loc12_65.1.temp = alloca [4 x i8], align 1, !dbg !16
|
||||
// CHECK:STDOUT: %_.var.loc13 = alloca [4 x i8], align 1, !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_65.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk(ptr %.loc8_65.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc8_65.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc9), !dbg !15
|
||||
// CHECK:STDOUT: call void @"_COp.d288d62be0e5d791:DefaultOrUnformed.Core.22b4681b019423d7"(ptr %_.var.loc9), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_65.1.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk(ptr %.loc12_65.1.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc12_65.1.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.d288d62be0e5d791:DefaultOrUnformed.Core.1a27c303748a2360"(ptr %_.var.loc13), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN26ImplicitlyDefaultedDefaultC1Ev.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 !19
|
||||
@@ -409,12 +409,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Default.2e5fb550c65543cf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !22 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk(ptr %return), !dbg !27
|
||||
// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !27
|
||||
// CHECK:STDOUT: ret void, !dbg !27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN26ExplicitlyDefaultedDefaultC1Ev.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 !28
|
||||
@@ -426,7 +426,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Default.cad83ce9b7db87bf.Core:ExplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !30 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk(ptr %return), !dbg !31
|
||||
// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !31
|
||||
// CHECK:STDOUT: ret void, !dbg !31
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -534,12 +534,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_10.1.temp = alloca [4 x i8], align 1, !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_10.1.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk(ptr %c, ptr %return), !dbg !17
|
||||
// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %c, ptr %return), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN4CopyC1ERKS_.carbon_thunk(ptr noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
@@ -554,7 +554,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Copy.692da64e78c7deec.Core:Copy.Cpp"(ptr sret([4 x i8]) %return, ptr %self) #2 !dbg !22 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk(ptr %self, ptr %return), !dbg !26
|
||||
// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !26
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -633,12 +633,12 @@ fn Four() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_44.1.temp = alloca [8 x i8], align 1, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_44.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk(ptr %.loc7_44.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk.(ptr %.loc7_44.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN7DerivedC1Ev.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN7DerivedC1Ev.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 !16
|
||||
@@ -712,14 +712,14 @@ fn Four() {
|
||||
// CHECK:STDOUT: %.loc7_26.1.temp = alloca [1 x i8], align 1, !dbg !14
|
||||
// CHECK:STDOUT: %.loc8_19.2.temp = alloca [1 x i8], align 1, !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk(ptr %.loc7_26.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc7_26.1.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_19.2.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple(ptr %.loc8_19.2.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc8_19.2.temp), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// 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 @_ZN1CC1Ev.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 !17
|
||||
@@ -729,7 +729,7 @@ fn Four() {
|
||||
// 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 @_ZN1CC1Ev.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 !17
|
||||
@@ -745,16 +745,16 @@ fn Four() {
|
||||
// CHECK:STDOUT: %.loc13_18.1.temp = alloca [1 x i8], align 1, !dbg !22
|
||||
// CHECK:STDOUT: %.loc14_21.2.temp = alloca [1 x i8], align 1, !dbg !23
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_27.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk(i32 1, ptr %.loc12_27.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk._(i32 1, ptr %.loc12_27.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_18.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk(i32 2, ptr %.loc13_18.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk._(i32 2, ptr %.loc13_18.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_21.2.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk_tuple(i32 3, ptr %.loc14_21.2.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_21.2.temp), !dbg !23
|
||||
// CHECK:STDOUT: ret void, !dbg !24
|
||||
// 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 @_ZN1CC1Ei.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
|
||||
@@ -767,7 +767,7 @@ fn Four() {
|
||||
// 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 @_ZN1CC1Ei.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
|
||||
@@ -785,14 +785,14 @@ fn Four() {
|
||||
// CHECK:STDOUT: %.loc18_30.1.temp = alloca [1 x i8], align 1, !dbg !26
|
||||
// CHECK:STDOUT: %.loc19_23.2.temp = alloca [1 x i8], align 1, !dbg !27
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_30.1.temp), !dbg !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk(i32 1, i32 2, ptr %.loc18_30.1.temp), !dbg !26
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_30.1.temp), !dbg !26
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_23.2.temp), !dbg !27
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk_tuple(i32 3, i32 4, ptr %.loc19_23.2.temp), !dbg !27
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_23.2.temp), !dbg !27
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// 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 @_ZN1CC1Eii.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
|
||||
@@ -808,7 +808,7 @@ fn Four() {
|
||||
// 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 @_ZN1CC1Eii.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
|
||||
@@ -829,14 +829,14 @@ fn Four() {
|
||||
// CHECK:STDOUT: %.loc23_33.1.temp = alloca [1 x i8], align 1, !dbg !30
|
||||
// CHECK:STDOUT: %.loc24_26.2.temp = alloca [1 x i8], align 1, !dbg !31
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_33.1.temp), !dbg !30
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk3(i32 1, i32 2, i32 3, ptr %.loc23_33.1.temp), !dbg !30
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_33.1.temp), !dbg !30
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_26.2.temp), !dbg !31
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple3(i32 4, i32 5, i32 6, ptr %.loc24_26.2.temp), !dbg !31
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_26.2.temp), !dbg !31
|
||||
// CHECK:STDOUT: ret void, !dbg !32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eiiii.carbon_thunk3(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eiiii.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
|
||||
@@ -855,7 +855,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eiiii.carbon_thunk_tuple3(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Eiiii.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
|
||||
@@ -879,14 +879,14 @@ fn Four() {
|
||||
// CHECK:STDOUT: %.loc28_36.1.temp = alloca [1 x i8], align 1, !dbg !34
|
||||
// CHECK:STDOUT: %.loc29_29.2.temp = alloca [1 x i8], align 1, !dbg !35
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_36.1.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_36.1.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_36.1.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_29.2.temp), !dbg !35
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_29.2.temp), !dbg !35
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_29.2.temp), !dbg !35
|
||||
// CHECK:STDOUT: ret void, !dbg !36
|
||||
// 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 @_ZN1CC1Eiiii.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
|
||||
@@ -908,7 +908,7 @@ fn Four() {
|
||||
// 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 @_ZN1CC1Eiiii.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
|
||||
@@ -983,7 +983,7 @@ fn Four() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN1CC1Ei.carbon_thunk, { 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN1CC1Ei.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 }
|
||||
|
||||
@@ -0,0 +1,504 @@
|
||||
// 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/destroy.carbon
|
||||
// EXTRA-ARGS: --clang-arg=-fno-exceptions
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/copy_vs_move.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/copy_vs_move.carbon
|
||||
|
||||
// --- copyable.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
inline Cpp '''
|
||||
struct Copyable {
|
||||
Copyable(const Copyable&);
|
||||
Copyable& operator=(const Copyable&);
|
||||
~Copyable();
|
||||
};
|
||||
Copyable make();
|
||||
void pass(Copyable);
|
||||
''';
|
||||
|
||||
var c: Cpp.Copyable = Cpp.make();
|
||||
|
||||
fn PassGlobal() {
|
||||
Cpp.pass(c);
|
||||
}
|
||||
|
||||
fn PassTemporary() {
|
||||
Cpp.pass(Cpp.make());
|
||||
}
|
||||
|
||||
fn PassValue(c: Cpp.Copyable) {
|
||||
Cpp.pass(c);
|
||||
}
|
||||
|
||||
fn PassRef(ref c: Cpp.Copyable) {
|
||||
Cpp.pass(c);
|
||||
}
|
||||
|
||||
// --- copy_or_move.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
inline Cpp '''
|
||||
struct CopyOrMove {
|
||||
CopyOrMove(const CopyOrMove&);
|
||||
CopyOrMove& operator=(const CopyOrMove&);
|
||||
CopyOrMove(CopyOrMove&&);
|
||||
CopyOrMove& operator=(CopyOrMove&&);
|
||||
~CopyOrMove();
|
||||
};
|
||||
CopyOrMove make();
|
||||
void pass(CopyOrMove);
|
||||
''';
|
||||
|
||||
var c: Cpp.CopyOrMove = Cpp.make();
|
||||
|
||||
fn PassGlobal() {
|
||||
Cpp.pass(c);
|
||||
}
|
||||
|
||||
fn PassTemporary() {
|
||||
Cpp.pass(Cpp.make());
|
||||
}
|
||||
|
||||
fn PassValue(c: Cpp.CopyOrMove) {
|
||||
Cpp.pass(c);
|
||||
}
|
||||
|
||||
fn PassRef(ref c: Cpp.CopyOrMove) {
|
||||
Cpp.pass(c);
|
||||
}
|
||||
|
||||
// --- move_only.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
inline Cpp '''
|
||||
namespace std {
|
||||
template<typename T> T&& move(T& t) { return static_cast<T&&>(t); }
|
||||
}
|
||||
|
||||
struct MoveOnly {
|
||||
MoveOnly(const MoveOnly&) = delete;
|
||||
MoveOnly& operator=(const MoveOnly&) = delete;
|
||||
MoveOnly(MoveOnly&&);
|
||||
MoveOnly& operator=(MoveOnly&&);
|
||||
~MoveOnly();
|
||||
};
|
||||
MoveOnly make();
|
||||
void pass(MoveOnly);
|
||||
''';
|
||||
|
||||
var c: Cpp.MoveOnly = Cpp.make();
|
||||
|
||||
fn PassGlobalByMove() {
|
||||
// TODO: This should be accepted.
|
||||
// Cpp.pass(Cpp.std.move(ref c));
|
||||
}
|
||||
|
||||
fn PassTemporary() {
|
||||
Cpp.pass(Cpp.make());
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ModuleID = 'copyable.carbon'
|
||||
// CHECK:STDOUT: source_filename = "copyable.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: %struct.Copyable = type { i8 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @_Cc.Main = global [1 x i8] zeroinitializer
|
||||
// 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: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !11
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !11
|
||||
// CHECK:STDOUT: call void @_Z4makev(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 !14 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr @_Cc.Main), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// 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: 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 !11
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11
|
||||
// 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 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !19 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc21_21.1.temp = alloca [1 x i8], align 1, !dbg !20
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_21.1.temp), !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %.loc21_21.1.temp), !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %.loc21_21.1.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %.loc21_21.1.temp), !dbg !20
|
||||
// CHECK:STDOUT: ret void, !dbg !22
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: declare void @_ZN8CopyableD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %c), !dbg !29
|
||||
// CHECK:STDOUT: ret void, !dbg !30
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %c), !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)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !36 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !37
|
||||
// CHECK:STDOUT: ret void, !dbg !38
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4pass8Copyable(ptr noundef) #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:
|
||||
// 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 }
|
||||
// CHECK:STDOUT: attributes #2 = { nounwind "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: attributes #4 = { "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:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// 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 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "copyable.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = !{!12, !12, i64 0}
|
||||
// CHECK:STDOUT: !12 = !{!"p1 _ZTS8Copyable", !13, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !6, line: 16, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !15 = !DISubroutineType(types: !16)
|
||||
// CHECK:STDOUT: !16 = !{null}
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 17, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 1, scope: !14)
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !6, line: 20, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 21, column: 12, scope: !19)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 21, column: 3, scope: !19)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 20, column: 1, scope: !19)
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !6, line: 24, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !27)
|
||||
// CHECK:STDOUT: !24 = !DISubroutineType(types: !25)
|
||||
// CHECK:STDOUT: !25 = !{null, !26}
|
||||
// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !27 = !{!28}
|
||||
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 25, column: 3, scope: !23)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 24, column: 1, scope: !23)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !6, line: 28, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32)
|
||||
// CHECK:STDOUT: !32 = !{!33}
|
||||
// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !26)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 29, column: 3, scope: !31)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 28, column: 1, scope: !31)
|
||||
// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 14, column: 23, scope: !36)
|
||||
// CHECK:STDOUT: !38 = !DILocation(line: 0, scope: !36)
|
||||
// CHECK:STDOUT: ; ModuleID = 'copy_or_move.carbon'
|
||||
// CHECK:STDOUT: source_filename = "copy_or_move.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: %struct.CopyOrMove = type { i8 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @_Cc.Main = global [1 x i8] zeroinitializer
|
||||
// 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: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !11
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !11
|
||||
// CHECK:STDOUT: call void @_Z4makev(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 !14 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// 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: 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 !11
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11
|
||||
// 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 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !19 {
|
||||
// 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 @_Z4pass10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !22
|
||||
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(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 @_Z4pass10CopyOrMove.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 !11
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11
|
||||
// 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 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: declare void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !24 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.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 @_Z4pass10CopyOrMove.carbon_thunk._(ptr %c), !dbg !35
|
||||
// CHECK:STDOUT: ret void, !dbg !36
|
||||
// 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: 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: ret void, !dbg !39
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4pass10CopyOrMove(ptr noundef) #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:
|
||||
// CHECK:STDOUT: declare void @_ZN10CopyOrMoveC1EOS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN10CopyOrMoveD1Ev, { 1, 2, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z4pass10CopyOrMove, { 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 }
|
||||
// CHECK:STDOUT: attributes #2 = { nounwind "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: attributes #4 = { "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:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// 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 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "copy_or_move.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = !{!12, !12, i64 0}
|
||||
// CHECK:STDOUT: !12 = !{!"p1 _ZTS10CopyOrMove", !13, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !6, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !15 = !DISubroutineType(types: !16)
|
||||
// CHECK:STDOUT: !16 = !{null}
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 19, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 18, column: 1, scope: !14)
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !6, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 21, scope: !19)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 12, scope: !19)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 23, column: 3, scope: !19)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 22, column: 1, scope: !19)
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !6, line: 26, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28)
|
||||
// CHECK:STDOUT: !25 = !DISubroutineType(types: !26)
|
||||
// CHECK:STDOUT: !26 = !{null, !27}
|
||||
// CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !28 = !{!29}
|
||||
// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !24, type: !27)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 27, column: 3, scope: !24)
|
||||
// CHECK:STDOUT: !31 = !DILocation(line: 26, column: 1, scope: !24)
|
||||
// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !6, line: 30, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33)
|
||||
// CHECK:STDOUT: !33 = !{!34}
|
||||
// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !27)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 31, column: 3, scope: !32)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 30, column: 1, scope: !32)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !38 = !DILocation(line: 16, column: 25, scope: !37)
|
||||
// CHECK:STDOUT: !39 = !DILocation(line: 0, scope: !37)
|
||||
// CHECK:STDOUT: ; ModuleID = 'move_only.carbon'
|
||||
// CHECK:STDOUT: source_filename = "move_only.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: %struct.MoveOnly = type { i8 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @_Cc.Main = global [1 x i8] zeroinitializer
|
||||
// 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: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !11
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !11
|
||||
// CHECK:STDOUT: call void @_Z4makev(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1 %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassGlobalByMove.Main() #1 !dbg !14 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !18 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !19
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %_.var), !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z4pass8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !21
|
||||
// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %_.var), !dbg !19
|
||||
// CHECK:STDOUT: ret void, !dbg !22
|
||||
// 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: 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 !11
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11
|
||||
// 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 %agg.tmp)
|
||||
// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: declare void @_ZN8MoveOnlyD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2
|
||||
// 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: nounwind
|
||||
// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !24
|
||||
// CHECK:STDOUT: ret void, !dbg !25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4pass8MoveOnly(ptr noundef) #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:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN8MoveOnlyD1Ev, { 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 }
|
||||
// CHECK:STDOUT: attributes #2 = { nounwind "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: attributes #4 = { "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:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// 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 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "move_only.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = !{!12, !12, i64 0}
|
||||
// CHECK:STDOUT: !12 = !{!"p1 _ZTS8MoveOnly", !13, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !6, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !15 = !DISubroutineType(types: !16)
|
||||
// CHECK:STDOUT: !16 = !{null}
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 22, column: 1, scope: !14)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !6, line: 27, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 17, column: 19, scope: !18)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 28, column: 12, scope: !18)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 28, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 27, column: 1, scope: !18)
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 20, column: 23, scope: !23)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 0, scope: !23)
|
||||
+2
-2
@@ -227,12 +227,12 @@ fn MyF() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main(ptr sret({}) %return, ptr %a, ptr %b) #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Zpl1XS_.carbon_thunk(ptr %a, ptr %b, ptr %return), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Zpl1XS_.carbon_thunk.__(ptr %a, ptr %b, ptr %return), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Zpl1XS_.carbon_thunk(ptr noundef %0, ptr noundef %1, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Zpl1XS_.carbon_thunk.__(ptr noundef %0, ptr noundef %1, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr1 = alloca ptr, align 8
|
||||
|
||||
@@ -385,13 +385,13 @@ fn MyF() -> i32 {
|
||||
// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %value.var = alloca i32, align 4, !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk0(), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk1(i32 3), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk.(), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk._(i32 3), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 3, i32 4), !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %value.var), !dbg !15
|
||||
// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc11 = call i32 @_Z17SimpleReturnValueii.carbon_thunk0(), !dbg !19
|
||||
// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc11 = call i32 @_Z17SimpleReturnValueii.carbon_thunk.(), !dbg !19
|
||||
// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc11, ptr %value.var, align 4, !dbg !15
|
||||
// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc12 = call i32 @_Z17SimpleReturnValueii.carbon_thunk1(i32 3), !dbg !20
|
||||
// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc12 = call i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 3), !dbg !20
|
||||
// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc12, ptr %value.var, align 4, !dbg !21
|
||||
// CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !22
|
||||
// CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !23
|
||||
@@ -401,14 +401,14 @@ fn MyF() -> i32 {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13NoReturnValueii.carbon_thunk0() #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z13NoReturnValueii.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 noundef 1, i32 noundef 2)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13NoReturnValueii.carbon_thunk1(i32 noundef %a) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z13NoReturnValueii.carbon_thunk._(i32 noundef %a) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !7
|
||||
@@ -420,14 +420,14 @@ fn MyF() -> i32 {
|
||||
// CHECK:STDOUT: declare void @_Z13NoReturnValueii(i32 noundef, i32 noundef) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef i32 @_Z17SimpleReturnValueii.carbon_thunk0() #1 {
|
||||
// CHECK:STDOUT: define internal noundef i32 @_Z17SimpleReturnValueii.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %call = call noundef i32 @_Z17SimpleReturnValueii(i32 noundef 1, i32 noundef 2)
|
||||
// CHECK:STDOUT: ret i32 %call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef i32 @_Z17SimpleReturnValueii.carbon_thunk1(i32 noundef %a) #1 {
|
||||
// CHECK:STDOUT: define internal noundef i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 noundef %a) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !7
|
||||
|
||||
+6
-6
@@ -86,7 +86,7 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %by_val__carbon_thunk.call = call i32 @_ZNK1A6by_valEv.carbon_thunk(ptr %a), !dbg !18
|
||||
// CHECK:STDOUT: %by_val__carbon_thunk.call = call i32 @_ZNK1A6by_valEv.carbon_thunk._(ptr %a), !dbg !18
|
||||
// CHECK:STDOUT: ret i32 %by_val__carbon_thunk.call, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -95,7 +95,7 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: declare void @_ZN1A5virt1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef i32 @_ZNK1A6by_valEv.carbon_thunk(ptr noundef nonnull align 8 dereferenceable(12) %this) #2 {
|
||||
// CHECK:STDOUT: define internal noundef i32 @_ZNK1A6by_valEv.carbon_thunk._(ptr noundef nonnull align 8 dereferenceable(12) %this) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20
|
||||
@@ -284,16 +284,16 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: %.loc7_14.3.temp = alloca i8, align 1, !dbg !17
|
||||
// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk(ptr %n, ptr @int_1.30e), !dbg !19
|
||||
// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr %n, ptr @int_1.30e), !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk(ptr %n, ptr @int_1.30e), !dbg !20
|
||||
// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr %n, ptr @int_1.30e), !dbg !20
|
||||
// CHECK:STDOUT: call void @"_COp.43bece552030817c:core.Destroy.Core"(ptr @int_1.30e), !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.43bece552030817c:core.Destroy.Core"(ptr @int_1.30e), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr noundef %c) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr noundef nonnull align 1 dereferenceable(1) %this, ptr noundef %c) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %c.addr = alloca ptr, align 8
|
||||
@@ -307,7 +307,7 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk(ptr noundef %0, ptr noundef %c) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr noundef %0, ptr noundef %c) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %c.addr = alloca ptr, align 8
|
||||
|
||||
+5
-5
@@ -67,7 +67,7 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_22.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, ptr %.loc14_22.1.temp, align 8, !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z11TakeNullptrDn.carbon_thunk(ptr %.loc14_22.1.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z11TakeNullptrDn.carbon_thunk._(ptr %.loc14_22.1.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.705e422c84320121:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @"_COp.e34c165b4a1e692a:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
@@ -76,7 +76,7 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: declare void @_Z7TakePtrPi(ptr noundef) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11TakeNullptrDn.carbon_thunk(ptr noundef %n) #2 {
|
||||
// CHECK:STDOUT: define internal void @_Z11TakeNullptrDn.carbon_thunk._(ptr noundef %n) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %n.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %n, ptr %n.addr, align 8, !tbaa !19
|
||||
@@ -130,7 +130,7 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !48
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !48
|
||||
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %a.var), !dbg !49
|
||||
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !49
|
||||
// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !50
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.a5972e826b98ae3c.Core.b88d1103f417c6d4"(ptr %.loc28_10), !dbg !51
|
||||
// CHECK:STDOUT: call void @"_COp.705e422c84320121:core.Destroy.Core"(ptr %a.var), !dbg !48
|
||||
@@ -138,7 +138,7 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13ReturnNullptrv.carbon_thunk(ptr noundef %return) #2 {
|
||||
// CHECK:STDOUT: define internal void @_Z13ReturnNullptrv.carbon_thunk.(ptr noundef %return) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !19
|
||||
@@ -153,7 +153,7 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !55
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !55
|
||||
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc32_28.1.temp), !dbg !55
|
||||
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %.loc32_28.1.temp), !dbg !55
|
||||
// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !55
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.a5972e826b98ae3c.Core.b88d1103f417c6d4"(ptr %.loc32_28.4), !dbg !56
|
||||
// CHECK:STDOUT: call void @"_COp.705e422c84320121:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !55
|
||||
|
||||
+12
-12
@@ -93,7 +93,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// 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 @_Zeq1AS_.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
|
||||
@@ -119,7 +119,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// 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 @_Zne1AS_.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
|
||||
@@ -149,7 +149,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !34
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_Zeq1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_Zeq1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.3.temp), !dbg !34
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !34
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
@@ -159,7 +159,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !39
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !39
|
||||
// CHECK:STDOUT: call void @_Zne1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !39
|
||||
// CHECK:STDOUT: call void @_Zne1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.3.temp), !dbg !39
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !39
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !39
|
||||
// CHECK:STDOUT: }
|
||||
@@ -304,7 +304,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// 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 @_Zlt1AS_.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
|
||||
@@ -330,7 +330,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// 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 @_Zle1AS_.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
|
||||
@@ -356,7 +356,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// 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 @_Zgt1AS_.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
|
||||
@@ -382,7 +382,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// 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 @_Zge1AS_.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
|
||||
@@ -412,7 +412,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !34
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_Zlt1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_Zlt1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.3.temp), !dbg !34
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !34
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
@@ -422,7 +422,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !39
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !39
|
||||
// CHECK:STDOUT: call void @_Zle1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !39
|
||||
// CHECK:STDOUT: call void @_Zle1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.3.temp), !dbg !39
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !39
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !39
|
||||
// CHECK:STDOUT: }
|
||||
@@ -432,7 +432,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !44
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !44
|
||||
// CHECK:STDOUT: call void @_Zgt1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !44
|
||||
// CHECK:STDOUT: call void @_Zgt1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.3.temp), !dbg !44
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !44
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !44
|
||||
// CHECK:STDOUT: }
|
||||
@@ -442,7 +442,7 @@ fn Driver(x: Cpp.A, y: Cpp.A) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.3.temp = alloca i1, align 1, !dbg !49
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.3.temp), !dbg !49
|
||||
// CHECK:STDOUT: call void @_Zge1AS_.carbon_thunk(ptr %self, ptr %other, ptr %.3.temp), !dbg !49
|
||||
// CHECK:STDOUT: call void @_Zge1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.3.temp), !dbg !49
|
||||
// CHECK:STDOUT: %0 = load i1, ptr %.3.temp, align 1, !dbg !49
|
||||
// CHECK:STDOUT: ret i1 %0, !dbg !49
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+18
-18
@@ -129,10 +129,10 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: %.loc9_24.3.temp = alloca i16, align 2, !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.3.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_22.3.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z11pass_signedasil.carbon_thunk(ptr @int_1.30e, ptr @int_2.305, i32 3, i64 4), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z11pass_signedasil.carbon_thunk.____(ptr @int_1.30e, ptr @int_2.305, i32 3, i64 4), !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.3.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_24.3.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk(ptr @int_1.e80, ptr @int_2.fb2, i32 3, i64 4), !dbg !19
|
||||
// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr @int_1.e80, ptr @int_2.fb2, i32 3, i64 4), !dbg !19
|
||||
// CHECK:STDOUT: call void @"_COp.ecaf8c3e76291eee:core.Destroy.Core"(ptr @int_2.fb2), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.3de38e83520d6bec:core.Destroy.Core"(ptr @int_1.e80), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr @int_2.305), !dbg !15
|
||||
@@ -141,7 +141,7 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_signedasil.carbon_thunk(ptr noundef %0, ptr noundef %1, i32 noundef %2, i64 noundef %3) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_signedasil.carbon_thunk.____(ptr noundef %0, ptr noundef %1, i32 noundef %2, i64 noundef %3) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr1 = alloca ptr, align 8
|
||||
@@ -162,7 +162,7 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13pass_unsignedhtjm.carbon_thunk(ptr noundef %0, ptr noundef %1, i32 noundef %2, i64 noundef %3) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr noundef %0, ptr noundef %1, i32 noundef %2, i64 noundef %3) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr1 = alloca ptr, align 8
|
||||
@@ -217,19 +217,19 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !69
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !66
|
||||
// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !66
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc17_18.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !67
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !67
|
||||
// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !67
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc18_18.3.temp), !dbg !71
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !71
|
||||
// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !68
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !68
|
||||
// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !68
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc19_18.2.temp), !dbg !72
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !72
|
||||
// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !69
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !69
|
||||
// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !69
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc20_28.3.temp), !dbg !73
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !73
|
||||
// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !69
|
||||
// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !68
|
||||
// CHECK:STDOUT: call void @"_COp.406738f1b62008ed:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !67
|
||||
@@ -238,7 +238,7 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z10pass_shorts.carbon_thunk(ptr noundef %0) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z10pass_shorts.carbon_thunk._(ptr noundef %0) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !24
|
||||
@@ -265,7 +265,7 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: declare void @_Z10pass_shorts(i16 noundef signext) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z10pass_shorts.carbon_thunk, { 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z10pass_shorts.carbon_thunk._, { 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 7, 6, 5, 4, 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -374,12 +374,12 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !16
|
||||
// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !17
|
||||
// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk(ptr %x.var), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !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 @_ZN1XC1Ev.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN1XC1Ev.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 !20
|
||||
@@ -390,12 +390,12 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Default.17a84649916546b3.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk(ptr %return), !dbg !28
|
||||
// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !28
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_struct1X.carbon_thunk(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_struct1X.carbon_thunk._(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.X, align 4
|
||||
@@ -493,12 +493,12 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !16
|
||||
// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !17
|
||||
// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk(ptr %y.var), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_struct1Y.carbon_thunk(ptr noundef %0) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_struct1Y.carbon_thunk._(ptr noundef %0) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.Y, align 4
|
||||
@@ -517,14 +517,14 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 1, !dbg !24
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk(ptr %.loc17_24.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !27 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk(ptr %y), !dbg !33
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !33
|
||||
// CHECK:STDOUT: ret void, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+8
-8
@@ -128,12 +128,12 @@ fn Convert() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %p) #0 !dbg !24 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr %p), !dbg !27
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %p), !dbg !27
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.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 !29
|
||||
@@ -145,12 +145,12 @@ fn Convert() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !32 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk0(), !dbg !33
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !33
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef ptr @_Z18ReturnPtrWithThunki.carbon_thunk0() #2 {
|
||||
// CHECK:STDOUT: define internal noundef ptr @_Z18ReturnPtrWithThunki.carbon_thunk.() #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %call = call noundef ptr @_Z18ReturnPtrWithThunki(i32 noundef 0)
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
@@ -264,13 +264,13 @@ fn Convert() {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !44
|
||||
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !44
|
||||
// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !44
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr %.loc35_24.4), !dbg !45
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %.loc35_24.4), !dbg !45
|
||||
// CHECK:STDOUT: call void @"_COp.f6ed00b54444c4a3:core.Destroy.Core"(ptr %.loc35_24.2.temp), !dbg !44
|
||||
// CHECK:STDOUT: ret void, !dbg !46
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr noundef %0) #2 {
|
||||
// CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.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 !47
|
||||
@@ -282,12 +282,12 @@ fn Convert() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !50 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk0(), !dbg !51
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !51
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !52
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef ptr @_Z18ReturnPtrWithThunki.carbon_thunk0() #2 {
|
||||
// CHECK:STDOUT: define internal noundef ptr @_Z18ReturnPtrWithThunki.carbon_thunk.() #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %call = call noundef ptr @_Z18ReturnPtrWithThunki(i32 noundef 0)
|
||||
// CHECK:STDOUT: ret ptr %call
|
||||
|
||||
+36
-36
@@ -148,18 +148,18 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: call void @_Z8TakeCRefR1C(ptr %c.var), !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.1), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.1, ptr align 1 @C.val.loc19_20, i64 0, i1 false), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk(ptr %_.var.1), !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk(ptr %c.var), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk.v(ptr %_.var.1), !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk._(ptr %c.var), !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !16
|
||||
// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z10TakeIntRefRi(ptr %n.var), !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.2), !dbg !17
|
||||
// CHECK:STDOUT: store i32 42, ptr %_.var.2, align 4, !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk(ptr %_.var.2), !dbg !23
|
||||
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr %_.var.2), !dbg !23
|
||||
// CHECK:STDOUT: %.loc25_23.1 = load i32, ptr %n.var, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_23.2.temp), !dbg !18
|
||||
// CHECK:STDOUT: store i32 %.loc25_23.1, ptr %.loc25_23.2.temp, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk(ptr %.loc25_23.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr %.loc25_23.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var.2), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !16
|
||||
@@ -167,7 +167,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Ev.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 !26
|
||||
@@ -178,14 +178,14 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Default.7b1e6a57c714cdb7.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !29 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk(ptr %return), !dbg !33
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !33
|
||||
// CHECK:STDOUT: ret void, !dbg !33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z8TakeCRefR1C(ptr noundef nonnull align 1 dereferenceable(1)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z9TakeCRRefO1C.carbon_thunk(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: define internal void @_Z9TakeCRRefO1C.carbon_thunk.v(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !26
|
||||
@@ -195,7 +195,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13TakeConstCRefRK1C.carbon_thunk(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: define internal void @_Z13TakeConstCRefRK1C.carbon_thunk._(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !26
|
||||
@@ -207,7 +207,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: declare void @_Z10TakeIntRefRi(ptr noundef nonnull align 4 dereferenceable(4)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11TakeIntRRefOi.carbon_thunk(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: define internal void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !34
|
||||
@@ -217,7 +217,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z15TakeConstIntRefRKi.carbon_thunk(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: define internal void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr noundef %0) #4 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !34
|
||||
@@ -335,20 +335,20 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !14
|
||||
// CHECK:STDOUT: call void @"_COp.d288d62be0e5d791:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr %c.var), !dbg !14
|
||||
// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk1(ptr %c.var), !dbg !19
|
||||
// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk1(ptr @C.val.loc20_20.3), !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk1(ptr %c.var), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !16
|
||||
// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk1(ptr %n.var), !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !17
|
||||
// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk1(ptr %_.var), !dbg !23
|
||||
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !23
|
||||
// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !18
|
||||
// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk1(ptr %.loc26_23.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !16
|
||||
@@ -356,7 +356,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN1CC1Ev.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 !26
|
||||
@@ -367,12 +367,12 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Default.7b1e6a57c714cdb7.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !29 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk(ptr %return), !dbg !33
|
||||
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !33
|
||||
// CHECK:STDOUT: ret void, !dbg !33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk1(ptr noundef nonnull align 1 dereferenceable(1) %0) #3 {
|
||||
// CHECK:STDOUT: define internal void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr noundef nonnull align 1 dereferenceable(1) %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
@@ -383,7 +383,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk1(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: define internal void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
@@ -394,7 +394,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk1(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: define internal void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
@@ -405,7 +405,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk1(ptr noundef nonnull align 4 dereferenceable(4) %0) #3 {
|
||||
// CHECK:STDOUT: define internal void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr noundef nonnull align 4 dereferenceable(4) %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
@@ -416,7 +416,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk1(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: define internal void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
@@ -427,7 +427,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk1(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: define internal void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
@@ -595,17 +595,17 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk0(), !dbg !14
|
||||
// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk0(), !dbg !15
|
||||
// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk0(), !dbg !16
|
||||
// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk0(), !dbg !17
|
||||
// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk0(), !dbg !18
|
||||
// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk0(), !dbg !19
|
||||
// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !14
|
||||
// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !15
|
||||
// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !16
|
||||
// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !17
|
||||
// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !18
|
||||
// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !19
|
||||
// CHECK:STDOUT: ret void, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk0() #1 {
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRef10ForceThunk()
|
||||
@@ -613,7 +613,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk0() #1 {
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 1 dereferenceable(1) ptr @_Z11ReturnCRRef10ForceThunk()
|
||||
@@ -621,7 +621,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk0() #1 {
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 1 dereferenceable(1) ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 1 dereferenceable(1) ptr @_Z15ReturnConstCRef10ForceThunk()
|
||||
@@ -629,7 +629,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk0() #1 {
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 4 dereferenceable(4) ptr @_Z12ReturnIntRef10ForceThunk()
|
||||
@@ -637,7 +637,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk0() #1 {
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 4 dereferenceable(4) ptr @_Z13ReturnIntRRef10ForceThunk()
|
||||
@@ -645,7 +645,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk0() #1 {
|
||||
// CHECK:STDOUT: define internal noundef nonnull align 4 dereferenceable(4) ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: %call = call noundef nonnull align 4 dereferenceable(4) ptr @_Z17ReturnConstIntRef10ForceThunk()
|
||||
|
||||
+22
-22
@@ -122,13 +122,13 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc6_40.1.temp = alloca i8, align 1, !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_40.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc6_40.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %.loc6_40.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: %0 = load i8, ptr %.loc6_40.1.temp, align 1, !dbg !16
|
||||
// CHECK:STDOUT: ret i8 %0, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z8ReturnU8v.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z8ReturnU8v.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 !17
|
||||
@@ -143,13 +143,13 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_43.1.temp = alloca i16, align 2, !dbg !25
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_43.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc7_43.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %.loc7_43.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: %0 = load i16, ptr %.loc7_43.1.temp, align 2, !dbg !26
|
||||
// CHECK:STDOUT: ret i16 %0, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z9ReturnU16v.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z9ReturnU16v.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 !27
|
||||
@@ -182,13 +182,13 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc11_40.1.temp = alloca i8, align 1, !dbg !47
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_40.1.temp), !dbg !47
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc11_40.1.temp), !dbg !47
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %.loc11_40.1.temp), !dbg !47
|
||||
// CHECK:STDOUT: %0 = load i8, ptr %.loc11_40.1.temp, align 1, !dbg !48
|
||||
// CHECK:STDOUT: ret i8 %0, !dbg !48
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z8ReturnI8v.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z8ReturnI8v.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 !17
|
||||
@@ -203,13 +203,13 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc12_43.1.temp = alloca i16, align 2, !dbg !53
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_43.1.temp), !dbg !53
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc12_43.1.temp), !dbg !53
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %.loc12_43.1.temp), !dbg !53
|
||||
// CHECK:STDOUT: %0 = load i16, ptr %.loc12_43.1.temp, align 2, !dbg !54
|
||||
// CHECK:STDOUT: ret i16 %0, !dbg !54
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z9ReturnI16v.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z9ReturnI16v.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 !27
|
||||
@@ -247,18 +247,18 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: %.loc24_32.1.temp = alloca i8, align 1, !dbg !72
|
||||
// CHECK:STDOUT: %.loc25_35.1.temp = alloca i16, align 2, !dbg !73
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_32.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc19_32.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %.loc19_32.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: %.loc19_32.4 = load i8, ptr %.loc19_32.1.temp, align 1, !dbg !70
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_35.1.temp), !dbg !71
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc20_35.1.temp), !dbg !71
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %.loc20_35.1.temp), !dbg !71
|
||||
// CHECK:STDOUT: %.loc20_35.4 = load i16, ptr %.loc20_35.1.temp, align 2, !dbg !71
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !74
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !75
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_32.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc24_32.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %.loc24_32.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: %.loc24_32.4 = load i8, ptr %.loc24_32.1.temp, align 1, !dbg !72
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_35.1.temp), !dbg !73
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc25_35.1.temp), !dbg !73
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %.loc25_35.1.temp), !dbg !73
|
||||
// CHECK:STDOUT: %.loc25_35.4 = load i16, ptr %.loc25_35.1.temp, align 2, !dbg !73
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !76
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !77
|
||||
@@ -306,9 +306,9 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !111
|
||||
// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !112
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !105
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %my_u8.var), !dbg !113
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %my_u8.var), !dbg !113
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !106
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %my_u16.var), !dbg !114
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %my_u16.var), !dbg !114
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !107
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !115
|
||||
// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !107
|
||||
@@ -316,9 +316,9 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !116
|
||||
// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !108
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !109
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %my_i8.var), !dbg !117
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %my_i8.var), !dbg !117
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !110
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %my_i16.var), !dbg !118
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %my_i16.var), !dbg !118
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !111
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !119
|
||||
// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !111
|
||||
@@ -557,12 +557,12 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %return), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4Makev.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z4Makev.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 !17
|
||||
@@ -576,7 +576,7 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 1, !dbg !23
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %.loc9_27.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %.loc9_27.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: ret void, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
@@ -589,7 +589,7 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 1, !dbg !26
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !26
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %_.var), !dbg !27
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !27
|
||||
// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %_.var), !dbg !26
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
@@ -652,12 +652,12 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk(ptr %x, ptr %return), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z1f1D.carbon_thunk(ptr noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z1f1D.carbon_thunk._(ptr noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
|
||||
@@ -178,7 +178,7 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !34
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !34
|
||||
// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !34
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !33
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !33
|
||||
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !35
|
||||
// CHECK:STDOUT: call void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr @array), !dbg !34
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !33
|
||||
@@ -186,7 +186,7 @@ fn InitNontrivialDtor() {
|
||||
// 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: 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
|
||||
@@ -221,11 +221,11 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !46
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !47
|
||||
// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !47
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.18.array.index), !dbg !47
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !47
|
||||
// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !47
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.16.array.index), !dbg !47
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !47
|
||||
// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !47
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.15.array.index), !dbg !47
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !47
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !46
|
||||
// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !46
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !46
|
||||
@@ -237,7 +237,7 @@ fn InitNontrivialDtor() {
|
||||
// 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: 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 !50
|
||||
@@ -291,7 +291,7 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple, { 2, 1, 0 }
|
||||
// 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 }
|
||||
@@ -427,7 +427,7 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !34
|
||||
// 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 !34
|
||||
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !34
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !33
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !33
|
||||
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !35
|
||||
// CHECK:STDOUT: call void @"_COp.bfd302cd235977c4:core.Destroy.Core"(ptr @array), !dbg !34
|
||||
// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !33
|
||||
@@ -435,7 +435,7 @@ fn InitNontrivialDtor() {
|
||||
// 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: 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
|
||||
@@ -470,11 +470,11 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !48
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !49
|
||||
// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !49
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.18.array.index), !dbg !49
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !49
|
||||
// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !49
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.16.array.index), !dbg !49
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !49
|
||||
// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !49
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple(ptr %.loc23_69.15.array.index), !dbg !49
|
||||
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !49
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !48
|
||||
// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !48
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !48
|
||||
@@ -485,7 +485,7 @@ fn InitNontrivialDtor() {
|
||||
// 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: 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 !52
|
||||
@@ -539,7 +539,7 @@ fn InitNontrivialDtor() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple, { 2, 1, 0 }
|
||||
// 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 }
|
||||
|
||||
+8
-8
@@ -126,12 +126,12 @@ fn Call3() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassClass.Main(ptr sret({}) %return, ptr %a) #0 !dbg !24 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z8identityI5ClassET_S1_.carbon_thunk(ptr %a, ptr %return), !dbg !30
|
||||
// CHECK:STDOUT: call void @_Z8identityI5ClassET_S1_.carbon_thunk._(ptr %a, ptr %return), !dbg !30
|
||||
// CHECK:STDOUT: ret void, !dbg !31
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z8identityI5ClassET_S1_.carbon_thunk(ptr noundef %x, ptr noundef %return) #2 {
|
||||
// CHECK:STDOUT: define internal void @_Z8identityI5ClassET_S1_.carbon_thunk._(ptr noundef %x, ptr noundef %return) #2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
@@ -271,12 +271,12 @@ fn Call3() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 8, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk(ptr @X.val.loc12_14.3), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk._(ptr @X.val.loc12_14.3), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z3fooIJEEv1XDpT_.carbon_thunk(ptr noundef %0) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z3fooIJEEv1XDpT_.carbon_thunk._(ptr noundef %0) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1
|
||||
@@ -291,12 +291,12 @@ fn Call3() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 8, !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk(ptr @X.val.loc12_14.3, i32 2), !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !22
|
||||
// CHECK:STDOUT: ret void, !dbg !23
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z3fooIJiEEv1XDpT_.carbon_thunk(ptr noundef %0, i32 noundef %1) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr noundef %0, i32 noundef %1) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
|
||||
@@ -314,12 +314,12 @@ fn Call3() {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 8, !dbg !25
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !26
|
||||
// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !26
|
||||
// CHECK:STDOUT: ret void, !dbg !27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z3fooIJiiEEv1XDpT_.carbon_thunk(ptr noundef %0, i32 noundef %1, i32 noundef %2) #1 {
|
||||
// CHECK:STDOUT: define internal void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr noundef %0, i32 noundef %1, i32 noundef %2) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
|
||||
|
||||
+3
-3
@@ -43,12 +43,12 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: %.loc9_34.1.temp = alloca [1 x i8], align 1, !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n2.var), !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_34.1.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk(ptr %n, ptr %n2.var), !dbg !18
|
||||
// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr %n, ptr %n2.var), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN9NeedThunkC1ERKS_.carbon_thunk(ptr noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
@@ -63,7 +63,7 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Copy.fdeb6dbda014bd1f.Core:NeedThunk.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk(ptr %self, ptr %return), !dbg !29
|
||||
// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !29
|
||||
// CHECK:STDOUT: ret void, !dbg !29
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -113,12 +113,12 @@ fn AccessD(d: Cpp.D) -> i32 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [40 x i8], align 1, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZN1DC1Ev.carbon_thunk(ptr %_.var), !dbg !15
|
||||
// CHECK:STDOUT: call void @_ZN1DC1Ev.carbon_thunk.(ptr %_.var), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1DC1Ev.carbon_thunk(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: define internal void @_ZN1DC1Ev.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 !17
|
||||
|
||||
Reference in New Issue
Block a user