Add Destroy.SubobjectDestroy as a temporary replacement for Destroy.Op (#7773)

This change partially implements [PR #7362], which revises how objects
are destroyed. It is a partial implementation for two reasons:

1. This change moves `Destroy.Op`'s current behaviour into
`Destroy.SubobjectDestroy`, but it doesn't add support for objects with
non-trivial destruction.
2. `Destroy.SubobjectDestroy` is a workaround for `require impls
SubobjectDestroy`. We aren't able to use the latter until the dependents
add their requirements' implementations to their own witness tables.

[PR #7362]: https://github.com/carbon-language/carbon-lang/pulls/7362
This commit is contained in:
Christopher Di Bella authored and GitHub committed 2026-09-24 00:06:28 +00:00
1 parent 03939a9223
commit f7cd39428e
309 files changed
+51760 -15269

No files matched your search

+243 -103
View File
@@ -185,7 +185,7 @@ fn G() {
// CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutAEPNS_7LayoutAE(ptr noundef %0) #2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !144
// CHECK:STDOUT: call void @_CCallLayoutA__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -194,7 +194,7 @@ fn G() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !108
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !144
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr noundef nonnull align 8 dereferenceable(12) %this1)
// CHECK:STDOUT: ret void
@@ -218,7 +218,7 @@ fn G() {
// CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutBEPNS_7LayoutBE(ptr noundef %0) #2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !110
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !146
// CHECK:STDOUT: call void @_CCallLayoutB__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -227,7 +227,7 @@ fn G() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutBD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !110
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !146
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1)
// CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::LayoutB", ptr %this1, i32 0, i32 0
@@ -251,7 +251,7 @@ fn G() {
// CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutCEPNS_7LayoutCE(ptr noundef %0) #2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !112
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !148
// CHECK:STDOUT: call void @_CCallLayoutC__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -260,7 +260,7 @@ fn G() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutCD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !112
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !148
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1)
// CHECK:STDOUT: call void @_ZN6Carbon7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this1) #5
@@ -276,90 +276,151 @@ fn G() {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr %self) #4 !dbg !55 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.5a318796badc8ab7:core.Destroy.Core"(ptr %self), !dbg !57
// CHECK:STDOUT: call void @"_CSelfDestruct.5a318796badc8ab7:core.Destroy.Core"(ptr %self), !dbg !57
// CHECK:STDOUT: ret void, !dbg !57
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #5 !dbg !59 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #5 !dbg !59 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !61
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.63f0d36eb067b612:core.Destroy.Core"(ptr %self) #5 !dbg !63 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #5 !dbg !63 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !65
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.5a318796badc8ab7:core.Destroy.Core"(ptr %self) #5 !dbg !67 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #5 !dbg !67 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !69
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCallLayoutA__carbon_thunk.Main(ptr %_) #5 !dbg !71 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #5 !dbg !71 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !73
// CHECK:STDOUT: call void @_CCallLayoutA.Main(ptr %.loc21), !dbg !73
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !73
// CHECK:STDOUT: ret void, !dbg !73
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr %self) #4 !dbg !75 {
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.63f0d36eb067b612:core.Destroy.Core"(ptr %self) #5 !dbg !75 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.98b9397038fd95a2:core.Destroy.Core"(ptr %self), !dbg !77
// CHECK:STDOUT: ret void, !dbg !77
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.680fc8e588bd03e0:core.Destroy.Core"(ptr %self) #5 !dbg !79 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.63f0d36eb067b612:core.Destroy.Core"(ptr %self) #5 !dbg !79 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.63f0d36eb067b612:core.Destroy.Core"(ptr %self), !dbg !81
// CHECK:STDOUT: ret void, !dbg !81
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.98b9397038fd95a2:core.Destroy.Core"(ptr %self) #5 !dbg !83 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a318796badc8ab7:core.Destroy.Core"(ptr %self) #5 !dbg !83 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !85
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCallLayoutB__carbon_thunk.Main(ptr %_) #5 !dbg !87 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a318796badc8ab7:core.Destroy.Core"(ptr %self) #5 !dbg !87 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !89
// CHECK:STDOUT: call void @_CCallLayoutB.Main(ptr %.loc22), !dbg !89
// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a318796badc8ab7:core.Destroy.Core"(ptr %self), !dbg !89
// CHECK:STDOUT: ret void, !dbg !89
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr %self) #4 !dbg !91 {
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCallLayoutA__carbon_thunk.Main(ptr %_) #5 !dbg !91 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.bb6bd82e06513595:core.Destroy.Core"(ptr %self), !dbg !93
// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !93
// CHECK:STDOUT: call void @_CCallLayoutA.Main(ptr %.loc21), !dbg !93
// CHECK:STDOUT: ret void, !dbg !93
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.d1ce4198d9e72e02:core.Destroy.Core"(ptr %self) #5 !dbg !95 {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr %self) #4 !dbg !95 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSelfDestruct.98b9397038fd95a2:core.Destroy.Core"(ptr %self), !dbg !97
// CHECK:STDOUT: ret void, !dbg !97
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.bb6bd82e06513595:core.Destroy.Core"(ptr %self) #5 !dbg !99 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.680fc8e588bd03e0:core.Destroy.Core"(ptr %self) #5 !dbg !99 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !101
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCallLayoutC__carbon_thunk.Main(ptr %_) #5 !dbg !103 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.680fc8e588bd03e0:core.Destroy.Core"(ptr %self) #5 !dbg !103 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !105
// CHECK:STDOUT: call void @_CCallLayoutC.Main(ptr %.loc23), !dbg !105
// CHECK:STDOUT: call void @"_CSubobjectDestroy.680fc8e588bd03e0:core.Destroy.Core"(ptr %self), !dbg !105
// CHECK:STDOUT: ret void, !dbg !105
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.98b9397038fd95a2:core.Destroy.Core"(ptr %self) #5 !dbg !107 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !109
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.98b9397038fd95a2:core.Destroy.Core"(ptr %self) #5 !dbg !111 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.98b9397038fd95a2:core.Destroy.Core"(ptr %self), !dbg !113
// CHECK:STDOUT: ret void, !dbg !113
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCallLayoutB__carbon_thunk.Main(ptr %_) #5 !dbg !115 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !117
// CHECK:STDOUT: call void @_CCallLayoutB.Main(ptr %.loc22), !dbg !117
// CHECK:STDOUT: ret void, !dbg !117
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr %self) #4 !dbg !119 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSelfDestruct.bb6bd82e06513595:core.Destroy.Core"(ptr %self), !dbg !121
// CHECK:STDOUT: ret void, !dbg !121
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d1ce4198d9e72e02:core.Destroy.Core"(ptr %self) #5 !dbg !123 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !125
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d1ce4198d9e72e02:core.Destroy.Core"(ptr %self) #5 !dbg !127 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.d1ce4198d9e72e02:core.Destroy.Core"(ptr %self), !dbg !129
// CHECK:STDOUT: ret void, !dbg !129
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bb6bd82e06513595:core.Destroy.Core"(ptr %self) #5 !dbg !131 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !133
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bb6bd82e06513595:core.Destroy.Core"(ptr %self) #5 !dbg !135 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.bb6bd82e06513595:core.Destroy.Core"(ptr %self), !dbg !137
// CHECK:STDOUT: ret void, !dbg !137
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCallLayoutC__carbon_thunk.Main(ptr %_) #5 !dbg !139 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !141
// CHECK:STDOUT: call void @_CCallLayoutC.Main(ptr %.loc23), !dbg !141
// CHECK:STDOUT: ret void, !dbg !141
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @_ZN6Carbon7LayoutAD2Ev, { 2, 1, 0 }
// CHECK:STDOUT:
@@ -397,60 +458,96 @@ fn G() {
// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !50)
// CHECK:STDOUT: !57 = !DILocation(line: 6, column: 1, scope: !55)
// CHECK:STDOUT: !58 = !{!56}
// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !48, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !62)
// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !37)
// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !62)
// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !50)
// CHECK:STDOUT: !61 = !DILocation(line: 6, column: 1, scope: !59)
// CHECK:STDOUT: !62 = !{!60}
// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Op", linkageName: "_COp.63f0d36eb067b612:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !66)
// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !50)
// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !48, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !66)
// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !37)
// CHECK:STDOUT: !65 = !DILocation(line: 6, column: 1, scope: !63)
// CHECK:STDOUT: !66 = !{!64}
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a318796badc8ab7:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !70)
// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !50)
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !48, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !70)
// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !37)
// CHECK:STDOUT: !69 = !DILocation(line: 6, column: 1, scope: !67)
// CHECK:STDOUT: !70 = !{!68}
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "CallLayoutA__carbon_thunk", linkageName: "_CCallLayoutA__carbon_thunk.Main", scope: null, file: !48, line: 21, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !74)
// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !50)
// CHECK:STDOUT: !73 = !DILocation(line: 21, column: 1, scope: !71)
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !48, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !74)
// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !37)
// CHECK:STDOUT: !73 = !DILocation(line: 6, column: 1, scope: !71)
// CHECK:STDOUT: !74 = !{!72}
// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutB.Main", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !78)
// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.63f0d36eb067b612:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !78)
// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !50)
// CHECK:STDOUT: !77 = !DILocation(line: 11, column: 1, scope: !75)
// CHECK:STDOUT: !77 = !DILocation(line: 6, column: 1, scope: !75)
// CHECK:STDOUT: !78 = !{!76}
// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.680fc8e588bd03e0:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !82)
// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.63f0d36eb067b612:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !82)
// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !50)
// CHECK:STDOUT: !81 = !DILocation(line: 11, column: 1, scope: !79)
// CHECK:STDOUT: !81 = !DILocation(line: 6, column: 1, scope: !79)
// CHECK:STDOUT: !82 = !{!80}
// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98b9397038fd95a2:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !86)
// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a318796badc8ab7:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !86)
// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !50)
// CHECK:STDOUT: !85 = !DILocation(line: 11, column: 1, scope: !83)
// CHECK:STDOUT: !85 = !DILocation(line: 6, column: 1, scope: !83)
// CHECK:STDOUT: !86 = !{!84}
// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "CallLayoutB__carbon_thunk", linkageName: "_CCallLayoutB__carbon_thunk.Main", scope: null, file: !48, line: 22, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !90)
// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a318796badc8ab7:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !90)
// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !50)
// CHECK:STDOUT: !89 = !DILocation(line: 22, column: 1, scope: !87)
// CHECK:STDOUT: !89 = !DILocation(line: 6, column: 1, scope: !87)
// CHECK:STDOUT: !90 = !{!88}
// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutC.Main", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !94)
// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "CallLayoutA__carbon_thunk", linkageName: "_CCallLayoutA__carbon_thunk.Main", scope: null, file: !48, line: 21, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !94)
// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !50)
// CHECK:STDOUT: !93 = !DILocation(line: 16, column: 1, scope: !91)
// CHECK:STDOUT: !93 = !DILocation(line: 21, column: 1, scope: !91)
// CHECK:STDOUT: !94 = !{!92}
// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d1ce4198d9e72e02:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !98)
// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutB.Main", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !98)
// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !50)
// CHECK:STDOUT: !97 = !DILocation(line: 16, column: 1, scope: !95)
// CHECK:STDOUT: !97 = !DILocation(line: 11, column: 1, scope: !95)
// CHECK:STDOUT: !98 = !{!96}
// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bb6bd82e06513595:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !102)
// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.680fc8e588bd03e0:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !102)
// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !50)
// CHECK:STDOUT: !101 = !DILocation(line: 16, column: 1, scope: !99)
// CHECK:STDOUT: !101 = !DILocation(line: 11, column: 1, scope: !99)
// CHECK:STDOUT: !102 = !{!100}
// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "CallLayoutC__carbon_thunk", linkageName: "_CCallLayoutC__carbon_thunk.Main", scope: null, file: !48, line: 23, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !106)
// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.680fc8e588bd03e0:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !106)
// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !50)
// CHECK:STDOUT: !105 = !DILocation(line: 23, column: 1, scope: !103)
// CHECK:STDOUT: !105 = !DILocation(line: 11, column: 1, scope: !103)
// CHECK:STDOUT: !106 = !{!104}
// CHECK:STDOUT: !107 = !{!"p1 _ZTSN6Carbon7LayoutAE", !2, i64 0}
// CHECK:STDOUT: !108 = !{!107, !107, i64 0}
// CHECK:STDOUT: !109 = !{!"p1 _ZTSN6Carbon7LayoutBE", !2, i64 0}
// CHECK:STDOUT: !110 = !{!109, !109, i64 0}
// CHECK:STDOUT: !111 = !{!"p1 _ZTSN6Carbon7LayoutCE", !2, i64 0}
// CHECK:STDOUT: !112 = !{!111, !111, i64 0}
// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.98b9397038fd95a2:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !110)
// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !50)
// CHECK:STDOUT: !109 = !DILocation(line: 11, column: 1, scope: !107)
// CHECK:STDOUT: !110 = !{!108}
// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.98b9397038fd95a2:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !114)
// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !50)
// CHECK:STDOUT: !113 = !DILocation(line: 11, column: 1, scope: !111)
// CHECK:STDOUT: !114 = !{!112}
// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "CallLayoutB__carbon_thunk", linkageName: "_CCallLayoutB__carbon_thunk.Main", scope: null, file: !48, line: 22, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !118)
// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !50)
// CHECK:STDOUT: !117 = !DILocation(line: 22, column: 1, scope: !115)
// CHECK:STDOUT: !118 = !{!116}
// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutC.Main", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !122)
// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !50)
// CHECK:STDOUT: !121 = !DILocation(line: 16, column: 1, scope: !119)
// CHECK:STDOUT: !122 = !{!120}
// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d1ce4198d9e72e02:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !126)
// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !50)
// CHECK:STDOUT: !125 = !DILocation(line: 16, column: 1, scope: !123)
// CHECK:STDOUT: !126 = !{!124}
// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d1ce4198d9e72e02:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !130)
// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !50)
// CHECK:STDOUT: !129 = !DILocation(line: 16, column: 1, scope: !127)
// CHECK:STDOUT: !130 = !{!128}
// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bb6bd82e06513595:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !134)
// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !50)
// CHECK:STDOUT: !133 = !DILocation(line: 16, column: 1, scope: !131)
// CHECK:STDOUT: !134 = !{!132}
// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bb6bd82e06513595:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !138)
// CHECK:STDOUT: !136 = !DILocalVariable(arg: 1, scope: !135, type: !50)
// CHECK:STDOUT: !137 = !DILocation(line: 16, column: 1, scope: !135)
// CHECK:STDOUT: !138 = !{!136}
// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "CallLayoutC__carbon_thunk", linkageName: "_CCallLayoutC__carbon_thunk.Main", scope: null, file: !48, line: 23, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !142)
// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !50)
// CHECK:STDOUT: !141 = !DILocation(line: 23, column: 1, scope: !139)
// CHECK:STDOUT: !142 = !{!140}
// CHECK:STDOUT: !143 = !{!"p1 _ZTSN6Carbon7LayoutAE", !2, i64 0}
// CHECK:STDOUT: !144 = !{!143, !143, i64 0}
// CHECK:STDOUT: !145 = !{!"p1 _ZTSN6Carbon7LayoutBE", !2, i64 0}
// CHECK:STDOUT: !146 = !{!145, !145, i64 0}
// CHECK:STDOUT: !147 = !{!"p1 _ZTSN6Carbon7LayoutCE", !2, i64 0}
// CHECK:STDOUT: !148 = !{!147, !147, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'field.carbon'
@@ -477,41 +574,68 @@ fn G() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.FieldC.Main"(ptr %self) #1 !dbg !115 {
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.FieldC.Main"(ptr %self) #1 !dbg !151 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.718874c3c75b803e:core.Destroy.Core"(ptr %self), !dbg !117
// CHECK:STDOUT: ret void, !dbg !117
// CHECK:STDOUT: call void @"_CSelfDestruct.718874c3c75b803e:core.Destroy.Core"(ptr %self), !dbg !153
// CHECK:STDOUT: ret void, !dbg !153
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #2 !dbg !119 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #2 !dbg !155 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !121
// CHECK:STDOUT: ret void, !dbg !157
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #2 !dbg !123 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #2 !dbg !159 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !125
// CHECK:STDOUT: ret void, !dbg !161
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.718874c3c75b803e:core.Destroy.Core"(ptr %self) #2 !dbg !127 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #2 !dbg !163 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !129
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !165
// CHECK:STDOUT: ret void, !dbg !165
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CG.Main() #2 !dbg !131 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #2 !dbg !167 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !132
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !132
// CHECK:STDOUT: %.loc19_34.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !133
// CHECK:STDOUT: %.loc19_34.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !133
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @FieldC.val.loc19_3, i64 8, i1 false), !dbg !132
// CHECK:STDOUT: call void @_Z1FRN6Carbon6FieldCE(ptr %c.var), !dbg !137
// CHECK:STDOUT: call void @"_COp.718874c3c75b803e:core.Destroy.Core"(ptr %c.var), !dbg !132
// CHECK:STDOUT: ret void, !dbg !138
// CHECK:STDOUT: ret void, !dbg !169
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #2 !dbg !171 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self), !dbg !173
// CHECK:STDOUT: ret void, !dbg !173
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.718874c3c75b803e:core.Destroy.Core"(ptr %self) #2 !dbg !175 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !177
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.718874c3c75b803e:core.Destroy.Core"(ptr %self) #2 !dbg !179 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.718874c3c75b803e:core.Destroy.Core"(ptr %self), !dbg !181
// CHECK:STDOUT: ret void, !dbg !181
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CG.Main() #2 !dbg !183 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !184
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !184
// CHECK:STDOUT: %.loc19_34.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !185
// CHECK:STDOUT: %.loc19_34.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !185
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @FieldC.val.loc19_3, i64 8, i1 false), !dbg !184
// CHECK:STDOUT: call void @_Z1FRN6Carbon6FieldCE(ptr %c.var), !dbg !189
// CHECK:STDOUT: call void @"_CSelfDestruct.718874c3c75b803e:core.Destroy.Core"(ptr %c.var), !dbg !184
// CHECK:STDOUT: ret void, !dbg !190
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -525,7 +649,7 @@ fn G() {
// CHECK:STDOUT: attributes #2 = { nounwind }
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!114}
// CHECK:STDOUT: !llvm.dbg.cu = !{!150}
// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !19, !20}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!47}
// CHECK:STDOUT:
@@ -555,27 +679,43 @@ fn G() {
// CHECK:STDOUT: !52 = !DISubroutineType(types: !51)
// CHECK:STDOUT: !53 = !{null, !37}
// CHECK:STDOUT: !54 = !DISubroutineType(types: !53)
// CHECK:STDOUT: !113 = !DIFile(filename: "field.carbon", directory: "")
// CHECK:STDOUT: !114 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !113, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.FieldC.Main", scope: null, file: !113, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !114, retainedNodes: !118)
// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !50)
// CHECK:STDOUT: !117 = !DILocation(line: 6, column: 1, scope: !115)
// CHECK:STDOUT: !118 = !{!116}
// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !113, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !114, retainedNodes: !122)
// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !37)
// CHECK:STDOUT: !121 = !DILocation(line: 6, column: 1, scope: !119)
// CHECK:STDOUT: !122 = !{!120}
// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !113, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !114, retainedNodes: !126)
// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !50)
// CHECK:STDOUT: !125 = !DILocation(line: 6, column: 1, scope: !123)
// CHECK:STDOUT: !126 = !{!124}
// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Op", linkageName: "_COp.718874c3c75b803e:core.Destroy.Core", scope: null, file: !113, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !114, retainedNodes: !130)
// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !50)
// CHECK:STDOUT: !129 = !DILocation(line: 6, column: 1, scope: !127)
// CHECK:STDOUT: !130 = !{!128}
// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !113, line: 18, type: !39, spFlags: DISPFlagDefinition, unit: !114)
// CHECK:STDOUT: !132 = !DILocation(line: 19, column: 3, scope: !131)
// CHECK:STDOUT: !133 = !DILocation(line: 19, column: 19, scope: !131)
// CHECK:STDOUT: !137 = !DILocation(line: 20, column: 3, scope: !131)
// CHECK:STDOUT: !138 = !DILocation(line: 18, column: 1, scope: !131)
// CHECK:STDOUT: !149 = !DIFile(filename: "field.carbon", directory: "")
// CHECK:STDOUT: !150 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !149, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.FieldC.Main", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !154)
// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !50)
// CHECK:STDOUT: !153 = !DILocation(line: 6, column: 1, scope: !151)
// CHECK:STDOUT: !154 = !{!152}
// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !149, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !158)
// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !37)
// CHECK:STDOUT: !157 = !DILocation(line: 6, column: 1, scope: !155)
// CHECK:STDOUT: !158 = !{!156}
// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !149, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !162)
// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !37)
// CHECK:STDOUT: !161 = !DILocation(line: 6, column: 1, scope: !159)
// CHECK:STDOUT: !162 = !{!160}
// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !149, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !166)
// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !37)
// CHECK:STDOUT: !165 = !DILocation(line: 6, column: 1, scope: !163)
// CHECK:STDOUT: !166 = !{!164}
// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !170)
// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !50)
// CHECK:STDOUT: !169 = !DILocation(line: 6, column: 1, scope: !167)
// CHECK:STDOUT: !170 = !{!168}
// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !174)
// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !50)
// CHECK:STDOUT: !173 = !DILocation(line: 6, column: 1, scope: !171)
// CHECK:STDOUT: !174 = !{!172}
// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.718874c3c75b803e:core.Destroy.Core", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !178)
// CHECK:STDOUT: !176 = !DILocalVariable(arg: 1, scope: !175, type: !50)
// CHECK:STDOUT: !177 = !DILocation(line: 6, column: 1, scope: !175)
// CHECK:STDOUT: !178 = !{!176}
// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.718874c3c75b803e:core.Destroy.Core", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !182)
// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !50)
// CHECK:STDOUT: !181 = !DILocation(line: 6, column: 1, scope: !179)
// CHECK:STDOUT: !182 = !{!180}
// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !149, line: 18, type: !39, spFlags: DISPFlagDefinition, unit: !150)
// CHECK:STDOUT: !184 = !DILocation(line: 19, column: 3, scope: !183)
// CHECK:STDOUT: !185 = !DILocation(line: 19, column: 19, scope: !183)
// CHECK:STDOUT: !189 = !DILocation(line: 20, column: 3, scope: !183)
// CHECK:STDOUT: !190 = !DILocation(line: 18, column: 1, scope: !183)
// CHECK:STDOUT:
@@ -0,0 +1,142 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
//
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon
// --- memory.h
template<class T>
auto make_unique() -> void {
T();
}
// --- a.carbon
import Cpp library "memory.h";
class C {}
fn Run() {
Cpp.make_unique(C);
}
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'a.carbon'
// CHECK:STDOUT: source_filename = "a.carbon"
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: %"class.Carbon::C" = type {}
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z11make_uniqueIN6Carbon1CEEvv = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: $_ZN6Carbon1CD2Ev = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @main() #0 !dbg !14 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z11make_uniqueIN6Carbon1CEEvv(), !dbg !15
// CHECK:STDOUT: ret i32 0, !dbg !16
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z11make_uniqueIN6Carbon1CEEvv() #1 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %agg.tmp.ensured = alloca %"class.Carbon::C", align 1
// CHECK:STDOUT: call void @_ZN6Carbon1CD2Ev(ptr noundef nonnull align 1 %agg.tmp.ensured) #0
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #2 !dbg !17 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !19
// CHECK:STDOUT: ret void, !dbg !19
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !21 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !23
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !25 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !27
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !29 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !31
// CHECK:STDOUT: ret void, !dbg !31
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1CD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !37
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.C.Main"(ptr noundef nonnull align 1 %this1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { 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 #2 = { alwaysinline nounwind }
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
// CHECK:STDOUT: !llvm.module.flags = !{!39, !40, !41, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!44}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !4 = !DIFile(filename: "a.carbon", directory: "")
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !7 = !{!6}
// CHECK:STDOUT: !8 = !DISubroutineType(types: !7)
// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !12 = !{null, !11}
// CHECK:STDOUT: !13 = !DISubroutineType(types: !12)
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !4, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !14)
// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !14)
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !4, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !20)
// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !17, type: !11)
// CHECK:STDOUT: !19 = !DILocation(line: 4, column: 1, scope: !17)
// CHECK:STDOUT: !20 = !{!18}
// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !4, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !24)
// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !21, type: !11)
// CHECK:STDOUT: !23 = !DILocation(line: 4, column: 1, scope: !21)
// CHECK:STDOUT: !24 = !{!22}
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !4, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28)
// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !11)
// CHECK:STDOUT: !27 = !DILocation(line: 4, column: 1, scope: !25)
// CHECK:STDOUT: !28 = !{!26}
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !4, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32)
// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !29, type: !11)
// CHECK:STDOUT: !31 = !DILocation(line: 4, column: 1, scope: !29)
// CHECK:STDOUT: !32 = !{!30}
// CHECK:STDOUT: !33 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !34 = !{!"omnipotent char", !33, i64 0}
// CHECK:STDOUT: !35 = !{!"any pointer", !34, i64 0}
// CHECK:STDOUT: !36 = !{!"p1 _ZTSN6Carbon1CE", !35, i64 0}
// CHECK:STDOUT: !37 = !{!36, !36, i64 0}
// CHECK:STDOUT: !39 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !40 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !41 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !42 = !{!"int", !34, i64 0}
// CHECK:STDOUT: !43 = !{!"__libc_errno", !42, i64 0}
// CHECK:STDOUT: !44 = !{!43, !42, i64 0}
// CHECK:STDOUT:
+191 -128
View File
@@ -91,7 +91,7 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: define internal void @_ZNK6Carbon1A1FEv(ptr noundef nonnull align 1 %this) #2 align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !47
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !55
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @_CF__carbon_thunk.A.Main(ptr noundef nonnull align 1 %this1)
// CHECK:STDOUT: ret void
@@ -101,7 +101,7 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !47
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !55
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 1 %this1)
// CHECK:STDOUT: ret void
@@ -119,23 +119,36 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !31 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !33
// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !33
// CHECK:STDOUT: ret void, !dbg !33
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !35 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #4 !dbg !35 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !37
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self) #4 !dbg !39 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !39 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.A.Main(ptr %self), !dbg !41
// CHECK:STDOUT: ret void, !dbg !41
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !43 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !45
// CHECK:STDOUT: ret void, !dbg !45
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self) #4 !dbg !47 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.A.Main(ptr %self), !dbg !49
// CHECK:STDOUT: ret void, !dbg !49
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #2 = { 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" }
@@ -144,8 +157,8 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: attributes #5 = { alwaysinline nounwind }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!21}
// CHECK:STDOUT: !llvm.module.flags = !{!48, !49, !50, !4, !5}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!53}
// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !4, !5}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT:
// CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3}
@@ -162,25 +175,33 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !22)
// CHECK:STDOUT: !33 = !DILocation(line: 5, column: 1, scope: !31)
// CHECK:STDOUT: !34 = !{!32}
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !20, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !38)
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !20, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !38)
// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !22)
// CHECK:STDOUT: !37 = !DILocation(line: 5, column: 1, scope: !35)
// CHECK:STDOUT: !38 = !{!36}
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !20, line: 6, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !42)
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !20, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !42)
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !22)
// CHECK:STDOUT: !41 = !DILocation(line: 6, column: 3, scope: !39)
// CHECK:STDOUT: !41 = !DILocation(line: 5, column: 1, scope: !39)
// CHECK:STDOUT: !42 = !{!40}
// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0}
// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0}
// CHECK:STDOUT: !46 = !{!"p1 _ZTSN6Carbon1AE", !45, i64 0}
// CHECK:STDOUT: !47 = !{!46, !46, i64 0}
// CHECK:STDOUT: !48 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !49 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !50 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !51 = !{!"int", !44, i64 0}
// CHECK:STDOUT: !52 = !{!"__libc_errno", !51, i64 0}
// CHECK:STDOUT: !53 = !{!52, !51, i64 0}
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !20, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !46)
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !22)
// CHECK:STDOUT: !45 = !DILocation(line: 5, column: 1, scope: !43)
// CHECK:STDOUT: !46 = !{!44}
// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !20, line: 6, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !50)
// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !22)
// CHECK:STDOUT: !49 = !DILocation(line: 6, column: 3, scope: !47)
// CHECK:STDOUT: !50 = !{!48}
// CHECK:STDOUT: !51 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !52 = !{!"omnipotent char", !51, i64 0}
// CHECK:STDOUT: !53 = !{!"any pointer", !52, i64 0}
// CHECK:STDOUT: !54 = !{!"p1 _ZTSN6Carbon1AE", !53, i64 0}
// CHECK:STDOUT: !55 = !{!54, !54, i64 0}
// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !59 = !{!"int", !52, i64 0}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0}
// CHECK:STDOUT: !61 = !{!60, !59, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'method_with_args_and_return.carbon'
@@ -212,8 +233,8 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: %retval = alloca i32, align 4
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: %.addr = alloca i32, align 4
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94
// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !95
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !110
// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !111
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @_CF__carbon_thunk.ArgsA.Main(ptr noundef nonnull align 1 %this1, ptr noundef nonnull align 4 dereferenceable(4) %.addr, ptr noundef nonnull align 4 dereferenceable(4) %retval)
// CHECK:STDOUT: %1 = load i32, ptr %retval, align 4
@@ -224,7 +245,7 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon5ArgsAD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !110
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr noundef nonnull align 1 %this1)
// CHECK:STDOUT: ret void
@@ -234,38 +255,51 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: declare void @llvm.lifetime.end.p0(ptr captures(none)) #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CF.ArgsA.Main(ptr %self, i32 %a) #4 !dbg !63 {
// CHECK:STDOUT: define i32 @_CF.ArgsA.Main(ptr %self, i32 %a) #4 !dbg !71 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret i32 %a, !dbg !72
// CHECK:STDOUT: ret i32 %a, !dbg !80
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr %self) #5 !dbg !74 {
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr %self) #5 !dbg !82 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self), !dbg !76
// CHECK:STDOUT: ret void, !dbg !76
// CHECK:STDOUT: call void @"_CSelfDestruct.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self), !dbg !84
// CHECK:STDOUT: ret void, !dbg !84
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self) #4 !dbg !78 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #4 !dbg !86 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !80
// CHECK:STDOUT: ret void, !dbg !88
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.ArgsA.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !82 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self) #4 !dbg !90 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !86
// CHECK:STDOUT: %ArgsA.F.call = call i32 @_CF.ArgsA.Main(ptr %self, i32 %.loc6_29.2), !dbg !86
// CHECK:STDOUT: store i32 %ArgsA.F.call, ptr %_1, align 4, !dbg !86
// CHECK:STDOUT: ret void, !dbg !86
// CHECK:STDOUT: ret void, !dbg !92
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !88 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self) #4 !dbg !94 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %CallArgsF.call = call i32 @_Z9CallArgsFv(), !dbg !91
// CHECK:STDOUT: ret i32 %CallArgsF.call, !dbg !92
// CHECK:STDOUT: call void @"_CSubobjectDestroy.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self), !dbg !96
// CHECK:STDOUT: ret void, !dbg !96
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.ArgsA.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !98 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !102
// CHECK:STDOUT: %ArgsA.F.call = call i32 @_CF.ArgsA.Main(ptr %self, i32 %.loc6_29.2), !dbg !102
// CHECK:STDOUT: store i32 %ArgsA.F.call, ptr %_1, align 4, !dbg !102
// CHECK:STDOUT: ret void, !dbg !102
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !104 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %CallArgsF.call = call i32 @_Z9CallArgsFv(), !dbg !107
// CHECK:STDOUT: ret i32 %CallArgsF.call, !dbg !108
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
@@ -275,58 +309,66 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: attributes #4 = { nounwind }
// CHECK:STDOUT: attributes #5 = { alwaysinline nounwind }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!55}
// CHECK:STDOUT: !llvm.module.flags = !{!48, !49, !50, !4, !5}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!53}
// CHECK:STDOUT: !llvm.dbg.cu = !{!63}
// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !4, !5}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT:
// CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !23 = !{null, !22}
// CHECK:STDOUT: !24 = !DISubroutineType(types: !23)
// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0}
// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0}
// CHECK:STDOUT: !48 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !49 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !50 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !51 = !{!"int", !44, i64 0}
// CHECK:STDOUT: !52 = !{!"__libc_errno", !51, i64 0}
// CHECK:STDOUT: !53 = !{!52, !51, i64 0}
// CHECK:STDOUT: !54 = !DIFile(filename: "method_with_args_and_return.carbon", directory: "")
// CHECK:STDOUT: !55 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !54, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !56 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !57 = !{!56, !22, !56}
// CHECK:STDOUT: !58 = !DISubroutineType(types: !57)
// CHECK:STDOUT: !59 = !{null, !22, !56, !56}
// CHECK:STDOUT: !60 = !DISubroutineType(types: !59)
// CHECK:STDOUT: !61 = !{!56}
// CHECK:STDOUT: !62 = !DISubroutineType(types: !61)
// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "F", linkageName: "_CF.ArgsA.Main", scope: null, file: !54, line: 6, type: !58, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !73)
// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !22)
// CHECK:STDOUT: !65 = !DILocalVariable(arg: 2, scope: !63, type: !56)
// CHECK:STDOUT: !72 = !DILocation(line: 8, column: 5, scope: !63)
// CHECK:STDOUT: !73 = !{!64, !65}
// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.ArgsA.Main", scope: null, file: !54, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !77)
// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !22)
// CHECK:STDOUT: !76 = !DILocation(line: 5, column: 1, scope: !74)
// CHECK:STDOUT: !77 = !{!75}
// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eefdfd667b52bf5b:core.Destroy.Core", scope: null, file: !54, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !81)
// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !22)
// CHECK:STDOUT: !80 = !DILocation(line: 5, column: 1, scope: !78)
// CHECK:STDOUT: !81 = !{!79}
// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.ArgsA.Main", scope: null, file: !54, line: 6, type: !60, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !87)
// CHECK:STDOUT: !51 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !52 = !{!"omnipotent char", !51, i64 0}
// CHECK:STDOUT: !53 = !{!"any pointer", !52, i64 0}
// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !59 = !{!"int", !52, i64 0}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0}
// CHECK:STDOUT: !61 = !{!60, !59, i64 0}
// CHECK:STDOUT: !62 = !DIFile(filename: "method_with_args_and_return.carbon", directory: "")
// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !64 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !65 = !{!64, !22, !64}
// CHECK:STDOUT: !66 = !DISubroutineType(types: !65)
// CHECK:STDOUT: !67 = !{null, !22, !64, !64}
// CHECK:STDOUT: !68 = !DISubroutineType(types: !67)
// CHECK:STDOUT: !69 = !{!64}
// CHECK:STDOUT: !70 = !DISubroutineType(types: !69)
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "F", linkageName: "_CF.ArgsA.Main", scope: null, file: !62, line: 6, type: !66, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !81)
// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !22)
// CHECK:STDOUT: !73 = !DILocalVariable(arg: 2, scope: !71, type: !64)
// CHECK:STDOUT: !80 = !DILocation(line: 8, column: 5, scope: !71)
// CHECK:STDOUT: !81 = !{!72, !73}
// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.ArgsA.Main", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !85)
// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !22)
// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !82, type: !56)
// CHECK:STDOUT: !85 = !DILocalVariable(arg: 3, scope: !82, type: !56)
// CHECK:STDOUT: !86 = !DILocation(line: 6, column: 3, scope: !82)
// CHECK:STDOUT: !87 = !{!83, !84, !85}
// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !54, line: 18, type: !62, spFlags: DISPFlagDefinition, unit: !55)
// CHECK:STDOUT: !91 = !DILocation(line: 18, column: 32, scope: !88)
// CHECK:STDOUT: !92 = !DILocation(line: 18, column: 25, scope: !88)
// CHECK:STDOUT: !93 = !{!"p1 _ZTSN6Carbon5ArgsAE", !45, i64 0}
// CHECK:STDOUT: !94 = !{!93, !93, i64 0}
// CHECK:STDOUT: !95 = !{!51, !51, i64 0}
// CHECK:STDOUT: !84 = !DILocation(line: 5, column: 1, scope: !82)
// CHECK:STDOUT: !85 = !{!83}
// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !89)
// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !22)
// CHECK:STDOUT: !88 = !DILocation(line: 5, column: 1, scope: !86)
// CHECK:STDOUT: !89 = !{!87}
// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.eefdfd667b52bf5b:core.Destroy.Core", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !93)
// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !22)
// CHECK:STDOUT: !92 = !DILocation(line: 5, column: 1, scope: !90)
// CHECK:STDOUT: !93 = !{!91}
// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.eefdfd667b52bf5b:core.Destroy.Core", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !97)
// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !22)
// CHECK:STDOUT: !96 = !DILocation(line: 5, column: 1, scope: !94)
// CHECK:STDOUT: !97 = !{!95}
// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.ArgsA.Main", scope: null, file: !62, line: 6, type: !68, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !103)
// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !22)
// CHECK:STDOUT: !100 = !DILocalVariable(arg: 2, scope: !98, type: !64)
// CHECK:STDOUT: !101 = !DILocalVariable(arg: 3, scope: !98, type: !64)
// CHECK:STDOUT: !102 = !DILocation(line: 6, column: 3, scope: !98)
// CHECK:STDOUT: !103 = !{!99, !100, !101}
// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !62, line: 18, type: !70, spFlags: DISPFlagDefinition, unit: !63)
// CHECK:STDOUT: !107 = !DILocation(line: 18, column: 32, scope: !104)
// CHECK:STDOUT: !108 = !DILocation(line: 18, column: 25, scope: !104)
// CHECK:STDOUT: !109 = !{!"p1 _ZTSN6Carbon5ArgsAE", !53, i64 0}
// CHECK:STDOUT: !110 = !{!109, !109, i64 0}
// CHECK:STDOUT: !111 = !{!59, !59, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'static.carbon'
@@ -349,36 +391,49 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF.StaticA.Main() #2 !dbg !100 {
// CHECK:STDOUT: define void @_CF.StaticA.Main() #2 !dbg !116 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !101
// CHECK:STDOUT: ret void, !dbg !117
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.StaticA.Main"(ptr %self) #3 !dbg !102 {
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.StaticA.Main"(ptr %self) #3 !dbg !118 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.1be3804f96ff0532:core.Destroy.Core"(ptr %self), !dbg !104
// CHECK:STDOUT: ret void, !dbg !104
// CHECK:STDOUT: call void @"_CSelfDestruct.1be3804f96ff0532:core.Destroy.Core"(ptr %self), !dbg !120
// CHECK:STDOUT: ret void, !dbg !120
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.1be3804f96ff0532:core.Destroy.Core"(ptr %self) #2 !dbg !106 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #2 !dbg !122 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !108
// CHECK:STDOUT: ret void, !dbg !124
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.StaticA.Main() #2 !dbg !110 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1be3804f96ff0532:core.Destroy.Core"(ptr %self) #2 !dbg !126 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.StaticA.Main(), !dbg !111
// CHECK:STDOUT: ret void, !dbg !111
// CHECK:STDOUT: ret void, !dbg !128
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !112 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1be3804f96ff0532:core.Destroy.Core"(ptr %self) #2 !dbg !130 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z11CallStaticFv(), !dbg !113
// CHECK:STDOUT: ret void, !dbg !114
// CHECK:STDOUT: call void @"_CSubobjectDestroy.1be3804f96ff0532:core.Destroy.Core"(ptr %self), !dbg !132
// CHECK:STDOUT: ret void, !dbg !132
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.StaticA.Main() #2 !dbg !134 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.StaticA.Main(), !dbg !135
// CHECK:STDOUT: ret void, !dbg !135
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !136 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z11CallStaticFv(), !dbg !137
// CHECK:STDOUT: ret void, !dbg !138
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
@@ -386,40 +441,48 @@ fn CallCallF() { Cpp.CallStaticF(); }
// CHECK:STDOUT: attributes #2 = { nounwind }
// CHECK:STDOUT: attributes #3 = { alwaysinline nounwind }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!97}
// CHECK:STDOUT: !llvm.module.flags = !{!48, !49, !50, !4, !5}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!53}
// CHECK:STDOUT: !llvm.dbg.cu = !{!113}
// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !4, !5}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT:
// CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !23 = !{null, !22}
// CHECK:STDOUT: !24 = !DISubroutineType(types: !23)
// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0}
// CHECK:STDOUT: !48 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !49 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !50 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !51 = !{!"int", !44, i64 0}
// CHECK:STDOUT: !52 = !{!"__libc_errno", !51, i64 0}
// CHECK:STDOUT: !53 = !{!52, !51, i64 0}
// CHECK:STDOUT: !96 = !DIFile(filename: "static.carbon", directory: "")
// CHECK:STDOUT: !97 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !96, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !98 = !{null}
// CHECK:STDOUT: !99 = !DISubroutineType(types: !98)
// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "F", linkageName: "_CF.StaticA.Main", scope: null, file: !96, line: 6, type: !99, spFlags: DISPFlagDefinition, unit: !97)
// CHECK:STDOUT: !101 = !DILocation(line: 6, column: 3, scope: !100)
// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.StaticA.Main", scope: null, file: !96, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !97, retainedNodes: !105)
// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !22)
// CHECK:STDOUT: !104 = !DILocation(line: 5, column: 1, scope: !102)
// CHECK:STDOUT: !105 = !{!103}
// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1be3804f96ff0532:core.Destroy.Core", scope: null, file: !96, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !97, retainedNodes: !109)
// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !22)
// CHECK:STDOUT: !108 = !DILocation(line: 5, column: 1, scope: !106)
// CHECK:STDOUT: !109 = !{!107}
// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.StaticA.Main", scope: null, file: !96, line: 6, type: !99, spFlags: DISPFlagDefinition, unit: !97)
// CHECK:STDOUT: !111 = !DILocation(line: 6, column: 3, scope: !110)
// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !96, line: 15, type: !99, spFlags: DISPFlagDefinition, unit: !97)
// CHECK:STDOUT: !113 = !DILocation(line: 15, column: 18, scope: !112)
// CHECK:STDOUT: !114 = !DILocation(line: 15, column: 1, scope: !112)
// CHECK:STDOUT: !51 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !52 = !{!"omnipotent char", !51, i64 0}
// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !59 = !{!"int", !52, i64 0}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0}
// CHECK:STDOUT: !61 = !{!60, !59, i64 0}
// CHECK:STDOUT: !112 = !DIFile(filename: "static.carbon", directory: "")
// CHECK:STDOUT: !113 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !112, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !114 = !{null}
// CHECK:STDOUT: !115 = !DISubroutineType(types: !114)
// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "F", linkageName: "_CF.StaticA.Main", scope: null, file: !112, line: 6, type: !115, spFlags: DISPFlagDefinition, unit: !113)
// CHECK:STDOUT: !117 = !DILocation(line: 6, column: 3, scope: !116)
// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.StaticA.Main", scope: null, file: !112, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !113, retainedNodes: !121)
// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !22)
// CHECK:STDOUT: !120 = !DILocation(line: 5, column: 1, scope: !118)
// CHECK:STDOUT: !121 = !{!119}
// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !112, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !113, retainedNodes: !125)
// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !22)
// CHECK:STDOUT: !124 = !DILocation(line: 5, column: 1, scope: !122)
// CHECK:STDOUT: !125 = !{!123}
// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1be3804f96ff0532:core.Destroy.Core", scope: null, file: !112, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !113, retainedNodes: !129)
// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !22)
// CHECK:STDOUT: !128 = !DILocation(line: 5, column: 1, scope: !126)
// CHECK:STDOUT: !129 = !{!127}
// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1be3804f96ff0532:core.Destroy.Core", scope: null, file: !112, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !113, retainedNodes: !133)
// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !22)
// CHECK:STDOUT: !132 = !DILocation(line: 5, column: 1, scope: !130)
// CHECK:STDOUT: !133 = !{!131}
// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.StaticA.Main", scope: null, file: !112, line: 6, type: !115, spFlags: DISPFlagDefinition, unit: !113)
// CHECK:STDOUT: !135 = !DILocation(line: 6, column: 3, scope: !134)
// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !112, line: 15, type: !115, spFlags: DISPFlagDefinition, unit: !113)
// CHECK:STDOUT: !137 = !DILocation(line: 15, column: 18, scope: !136)
// CHECK:STDOUT: !138 = !DILocation(line: 15, column: 1, scope: !136)
// CHECK:STDOUT:
@@ -71,6 +71,7 @@ fn Packed(n: i32) {
// CHECK:STDOUT: %.loc25.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !47
// CHECK:STDOUT: store i32 %n, ptr %.loc25.n, align 4, !dbg !47
// CHECK:STDOUT: call void @_Z4TakeI16NaturallyAlignedEvRT_(ptr %a.var), !dbg !51
// CHECK:STDOUT: call void @"_CSelfDestruct.89af5f7a0692dfe8:core.Destroy.Core"(ptr %a.var), !dbg !45
// CHECK:STDOUT: ret void, !dbg !52
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -78,8 +79,8 @@ fn Packed(n: i32) {
// CHECK:STDOUT: define internal void @_ZN16NaturallyAlignedC1Ev.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 !106
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !106
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !118
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !118
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -93,84 +94,104 @@ fn Packed(n: i32) {
// CHECK:STDOUT: declare void @_Z4TakeI16NaturallyAlignedEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #3
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CExtraAlignment.Main(i32 %n) #0 !dbg !57 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.89af5f7a0692dfe8:core.Destroy.Core"(ptr %self) #0 !dbg !57 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca [16 x i8], align 16, !dbg !60
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !60
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr %a.var), !dbg !60
// CHECK:STDOUT: %.loc33.n = getelementptr inbounds nuw [16 x i8], ptr %a.var, i32 0, i32 0, !dbg !62
// CHECK:STDOUT: store i32 %n, ptr %.loc33.n, align 4, !dbg !62
// CHECK:STDOUT: call void @_Z4TakeI14ExtraAlignmentEvRT_(ptr %a.var), !dbg !66
// CHECK:STDOUT: ret void, !dbg !67
// CHECK:STDOUT: ret void, !dbg !59
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CExtraAlignment.Main(i32 %n) #0 !dbg !61 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca [16 x i8], align 16, !dbg !64
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !64
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr %a.var), !dbg !64
// CHECK:STDOUT: %.loc33.n = getelementptr inbounds nuw [16 x i8], ptr %a.var, i32 0, i32 0, !dbg !66
// CHECK:STDOUT: store i32 %n, ptr %.loc33.n, align 4, !dbg !66
// CHECK:STDOUT: call void @_Z4TakeI14ExtraAlignmentEvRT_(ptr %a.var), !dbg !70
// CHECK:STDOUT: call void @"_CSelfDestruct.77c39a3d53f40ae2:core.Destroy.Core"(ptr %a.var), !dbg !64
// CHECK:STDOUT: ret void, !dbg !71
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
// CHECK:STDOUT: define internal void @_ZN14ExtraAlignmentC1Ev.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 !108
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !108
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !120
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !120
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr sret([16 x i8]) %return) #2 !dbg !69 {
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr sret([16 x i8]) %return) #2 !dbg !73 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN14ExtraAlignmentC1Ev.carbon_thunk.(ptr %return), !dbg !71
// CHECK:STDOUT: ret void, !dbg !71
// CHECK:STDOUT: call void @_ZN14ExtraAlignmentC1Ev.carbon_thunk.(ptr %return), !dbg !75
// CHECK:STDOUT: ret void, !dbg !75
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z4TakeI14ExtraAlignmentEvRT_(ptr noundef nonnull align 16 dereferenceable(16)) #3
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPacked.Main(i32 %n) #0 !dbg !72 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.77c39a3d53f40ae2:core.Destroy.Core"(ptr %self) #0 !dbg !76 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca [4 x i8], align 1, !dbg !75
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !75
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr %a.var), !dbg !75
// CHECK:STDOUT: %.loc42.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !77
// CHECK:STDOUT: store i32 %n, ptr %.loc42.n, align 4, !dbg !77
// CHECK:STDOUT: call void @_Z4TakeI6PackedEvRT_(ptr %a.var), !dbg !81
// CHECK:STDOUT: ret void, !dbg !82
// CHECK:STDOUT: ret void, !dbg !78
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPacked.Main(i32 %n) #0 !dbg !80 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca [4 x i8], align 1, !dbg !83
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !83
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr %a.var), !dbg !83
// CHECK:STDOUT: %.loc42.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !85
// CHECK:STDOUT: store i32 %n, ptr %.loc42.n, align 4, !dbg !85
// CHECK:STDOUT: call void @_Z4TakeI6PackedEvRT_(ptr %a.var), !dbg !89
// CHECK:STDOUT: call void @"_CSelfDestruct.00b787a687567d9a:core.Destroy.Core"(ptr %a.var), !dbg !83
// CHECK:STDOUT: ret void, !dbg !90
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
// CHECK:STDOUT: define internal void @_ZN6PackedC1Ev.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 !110
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !110
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !122
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !122
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !84 {
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !92 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN6PackedC1Ev.carbon_thunk.(ptr %return), !dbg !86
// CHECK:STDOUT: ret void, !dbg !86
// CHECK:STDOUT: call void @_ZN6PackedC1Ev.carbon_thunk.(ptr %return), !dbg !94
// CHECK:STDOUT: ret void, !dbg !94
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z4TakeI6PackedEvRT_(ptr noundef nonnull align 1 dereferenceable(4)) #3
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.00b787a687567d9a:core.Destroy.Core"(ptr %self) #0 !dbg !95 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !97
// 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)) #4
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619"(ptr sret([4 x i8]) %return) #0 !dbg !87 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp"(ptr %return), !dbg !90
// CHECK:STDOUT: ret void, !dbg !91
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619"(ptr sret([4 x i8]) %return) #0 !dbg !99 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp"(ptr %return), !dbg !102
// CHECK:STDOUT: ret void, !dbg !103
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr sret([16 x i8]) %return) #0 !dbg !92 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr %return), !dbg !95
// CHECK:STDOUT: ret void, !dbg !96
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr sret([16 x i8]) %return) #0 !dbg !104 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr %return), !dbg !107
// CHECK:STDOUT: ret void, !dbg !108
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr sret([4 x i8]) %return) #0 !dbg !97 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr %return), !dbg !100
// CHECK:STDOUT: ret void, !dbg !101
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr sret([4 x i8]) %return) #0 !dbg !109 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr %return), !dbg !112
// CHECK:STDOUT: ret void, !dbg !113
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
@@ -183,8 +204,8 @@ fn Packed(n: i32) {
// CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!33}
// CHECK:STDOUT: !llvm.module.flags = !{!111, !112, !113, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!116}
// CHECK:STDOUT: !llvm.module.flags = !{!123, !124, !125, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!128}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -195,6 +216,8 @@ fn Packed(n: i32) {
// CHECK:STDOUT: !35 = !{null, !34}
// CHECK:STDOUT: !36 = !DISubroutineType(types: !35)
// CHECK:STDOUT: !37 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !38 = !{null, !37}
// CHECK:STDOUT: !39 = !DISubroutineType(types: !38)
// CHECK:STDOUT: !40 = !{!37}
// CHECK:STDOUT: !41 = !DISubroutineType(types: !40)
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "NaturallyAligned", linkageName: "_CNaturallyAligned.Main", scope: null, file: !32, line: 23, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !53)
@@ -206,46 +229,58 @@ fn Packed(n: i32) {
// CHECK:STDOUT: !53 = !{!43}
// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp", scope: null, file: !32, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !56 = !DILocation(line: 7, column: 8, scope: !54)
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "ExtraAlignment", linkageName: "_CExtraAlignment.Main", scope: null, file: !32, line: 29, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !68)
// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !34)
// CHECK:STDOUT: !60 = !DILocation(line: 30, column: 3, scope: !57)
// CHECK:STDOUT: !62 = !DILocation(line: 33, column: 3, scope: !57)
// CHECK:STDOUT: !66 = !DILocation(line: 34, column: 3, scope: !57)
// CHECK:STDOUT: !67 = !DILocation(line: 29, column: 1, scope: !57)
// CHECK:STDOUT: !68 = !{!58}
// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp", scope: null, file: !32, line: 11, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !71 = !DILocation(line: 11, column: 20, scope: !69)
// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Packed", linkageName: "_CPacked.Main", scope: null, file: !32, line: 37, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !83)
// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !34)
// CHECK:STDOUT: !75 = !DILocation(line: 38, column: 3, scope: !72)
// CHECK:STDOUT: !77 = !DILocation(line: 42, column: 3, scope: !72)
// CHECK:STDOUT: !81 = !DILocation(line: 43, column: 3, scope: !72)
// CHECK:STDOUT: !82 = !DILocation(line: 37, column: 1, scope: !72)
// CHECK:STDOUT: !83 = !{!73}
// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !86 = !DILocation(line: 15, column: 32, scope: !84)
// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !90 = !DILocation(line: 9, column: 28, scope: !87)
// CHECK:STDOUT: !91 = !DILocation(line: 9, column: 21, scope: !87)
// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !95 = !DILocation(line: 9, column: 28, scope: !92)
// CHECK:STDOUT: !96 = !DILocation(line: 9, column: 21, scope: !92)
// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !100 = !DILocation(line: 9, column: 28, scope: !97)
// CHECK:STDOUT: !101 = !DILocation(line: 9, column: 21, scope: !97)
// CHECK:STDOUT: !102 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !103 = !{!"omnipotent char", !102, i64 0}
// CHECK:STDOUT: !104 = !{!"any pointer", !103, i64 0}
// CHECK:STDOUT: !105 = !{!"p1 _ZTS16NaturallyAligned", !104, i64 0}
// CHECK:STDOUT: !106 = !{!105, !105, i64 0}
// CHECK:STDOUT: !107 = !{!"p1 _ZTS14ExtraAlignment", !104, i64 0}
// CHECK:STDOUT: !108 = !{!107, !107, i64 0}
// CHECK:STDOUT: !109 = !{!"p1 _ZTS6Packed", !104, i64 0}
// CHECK:STDOUT: !110 = !{!109, !109, i64 0}
// CHECK:STDOUT: !111 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !112 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !113 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !114 = !{!"int", !103, i64 0}
// CHECK:STDOUT: !115 = !{!"__libc_errno", !114, i64 0}
// CHECK:STDOUT: !116 = !{!115, !114, i64 0}
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.89af5f7a0692dfe8:core.Destroy.Core", scope: null, file: !32, line: 24, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !60)
// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !37)
// CHECK:STDOUT: !59 = !DILocation(line: 24, column: 3, scope: !57)
// CHECK:STDOUT: !60 = !{!58}
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "ExtraAlignment", linkageName: "_CExtraAlignment.Main", scope: null, file: !32, line: 29, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !72)
// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !34)
// CHECK:STDOUT: !64 = !DILocation(line: 30, column: 3, scope: !61)
// CHECK:STDOUT: !66 = !DILocation(line: 33, column: 3, scope: !61)
// CHECK:STDOUT: !70 = !DILocation(line: 34, column: 3, scope: !61)
// CHECK:STDOUT: !71 = !DILocation(line: 29, column: 1, scope: !61)
// CHECK:STDOUT: !72 = !{!62}
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp", scope: null, file: !32, line: 11, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !75 = !DILocation(line: 11, column: 20, scope: !73)
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.77c39a3d53f40ae2:core.Destroy.Core", scope: null, file: !32, line: 30, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !79)
// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !37)
// CHECK:STDOUT: !78 = !DILocation(line: 30, column: 3, scope: !76)
// CHECK:STDOUT: !79 = !{!77}
// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Packed", linkageName: "_CPacked.Main", scope: null, file: !32, line: 37, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !91)
// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !34)
// CHECK:STDOUT: !83 = !DILocation(line: 38, column: 3, scope: !80)
// CHECK:STDOUT: !85 = !DILocation(line: 42, column: 3, scope: !80)
// CHECK:STDOUT: !89 = !DILocation(line: 43, column: 3, scope: !80)
// CHECK:STDOUT: !90 = !DILocation(line: 37, column: 1, scope: !80)
// CHECK:STDOUT: !91 = !{!81}
// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !94 = !DILocation(line: 15, column: 32, scope: !92)
// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.00b787a687567d9a:core.Destroy.Core", scope: null, file: !32, line: 38, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !98)
// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !37)
// CHECK:STDOUT: !97 = !DILocation(line: 38, column: 3, scope: !95)
// CHECK:STDOUT: !98 = !{!96}
// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !102 = !DILocation(line: 9, column: 28, scope: !99)
// CHECK:STDOUT: !103 = !DILocation(line: 9, column: 21, scope: !99)
// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !107 = !DILocation(line: 9, column: 28, scope: !104)
// CHECK:STDOUT: !108 = !DILocation(line: 9, column: 21, scope: !104)
// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !112 = !DILocation(line: 9, column: 28, scope: !109)
// CHECK:STDOUT: !113 = !DILocation(line: 9, column: 21, scope: !109)
// CHECK:STDOUT: !114 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !115 = !{!"omnipotent char", !114, i64 0}
// CHECK:STDOUT: !116 = !{!"any pointer", !115, i64 0}
// CHECK:STDOUT: !117 = !{!"p1 _ZTS16NaturallyAligned", !116, i64 0}
// CHECK:STDOUT: !118 = !{!117, !117, i64 0}
// CHECK:STDOUT: !119 = !{!"p1 _ZTS14ExtraAlignment", !116, i64 0}
// CHECK:STDOUT: !120 = !{!119, !119, i64 0}
// CHECK:STDOUT: !121 = !{!"p1 _ZTS6Packed", !116, i64 0}
// CHECK:STDOUT: !122 = !{!121, !121, i64 0}
// CHECK:STDOUT: !123 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !124 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !125 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !126 = !{!"int", !115, i64 0}
// CHECK:STDOUT: !127 = !{!"__libc_errno", !126, i64 0}
// CHECK:STDOUT: !128 = !{!127, !126, i64 0}
// CHECK:STDOUT:
File diff suppressed because it is too large. Load diff
@@ -90,7 +90,7 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: %a.var = alloca [4 x i8], align 4, !dbg !29
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !29
// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %a.var), !dbg !29
// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %a.var), !dbg !29
// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %a.var), !dbg !29
// CHECK:STDOUT: ret void, !dbg !32
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -99,10 +99,10 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !46
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !48
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !48
// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !46, !nonnull !50
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !50
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !52
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !52
// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !50, !nonnull !54
// CHECK:STDOUT: call void @_ZNK1Bcv1AEv(ptr dead_on_unwind writable sret(%struct.A) align 4 %0, ptr noundef nonnull align 1 dereferenceable(1) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -111,13 +111,20 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: declare void @_ZN1AD1Ev(ptr noundef nonnull align 4 dead_on_return(4) dereferenceable(4)) unnamed_addr #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !34 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #0 !dbg !34 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc20_25.1.temp = alloca [4 x i8], align 4, !dbg !37
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !37
// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !37
// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %.loc20_25.1.temp), !dbg !37
// CHECK:STDOUT: ret void, !dbg !40
// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %self), !dbg !36
// CHECK:STDOUT: ret void, !dbg !36
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !38 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc20_25.1.temp = alloca [4 x i8], align 4, !dbg !41
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !41
// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !41
// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %.loc20_25.1.temp), !dbg !41
// CHECK:STDOUT: ret void, !dbg !44
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -135,8 +142,8 @@ fn ConvertToValue(b: Cpp.IntB) {
// 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.dbg.cu = !{!19}
// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!57}
// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -150,25 +157,29 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 3, scope: !26)
// CHECK:STDOUT: !32 = !DILocation(line: 15, column: 1, scope: !26)
// CHECK:STDOUT: !33 = !{!27}
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !18, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41)
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !18, line: 16, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !37)
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !21)
// CHECK:STDOUT: !37 = !DILocation(line: 20, column: 25, scope: !34)
// CHECK:STDOUT: !40 = !DILocation(line: 19, column: 1, scope: !34)
// CHECK:STDOUT: !41 = !{!35}
// CHECK:STDOUT: !42 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !43 = !{!"omnipotent char", !42, i64 0}
// CHECK:STDOUT: !44 = !{!"any pointer", !43, i64 0}
// CHECK:STDOUT: !45 = !{!"p1 _ZTS1B", !44, i64 0}
// CHECK:STDOUT: !46 = !{!45, !45, i64 0}
// CHECK:STDOUT: !47 = !{!"p1 _ZTS1A", !44, i64 0}
// CHECK:STDOUT: !48 = !{!47, !47, i64 0}
// CHECK:STDOUT: !50 = !{}
// CHECK:STDOUT: !51 = !{!"int", !43, i64 0}
// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !56 = !{!"__libc_errno", !51, i64 0}
// CHECK:STDOUT: !57 = !{!56, !51, i64 0}
// CHECK:STDOUT: !36 = !DILocation(line: 16, column: 3, scope: !34)
// CHECK:STDOUT: !37 = !{!35}
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !18, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45)
// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !21)
// CHECK:STDOUT: !41 = !DILocation(line: 20, column: 25, scope: !38)
// CHECK:STDOUT: !44 = !DILocation(line: 19, column: 1, scope: !38)
// CHECK:STDOUT: !45 = !{!39}
// CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0}
// CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0}
// CHECK:STDOUT: !49 = !{!"p1 _ZTS1B", !48, i64 0}
// CHECK:STDOUT: !50 = !{!49, !49, i64 0}
// CHECK:STDOUT: !51 = !{!"p1 _ZTS1A", !48, i64 0}
// CHECK:STDOUT: !52 = !{!51, !51, i64 0}
// CHECK:STDOUT: !54 = !{}
// CHECK:STDOUT: !55 = !{!"int", !47, i64 0}
// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !55, i64 0}
// CHECK:STDOUT: !61 = !{!60, !55, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'class_to_enum.carbon'
@@ -177,15 +188,17 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !61 {
// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !67 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !64
// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !67
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !64
// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !64
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !67
// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !67
// CHECK:STDOUT: ret void, !dbg !70
// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !70
// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !73
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !70
// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !70
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !73
// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !73
// CHECK:STDOUT: call void @"_CSelfDestruct.93ce72f55a28222b:core.Destroy.Core"(ptr %i.var), !dbg !73
// CHECK:STDOUT: call void @"_CSelfDestruct.7c9bfa05445fab48:core.Destroy.Core"(ptr %s.var), !dbg !70
// CHECK:STDOUT: ret void, !dbg !76
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -193,12 +206,12 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !84
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !85
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !85
// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !84, !nonnull !50
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !98
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !99
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !99
// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !98, !nonnull !54
// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK5EnumBcv1SEv(ptr noundef nonnull align 1 dereferenceable(1) %1)
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !88
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !102
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -207,27 +220,41 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !84
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !85
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !85
// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !84, !nonnull !50
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !98
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !99
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !99
// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !98, !nonnull !54
// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK5EnumBcv1IEv(ptr noundef nonnull align 1 dereferenceable(1) %1)
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !90
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !104
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !72 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.93ce72f55a28222b:core.Destroy.Core"(ptr %self) #0 !dbg !78 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !75
// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !78
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !75
// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !75
// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !75
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !78
// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !78
// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !78
// CHECK:STDOUT: ret void, !dbg !81
// CHECK:STDOUT: ret void, !dbg !80
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7c9bfa05445fab48:core.Destroy.Core"(ptr %self) #0 !dbg !82 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !84
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !86 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !89
// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !92
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !89
// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !89
// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !89
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !92
// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !92
// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !92
// CHECK:STDOUT: call void @"_CSelfDestruct.93ce72f55a28222b:core.Destroy.Core"(ptr %.loc21_25.1.temp), !dbg !92
// CHECK:STDOUT: call void @"_CSelfDestruct.7c9bfa05445fab48:core.Destroy.Core"(ptr %.loc20_25.1.temp), !dbg !89
// CHECK:STDOUT: ret void, !dbg !95
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -245,46 +272,57 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #3 = { "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.dbg.cu = !{!59}
// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!57}
// CHECK:STDOUT: !llvm.dbg.cu = !{!63}
// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !22 = !{null, !21}
// CHECK:STDOUT: !23 = !DISubroutineType(types: !22)
// CHECK:STDOUT: !42 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !43 = !{!"omnipotent char", !42, i64 0}
// CHECK:STDOUT: !44 = !{!"any pointer", !43, i64 0}
// CHECK:STDOUT: !50 = !{}
// CHECK:STDOUT: !51 = !{!"int", !43, i64 0}
// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !56 = !{!"__libc_errno", !51, i64 0}
// CHECK:STDOUT: !57 = !{!56, !51, i64 0}
// CHECK:STDOUT: !58 = !DIFile(filename: "class_to_enum.carbon", directory: "")
// CHECK:STDOUT: !59 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !58, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !58, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !71)
// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !21)
// CHECK:STDOUT: !64 = !DILocation(line: 15, column: 3, scope: !61)
// CHECK:STDOUT: !67 = !DILocation(line: 16, column: 3, scope: !61)
// CHECK:STDOUT: !70 = !DILocation(line: 14, column: 1, scope: !61)
// CHECK:STDOUT: !71 = !{!62}
// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !58, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !82)
// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !21)
// CHECK:STDOUT: !75 = !DILocation(line: 20, column: 25, scope: !72)
// CHECK:STDOUT: !78 = !DILocation(line: 21, column: 25, scope: !72)
// CHECK:STDOUT: !81 = !DILocation(line: 19, column: 1, scope: !72)
// CHECK:STDOUT: !82 = !{!73}
// CHECK:STDOUT: !83 = !{!"p1 _ZTS5EnumB", !44, i64 0}
// CHECK:STDOUT: !84 = !{!83, !83, i64 0}
// CHECK:STDOUT: !85 = !{!44, !44, i64 0}
// CHECK:STDOUT: !86 = !{!"_ZTS1S", !43, i64 0}
// CHECK:STDOUT: !88 = !{!86, !86, i64 0}
// CHECK:STDOUT: !89 = !{!"_ZTS1I", !43, i64 0}
// CHECK:STDOUT: !90 = !{!89, !89, i64 0}
// CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0}
// CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0}
// CHECK:STDOUT: !54 = !{}
// CHECK:STDOUT: !55 = !{!"int", !47, i64 0}
// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !55, i64 0}
// CHECK:STDOUT: !61 = !{!60, !55, i64 0}
// CHECK:STDOUT: !62 = !DIFile(filename: "class_to_enum.carbon", directory: "")
// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !64 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
// CHECK:STDOUT: !65 = !{null, !64}
// CHECK:STDOUT: !66 = !DISubroutineType(types: !65)
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !62, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !77)
// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !21)
// CHECK:STDOUT: !70 = !DILocation(line: 15, column: 3, scope: !67)
// CHECK:STDOUT: !73 = !DILocation(line: 16, column: 3, scope: !67)
// CHECK:STDOUT: !76 = !DILocation(line: 14, column: 1, scope: !67)
// CHECK:STDOUT: !77 = !{!68}
// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.93ce72f55a28222b:core.Destroy.Core", scope: null, file: !62, line: 16, type: !66, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !81)
// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !64)
// CHECK:STDOUT: !80 = !DILocation(line: 16, column: 3, scope: !78)
// CHECK:STDOUT: !81 = !{!79}
// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7c9bfa05445fab48:core.Destroy.Core", scope: null, file: !62, line: 15, type: !66, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !85)
// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !64)
// CHECK:STDOUT: !84 = !DILocation(line: 15, column: 3, scope: !82)
// CHECK:STDOUT: !85 = !{!83}
// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !62, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !96)
// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !21)
// CHECK:STDOUT: !89 = !DILocation(line: 20, column: 25, scope: !86)
// CHECK:STDOUT: !92 = !DILocation(line: 21, column: 25, scope: !86)
// CHECK:STDOUT: !95 = !DILocation(line: 19, column: 1, scope: !86)
// CHECK:STDOUT: !96 = !{!87}
// CHECK:STDOUT: !97 = !{!"p1 _ZTS5EnumB", !48, i64 0}
// CHECK:STDOUT: !98 = !{!97, !97, i64 0}
// CHECK:STDOUT: !99 = !{!48, !48, i64 0}
// CHECK:STDOUT: !100 = !{!"_ZTS1S", !47, i64 0}
// CHECK:STDOUT: !102 = !{!100, !100, i64 0}
// CHECK:STDOUT: !103 = !{!"_ZTS1I", !47, i64 0}
// CHECK:STDOUT: !104 = !{!103, !103, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'class_to_int.carbon'
@@ -293,37 +331,50 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !97 {
// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !111 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !100
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !100
// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !100
// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !100
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !100
// CHECK:STDOUT: ret void, !dbg !103
// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !114
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !114
// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !114
// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !114
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !114
// CHECK:STDOUT: ret void, !dbg !117
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal noundef i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this) #1 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !118
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !118, !nonnull !50
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !140
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !140, !nonnull !54
// CHECK:STDOUT: %call = call noundef i32 @_ZNK4IntBcviEv(ptr noundef nonnull align 1 dereferenceable(1) %0)
// CHECK:STDOUT: ret i32 %call
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !105 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !119 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !107
// CHECK:STDOUT: ret void, !dbg !121
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !109 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !123 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !112
// CHECK:STDOUT: ret void, !dbg !115
// CHECK:STDOUT: ret void, !dbg !125
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !127 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !129
// CHECK:STDOUT: ret void, !dbg !129
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !131 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !134
// CHECK:STDOUT: ret void, !dbg !137
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -336,9 +387,9 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #3 = { "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.dbg.cu = !{!92}
// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!57}
// CHECK:STDOUT: !llvm.dbg.cu = !{!106}
// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -346,34 +397,42 @@ fn ConvertToValue(b: Cpp.IntB) {
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !22 = !{null, !21}
// CHECK:STDOUT: !23 = !DISubroutineType(types: !22)
// CHECK:STDOUT: !42 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !43 = !{!"omnipotent char", !42, i64 0}
// CHECK:STDOUT: !44 = !{!"any pointer", !43, i64 0}
// CHECK:STDOUT: !50 = !{}
// CHECK:STDOUT: !51 = !{!"int", !43, i64 0}
// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !56 = !{!"__libc_errno", !51, i64 0}
// CHECK:STDOUT: !57 = !{!56, !51, i64 0}
// CHECK:STDOUT: !91 = !DIFile(filename: "class_to_int.carbon", directory: "")
// CHECK:STDOUT: !92 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !91, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !95 = !{null, !20}
// CHECK:STDOUT: !96 = !DISubroutineType(types: !95)
// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !91, line: 11, type: !23, spFlags: DISPFlagDefinition, unit: !92, retainedNodes: !104)
// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !21)
// CHECK:STDOUT: !100 = !DILocation(line: 12, column: 3, scope: !97)
// CHECK:STDOUT: !103 = !DILocation(line: 11, column: 1, scope: !97)
// CHECK:STDOUT: !104 = !{!98}
// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !91, line: 12, type: !96, spFlags: DISPFlagDefinition, unit: !92, retainedNodes: !108)
// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !20)
// CHECK:STDOUT: !107 = !DILocation(line: 12, column: 3, scope: !105)
// CHECK:STDOUT: !108 = !{!106}
// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !91, line: 15, type: !23, spFlags: DISPFlagDefinition, unit: !92, retainedNodes: !116)
// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !21)
// CHECK:STDOUT: !112 = !DILocation(line: 16, column: 27, scope: !109)
// CHECK:STDOUT: !115 = !DILocation(line: 15, column: 1, scope: !109)
// CHECK:STDOUT: !116 = !{!110}
// CHECK:STDOUT: !117 = !{!"p1 _ZTS4IntB", !44, i64 0}
// CHECK:STDOUT: !118 = !{!117, !117, i64 0}
// CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0}
// CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0}
// CHECK:STDOUT: !54 = !{}
// CHECK:STDOUT: !55 = !{!"int", !47, i64 0}
// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !55, i64 0}
// CHECK:STDOUT: !61 = !{!60, !55, i64 0}
// CHECK:STDOUT: !105 = !DIFile(filename: "class_to_int.carbon", directory: "")
// CHECK:STDOUT: !106 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !105, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !109 = !{null, !20}
// CHECK:STDOUT: !110 = !DISubroutineType(types: !109)
// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !105, line: 11, type: !23, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !118)
// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !21)
// CHECK:STDOUT: !114 = !DILocation(line: 12, column: 3, scope: !111)
// CHECK:STDOUT: !117 = !DILocation(line: 11, column: 1, scope: !111)
// CHECK:STDOUT: !118 = !{!112}
// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !105, line: 12, type: !110, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !122)
// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !20)
// CHECK:STDOUT: !121 = !DILocation(line: 12, column: 3, scope: !119)
// CHECK:STDOUT: !122 = !{!120}
// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !105, line: 12, type: !110, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !126)
// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !20)
// CHECK:STDOUT: !125 = !DILocation(line: 12, column: 3, scope: !123)
// CHECK:STDOUT: !126 = !{!124}
// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !105, line: 12, type: !110, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !130)
// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !20)
// CHECK:STDOUT: !129 = !DILocation(line: 12, column: 3, scope: !127)
// CHECK:STDOUT: !130 = !{!128}
// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !105, line: 15, type: !23, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !138)
// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !21)
// CHECK:STDOUT: !134 = !DILocation(line: 16, column: 27, scope: !131)
// CHECK:STDOUT: !137 = !DILocation(line: 15, column: 1, scope: !131)
// CHECK:STDOUT: !138 = !{!132}
// CHECK:STDOUT: !139 = !{!"p1 _ZTS4IntB", !48, i64 0}
// CHECK:STDOUT: !140 = !{!139, !139, i64 0}
// CHECK:STDOUT:
@@ -123,8 +123,8 @@ fn PassTemporary() {
// CHECK:STDOUT: define internal void @_Z13make_copyablev.carbon_thunk.(ptr noundef %return) #0 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !43
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !43
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !47
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !47
// CHECK:STDOUT: call void @_Z13make_copyablev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1 %0)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -141,8 +141,8 @@ fn PassTemporary() {
// 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 !43
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !43
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !47
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !47
// 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 @_Z13pass_copyable8Copyable(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp)
// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
@@ -156,7 +156,7 @@ fn PassTemporary() {
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_39.1.temp), !dbg !18
// CHECK:STDOUT: call void @_Z13make_copyablev.carbon_thunk.(ptr %.loc21_39.1.temp), !dbg !18
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %.loc21_39.1.temp), !dbg !19
// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %.loc21_39.1.temp), !dbg !18
// CHECK:STDOUT: call void @"_CSelfDestruct.fd98d268aadcda21:core.Destroy.Core"(ptr %.loc21_39.1.temp), !dbg !18
// CHECK:STDOUT: ret void, !dbg !20
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -164,27 +164,34 @@ fn PassTemporary() {
// 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 !21 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.fd98d268aadcda21:core.Destroy.Core"(ptr %self) #1 !dbg !21 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !25
// CHECK:STDOUT: ret void, !dbg !26
// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %self), !dbg !23
// CHECK:STDOUT: ret void, !dbg !23
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !28 {
// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !25 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !32
// CHECK:STDOUT: ret void, !dbg !33
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.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 !32 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !36
// CHECK:STDOUT: ret void, !dbg !37
// 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 !35 {
// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !39 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z13make_copyablev.carbon_thunk.(ptr @_Cc.Main), !dbg !36
// CHECK:STDOUT: ret void, !dbg !38
// CHECK:STDOUT: call void @_Z13make_copyablev.carbon_thunk.(ptr @_Cc.Main), !dbg !40
// CHECK:STDOUT: ret void, !dbg !42
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z13make_copyablev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1) #4
@@ -193,6 +200,9 @@ fn PassTemporary() {
// 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: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @_ZN8CopyableD1Ev, { 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" }
@@ -200,8 +210,8 @@ fn PassTemporary() {
// 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.dbg.cu = !{!7}
// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!50}
// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!54}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -219,30 +229,34 @@ fn PassTemporary() {
// CHECK:STDOUT: !18 = !DILocation(line: 21, column: 21, scope: !17)
// CHECK:STDOUT: !19 = !DILocation(line: 21, column: 3, scope: !17)
// CHECK:STDOUT: !20 = !DILocation(line: 20, column: 1, scope: !17)
// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !6, line: 24, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !27)
// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.fd98d268aadcda21:core.Destroy.Core", scope: null, file: !6, line: 21, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !24)
// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !21, type: !8)
// CHECK:STDOUT: !25 = !DILocation(line: 25, column: 3, scope: !21)
// CHECK:STDOUT: !26 = !DILocation(line: 24, column: 1, scope: !21)
// CHECK:STDOUT: !27 = !{!22}
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !6, line: 28, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !34)
// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !8)
// CHECK:STDOUT: !32 = !DILocation(line: 29, column: 3, scope: !28)
// CHECK:STDOUT: !33 = !DILocation(line: 28, column: 1, scope: !28)
// CHECK:STDOUT: !34 = !{!29}
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !12, spFlags: DISPFlagDefinition, unit: !7)
// CHECK:STDOUT: !36 = !DILocation(line: 14, column: 23, scope: !35)
// CHECK:STDOUT: !38 = !DILocation(line: 0, scope: !35)
// CHECK:STDOUT: !39 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !40 = !{!"omnipotent char", !39, i64 0}
// CHECK:STDOUT: !41 = !{!"any pointer", !40, i64 0}
// CHECK:STDOUT: !42 = !{!"p1 _ZTS8Copyable", !41, i64 0}
// CHECK:STDOUT: !43 = !{!42, !42, i64 0}
// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !48 = !{!"int", !40, i64 0}
// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0}
// CHECK:STDOUT: !50 = !{!49, !48, i64 0}
// CHECK:STDOUT: !23 = !DILocation(line: 21, column: 21, scope: !21)
// CHECK:STDOUT: !24 = !{!22}
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !6, line: 24, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !31)
// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !8)
// CHECK:STDOUT: !29 = !DILocation(line: 25, column: 3, scope: !25)
// CHECK:STDOUT: !30 = !DILocation(line: 24, column: 1, scope: !25)
// CHECK:STDOUT: !31 = !{!26}
// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !6, line: 28, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !38)
// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !8)
// CHECK:STDOUT: !36 = !DILocation(line: 29, column: 3, scope: !32)
// CHECK:STDOUT: !37 = !DILocation(line: 28, column: 1, scope: !32)
// CHECK:STDOUT: !38 = !{!33}
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !12, spFlags: DISPFlagDefinition, unit: !7)
// CHECK:STDOUT: !40 = !DILocation(line: 14, column: 23, scope: !39)
// CHECK:STDOUT: !42 = !DILocation(line: 0, scope: !39)
// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0}
// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0}
// CHECK:STDOUT: !46 = !{!"p1 _ZTS8Copyable", !45, i64 0}
// CHECK:STDOUT: !47 = !{!46, !46, i64 0}
// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !52 = !{!"int", !44, i64 0}
// CHECK:STDOUT: !53 = !{!"__libc_errno", !52, i64 0}
// CHECK:STDOUT: !54 = !{!53, !52, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'copy_or_move.carbon'
@@ -259,17 +273,17 @@ fn PassTemporary() {
// CHECK:STDOUT: define internal void @_Z17make_copy_or_movev.carbon_thunk.(ptr noundef %return) #0 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !81
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !81
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !89
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !89
// CHECK:STDOUT: call void @_Z17make_copy_or_movev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1 %0)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !53 {
// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !57 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !55
// CHECK:STDOUT: ret void, !dbg !56
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !59
// CHECK:STDOUT: ret void, !dbg !60
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
@@ -277,8 +291,8 @@ fn PassTemporary() {
// 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 !81
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !81
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !89
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !89
// 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 @_Z17pass_copy_or_move10CopyOrMove(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp)
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
@@ -286,14 +300,14 @@ fn PassTemporary() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !57 {
// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !61 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !58
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !58
// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr %_.var), !dbg !59
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !60
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %_.var), !dbg !58
// CHECK:STDOUT: ret void, !dbg !61
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !62
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !62
// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr %_.var), !dbg !63
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !64
// CHECK:STDOUT: call void @"_CSelfDestruct.47b8ebd18f50db75:core.Destroy.Core"(ptr %_.var), !dbg !62
// CHECK:STDOUT: ret void, !dbg !65
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
@@ -301,8 +315,8 @@ fn PassTemporary() {
// 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 !81
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !81
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !89
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !89
// 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 @_Z17pass_copy_or_move10CopyOrMove(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp)
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
@@ -313,27 +327,34 @@ fn PassTemporary() {
// 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 !62 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.47b8ebd18f50db75:core.Destroy.Core"(ptr %self) #1 !dbg !66 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !66
// CHECK:STDOUT: ret void, !dbg !67
// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %self), !dbg !68
// CHECK:STDOUT: ret void, !dbg !68
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !69 {
// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !70 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !73
// CHECK:STDOUT: ret void, !dbg !74
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !74
// CHECK:STDOUT: ret void, !dbg !75
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !77 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !81
// CHECK:STDOUT: ret void, !dbg !82
// 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 !76 {
// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !84 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr @_Cc.Main), !dbg !77
// CHECK:STDOUT: ret void, !dbg !79
// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr @_Cc.Main), !dbg !85
// CHECK:STDOUT: ret void, !dbg !87
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z17make_copy_or_movev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1) #4
@@ -345,7 +366,7 @@ fn PassTemporary() {
// 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 @_ZN10CopyOrMoveD1Ev, { 2, 1, 0 }
// CHECK:STDOUT: uselistorder ptr @_Z17pass_copy_or_move10CopyOrMove, { 1, 0 }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
@@ -354,9 +375,9 @@ fn PassTemporary() {
// 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.dbg.cu = !{!52}
// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!50}
// CHECK:STDOUT: !llvm.dbg.cu = !{!56}
// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!54}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -365,40 +386,44 @@ fn PassTemporary() {
// CHECK:STDOUT: !10 = !DISubroutineType(types: !9)
// CHECK:STDOUT: !11 = !{null}
// CHECK:STDOUT: !12 = !DISubroutineType(types: !11)
// CHECK:STDOUT: !39 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !40 = !{!"omnipotent char", !39, i64 0}
// CHECK:STDOUT: !41 = !{!"any pointer", !40, i64 0}
// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !48 = !{!"int", !40, i64 0}
// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0}
// CHECK:STDOUT: !50 = !{!49, !48, i64 0}
// CHECK:STDOUT: !51 = !DIFile(filename: "copy_or_move.carbon", directory: "")
// CHECK:STDOUT: !52 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !51, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !51, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !52)
// CHECK:STDOUT: !55 = !DILocation(line: 19, column: 3, scope: !53)
// CHECK:STDOUT: !56 = !DILocation(line: 18, column: 1, scope: !53)
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !51, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !52)
// CHECK:STDOUT: !58 = !DILocation(line: 13, column: 34, scope: !57)
// CHECK:STDOUT: !59 = !DILocation(line: 23, column: 25, scope: !57)
// CHECK:STDOUT: !60 = !DILocation(line: 23, column: 3, scope: !57)
// CHECK:STDOUT: !61 = !DILocation(line: 22, column: 1, scope: !57)
// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !51, line: 26, type: !10, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !68)
// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !8)
// CHECK:STDOUT: !66 = !DILocation(line: 27, column: 3, scope: !62)
// CHECK:STDOUT: !67 = !DILocation(line: 26, column: 1, scope: !62)
// CHECK:STDOUT: !68 = !{!63}
// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !51, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !75)
// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !8)
// CHECK:STDOUT: !73 = !DILocation(line: 31, column: 3, scope: !69)
// CHECK:STDOUT: !74 = !DILocation(line: 30, column: 1, scope: !69)
// CHECK:STDOUT: !75 = !{!70}
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !51, type: !12, spFlags: DISPFlagDefinition, unit: !52)
// CHECK:STDOUT: !77 = !DILocation(line: 16, column: 25, scope: !76)
// CHECK:STDOUT: !79 = !DILocation(line: 0, scope: !76)
// CHECK:STDOUT: !80 = !{!"p1 _ZTS10CopyOrMove", !41, i64 0}
// CHECK:STDOUT: !81 = !{!80, !80, i64 0}
// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0}
// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0}
// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !52 = !{!"int", !44, i64 0}
// CHECK:STDOUT: !53 = !{!"__libc_errno", !52, i64 0}
// CHECK:STDOUT: !54 = !{!53, !52, i64 0}
// CHECK:STDOUT: !55 = !DIFile(filename: "copy_or_move.carbon", directory: "")
// CHECK:STDOUT: !56 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !55, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !55, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !56)
// CHECK:STDOUT: !59 = !DILocation(line: 19, column: 3, scope: !57)
// CHECK:STDOUT: !60 = !DILocation(line: 18, column: 1, scope: !57)
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !55, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !56)
// CHECK:STDOUT: !62 = !DILocation(line: 13, column: 34, scope: !61)
// CHECK:STDOUT: !63 = !DILocation(line: 23, column: 25, scope: !61)
// CHECK:STDOUT: !64 = !DILocation(line: 23, column: 3, scope: !61)
// CHECK:STDOUT: !65 = !DILocation(line: 22, column: 1, scope: !61)
// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.47b8ebd18f50db75:core.Destroy.Core", scope: null, file: !55, line: 13, type: !10, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !69)
// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !8)
// CHECK:STDOUT: !68 = !DILocation(line: 13, column: 34, scope: !66)
// CHECK:STDOUT: !69 = !{!67}
// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !55, line: 26, type: !10, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !76)
// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !8)
// CHECK:STDOUT: !74 = !DILocation(line: 27, column: 3, scope: !70)
// CHECK:STDOUT: !75 = !DILocation(line: 26, column: 1, scope: !70)
// CHECK:STDOUT: !76 = !{!71}
// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !55, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !83)
// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !8)
// CHECK:STDOUT: !81 = !DILocation(line: 31, column: 3, scope: !77)
// CHECK:STDOUT: !82 = !DILocation(line: 30, column: 1, scope: !77)
// CHECK:STDOUT: !83 = !{!78}
// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !55, type: !12, spFlags: DISPFlagDefinition, unit: !56)
// CHECK:STDOUT: !85 = !DILocation(line: 16, column: 25, scope: !84)
// CHECK:STDOUT: !87 = !DILocation(line: 0, scope: !84)
// CHECK:STDOUT: !88 = !{!"p1 _ZTS10CopyOrMove", !45, i64 0}
// CHECK:STDOUT: !89 = !{!88, !88, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'move_only.carbon'
@@ -415,27 +440,27 @@ fn PassTemporary() {
// CHECK:STDOUT: define internal void @_Z14make_move_onlyv.carbon_thunk.(ptr noundef %return) #0 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !97
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !97
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !109
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !109
// CHECK:STDOUT: call void @_Z14make_move_onlyv(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1 %0)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassGlobalByMove.Main() #1 !dbg !85 {
// CHECK:STDOUT: define void @_CPassGlobalByMove.Main() #1 !dbg !93 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !86
// CHECK:STDOUT: ret void, !dbg !94
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !87 {
// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !95 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !88
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !88
// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr %_.var), !dbg !89
// CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !90
// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %_.var), !dbg !88
// CHECK:STDOUT: ret void, !dbg !91
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !96
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !96
// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr %_.var), !dbg !97
// CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !98
// CHECK:STDOUT: call void @"_CSelfDestruct.48e50e337b0b966c:core.Destroy.Core"(ptr %_.var), !dbg !96
// CHECK:STDOUT: ret void, !dbg !99
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
@@ -443,8 +468,8 @@ fn PassTemporary() {
// 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 !97
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !97
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !109
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !109
// 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 @_Z14pass_move_only8MoveOnly(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp)
// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1
@@ -454,14 +479,21 @@ fn PassTemporary() {
// 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: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e50e337b0b966c:core.Destroy.Core"(ptr %self) #1 !dbg !100 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %self), !dbg !102
// CHECK:STDOUT: ret void, !dbg !102
// 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 !92 {
// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !104 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr @_Cc.Main), !dbg !93
// CHECK:STDOUT: ret void, !dbg !95
// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr @_Cc.Main), !dbg !105
// CHECK:STDOUT: ret void, !dbg !107
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z14make_move_onlyv(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1) #4
@@ -479,35 +511,42 @@ fn PassTemporary() {
// 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.dbg.cu = !{!84}
// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!50}
// CHECK:STDOUT: !llvm.dbg.cu = !{!92}
// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!54}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !9 = !{null, !8}
// CHECK:STDOUT: !10 = !DISubroutineType(types: !9)
// CHECK:STDOUT: !11 = !{null}
// CHECK:STDOUT: !12 = !DISubroutineType(types: !11)
// CHECK:STDOUT: !39 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !40 = !{!"omnipotent char", !39, i64 0}
// CHECK:STDOUT: !41 = !{!"any pointer", !40, i64 0}
// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !48 = !{!"int", !40, i64 0}
// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0}
// CHECK:STDOUT: !50 = !{!49, !48, i64 0}
// CHECK:STDOUT: !83 = !DIFile(filename: "move_only.carbon", directory: "")
// CHECK:STDOUT: !84 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !83, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !83, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !84)
// CHECK:STDOUT: !86 = !DILocation(line: 22, column: 1, scope: !85)
// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !83, line: 27, type: !12, spFlags: DISPFlagDefinition, unit: !84)
// CHECK:STDOUT: !88 = !DILocation(line: 17, column: 29, scope: !87)
// CHECK:STDOUT: !89 = !DILocation(line: 28, column: 22, scope: !87)
// CHECK:STDOUT: !90 = !DILocation(line: 28, column: 3, scope: !87)
// CHECK:STDOUT: !91 = !DILocation(line: 27, column: 1, scope: !87)
// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !83, type: !12, spFlags: DISPFlagDefinition, unit: !84)
// CHECK:STDOUT: !93 = !DILocation(line: 20, column: 23, scope: !92)
// CHECK:STDOUT: !95 = !DILocation(line: 0, scope: !92)
// CHECK:STDOUT: !96 = !{!"p1 _ZTS8MoveOnly", !41, i64 0}
// CHECK:STDOUT: !97 = !{!96, !96, i64 0}
// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0}
// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0}
// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !52 = !{!"int", !44, i64 0}
// CHECK:STDOUT: !53 = !{!"__libc_errno", !52, i64 0}
// CHECK:STDOUT: !54 = !{!53, !52, i64 0}
// CHECK:STDOUT: !91 = !DIFile(filename: "move_only.carbon", directory: "")
// CHECK:STDOUT: !92 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !91, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !91, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !92)
// CHECK:STDOUT: !94 = !DILocation(line: 22, column: 1, scope: !93)
// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !91, line: 27, type: !12, spFlags: DISPFlagDefinition, unit: !92)
// CHECK:STDOUT: !96 = !DILocation(line: 17, column: 29, scope: !95)
// CHECK:STDOUT: !97 = !DILocation(line: 28, column: 22, scope: !95)
// CHECK:STDOUT: !98 = !DILocation(line: 28, column: 3, scope: !95)
// CHECK:STDOUT: !99 = !DILocation(line: 27, column: 1, scope: !95)
// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e50e337b0b966c:core.Destroy.Core", scope: null, file: !91, line: 17, type: !10, spFlags: DISPFlagDefinition, unit: !92, retainedNodes: !103)
// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !8)
// CHECK:STDOUT: !102 = !DILocation(line: 17, column: 29, scope: !100)
// CHECK:STDOUT: !103 = !{!101}
// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !91, type: !12, spFlags: DISPFlagDefinition, unit: !92)
// CHECK:STDOUT: !105 = !DILocation(line: 20, column: 23, scope: !104)
// CHECK:STDOUT: !107 = !DILocation(line: 0, scope: !104)
// CHECK:STDOUT: !108 = !{!"p1 _ZTS8MoveOnly", !45, i64 0}
// CHECK:STDOUT: !109 = !{!108, !108, i64 0}
// CHECK:STDOUT:
@@ -79,8 +79,9 @@ fn DestroyAIndirectly() {
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc17, ptr align 1 @Nontrivial.val.loc17_3, i64 0, i1 false), !dbg !44
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc18), !dbg !46
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc18, ptr align 1 @Constexpr.val.loc18_3, i64 0, i1 false), !dbg !46
// CHECK:STDOUT: call void @_ZN9ConstexprD2Ev(ptr %_.var.loc18), !dbg !46
// CHECK:STDOUT: call void @_ZN10NontrivialD1Ev(ptr %_.var.loc17), !dbg !44
// CHECK:STDOUT: call void @"_CSelfDestruct.dec26c21eef1f685:core.Destroy.Core"(ptr %_.var.loc18), !dbg !46
// CHECK:STDOUT: call void @"_CSelfDestruct.c1d87436718894ba:core.Destroy.Core"(ptr %_.var.loc17), !dbg !44
// CHECK:STDOUT: call void @"_CSelfDestruct.74d7ad7746f17264:core.Destroy.Core"(ptr %_.var.loc16), !dbg !42
// CHECK:STDOUT: ret void, !dbg !48
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -88,82 +89,102 @@ fn DestroyAIndirectly() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN9ConstexprD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #1 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !98
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !110
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp"(ptr %self) #2 !dbg !49 {
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dec26c21eef1f685:core.Destroy.Core"(ptr %self) #0 !dbg !49 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN9ConstexprD2Ev(ptr %self), !dbg !52
// CHECK:STDOUT: ret void, !dbg !52
// CHECK:STDOUT: call void @_ZN9ConstexprD2Ev(ptr %self), !dbg !51
// CHECK:STDOUT: ret void, !dbg !51
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp"(ptr %self) #2 !dbg !53 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN9ConstexprD2Ev(ptr %self), !dbg !56
// CHECK:STDOUT: ret void, !dbg !56
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: declare void @_ZN10NontrivialD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp"(ptr %self) #2 !dbg !54 {
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c1d87436718894ba:core.Destroy.Core"(ptr %self) #0 !dbg !58 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !57
// CHECK:STDOUT: call void @_ZN10NontrivialD1Ev(ptr %self), !dbg !60
// CHECK:STDOUT: ret void, !dbg !60
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @"_CMake.Trivial.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !59 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.74d7ad7746f17264:core.Destroy.Core"(ptr %self) #0 !dbg !62 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN7TrivialC1Ev.carbon_thunk.(ptr %return), !dbg !62
// CHECK:STDOUT: ret void, !dbg !63
// CHECK:STDOUT: ret void, !dbg !64
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp"(ptr %self) #2 !dbg !66 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !69
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @"_CMake.Trivial.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !71 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN7TrivialC1Ev.carbon_thunk.(ptr %return), !dbg !74
// CHECK:STDOUT: ret void, !dbg !75
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
// CHECK:STDOUT: define internal void @_ZN7TrivialC1Ev.carbon_thunk.(ptr noundef %return) #4 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !100
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !100
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !112
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !112
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @"_CMake.Nontrivial.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !64 {
// CHECK:STDOUT: define void @"_CMake.Nontrivial.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !76 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN10NontrivialC1Ev.carbon_thunk.(ptr %return), !dbg !67
// CHECK:STDOUT: ret void, !dbg !68
// CHECK:STDOUT: call void @_ZN10NontrivialC1Ev.carbon_thunk.(ptr %return), !dbg !79
// CHECK:STDOUT: ret void, !dbg !80
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
// CHECK:STDOUT: define internal void @_ZN10NontrivialC1Ev.carbon_thunk.(ptr noundef %return) #4 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !102
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !102
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !114
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !114
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @"_CMake.Constexpr.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !69 {
// CHECK:STDOUT: define void @"_CMake.Constexpr.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !81 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN9ConstexprC1Ev.carbon_thunk.(ptr %return), !dbg !72
// CHECK:STDOUT: ret void, !dbg !73
// CHECK:STDOUT: call void @_ZN9ConstexprC1Ev.carbon_thunk.(ptr %return), !dbg !84
// CHECK:STDOUT: ret void, !dbg !85
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
// CHECK:STDOUT: define internal void @_ZN9ConstexprC1Ev.carbon_thunk.(ptr noundef %return) #4 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !98
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !98
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !110
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !110
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CDestroyAIndirectly.Main() #0 !dbg !74 {
// CHECK:STDOUT: define void @_CDestroyAIndirectly.Main() #0 !dbg !86 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.2a28a415478a31f5(), !dbg !75
// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.a0f524e76111d8a1(), !dbg !76
// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.bf648cc7ac7f04db(), !dbg !77
// CHECK:STDOUT: ret void, !dbg !78
// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.bbfc87135555afbb(), !dbg !87
// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.cbf5e6d817f75fdf(), !dbg !88
// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.310c2661ae23419f(), !dbg !89
// CHECK:STDOUT: ret void, !dbg !90
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -173,33 +194,33 @@ fn DestroyAIndirectly() {
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #5
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.2a28a415478a31f5() #0 !dbg !79 {
// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.bbfc87135555afbb() #0 !dbg !91 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !80
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !80
// CHECK:STDOUT: call void @"_CMake.Trivial.Cpp:Make.Main"(ptr %a.var), !dbg !81
// CHECK:STDOUT: call void @"_COp:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp"(ptr %a.var), !dbg !80
// CHECK:STDOUT: ret void, !dbg !83
// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !92
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !92
// CHECK:STDOUT: call void @"_CMake.Trivial.Cpp:Make.Main"(ptr %a.var), !dbg !93
// CHECK:STDOUT: call void @"_CSelfDestruct.74d7ad7746f17264:core.Destroy.Core"(ptr %a.var), !dbg !92
// CHECK:STDOUT: ret void, !dbg !95
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.a0f524e76111d8a1() #0 !dbg !84 {
// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.cbf5e6d817f75fdf() #0 !dbg !96 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !85
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !85
// CHECK:STDOUT: call void @"_CMake.Nontrivial.Cpp:Make.Main"(ptr %a.var), !dbg !86
// CHECK:STDOUT: call void @_ZN10NontrivialD1Ev(ptr %a.var), !dbg !85
// CHECK:STDOUT: ret void, !dbg !88
// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !97
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !97
// CHECK:STDOUT: call void @"_CMake.Nontrivial.Cpp:Make.Main"(ptr %a.var), !dbg !98
// CHECK:STDOUT: call void @"_CSelfDestruct.c1d87436718894ba:core.Destroy.Core"(ptr %a.var), !dbg !97
// CHECK:STDOUT: ret void, !dbg !100
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.bf648cc7ac7f04db() #0 !dbg !89 {
// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.310c2661ae23419f() #0 !dbg !101 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !90
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !90
// CHECK:STDOUT: call void @"_CMake.Constexpr.Cpp:Make.Main"(ptr %a.var), !dbg !91
// CHECK:STDOUT: call void @"_COp:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp"(ptr %a.var), !dbg !90
// CHECK:STDOUT: ret void, !dbg !93
// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !102
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !102
// CHECK:STDOUT: call void @"_CMake.Constexpr.Cpp:Make.Main"(ptr %a.var), !dbg !103
// CHECK:STDOUT: call void @"_CSelfDestruct.dec26c21eef1f685:core.Destroy.Core"(ptr %a.var), !dbg !102
// CHECK:STDOUT: ret void, !dbg !105
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
@@ -215,8 +236,8 @@ fn DestroyAIndirectly() {
// CHECK:STDOUT: attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!33}
// CHECK:STDOUT: !llvm.module.flags = !{!103, !104, !105, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!108}
// CHECK:STDOUT: !llvm.module.flags = !{!115, !116, !117, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!120}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -234,53 +255,65 @@ fn DestroyAIndirectly() {
// CHECK:STDOUT: !44 = !DILocation(line: 17, column: 3, scope: !41)
// CHECK:STDOUT: !46 = !DILocation(line: 18, column: 3, scope: !41)
// CHECK:STDOUT: !48 = !DILocation(line: 15, column: 1, scope: !41)
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp", scope: null, file: !32, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !53)
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dec26c21eef1f685:core.Destroy.Core", scope: null, file: !32, line: 18, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !52)
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !36)
// CHECK:STDOUT: !52 = !DILocation(line: 11, column: 13, scope: !49)
// CHECK:STDOUT: !53 = !{!50}
// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp", scope: null, file: !32, line: 6, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !58)
// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !36)
// CHECK:STDOUT: !57 = !DILocation(line: 6, column: 8, scope: !54)
// CHECK:STDOUT: !58 = !{!55}
// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Trivial.Cpp:Make.Main", scope: null, file: !32, line: 25, type: !40, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !62 = !DILocation(line: 25, column: 30, scope: !59)
// CHECK:STDOUT: !63 = !DILocation(line: 25, column: 23, scope: !59)
// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Nontrivial.Cpp:Make.Main", scope: null, file: !32, line: 28, type: !40, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !67 = !DILocation(line: 28, column: 30, scope: !64)
// CHECK:STDOUT: !68 = !DILocation(line: 28, column: 23, scope: !64)
// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Constexpr.Cpp:Make.Main", scope: null, file: !32, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !72 = !DILocation(line: 31, column: 30, scope: !69)
// CHECK:STDOUT: !73 = !DILocation(line: 31, column: 23, scope: !69)
// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "DestroyAIndirectly", linkageName: "_CDestroyAIndirectly.Main", scope: null, file: !32, line: 38, type: !35, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !75 = !DILocation(line: 39, column: 3, scope: !74)
// CHECK:STDOUT: !76 = !DILocation(line: 40, column: 3, scope: !74)
// CHECK:STDOUT: !77 = !DILocation(line: 41, column: 3, scope: !74)
// CHECK:STDOUT: !78 = !DILocation(line: 38, column: 1, scope: !74)
// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.2a28a415478a31f5", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !80 = !DILocation(line: 35, column: 3, scope: !79)
// CHECK:STDOUT: !81 = !DILocation(line: 35, column: 21, scope: !79)
// CHECK:STDOUT: !83 = !DILocation(line: 34, column: 1, scope: !79)
// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.a0f524e76111d8a1", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !85 = !DILocation(line: 35, column: 3, scope: !84)
// CHECK:STDOUT: !86 = !DILocation(line: 35, column: 21, scope: !84)
// CHECK:STDOUT: !88 = !DILocation(line: 34, column: 1, scope: !84)
// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.bf648cc7ac7f04db", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !90 = !DILocation(line: 35, column: 3, scope: !89)
// CHECK:STDOUT: !91 = !DILocation(line: 35, column: 21, scope: !89)
// CHECK:STDOUT: !93 = !DILocation(line: 34, column: 1, scope: !89)
// CHECK:STDOUT: !94 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !95 = !{!"omnipotent char", !94, i64 0}
// CHECK:STDOUT: !96 = !{!"any pointer", !95, i64 0}
// CHECK:STDOUT: !97 = !{!"p1 _ZTS9Constexpr", !96, i64 0}
// CHECK:STDOUT: !98 = !{!97, !97, i64 0}
// CHECK:STDOUT: !99 = !{!"p1 _ZTS7Trivial", !96, i64 0}
// CHECK:STDOUT: !100 = !{!99, !99, i64 0}
// CHECK:STDOUT: !101 = !{!"p1 _ZTS10Nontrivial", !96, i64 0}
// CHECK:STDOUT: !102 = !{!101, !101, i64 0}
// CHECK:STDOUT: !103 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !104 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !105 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !106 = !{!"int", !95, i64 0}
// CHECK:STDOUT: !107 = !{!"__libc_errno", !106, i64 0}
// CHECK:STDOUT: !108 = !{!107, !106, i64 0}
// CHECK:STDOUT: !51 = !DILocation(line: 18, column: 3, scope: !49)
// CHECK:STDOUT: !52 = !{!50}
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp", scope: null, file: !32, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !57)
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !36)
// CHECK:STDOUT: !56 = !DILocation(line: 11, column: 13, scope: !53)
// CHECK:STDOUT: !57 = !{!54}
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c1d87436718894ba:core.Destroy.Core", scope: null, file: !32, line: 17, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !61)
// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !36)
// CHECK:STDOUT: !60 = !DILocation(line: 17, column: 3, scope: !58)
// CHECK:STDOUT: !61 = !{!59}
// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.74d7ad7746f17264:core.Destroy.Core", scope: null, file: !32, line: 16, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !65)
// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !36)
// CHECK:STDOUT: !64 = !DILocation(line: 16, column: 3, scope: !62)
// CHECK:STDOUT: !65 = !{!63}
// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp", scope: null, file: !32, line: 6, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !70)
// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !36)
// CHECK:STDOUT: !69 = !DILocation(line: 6, column: 8, scope: !66)
// CHECK:STDOUT: !70 = !{!67}
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Trivial.Cpp:Make.Main", scope: null, file: !32, line: 25, type: !40, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !74 = !DILocation(line: 25, column: 30, scope: !71)
// CHECK:STDOUT: !75 = !DILocation(line: 25, column: 23, scope: !71)
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Nontrivial.Cpp:Make.Main", scope: null, file: !32, line: 28, type: !40, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !79 = !DILocation(line: 28, column: 30, scope: !76)
// CHECK:STDOUT: !80 = !DILocation(line: 28, column: 23, scope: !76)
// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Constexpr.Cpp:Make.Main", scope: null, file: !32, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !84 = !DILocation(line: 31, column: 30, scope: !81)
// CHECK:STDOUT: !85 = !DILocation(line: 31, column: 23, scope: !81)
// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "DestroyAIndirectly", linkageName: "_CDestroyAIndirectly.Main", scope: null, file: !32, line: 38, type: !35, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !87 = !DILocation(line: 39, column: 3, scope: !86)
// CHECK:STDOUT: !88 = !DILocation(line: 40, column: 3, scope: !86)
// CHECK:STDOUT: !89 = !DILocation(line: 41, column: 3, scope: !86)
// CHECK:STDOUT: !90 = !DILocation(line: 38, column: 1, scope: !86)
// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.bbfc87135555afbb", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !92 = !DILocation(line: 35, column: 3, scope: !91)
// CHECK:STDOUT: !93 = !DILocation(line: 35, column: 21, scope: !91)
// CHECK:STDOUT: !95 = !DILocation(line: 34, column: 1, scope: !91)
// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.cbf5e6d817f75fdf", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !97 = !DILocation(line: 35, column: 3, scope: !96)
// CHECK:STDOUT: !98 = !DILocation(line: 35, column: 21, scope: !96)
// CHECK:STDOUT: !100 = !DILocation(line: 34, column: 1, scope: !96)
// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.310c2661ae23419f", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !102 = !DILocation(line: 35, column: 3, scope: !101)
// CHECK:STDOUT: !103 = !DILocation(line: 35, column: 21, scope: !101)
// CHECK:STDOUT: !105 = !DILocation(line: 34, column: 1, scope: !101)
// CHECK:STDOUT: !106 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !107 = !{!"omnipotent char", !106, i64 0}
// CHECK:STDOUT: !108 = !{!"any pointer", !107, i64 0}
// CHECK:STDOUT: !109 = !{!"p1 _ZTS9Constexpr", !108, i64 0}
// CHECK:STDOUT: !110 = !{!109, !109, i64 0}
// CHECK:STDOUT: !111 = !{!"p1 _ZTS7Trivial", !108, i64 0}
// CHECK:STDOUT: !112 = !{!111, !111, i64 0}
// CHECK:STDOUT: !113 = !{!"p1 _ZTS10Nontrivial", !108, i64 0}
// CHECK:STDOUT: !114 = !{!113, !113, i64 0}
// CHECK:STDOUT: !115 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !116 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !117 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !118 = !{!"int", !107, i64 0}
// CHECK:STDOUT: !119 = !{!"__libc_errno", !118, i64 0}
// CHECK:STDOUT: !120 = !{!119, !118, i64 0}
// CHECK:STDOUT:
@@ -104,53 +104,73 @@ fn DoThing() {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Derived.Main"(ptr %self) #3 !dbg !60 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !62
// CHECK:STDOUT: call void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !62
// CHECK:STDOUT: ret void, !dbg !62
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.0a0b9df20a60c6f6:core.Destroy.Core"(ptr %self) #2 !dbg !64 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.352b8f386f44a614:core.Destroy.Core"(ptr %self) #2 !dbg !64 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !66
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #2 !dbg !68 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0a0b9df20a60c6f6:core.Destroy.Core"(ptr %self) #2 !dbg !68 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !70
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_Cfunc__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !72 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0a0b9df20a60c6f6:core.Destroy.Core"(ptr %self) #2 !dbg !72 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Cfunc.Derived.Main(ptr %self), !dbg !74
// CHECK:STDOUT: call void @"_CSubobjectDestroy.0a0b9df20a60c6f6:core.Destroy.Core"(ptr %self), !dbg !74
// CHECK:STDOUT: ret void, !dbg !74
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_Cother_func__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !76 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #2 !dbg !76 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %Derived.other_func.call.vtable = load ptr, ptr %self, align 8, !dbg !78
// CHECK:STDOUT: %Derived.other_func.call = call ptr @llvm.load.relative.i32(ptr %Derived.other_func.call.vtable, i32 8), !dbg !78
// CHECK:STDOUT: call void %Derived.other_func.call(ptr %self), !dbg !78
// CHECK:STDOUT: ret void, !dbg !78
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CDoThing.Main() #2 !dbg !80 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #2 !dbg !80 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %d.var = alloca { [16 x i8] }, align 8, !dbg !81
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %d.var), !dbg !81
// CHECK:STDOUT: %.loc31_44.1.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !82
// CHECK:STDOUT: call void @_ZN4BaseC1Ev.carbon_thunk.(ptr %.loc31_44.1.base), !dbg !83
// CHECK:STDOUT: %.loc31_44.7.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !82
// CHECK:STDOUT: %.loc31_44.8.base = getelementptr inbounds nuw [16 x i8], ptr %.loc31_44.7.base, i32 0, i32 0, !dbg !82
// CHECK:STDOUT: %.loc31_44.9.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc31_44.8.base, i32 0, i32 0, !dbg !82
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN6Carbon7DerivedE, i32 0, i32 0, i32 2), ptr %.loc31_44.9.vptr, align 8, !dbg !82
// CHECK:STDOUT: %.loc32_11.2.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !86
// CHECK:STDOUT: call void @_Z3UseR4Base(ptr %.loc32_11.2.base), !dbg !87
// CHECK:STDOUT: call void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %d.var), !dbg !81
// CHECK:STDOUT: ret void, !dbg !88
// CHECK:STDOUT: call void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !82
// CHECK:STDOUT: ret void, !dbg !82
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_Cfunc__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !84 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Cfunc.Derived.Main(ptr %self), !dbg !86
// CHECK:STDOUT: ret void, !dbg !86
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_Cother_func__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !88 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %Derived.other_func.call.vtable = load ptr, ptr %self, align 8, !dbg !90
// CHECK:STDOUT: %Derived.other_func.call = call ptr @llvm.load.relative.i32(ptr %Derived.other_func.call.vtable, i32 8), !dbg !90
// CHECK:STDOUT: call void %Derived.other_func.call(ptr %self), !dbg !90
// CHECK:STDOUT: ret void, !dbg !90
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CDoThing.Main() #2 !dbg !92 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %d.var = alloca { [16 x i8] }, align 8, !dbg !93
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %d.var), !dbg !93
// CHECK:STDOUT: %.loc31_44.1.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !94
// CHECK:STDOUT: call void @_ZN4BaseC1Ev.carbon_thunk.(ptr %.loc31_44.1.base), !dbg !95
// CHECK:STDOUT: %.loc31_44.7.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !94
// CHECK:STDOUT: %.loc31_44.8.base = getelementptr inbounds nuw [16 x i8], ptr %.loc31_44.7.base, i32 0, i32 0, !dbg !94
// CHECK:STDOUT: %.loc31_44.9.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc31_44.8.base, i32 0, i32 0, !dbg !94
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN6Carbon7DerivedE, i32 0, i32 0, i32 2), ptr %.loc31_44.9.vptr, align 8, !dbg !94
// CHECK:STDOUT: %.loc32_11.2.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !98
// CHECK:STDOUT: call void @_Z3UseR4Base(ptr %.loc32_11.2.base), !dbg !99
// CHECK:STDOUT: call void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %d.var), !dbg !93
// CHECK:STDOUT: ret void, !dbg !100
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
@@ -173,7 +193,7 @@ fn DoThing() {
// CHECK:STDOUT: define internal void @_ZNR6Carbon7Derived4funcEv(ptr noundef nonnull align 8 dereferenceable(12) %this) unnamed_addr #4 align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !106
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @_Cfunc__carbon_thunk.Derived.Main(ptr noundef nonnull align 8 dereferenceable(12) %this1)
// CHECK:STDOUT: ret void
@@ -183,7 +203,7 @@ fn DoThing() {
// CHECK:STDOUT: define internal void @_ZNK6Carbon7Derived10other_funcEv(ptr noundef nonnull align 8 dereferenceable(12) %this) unnamed_addr #4 align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !106
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @_Cother_func__carbon_thunk.Derived.Main(ptr noundef nonnull align 8 dereferenceable(12) %this1)
// CHECK:STDOUT: ret void
@@ -196,7 +216,7 @@ fn DoThing() {
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !4
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @_ZN11FurtherBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this1) #2
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTV4Base, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !90
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTV4Base, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !102
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -204,9 +224,9 @@ fn DoThing() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11FurtherBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #7 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !92
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !104
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV11FurtherBase, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !90
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV11FurtherBase, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !102
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -223,8 +243,8 @@ fn DoThing() {
// CHECK:STDOUT: attributes #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!38}
// CHECK:STDOUT: !llvm.module.flags = !{!99, !100, !101, !7, !8}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!103}
// CHECK:STDOUT: !llvm.module.flags = !{!111, !112, !113, !7, !8}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!115}
// CHECK:STDOUT:
// CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0}
@@ -256,39 +276,51 @@ fn DoThing() {
// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !40)
// CHECK:STDOUT: !62 = !DILocation(line: 22, column: 1, scope: !60)
// CHECK:STDOUT: !63 = !{!61}
// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0a0b9df20a60c6f6:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !67)
// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.352b8f386f44a614:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !67)
// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !40)
// CHECK:STDOUT: !66 = !DILocation(line: 22, column: 1, scope: !64)
// CHECK:STDOUT: !67 = !{!65}
// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !71)
// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0a0b9df20a60c6f6:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !71)
// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !40)
// CHECK:STDOUT: !70 = !DILocation(line: 22, column: 1, scope: !68)
// CHECK:STDOUT: !71 = !{!69}
// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "func__carbon_thunk", linkageName: "_Cfunc__carbon_thunk.Derived.Main", scope: null, file: !37, line: 26, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !75)
// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0a0b9df20a60c6f6:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !75)
// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !40)
// CHECK:STDOUT: !74 = !DILocation(line: 26, column: 3, scope: !72)
// CHECK:STDOUT: !74 = !DILocation(line: 22, column: 1, scope: !72)
// CHECK:STDOUT: !75 = !{!73}
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "other_func__carbon_thunk", linkageName: "_Cother_func__carbon_thunk.Derived.Main", scope: null, file: !37, line: 24, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !79)
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !79)
// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !40)
// CHECK:STDOUT: !78 = !DILocation(line: 24, column: 3, scope: !76)
// CHECK:STDOUT: !78 = !DILocation(line: 22, column: 1, scope: !76)
// CHECK:STDOUT: !79 = !{!77}
// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "DoThing", linkageName: "_CDoThing.Main", scope: null, file: !37, line: 30, type: !44, spFlags: DISPFlagDefinition, unit: !38)
// CHECK:STDOUT: !81 = !DILocation(line: 31, column: 3, scope: !80)
// CHECK:STDOUT: !82 = !DILocation(line: 31, column: 20, scope: !80)
// CHECK:STDOUT: !83 = !DILocation(line: 31, column: 29, scope: !80)
// CHECK:STDOUT: !86 = !DILocation(line: 32, column: 11, scope: !80)
// CHECK:STDOUT: !87 = !DILocation(line: 32, column: 3, scope: !80)
// CHECK:STDOUT: !88 = !DILocation(line: 30, column: 1, scope: !80)
// CHECK:STDOUT: !89 = !{!"vtable pointer", !0, i64 0}
// CHECK:STDOUT: !90 = !{!89, !89, i64 0}
// CHECK:STDOUT: !91 = !{!"p1 _ZTS11FurtherBase", !2, i64 0}
// CHECK:STDOUT: !92 = !{!91, !91, i64 0}
// CHECK:STDOUT: !93 = !{!"p1 _ZTSN6Carbon7DerivedE", !2, i64 0}
// CHECK:STDOUT: !94 = !{!93, !93, i64 0}
// CHECK:STDOUT: !96 = !{!"int", !1, i64 0}
// CHECK:STDOUT: !99 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !100 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !101 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !102 = !{!"__libc_errno", !96, i64 0}
// CHECK:STDOUT: !103 = !{!102, !96, i64 0}
// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !83)
// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !40)
// CHECK:STDOUT: !82 = !DILocation(line: 22, column: 1, scope: !80)
// CHECK:STDOUT: !83 = !{!81}
// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "func__carbon_thunk", linkageName: "_Cfunc__carbon_thunk.Derived.Main", scope: null, file: !37, line: 26, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !87)
// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !40)
// CHECK:STDOUT: !86 = !DILocation(line: 26, column: 3, scope: !84)
// CHECK:STDOUT: !87 = !{!85}
// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "other_func__carbon_thunk", linkageName: "_Cother_func__carbon_thunk.Derived.Main", scope: null, file: !37, line: 24, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !91)
// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !40)
// CHECK:STDOUT: !90 = !DILocation(line: 24, column: 3, scope: !88)
// CHECK:STDOUT: !91 = !{!89}
// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "DoThing", linkageName: "_CDoThing.Main", scope: null, file: !37, line: 30, type: !44, spFlags: DISPFlagDefinition, unit: !38)
// CHECK:STDOUT: !93 = !DILocation(line: 31, column: 3, scope: !92)
// CHECK:STDOUT: !94 = !DILocation(line: 31, column: 20, scope: !92)
// CHECK:STDOUT: !95 = !DILocation(line: 31, column: 29, scope: !92)
// CHECK:STDOUT: !98 = !DILocation(line: 32, column: 11, scope: !92)
// CHECK:STDOUT: !99 = !DILocation(line: 32, column: 3, scope: !92)
// CHECK:STDOUT: !100 = !DILocation(line: 30, column: 1, scope: !92)
// CHECK:STDOUT: !101 = !{!"vtable pointer", !0, i64 0}
// CHECK:STDOUT: !102 = !{!101, !101, i64 0}
// CHECK:STDOUT: !103 = !{!"p1 _ZTS11FurtherBase", !2, i64 0}
// CHECK:STDOUT: !104 = !{!103, !103, i64 0}
// CHECK:STDOUT: !105 = !{!"p1 _ZTSN6Carbon7DerivedE", !2, i64 0}
// CHECK:STDOUT: !106 = !{!105, !105, i64 0}
// CHECK:STDOUT: !108 = !{!"int", !1, i64 0}
// CHECK:STDOUT: !111 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !112 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !113 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !114 = !{!"__libc_errno", !108, i64 0}
// CHECK:STDOUT: !115 = !{!114, !108, i64 0}
// CHECK:STDOUT:
@@ -334,10 +334,10 @@ fn F(ref r: Cpp.RefSelfA) {
// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !82
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !80
// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !79
// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !80
// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !80
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !82
// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !81
// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !82
// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !82
// CHECK:STDOUT: ret void, !dbg !83
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -346,32 +346,45 @@ fn F(ref r: Cpp.RefSelfA) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: %c.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !90
// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !92
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !90, !nonnull !42
// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !92
// CHECK:STDOUT: %2 = load i8, ptr %1, align 1, !tbaa !94
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !98
// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !100
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !98, !nonnull !42
// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !100
// CHECK:STDOUT: %2 = load i8, ptr %1, align 1, !tbaa !102
// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef signext %2)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !85 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core"(ptr %self) #0 !dbg !85 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !87
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !89 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !91
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !93 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self), !dbg !95
// CHECK:STDOUT: ret void, !dbg !95
// 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: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %c.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %struct.NeedThunk, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !90
// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !92
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !90
// CHECK:STDOUT: %2 = load ptr, ptr %c.addr, align 8, !tbaa !92
// CHECK:STDOUT: %3 = load i8, ptr %2, align 1, !tbaa !94
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !98
// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !100
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !98
// CHECK:STDOUT: %2 = load ptr, ptr %c.addr, align 8, !tbaa !100
// CHECK:STDOUT: %3 = load i8, ptr %2, align 1, !tbaa !102
// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a(i8 noundef signext %3)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -384,7 +397,7 @@ fn F(ref r: Cpp.RefSelfA) {
// CHECK:STDOUT: declare void @_ZNH9NeedThunk8ExplicitES_a(i8 noundef signext) #3
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @"_COp.4954785a8b134801:core.Destroy.Core", { 1, 0 }
// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core", { 1, 0 }
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
@@ -424,15 +437,23 @@ fn F(ref r: Cpp.RefSelfA) {
// CHECK:STDOUT: !82 = !DILocation(line: 8, column: 14, scope: !76)
// CHECK:STDOUT: !83 = !DILocation(line: 6, column: 1, scope: !76)
// CHECK:STDOUT: !84 = !{!77}
// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4954785a8b134801:core.Destroy.Core", scope: null, file: !69, line: 7, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !88)
// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core", scope: null, file: !69, line: 7, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !88)
// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !71)
// CHECK:STDOUT: !87 = !DILocation(line: 7, column: 14, scope: !85)
// CHECK:STDOUT: !88 = !{!86}
// CHECK:STDOUT: !89 = !{!"p1 _ZTS9NeedThunk", !36, i64 0}
// CHECK:STDOUT: !90 = !{!89, !89, i64 0}
// CHECK:STDOUT: !91 = !{!"p1 omnipotent char", !36, i64 0}
// CHECK:STDOUT: !92 = !{!91, !91, i64 0}
// CHECK:STDOUT: !94 = !{!35, !35, i64 0}
// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core", scope: null, file: !69, line: 7, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !92)
// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !71)
// CHECK:STDOUT: !91 = !DILocation(line: 7, column: 14, scope: !89)
// CHECK:STDOUT: !92 = !{!90}
// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4954785a8b134801:core.Destroy.Core", scope: null, file: !69, line: 7, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !96)
// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !71)
// CHECK:STDOUT: !95 = !DILocation(line: 7, column: 14, scope: !93)
// CHECK:STDOUT: !96 = !{!94}
// CHECK:STDOUT: !97 = !{!"p1 _ZTS9NeedThunk", !36, i64 0}
// CHECK:STDOUT: !98 = !{!97, !97, i64 0}
// CHECK:STDOUT: !99 = !{!"p1 omnipotent char", !36, i64 0}
// CHECK:STDOUT: !100 = !{!99, !99, i64 0}
// CHECK:STDOUT: !102 = !{!35, !35, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'call_with_ref_self.carbon'
@@ -441,10 +462,10 @@ fn F(ref r: Cpp.RefSelfA) {
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF.Main(ptr %r) #0 !dbg !99 {
// CHECK:STDOUT: define void @_CF.Main(ptr %r) #0 !dbg !107 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN8RefSelfA1fEii(ptr %r, i32 1, i32 2), !dbg !102
// CHECK:STDOUT: ret void, !dbg !103
// CHECK:STDOUT: call void @_ZN8RefSelfA1fEii(ptr %r, i32 1, i32 2), !dbg !110
// CHECK:STDOUT: ret void, !dbg !111
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_ZN8RefSelfA1fEii(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) #1
@@ -452,7 +473,7 @@ fn F(ref r: Cpp.RefSelfA) {
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!96}
// CHECK:STDOUT: !llvm.dbg.cu = !{!104}
// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!49}
// CHECK:STDOUT:
@@ -469,11 +490,11 @@ fn F(ref r: Cpp.RefSelfA) {
// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !48 = !{!"__libc_errno", !40, i64 0}
// CHECK:STDOUT: !49 = !{!48, !40, i64 0}
// CHECK:STDOUT: !95 = !DIFile(filename: "call_with_ref_self.carbon", directory: "")
// CHECK:STDOUT: !96 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !95, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !95, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !96, retainedNodes: !104)
// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !21)
// CHECK:STDOUT: !102 = !DILocation(line: 12, column: 3, scope: !99)
// CHECK:STDOUT: !103 = !DILocation(line: 11, column: 1, scope: !99)
// CHECK:STDOUT: !104 = !{!100}
// CHECK:STDOUT: !103 = !DIFile(filename: "call_with_ref_self.carbon", directory: "")
// CHECK:STDOUT: !104 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !103, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !103, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !112)
// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !21)
// CHECK:STDOUT: !110 = !DILocation(line: 12, column: 3, scope: !107)
// CHECK:STDOUT: !111 = !DILocation(line: 11, column: 1, scope: !107)
// CHECK:STDOUT: !112 = !{!108}
// CHECK:STDOUT:
@@ -127,6 +127,7 @@ fn AccessD(d: Cpp.D) -> i32 {
// CHECK:STDOUT: %_.var = alloca [40 x i8], align 8, !dbg !29
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !29
// CHECK:STDOUT: call void @_ZN1DC1Ev.carbon_thunk.(ptr %_.var), !dbg !30
// CHECK:STDOUT: call void @"_CSelfDestruct.87042109e4175f46:core.Destroy.Core"(ptr %_.var), !dbg !29
// CHECK:STDOUT: ret void, !dbg !32
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -134,18 +135,24 @@ fn AccessD(d: Cpp.D) -> i32 {
// 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 !45
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !45
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !49
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !49
// CHECK:STDOUT: call void @_ZN1DC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CAccessD.Main(ptr %d) #0 !dbg !33 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.87042109e4175f46:core.Destroy.Core"(ptr %self) #0 !dbg !33 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc16_11.1.d = getelementptr inbounds nuw [40 x i8], ptr %d, i32 0, i32 28, !dbg !38
// CHECK:STDOUT: %.loc16_11.2 = load i32, ptr %.loc16_11.1.d, align 4, !dbg !38
// CHECK:STDOUT: ret i32 %.loc16_11.2, !dbg !39
// CHECK:STDOUT: ret void, !dbg !35
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CAccessD.Main(ptr %d) #0 !dbg !37 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc16_11.1.d = getelementptr inbounds nuw [40 x i8], ptr %d, i32 0, i32 28, !dbg !42
// CHECK:STDOUT: %.loc16_11.2 = load i32, ptr %.loc16_11.1.d, align 4, !dbg !42
// CHECK:STDOUT: ret i32 %.loc16_11.2, !dbg !43
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -155,16 +162,16 @@ fn AccessD(d: Cpp.D) -> i32 {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1DC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !45
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !49
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: %0 = getelementptr inbounds i8, ptr %this1, i64 32
// CHECK:STDOUT: call void @_ZN1AC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %0)
// CHECK:STDOUT: call void @_ZN1BC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %this1, ptr noundef getelementptr inbounds nuw (i8, ptr @_ZTT1D, i64 8))
// CHECK:STDOUT: %1 = getelementptr inbounds i8, ptr %this1, i64 16
// CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %1, ptr noundef getelementptr inbounds nuw (i8, ptr @_ZTT1D, i64 16))
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !47
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !51
// CHECK:STDOUT: %add.ptr = getelementptr inbounds i8, ptr %this1, i64 16
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 1, i32 3), ptr %add.ptr, align 8, !tbaa !47
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 1, i32 3), ptr %add.ptr, align 8, !tbaa !51
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -188,8 +195,8 @@ fn AccessD(d: Cpp.D) -> i32 {
// 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.dbg.cu = !{!19}
// CHECK:STDOUT: !llvm.module.flags = !{!48, !49, !50, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!53}
// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!57}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -199,28 +206,34 @@ fn AccessD(d: Cpp.D) -> i32 {
// CHECK:STDOUT: !21 = !{null}
// CHECK:STDOUT: !22 = !DISubroutineType(types: !21)
// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !24 = !{null, !23}
// CHECK:STDOUT: !25 = !DISubroutineType(types: !24)
// CHECK:STDOUT: !26 = !{!20, !23}
// CHECK:STDOUT: !27 = !DISubroutineType(types: !26)
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !18, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !19)
// CHECK:STDOUT: !29 = !DILocation(line: 11, column: 3, scope: !28)
// CHECK:STDOUT: !30 = !DILocation(line: 11, column: 18, scope: !28)
// CHECK:STDOUT: !32 = !DILocation(line: 6, column: 1, scope: !28)
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "AccessD", linkageName: "_CAccessD.Main", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40)
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.87042109e4175f46:core.Destroy.Core", scope: null, file: !18, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !36)
// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !23)
// CHECK:STDOUT: !38 = !DILocation(line: 16, column: 10, scope: !33)
// CHECK:STDOUT: !39 = !DILocation(line: 16, column: 3, scope: !33)
// CHECK:STDOUT: !40 = !{!34}
// CHECK:STDOUT: !41 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !42 = !{!"omnipotent char", !41, i64 0}
// CHECK:STDOUT: !43 = !{!"any pointer", !42, i64 0}
// CHECK:STDOUT: !44 = !{!"p1 _ZTS1D", !43, i64 0}
// CHECK:STDOUT: !45 = !{!44, !44, i64 0}
// CHECK:STDOUT: !46 = !{!"vtable pointer", !41, i64 0}
// CHECK:STDOUT: !47 = !{!46, !46, i64 0}
// CHECK:STDOUT: !48 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !49 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !50 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !51 = !{!"int", !42, i64 0}
// CHECK:STDOUT: !52 = !{!"__libc_errno", !51, i64 0}
// CHECK:STDOUT: !53 = !{!52, !51, i64 0}
// CHECK:STDOUT: !35 = !DILocation(line: 11, column: 3, scope: !33)
// CHECK:STDOUT: !36 = !{!34}
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "AccessD", linkageName: "_CAccessD.Main", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44)
// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !23)
// CHECK:STDOUT: !42 = !DILocation(line: 16, column: 10, scope: !37)
// CHECK:STDOUT: !43 = !DILocation(line: 16, column: 3, scope: !37)
// CHECK:STDOUT: !44 = !{!38}
// CHECK:STDOUT: !45 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !46 = !{!"omnipotent char", !45, i64 0}
// CHECK:STDOUT: !47 = !{!"any pointer", !46, i64 0}
// CHECK:STDOUT: !48 = !{!"p1 _ZTS1D", !47, i64 0}
// CHECK:STDOUT: !49 = !{!48, !48, i64 0}
// CHECK:STDOUT: !50 = !{!"vtable pointer", !45, i64 0}
// CHECK:STDOUT: !51 = !{!50, !50, i64 0}
// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !55 = !{!"int", !46, i64 0}
// CHECK:STDOUT: !56 = !{!"__libc_errno", !55, i64 0}
// CHECK:STDOUT: !57 = !{!56, !55, i64 0}
// CHECK:STDOUT:
+107 -60
View File
@@ -186,8 +186,8 @@ void delete_new_Base() {
// CHECK:STDOUT: define internal void @_ZNK1A1FEv.carbon_thunk._(ptr noundef nonnull align 8 dereferenceable(8) %this) #5 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !71
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !71, !nonnull !74, !align !75
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !87
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !87, !nonnull !90, !align !91
// CHECK:STDOUT: %vtable = load ptr, ptr %0, align 8, !tbaa !8
// CHECK:STDOUT: %vfn = getelementptr inbounds ptr, ptr %vtable, i64 2
// CHECK:STDOUT: %1 = load ptr, ptr %vfn, align 8
@@ -207,7 +207,7 @@ void delete_new_Base() {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Final.Main"(ptr %self) #6 !dbg !37 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.28387b086eba9957:core.Destroy.Core"(ptr %self), !dbg !39
// CHECK:STDOUT: call void @"_CSelfDestruct.28387b086eba9957:core.Destroy.Core"(ptr %self), !dbg !39
// CHECK:STDOUT: ret void, !dbg !39
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -215,53 +215,84 @@ void delete_new_Base() {
// CHECK:STDOUT: declare void @_ZN1AD1Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8)) unnamed_addr #7
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.e9cc9e95545cc62f:core.Destroy.Core"(ptr %self) #8 !dbg !41 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #8 !dbg !41 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %A.cpp_destructor.call.vtable = load ptr, ptr %self, align 8, !dbg !43
// CHECK:STDOUT: %A.cpp_destructor.call = getelementptr ptr, ptr %A.cpp_destructor.call.vtable, i32 0, !dbg !43
// CHECK:STDOUT: %A.cpp_destructor.call.memptr.virtualfn = load ptr, ptr %A.cpp_destructor.call, align 8, !dbg !43
// CHECK:STDOUT: call void %A.cpp_destructor.call.memptr.virtualfn(ptr %self), !dbg !43
// CHECK:STDOUT: ret void, !dbg !43
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.28387b086eba9957:core.Destroy.Core"(ptr %self) #8 !dbg !45 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e9cc9e95545cc62f:core.Destroy.Core"(ptr %self) #8 !dbg !45 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !47
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.Final.Main(ptr %self) #8 !dbg !49 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e9cc9e95545cc62f:core.Destroy.Core"(ptr %self) #8 !dbg !49 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Final.Main(ptr %self), !dbg !51
// CHECK:STDOUT: call void @"_CSubobjectDestroy.e9cc9e95545cc62f:core.Destroy.Core"(ptr %self), !dbg !51
// CHECK:STDOUT: ret void, !dbg !51
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.28387b086eba9957:core.Destroy.Core"(ptr %self) #8 !dbg !53 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !55
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.28387b086eba9957:core.Destroy.Core"(ptr %self) #8 !dbg !57 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.28387b086eba9957:core.Destroy.Core"(ptr %self), !dbg !59
// CHECK:STDOUT: ret void, !dbg !59
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.Final.Main(ptr %self) #8 !dbg !61 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Final.Main(ptr %self), !dbg !63
// CHECK:STDOUT: ret void, !dbg !63
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_CF.Base.Main(ptr)
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_CF:thunk:A.Cpp:Base.Main"(ptr %self) #6 !dbg !53 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !56
// CHECK:STDOUT: ret void, !dbg !56
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Base.Main"(ptr %self) #6 !dbg !58 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !60
// CHECK:STDOUT: ret void, !dbg !60
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.294df737cd074d60:core.Destroy.Core"(ptr %self) #8 !dbg !62 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !64
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.Base.Main(ptr %self) #8 !dbg !66 {
// CHECK:STDOUT: define weak_odr void @"_CF:thunk:A.Cpp:Base.Main"(ptr %self) #6 !dbg !65 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !68
// CHECK:STDOUT: ret void, !dbg !68
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Base.Main"(ptr %self) #6 !dbg !70 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSelfDestruct.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !72
// CHECK:STDOUT: ret void, !dbg !72
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self) #8 !dbg !74 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !76
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.294df737cd074d60:core.Destroy.Core"(ptr %self) #8 !dbg !78 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !80
// CHECK:STDOUT: ret void, !dbg !80
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.Base.Main(ptr %self) #8 !dbg !82 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !84
// CHECK:STDOUT: ret void, !dbg !84
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @__cxa_pure_virtual() unnamed_addr
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_ZNK1A1FEv(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #9
@@ -324,7 +355,7 @@ void delete_new_Base() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1AC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !71
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !87
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTV1A, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !8
// CHECK:STDOUT: ret void
@@ -354,8 +385,8 @@ void delete_new_Base() {
// CHECK:STDOUT: attributes #11 = { builtin nounwind }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!28}
// CHECK:STDOUT: !llvm.module.flags = !{!77, !78, !79, !11, !12}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!82}
// CHECK:STDOUT: !llvm.module.flags = !{!93, !94, !95, !11, !12}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!98}
// CHECK:STDOUT:
// CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0}
@@ -381,42 +412,58 @@ void delete_new_Base() {
// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !29)
// CHECK:STDOUT: !39 = !DILocation(line: 12, column: 1, scope: !37)
// CHECK:STDOUT: !40 = !{!38}
// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e9cc9e95545cc62f:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !44)
// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !44)
// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !29)
// CHECK:STDOUT: !43 = !DILocation(line: 12, column: 1, scope: !41)
// CHECK:STDOUT: !44 = !{!42}
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.28387b086eba9957:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !48)
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e9cc9e95545cc62f:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !48)
// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !29)
// CHECK:STDOUT: !47 = !DILocation(line: 12, column: 1, scope: !45)
// CHECK:STDOUT: !48 = !{!46}
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Final.Main", scope: null, file: !27, line: 14, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !52)
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e9cc9e95545cc62f:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !52)
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !29)
// CHECK:STDOUT: !51 = !DILocation(line: 14, column: 3, scope: !49)
// CHECK:STDOUT: !51 = !DILocation(line: 12, column: 1, scope: !49)
// CHECK:STDOUT: !52 = !{!50}
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:A.Cpp:Base.Main", scope: null, file: !27, line: 19, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !57)
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.28387b086eba9957:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !56)
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !29)
// CHECK:STDOUT: !56 = !DILocation(line: 19, column: 3, scope: !53)
// CHECK:STDOUT: !57 = !{!54}
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Base.Main", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !61)
// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !29)
// CHECK:STDOUT: !60 = !DILocation(line: 17, column: 1, scope: !58)
// CHECK:STDOUT: !61 = !{!59}
// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Op", linkageName: "_COp.294df737cd074d60:core.Destroy.Core", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !65)
// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !29)
// CHECK:STDOUT: !64 = !DILocation(line: 17, column: 1, scope: !62)
// CHECK:STDOUT: !65 = !{!63}
// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Base.Main", scope: null, file: !27, line: 19, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !69)
// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !29)
// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 3, scope: !66)
// CHECK:STDOUT: !69 = !{!67}
// CHECK:STDOUT: !70 = !{!"p1 _ZTS1A", !2, i64 0}
// CHECK:STDOUT: !71 = !{!70, !70, i64 0}
// CHECK:STDOUT: !74 = !{}
// CHECK:STDOUT: !75 = !{i64 8}
// CHECK:STDOUT: !77 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !78 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !79 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !80 = !{!"int", !1, i64 0}
// CHECK:STDOUT: !81 = !{!"__libc_errno", !80, i64 0}
// CHECK:STDOUT: !82 = !{!81, !80, i64 0}
// CHECK:STDOUT: !55 = !DILocation(line: 12, column: 1, scope: !53)
// CHECK:STDOUT: !56 = !{!54}
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.28387b086eba9957:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !60)
// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !29)
// CHECK:STDOUT: !59 = !DILocation(line: 12, column: 1, scope: !57)
// CHECK:STDOUT: !60 = !{!58}
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Final.Main", scope: null, file: !27, line: 14, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !64)
// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !29)
// CHECK:STDOUT: !63 = !DILocation(line: 14, column: 3, scope: !61)
// CHECK:STDOUT: !64 = !{!62}
// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:A.Cpp:Base.Main", scope: null, file: !27, line: 19, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !69)
// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !29)
// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 3, scope: !65)
// CHECK:STDOUT: !69 = !{!66}
// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Base.Main", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !73)
// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !29)
// CHECK:STDOUT: !72 = !DILocation(line: 17, column: 1, scope: !70)
// CHECK:STDOUT: !73 = !{!71}
// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !77)
// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !29)
// CHECK:STDOUT: !76 = !DILocation(line: 17, column: 1, scope: !74)
// CHECK:STDOUT: !77 = !{!75}
// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.294df737cd074d60:core.Destroy.Core", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !81)
// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !29)
// CHECK:STDOUT: !80 = !DILocation(line: 17, column: 1, scope: !78)
// CHECK:STDOUT: !81 = !{!79}
// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Base.Main", scope: null, file: !27, line: 19, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !85)
// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !29)
// CHECK:STDOUT: !84 = !DILocation(line: 19, column: 3, scope: !82)
// CHECK:STDOUT: !85 = !{!83}
// CHECK:STDOUT: !86 = !{!"p1 _ZTS1A", !2, i64 0}
// CHECK:STDOUT: !87 = !{!86, !86, i64 0}
// CHECK:STDOUT: !90 = !{}
// CHECK:STDOUT: !91 = !{i64 8}
// CHECK:STDOUT: !93 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !94 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !95 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !96 = !{!"int", !1, i64 0}
// CHECK:STDOUT: !97 = !{!"__libc_errno", !96, i64 0}
// CHECK:STDOUT: !98 = !{!97, !96, i64 0}
// CHECK:STDOUT:
@@ -59,7 +59,7 @@ fn F() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1X1fEv(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #0 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !49
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !61
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -80,49 +80,69 @@ fn F() {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Z.Main"(ptr %self) #2 !dbg !23 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self), !dbg !25
// CHECK:STDOUT: call void @"_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self), !dbg !25
// CHECK:STDOUT: ret void, !dbg !25
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.de73a19002e400c9:core.Destroy.Core"(ptr %self) #1 !dbg !27 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %self) #1 !dbg !27 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !29
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self) #1 !dbg !31 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.de73a19002e400c9:core.Destroy.Core"(ptr %self) #1 !dbg !31 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !33
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_Cf__carbon_thunk.Z.Main(ptr %self) #1 !dbg !35 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.de73a19002e400c9:core.Destroy.Core"(ptr %self) #1 !dbg !35 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Cf.Z.Main(ptr %self), !dbg !37
// CHECK:STDOUT: call void @"_CSubobjectDestroy.de73a19002e400c9:core.Destroy.Core"(ptr %self), !dbg !37
// CHECK:STDOUT: ret void, !dbg !37
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF.Main() #1 !dbg !39 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self) #1 !dbg !39 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca { [8 x i8] }, align 8, !dbg !40
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !40
// CHECK:STDOUT: %.loc24_32.1.base = getelementptr inbounds nuw { [8 x i8] }, ptr %_.var, i32 0, i32 0, !dbg !41
// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %.loc24_32.1.base), !dbg !42
// CHECK:STDOUT: %.loc24_32.7.base = getelementptr inbounds nuw { [8 x i8] }, ptr %_.var, i32 0, i32 0, !dbg !41
// CHECK:STDOUT: %.loc24_32.8.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc24_32.7.base, i32 0, i32 0, !dbg !41
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTVN6Carbon1ZE, i32 0, i32 0, i32 2), ptr %.loc24_32.8.vptr, align 8, !dbg !41
// CHECK:STDOUT: call void @"_COp.680f7fa3ef86df7a:core.Destroy.Core"(ptr %_.var), !dbg !40
// CHECK:STDOUT: ret void, !dbg !44
// CHECK:STDOUT: ret void, !dbg !41
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self) #1 !dbg !43 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self), !dbg !45
// CHECK:STDOUT: ret void, !dbg !45
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_Cf__carbon_thunk.Z.Main(ptr %self) #1 !dbg !47 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Cf.Z.Main(ptr %self), !dbg !49
// CHECK:STDOUT: ret void, !dbg !49
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF.Main() #1 !dbg !51 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca { [8 x i8] }, align 8, !dbg !52
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !52
// CHECK:STDOUT: %.loc24_32.1.base = getelementptr inbounds nuw { [8 x i8] }, ptr %_.var, i32 0, i32 0, !dbg !53
// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %.loc24_32.1.base), !dbg !54
// CHECK:STDOUT: %.loc24_32.7.base = getelementptr inbounds nuw { [8 x i8] }, ptr %_.var, i32 0, i32 0, !dbg !53
// CHECK:STDOUT: %.loc24_32.8.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc24_32.7.base, i32 0, i32 0, !dbg !53
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTVN6Carbon1ZE, i32 0, i32 0, i32 2), ptr %.loc24_32.8.vptr, align 8, !dbg !53
// CHECK:STDOUT: call void @"_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core"(ptr %_.var), !dbg !52
// CHECK:STDOUT: ret void, !dbg !56
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
// CHECK:STDOUT: define internal void @_ZN1XC1Ev.carbon_thunk.(ptr noundef %return) #3 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !49
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !49
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !61
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !61
// CHECK:STDOUT: call void @_ZN1XC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #1
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -134,7 +154,7 @@ fn F() {
// CHECK:STDOUT: define internal void @_ZN6Carbon1Z1fEv(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !65
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @_Cf__carbon_thunk.Z.Main(ptr noundef nonnull align 8 dereferenceable(8) %this1)
// CHECK:STDOUT: ret void
@@ -144,9 +164,9 @@ fn F() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1XC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #5 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !49
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !61
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV1X, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !51
// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV1X, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !63
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -158,8 +178,8 @@ fn F() {
// CHECK:STDOUT: attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!7}
// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!73}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -182,36 +202,48 @@ fn F() {
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !8)
// CHECK:STDOUT: !25 = !DILocation(line: 18, column: 1, scope: !23)
// CHECK:STDOUT: !26 = !{!24}
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.de73a19002e400c9:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !30)
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !30)
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !8)
// CHECK:STDOUT: !29 = !DILocation(line: 18, column: 1, scope: !27)
// CHECK:STDOUT: !30 = !{!28}
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.680f7fa3ef86df7a:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !34)
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.de73a19002e400c9:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !34)
// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !8)
// CHECK:STDOUT: !33 = !DILocation(line: 18, column: 1, scope: !31)
// CHECK:STDOUT: !34 = !{!32}
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "f__carbon_thunk", linkageName: "_Cf__carbon_thunk.Z.Main", scope: null, file: !6, line: 20, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !38)
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.de73a19002e400c9:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !38)
// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !8)
// CHECK:STDOUT: !37 = !DILocation(line: 20, column: 3, scope: !35)
// CHECK:STDOUT: !37 = !DILocation(line: 18, column: 1, scope: !35)
// CHECK:STDOUT: !38 = !{!36}
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !7)
// CHECK:STDOUT: !40 = !DILocation(line: 24, column: 3, scope: !39)
// CHECK:STDOUT: !41 = !DILocation(line: 24, column: 14, scope: !39)
// CHECK:STDOUT: !42 = !DILocation(line: 24, column: 23, scope: !39)
// CHECK:STDOUT: !44 = !DILocation(line: 23, column: 1, scope: !39)
// CHECK:STDOUT: !45 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !46 = !{!"omnipotent char", !45, i64 0}
// CHECK:STDOUT: !47 = !{!"any pointer", !46, i64 0}
// CHECK:STDOUT: !48 = !{!"p1 _ZTS1X", !47, i64 0}
// CHECK:STDOUT: !49 = !{!48, !48, i64 0}
// CHECK:STDOUT: !50 = !{!"vtable pointer", !45, i64 0}
// CHECK:STDOUT: !51 = !{!50, !50, i64 0}
// CHECK:STDOUT: !52 = !{!"p1 _ZTSN6Carbon1ZE", !47, i64 0}
// CHECK:STDOUT: !53 = !{!52, !52, i64 0}
// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !59 = !{!"int", !46, i64 0}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0}
// CHECK:STDOUT: !61 = !{!60, !59, i64 0}
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !42)
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !8)
// CHECK:STDOUT: !41 = !DILocation(line: 18, column: 1, scope: !39)
// CHECK:STDOUT: !42 = !{!40}
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !46)
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !8)
// CHECK:STDOUT: !45 = !DILocation(line: 18, column: 1, scope: !43)
// CHECK:STDOUT: !46 = !{!44}
// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "f__carbon_thunk", linkageName: "_Cf__carbon_thunk.Z.Main", scope: null, file: !6, line: 20, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !50)
// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !8)
// CHECK:STDOUT: !49 = !DILocation(line: 20, column: 3, scope: !47)
// CHECK:STDOUT: !50 = !{!48}
// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !7)
// CHECK:STDOUT: !52 = !DILocation(line: 24, column: 3, scope: !51)
// CHECK:STDOUT: !53 = !DILocation(line: 24, column: 14, scope: !51)
// CHECK:STDOUT: !54 = !DILocation(line: 24, column: 23, scope: !51)
// CHECK:STDOUT: !56 = !DILocation(line: 23, column: 1, scope: !51)
// CHECK:STDOUT: !57 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !58 = !{!"omnipotent char", !57, i64 0}
// CHECK:STDOUT: !59 = !{!"any pointer", !58, i64 0}
// CHECK:STDOUT: !60 = !{!"p1 _ZTS1X", !59, i64 0}
// CHECK:STDOUT: !61 = !{!60, !60, i64 0}
// CHECK:STDOUT: !62 = !{!"vtable pointer", !57, i64 0}
// CHECK:STDOUT: !63 = !{!62, !62, i64 0}
// CHECK:STDOUT: !64 = !{!"p1 _ZTSN6Carbon1ZE", !59, i64 0}
// CHECK:STDOUT: !65 = !{!64, !64, i64 0}
// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !71 = !{!"int", !58, i64 0}
// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0}
// CHECK:STDOUT: !73 = !{!72, !71, i64 0}
// CHECK:STDOUT:
File diff suppressed because it is too large. Load diff
@@ -54,8 +54,8 @@ void f() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: %.addr = alloca i32, align 4
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !32
// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !34
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40
// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !42
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @_COneArg__carbon_thunk.OneArg.Main(ptr noundef nonnull align 1 %this1, ptr noundef nonnull align 4 dereferenceable(4) %.addr)
// CHECK:STDOUT: ret void
@@ -65,7 +65,7 @@ void f() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon6OneArgD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !32
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.OneArg.Main"(ptr noundef nonnull align 1 %this1)
// CHECK:STDOUT: ret void
@@ -79,22 +79,35 @@ void f() {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.OneArg.Main"(ptr %self) #4 !dbg !15 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.7040ef4e2429d520:core.Destroy.Core"(ptr %self), !dbg !17
// CHECK:STDOUT: call void @"_CSelfDestruct.7040ef4e2429d520:core.Destroy.Core"(ptr %self), !dbg !17
// CHECK:STDOUT: ret void, !dbg !17
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.7040ef4e2429d520:core.Destroy.Core"(ptr %self) #5 !dbg !19 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #5 !dbg !19 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !21
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_COneArg__carbon_thunk.OneArg.Main(ptr %_, ptr %_1) #5 !dbg !23 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.7040ef4e2429d520:core.Destroy.Core"(ptr %self) #5 !dbg !23 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc6_28.2 = load i32, ptr %_1, align 4, !dbg !26
// CHECK:STDOUT: call void @_COneArg.OneArg.Main(ptr %_, i32 %.loc6_28.2), !dbg !26
// CHECK:STDOUT: ret void, !dbg !26
// CHECK:STDOUT: ret void, !dbg !25
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7040ef4e2429d520:core.Destroy.Core"(ptr %self) #5 !dbg !27 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.7040ef4e2429d520:core.Destroy.Core"(ptr %self), !dbg !29
// CHECK:STDOUT: ret void, !dbg !29
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_COneArg__carbon_thunk.OneArg.Main(ptr %_, ptr %_1) #5 !dbg !31 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc6_28.2 = load i32, ptr %_1, align 4, !dbg !34
// CHECK:STDOUT: call void @_COneArg.OneArg.Main(ptr %_, i32 %.loc6_28.2), !dbg !34
// CHECK:STDOUT: ret void, !dbg !34
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
@@ -105,8 +118,8 @@ void f() {
// CHECK:STDOUT: attributes #5 = { nounwind }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!6}
// CHECK:STDOUT: !llvm.module.flags = !{!35, !36, !37, !3, !4}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!39}
// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !3, !4}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!47}
// CHECK:STDOUT:
// CHECK:STDOUT: !3 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !4 = !{i32 2, !"Debug Info Version", i32 3}
@@ -122,25 +135,33 @@ void f() {
// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !15, type: !8)
// CHECK:STDOUT: !17 = !DILocation(line: 5, column: 1, scope: !15)
// CHECK:STDOUT: !18 = !{!16}
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7040ef4e2429d520:core.Destroy.Core", scope: null, file: !5, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !22)
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !5, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !22)
// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !19, type: !8)
// CHECK:STDOUT: !21 = !DILocation(line: 5, column: 1, scope: !19)
// CHECK:STDOUT: !22 = !{!20}
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "OneArg__carbon_thunk", linkageName: "_COneArg__carbon_thunk.OneArg.Main", scope: null, file: !5, line: 6, type: !14, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !27)
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.7040ef4e2429d520:core.Destroy.Core", scope: null, file: !5, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !26)
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !8)
// CHECK:STDOUT: !25 = !DILocalVariable(arg: 2, scope: !23, type: !7)
// CHECK:STDOUT: !26 = !DILocation(line: 6, column: 3, scope: !23)
// CHECK:STDOUT: !27 = !{!24, !25}
// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0}
// CHECK:STDOUT: !30 = !{!"any pointer", !29, i64 0}
// CHECK:STDOUT: !31 = !{!"p1 _ZTSN6Carbon6OneArgE", !30, i64 0}
// CHECK:STDOUT: !32 = !{!31, !31, i64 0}
// CHECK:STDOUT: !33 = !{!"int", !29, i64 0}
// CHECK:STDOUT: !34 = !{!33, !33, i64 0}
// CHECK:STDOUT: !35 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !36 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !37 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !38 = !{!"__libc_errno", !33, i64 0}
// CHECK:STDOUT: !39 = !{!38, !33, i64 0}
// CHECK:STDOUT: !25 = !DILocation(line: 5, column: 1, scope: !23)
// CHECK:STDOUT: !26 = !{!24}
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7040ef4e2429d520:core.Destroy.Core", scope: null, file: !5, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !30)
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !8)
// CHECK:STDOUT: !29 = !DILocation(line: 5, column: 1, scope: !27)
// CHECK:STDOUT: !30 = !{!28}
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "OneArg__carbon_thunk", linkageName: "_COneArg__carbon_thunk.OneArg.Main", scope: null, file: !5, line: 6, type: !14, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !35)
// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !8)
// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !31, type: !7)
// CHECK:STDOUT: !34 = !DILocation(line: 6, column: 3, scope: !31)
// CHECK:STDOUT: !35 = !{!32, !33}
// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0}
// CHECK:STDOUT: !38 = !{!"any pointer", !37, i64 0}
// CHECK:STDOUT: !39 = !{!"p1 _ZTSN6Carbon6OneArgE", !38, i64 0}
// CHECK:STDOUT: !40 = !{!39, !39, i64 0}
// CHECK:STDOUT: !41 = !{!"int", !37, i64 0}
// CHECK:STDOUT: !42 = !{!41, !41, i64 0}
// CHECK:STDOUT: !43 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !44 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !45 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !46 = !{!"__libc_errno", !41, i64 0}
// CHECK:STDOUT: !47 = !{!46, !41, i64 0}
// CHECK:STDOUT:
@@ -142,7 +142,7 @@ fn Run() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !71
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !83
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 1 %this1)
// CHECK:STDOUT: ret void
@@ -160,7 +160,7 @@ fn Run() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1BD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !73
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !85
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.B.Main"(ptr noundef nonnull align 1 %this1)
// CHECK:STDOUT: ret void
@@ -184,62 +184,82 @@ fn Run() {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !28 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !30
// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !30
// CHECK:STDOUT: ret void, !dbg !30
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !32 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #4 !dbg !32 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !34
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #5 !dbg !36 {
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !36 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !38
// CHECK:STDOUT: ret void, !dbg !38
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #4 !dbg !40 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !40 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !42
// CHECK:STDOUT: ret void, !dbg !42
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.26f2099a79512a5d.Main(ptr %_) #4 !dbg !44 {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #5 !dbg !44 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Main.6662a1ffb773360a(ptr %_), !dbg !46
// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !46
// CHECK:STDOUT: ret void, !dbg !46
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CF__carbon_thunk.7a3b9f04ddf4269e.Main(ptr %_) #4 !dbg !48 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #4 !dbg !48 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Main.d53b17eed3ce903c(ptr %_), !dbg !50
// CHECK:STDOUT: ret void, !dbg !50
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @main() #4 !dbg !52 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #4 !dbg !52 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z1Gv(), !dbg !53
// CHECK:STDOUT: ret i32 0, !dbg !54
// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !54
// CHECK:STDOUT: ret void, !dbg !54
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.6662a1ffb773360a(ptr %t) #4 !dbg !55 {
// CHECK:STDOUT: define void @_CF__carbon_thunk.26f2099a79512a5d.Main(ptr %_) #4 !dbg !56 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CDoit.A.Main:I.Main"(ptr %t), !dbg !58
// CHECK:STDOUT: ret void, !dbg !59
// CHECK:STDOUT: call void @_CF.Main.6662a1ffb773360a(ptr %_), !dbg !58
// CHECK:STDOUT: ret void, !dbg !58
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.d53b17eed3ce903c(ptr %t) #4 !dbg !61 {
// CHECK:STDOUT: define void @_CF__carbon_thunk.7a3b9f04ddf4269e.Main(ptr %_) #4 !dbg !60 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CDoit.B.Main:I.Main"(ptr %t), !dbg !64
// CHECK:STDOUT: ret void, !dbg !65
// CHECK:STDOUT: call void @_CF.Main.d53b17eed3ce903c(ptr %_), !dbg !62
// CHECK:STDOUT: ret void, !dbg !62
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @main() #4 !dbg !64 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z1Gv(), !dbg !65
// CHECK:STDOUT: ret i32 0, !dbg !66
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.6662a1ffb773360a(ptr %t) #4 !dbg !67 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CDoit.A.Main:I.Main"(ptr %t), !dbg !70
// CHECK:STDOUT: ret void, !dbg !71
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.d53b17eed3ce903c(ptr %t) #4 !dbg !73 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CDoit.B.Main:I.Main"(ptr %t), !dbg !76
// CHECK:STDOUT: ret void, !dbg !77
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
@@ -256,8 +276,8 @@ fn Run() {
// CHECK:STDOUT: attributes #5 = { alwaysinline nounwind }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!9}
// CHECK:STDOUT: !llvm.module.flags = !{!74, !75, !76, !4, !5}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!79}
// CHECK:STDOUT: !llvm.module.flags = !{!86, !87, !88, !4, !5}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!91}
// CHECK:STDOUT:
// CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3}
@@ -281,50 +301,62 @@ fn Run() {
// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !10)
// CHECK:STDOUT: !30 = !DILocation(line: 8, column: 1, scope: !28)
// CHECK:STDOUT: !31 = !{!29}
// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !8, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !35)
// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !8, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !35)
// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !10)
// CHECK:STDOUT: !34 = !DILocation(line: 8, column: 1, scope: !32)
// CHECK:STDOUT: !35 = !{!33}
// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !39)
// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !8, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !39)
// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !10)
// CHECK:STDOUT: !38 = !DILocation(line: 13, column: 1, scope: !36)
// CHECK:STDOUT: !38 = !DILocation(line: 8, column: 1, scope: !36)
// CHECK:STDOUT: !39 = !{!37}
// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !43)
// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !8, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !43)
// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !10)
// CHECK:STDOUT: !42 = !DILocation(line: 13, column: 1, scope: !40)
// CHECK:STDOUT: !42 = !DILocation(line: 8, column: 1, scope: !40)
// CHECK:STDOUT: !43 = !{!41}
// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "F__carbon_thunk.26f2099a79512a5d", linkageName: "_CF__carbon_thunk.26f2099a79512a5d.Main", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !47)
// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !47)
// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !10)
// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 1, scope: !44)
// CHECK:STDOUT: !46 = !DILocation(line: 13, column: 1, scope: !44)
// CHECK:STDOUT: !47 = !{!45}
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "F__carbon_thunk.7a3b9f04ddf4269e", linkageName: "_CF__carbon_thunk.7a3b9f04ddf4269e.Main", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !51)
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !51)
// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !10)
// CHECK:STDOUT: !50 = !DILocation(line: 19, column: 1, scope: !48)
// CHECK:STDOUT: !50 = !DILocation(line: 13, column: 1, scope: !48)
// CHECK:STDOUT: !51 = !{!49}
// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !8, line: 32, type: !15, spFlags: DISPFlagDefinition, unit: !9)
// CHECK:STDOUT: !53 = !DILocation(line: 33, column: 3, scope: !52)
// CHECK:STDOUT: !54 = !DILocation(line: 32, column: 1, scope: !52)
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.6662a1ffb773360a", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !60)
// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !10)
// CHECK:STDOUT: !58 = !DILocation(line: 20, column: 3, scope: !55)
// CHECK:STDOUT: !59 = !DILocation(line: 19, column: 1, scope: !55)
// CHECK:STDOUT: !60 = !{!56}
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d53b17eed3ce903c", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !66)
// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !10)
// CHECK:STDOUT: !64 = !DILocation(line: 20, column: 3, scope: !61)
// CHECK:STDOUT: !65 = !DILocation(line: 19, column: 1, scope: !61)
// CHECK:STDOUT: !66 = !{!62}
// CHECK:STDOUT: !67 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !68 = !{!"omnipotent char", !67, i64 0}
// CHECK:STDOUT: !69 = !{!"any pointer", !68, i64 0}
// CHECK:STDOUT: !70 = !{!"p1 _ZTSN6Carbon1AE", !69, i64 0}
// CHECK:STDOUT: !71 = !{!70, !70, i64 0}
// CHECK:STDOUT: !72 = !{!"p1 _ZTSN6Carbon1BE", !69, i64 0}
// CHECK:STDOUT: !73 = !{!72, !72, i64 0}
// CHECK:STDOUT: !74 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !75 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !76 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !77 = !{!"int", !68, i64 0}
// CHECK:STDOUT: !78 = !{!"__libc_errno", !77, i64 0}
// CHECK:STDOUT: !79 = !{!78, !77, i64 0}
// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !55)
// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !10)
// CHECK:STDOUT: !54 = !DILocation(line: 13, column: 1, scope: !52)
// CHECK:STDOUT: !55 = !{!53}
// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "F__carbon_thunk.26f2099a79512a5d", linkageName: "_CF__carbon_thunk.26f2099a79512a5d.Main", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !59)
// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !10)
// CHECK:STDOUT: !58 = !DILocation(line: 19, column: 1, scope: !56)
// CHECK:STDOUT: !59 = !{!57}
// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "F__carbon_thunk.7a3b9f04ddf4269e", linkageName: "_CF__carbon_thunk.7a3b9f04ddf4269e.Main", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !63)
// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !10)
// CHECK:STDOUT: !62 = !DILocation(line: 19, column: 1, scope: !60)
// CHECK:STDOUT: !63 = !{!61}
// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !8, line: 32, type: !15, spFlags: DISPFlagDefinition, unit: !9)
// CHECK:STDOUT: !65 = !DILocation(line: 33, column: 3, scope: !64)
// CHECK:STDOUT: !66 = !DILocation(line: 32, column: 1, scope: !64)
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.6662a1ffb773360a", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !72)
// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !10)
// CHECK:STDOUT: !70 = !DILocation(line: 20, column: 3, scope: !67)
// CHECK:STDOUT: !71 = !DILocation(line: 19, column: 1, scope: !67)
// CHECK:STDOUT: !72 = !{!68}
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d53b17eed3ce903c", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !78)
// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !10)
// CHECK:STDOUT: !76 = !DILocation(line: 20, column: 3, scope: !73)
// CHECK:STDOUT: !77 = !DILocation(line: 19, column: 1, scope: !73)
// CHECK:STDOUT: !78 = !{!74}
// CHECK:STDOUT: !79 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !80 = !{!"omnipotent char", !79, i64 0}
// CHECK:STDOUT: !81 = !{!"any pointer", !80, i64 0}
// CHECK:STDOUT: !82 = !{!"p1 _ZTSN6Carbon1AE", !81, i64 0}
// CHECK:STDOUT: !83 = !{!82, !82, i64 0}
// CHECK:STDOUT: !84 = !{!"p1 _ZTSN6Carbon1BE", !81, i64 0}
// CHECK:STDOUT: !85 = !{!84, !84, i64 0}
// CHECK:STDOUT: !86 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !87 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !88 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !89 = !{!"int", !80, i64 0}
// CHECK:STDOUT: !90 = !{!"__libc_errno", !89, i64 0}
// CHECK:STDOUT: !91 = !{!90, !89, i64 0}
// CHECK:STDOUT:
@@ -412,7 +412,7 @@ fn MyF() -> i32 {
// CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !80
// CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !79
// CHECK:STDOUT: %.loc14 = load i32, ptr %value.var, align 4, !dbg !81
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %value.var), !dbg !74
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %value.var), !dbg !74
// CHECK:STDOUT: ret i32 %.loc14, !dbg !82
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -427,8 +427,8 @@ fn MyF() -> i32 {
// 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 !87
// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !87
// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !95
// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !95
// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 noundef %0, i32 noundef 2)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -446,8 +446,8 @@ fn MyF() -> i32 {
// 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 !87
// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !87
// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !95
// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !95
// CHECK:STDOUT: %call = call noundef i32 @_Z17SimpleReturnValueii(i32 noundef %0, i32 noundef 2)
// CHECK:STDOUT: ret i32 %call
// CHECK:STDOUT: }
@@ -455,11 +455,24 @@ fn MyF() -> i32 {
// CHECK:STDOUT: declare noundef i32 @_Z17SimpleReturnValueii(i32 noundef, i32 noundef) #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !83 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !83 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !85
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !87 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !89
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !91 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !93
// CHECK:STDOUT: ret void, !dbg !93
// 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:
@@ -505,9 +518,17 @@ fn MyF() -> i32 {
// CHECK:STDOUT: !80 = !DILocation(line: 13, column: 11, scope: !68)
// CHECK:STDOUT: !81 = !DILocation(line: 14, column: 10, scope: !68)
// CHECK:STDOUT: !82 = !DILocation(line: 14, column: 3, scope: !68)
// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !55, line: 11, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !86)
// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !55, line: 11, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !86)
// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !57)
// CHECK:STDOUT: !85 = !DILocation(line: 11, column: 3, scope: !83)
// CHECK:STDOUT: !86 = !{!84}
// CHECK:STDOUT: !87 = !{!30, !30, i64 0}
// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !55, line: 11, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !90)
// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !57)
// CHECK:STDOUT: !89 = !DILocation(line: 11, column: 3, scope: !87)
// CHECK:STDOUT: !90 = !{!88}
// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !55, line: 11, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !94)
// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !57)
// CHECK:STDOUT: !93 = !DILocation(line: 11, column: 3, scope: !91)
// CHECK:STDOUT: !94 = !{!92}
// CHECK:STDOUT: !95 = !{!30, !30, i64 0}
// CHECK:STDOUT:
@@ -48,16 +48,29 @@ fn Call() -> i32 {
// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !38
// CHECK:STDOUT: call void @_Z1FPi(ptr %n.var), !dbg !42
// CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !43
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !38
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !38
// CHECK:STDOUT: ret i32 %.loc24, !dbg !44
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !45 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #1 !dbg !45 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !47
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !49 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !51
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !53 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !55
// CHECK:STDOUT: ret void, !dbg !55
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
@@ -66,8 +79,8 @@ fn Call() -> i32 {
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!26}
// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !9, !10}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!53}
// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !9, !10}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT:
// CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0}
@@ -90,13 +103,21 @@ fn Call() -> i32 {
// CHECK:STDOUT: !42 = !DILocation(line: 23, column: 3, scope: !35)
// CHECK:STDOUT: !43 = !DILocation(line: 24, column: 10, scope: !35)
// CHECK:STDOUT: !44 = !DILocation(line: 24, column: 3, scope: !35)
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !25, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !48)
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !25, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !48)
// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !27)
// CHECK:STDOUT: !47 = !DILocation(line: 22, column: 3, scope: !45)
// CHECK:STDOUT: !48 = !{!46}
// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !52 = !{!"__libc_errno", !2, i64 0}
// CHECK:STDOUT: !53 = !{!52, !2, i64 0}
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !25, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !52)
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !27)
// CHECK:STDOUT: !51 = !DILocation(line: 22, column: 3, scope: !49)
// CHECK:STDOUT: !52 = !{!50}
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !25, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !56)
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !27)
// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 3, scope: !53)
// CHECK:STDOUT: !56 = !{!54}
// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !2, i64 0}
// CHECK:STDOUT: !61 = !{!60, !2, i64 0}
// CHECK:STDOUT:
@@ -131,13 +131,13 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.3.temp), !dbg !62
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_22.3.temp), !dbg !63
// CHECK:STDOUT: call void @_Z11pass_signedasil.carbon_thunk.____(ptr @int_1.f1e, ptr @int_2.5c2, i32 3, i64 4), !dbg !64
// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr @int_2.5c2), !dbg !63
// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !62
// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr @int_2.5c2), !dbg !63
// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !62
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.3.temp), !dbg !65
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_24.3.temp), !dbg !66
// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr @int_1.067, ptr @int_2.ec3, i32 3, i64 4), !dbg !67
// CHECK:STDOUT: call void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr @int_2.ec3), !dbg !66
// CHECK:STDOUT: call void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr @int_1.067), !dbg !65
// CHECK:STDOUT: call void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr @int_2.ec3), !dbg !66
// CHECK:STDOUT: call void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr @int_1.067), !dbg !65
// CHECK:STDOUT: ret void, !dbg !68
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -148,32 +148,58 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: %.addr1 = alloca ptr, align 8
// CHECK:STDOUT: %.addr2 = alloca i32, align 4
// CHECK:STDOUT: %.addr3 = alloca i64, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !111
// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !113
// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !115
// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !116
// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !111
// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !117
// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !113
// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !115
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !140
// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !143
// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !145
// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !147
// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !140
// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !148
// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !143
// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !149
// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !145
// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !147
// CHECK:STDOUT: call void @_Z11pass_signedasil(i8 noundef signext %5, i16 noundef signext %7, i32 noundef %8, i64 noundef %9)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !69 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core"(ptr %self) #0 !dbg !69 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !71
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !73 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !73 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !75
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !77 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self), !dbg !79
// CHECK:STDOUT: ret void, !dbg !79
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core"(ptr %self) #0 !dbg !81 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !83
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !85 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !87
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !89 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self), !dbg !91
// CHECK:STDOUT: ret void, !dbg !91
// 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: entry:
@@ -181,70 +207,96 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: %.addr1 = alloca ptr, align 8
// CHECK:STDOUT: %.addr2 = alloca i32, align 4
// CHECK:STDOUT: %.addr3 = alloca i64, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !111
// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !113
// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !115
// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !116
// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !111
// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !117
// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !113
// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !115
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !140
// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !143
// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !145
// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !147
// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !140
// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !148
// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !143
// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !149
// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !145
// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !147
// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm(i8 noundef zeroext %5, i16 noundef zeroext %7, i32 noundef %8, i64 noundef %9)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !77 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.99892fadd247b492:core.Destroy.Core"(ptr %self) #0 !dbg !93 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !79
// CHECK:STDOUT: ret void, !dbg !95
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !81 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !97 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !83
// CHECK:STDOUT: ret void, !dbg !99
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !101 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self), !dbg !103
// CHECK:STDOUT: ret void, !dbg !103
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core"(ptr %self) #0 !dbg !105 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !107
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !109 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !111
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !113 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self), !dbg !115
// CHECK:STDOUT: ret void, !dbg !115
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare i16 @_CMakeShort.Main()
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #0 !dbg !85 {
// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #0 !dbg !117 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !90
// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !93
// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !95
// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !97
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !90
// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !90
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !91
// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !90
// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !93
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !93
// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !93
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !94
// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !93
// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !95
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !95
// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !95
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !96
// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !95
// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !97
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !97
// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !97
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !98
// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !97
// CHECK:STDOUT: ret void, !dbg !99
// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !122
// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !125
// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !127
// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !129
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !122
// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !122
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !123
// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !122
// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !125
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !125
// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !125
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !126
// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !125
// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !127
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !127
// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !127
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !128
// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !127
// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !129
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !129
// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !129
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !130
// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !129
// CHECK:STDOUT: ret void, !dbg !131
// 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: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !111
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !111
// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !117
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !143
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !143
// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !149
// CHECK:STDOUT: call void @_Z10pass_shorts(i16 noundef signext %2)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -253,10 +305,10 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !101 {
// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !133 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !102
// CHECK:STDOUT: ret void, !dbg !103
// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !134
// CHECK:STDOUT: ret void, !dbg !135
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z11pass_signedasil(i8 noundef signext, i16 noundef signext, i32 noundef, i64 noundef) #3
@@ -275,8 +327,8 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: attributes #3 = { "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.dbg.cu = !{!33}
// CHECK:STDOUT: !llvm.module.flags = !{!118, !119, !120, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!122}
// CHECK:STDOUT: !llvm.module.flags = !{!150, !151, !152, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!154}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -307,57 +359,89 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: !66 = !DILocation(line: 9, column: 24, scope: !61)
// CHECK:STDOUT: !67 = !DILocation(line: 9, column: 3, scope: !61)
// CHECK:STDOUT: !68 = !DILocation(line: 6, column: 1, scope: !61)
// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !32, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !72)
// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core", scope: null, file: !32, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !72)
// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !37)
// CHECK:STDOUT: !71 = !DILocation(line: 7, column: 22, scope: !69)
// CHECK:STDOUT: !72 = !{!70}
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4954785a8b134801:core.Destroy.Core", scope: null, file: !32, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !76)
// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !36)
// CHECK:STDOUT: !75 = !DILocation(line: 7, column: 19, scope: !73)
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !32, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !76)
// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !37)
// CHECK:STDOUT: !75 = !DILocation(line: 7, column: 22, scope: !73)
// CHECK:STDOUT: !76 = !{!74}
// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !32, line: 9, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !80)
// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !39)
// CHECK:STDOUT: !79 = !DILocation(line: 9, column: 24, scope: !77)
// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !32, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !80)
// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !37)
// CHECK:STDOUT: !79 = !DILocation(line: 7, column: 22, scope: !77)
// CHECK:STDOUT: !80 = !{!78}
// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.be60742f00557eec:core.Destroy.Core", scope: null, file: !32, line: 9, type: !54, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !84)
// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !8)
// CHECK:STDOUT: !83 = !DILocation(line: 9, column: 21, scope: !81)
// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core", scope: null, file: !32, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !84)
// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !36)
// CHECK:STDOUT: !83 = !DILocation(line: 7, column: 19, scope: !81)
// CHECK:STDOUT: !84 = !{!82}
// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !32, line: 16, type: !58, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !100)
// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !37)
// CHECK:STDOUT: !87 = !DILocalVariable(arg: 2, scope: !85, type: !42)
// CHECK:STDOUT: !90 = !DILocation(line: 17, column: 18, scope: !85)
// CHECK:STDOUT: !91 = !DILocation(line: 17, column: 3, scope: !85)
// CHECK:STDOUT: !93 = !DILocation(line: 18, column: 18, scope: !85)
// CHECK:STDOUT: !94 = !DILocation(line: 18, column: 3, scope: !85)
// CHECK:STDOUT: !95 = !DILocation(line: 19, column: 18, scope: !85)
// CHECK:STDOUT: !96 = !DILocation(line: 19, column: 3, scope: !85)
// CHECK:STDOUT: !97 = !DILocation(line: 20, column: 18, scope: !85)
// CHECK:STDOUT: !98 = !DILocation(line: 20, column: 3, scope: !85)
// CHECK:STDOUT: !99 = !DILocation(line: 16, column: 1, scope: !85)
// CHECK:STDOUT: !100 = !{!86, !87}
// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !32, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !102 = !DILocation(line: 14, column: 1, scope: !101)
// CHECK:STDOUT: !103 = !DILocation(line: 0, scope: !101)
// CHECK:STDOUT: !104 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !105 = !{!"omnipotent char", !104, i64 0}
// CHECK:STDOUT: !106 = !{!"any pointer", !105, i64 0}
// CHECK:STDOUT: !107 = !{!"p1 omnipotent char", !106, i64 0}
// CHECK:STDOUT: !108 = !{!107, !107, i64 0}
// CHECK:STDOUT: !109 = !{!"short", !105, i64 0}
// CHECK:STDOUT: !110 = !{!"p1 short", !106, i64 0}
// CHECK:STDOUT: !111 = !{!110, !110, i64 0}
// CHECK:STDOUT: !112 = !{!"int", !105, i64 0}
// CHECK:STDOUT: !113 = !{!112, !112, i64 0}
// CHECK:STDOUT: !114 = !{!"long", !105, i64 0}
// CHECK:STDOUT: !115 = !{!114, !114, i64 0}
// CHECK:STDOUT: !116 = !{!105, !105, i64 0}
// CHECK:STDOUT: !117 = !{!109, !109, i64 0}
// CHECK:STDOUT: !118 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !119 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !120 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !121 = !{!"__libc_errno", !112, i64 0}
// CHECK:STDOUT: !122 = !{!121, !112, i64 0}
// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core", scope: null, file: !32, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !88)
// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !36)
// CHECK:STDOUT: !87 = !DILocation(line: 7, column: 19, scope: !85)
// CHECK:STDOUT: !88 = !{!86}
// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4954785a8b134801:core.Destroy.Core", scope: null, file: !32, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !92)
// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !36)
// CHECK:STDOUT: !91 = !DILocation(line: 7, column: 19, scope: !89)
// CHECK:STDOUT: !92 = !{!90}
// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.99892fadd247b492:core.Destroy.Core", scope: null, file: !32, line: 9, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !96)
// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !39)
// CHECK:STDOUT: !95 = !DILocation(line: 9, column: 24, scope: !93)
// CHECK:STDOUT: !96 = !{!94}
// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !32, line: 9, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !100)
// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !39)
// CHECK:STDOUT: !99 = !DILocation(line: 9, column: 24, scope: !97)
// CHECK:STDOUT: !100 = !{!98}
// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !32, line: 9, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !104)
// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !39)
// CHECK:STDOUT: !103 = !DILocation(line: 9, column: 24, scope: !101)
// CHECK:STDOUT: !104 = !{!102}
// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core", scope: null, file: !32, line: 9, type: !54, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !108)
// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !8)
// CHECK:STDOUT: !107 = !DILocation(line: 9, column: 21, scope: !105)
// CHECK:STDOUT: !108 = !{!106}
// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core", scope: null, file: !32, line: 9, type: !54, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !112)
// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !8)
// CHECK:STDOUT: !111 = !DILocation(line: 9, column: 21, scope: !109)
// CHECK:STDOUT: !112 = !{!110}
// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.be60742f00557eec:core.Destroy.Core", scope: null, file: !32, line: 9, type: !54, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !116)
// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !8)
// CHECK:STDOUT: !115 = !DILocation(line: 9, column: 21, scope: !113)
// CHECK:STDOUT: !116 = !{!114}
// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !32, line: 16, type: !58, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !132)
// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !37)
// CHECK:STDOUT: !119 = !DILocalVariable(arg: 2, scope: !117, type: !42)
// CHECK:STDOUT: !122 = !DILocation(line: 17, column: 18, scope: !117)
// CHECK:STDOUT: !123 = !DILocation(line: 17, column: 3, scope: !117)
// CHECK:STDOUT: !125 = !DILocation(line: 18, column: 18, scope: !117)
// CHECK:STDOUT: !126 = !DILocation(line: 18, column: 3, scope: !117)
// CHECK:STDOUT: !127 = !DILocation(line: 19, column: 18, scope: !117)
// CHECK:STDOUT: !128 = !DILocation(line: 19, column: 3, scope: !117)
// CHECK:STDOUT: !129 = !DILocation(line: 20, column: 18, scope: !117)
// CHECK:STDOUT: !130 = !DILocation(line: 20, column: 3, scope: !117)
// CHECK:STDOUT: !131 = !DILocation(line: 16, column: 1, scope: !117)
// CHECK:STDOUT: !132 = !{!118, !119}
// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !32, type: !41, spFlags: DISPFlagDefinition, unit: !33)
// CHECK:STDOUT: !134 = !DILocation(line: 14, column: 1, scope: !133)
// CHECK:STDOUT: !135 = !DILocation(line: 0, scope: !133)
// CHECK:STDOUT: !136 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !137 = !{!"omnipotent char", !136, i64 0}
// CHECK:STDOUT: !138 = !{!"any pointer", !137, i64 0}
// CHECK:STDOUT: !139 = !{!"p1 omnipotent char", !138, i64 0}
// CHECK:STDOUT: !140 = !{!139, !139, i64 0}
// CHECK:STDOUT: !141 = !{!"short", !137, i64 0}
// CHECK:STDOUT: !142 = !{!"p1 short", !138, i64 0}
// CHECK:STDOUT: !143 = !{!142, !142, i64 0}
// CHECK:STDOUT: !144 = !{!"int", !137, i64 0}
// CHECK:STDOUT: !145 = !{!144, !144, i64 0}
// CHECK:STDOUT: !146 = !{!"long", !137, i64 0}
// CHECK:STDOUT: !147 = !{!146, !146, i64 0}
// CHECK:STDOUT: !148 = !{!137, !137, i64 0}
// CHECK:STDOUT: !149 = !{!141, !141, i64 0}
// CHECK:STDOUT: !150 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !151 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !152 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !153 = !{!"__libc_errno", !144, i64 0}
// CHECK:STDOUT: !154 = !{!153, !144, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'import_struct.carbon'
@@ -368,35 +452,36 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: %struct.X = type { i32, i32, i32 }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !127 {
// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !159 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !128
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !128
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !128
// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !130
// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !130
// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !131
// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !131
// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !132
// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !132
// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !134
// CHECK:STDOUT: ret void, !dbg !135
// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !160
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !160
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !160
// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !162
// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !162
// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !163
// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !163
// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !164
// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !164
// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !166
// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %x.var), !dbg !160
// CHECK:STDOUT: ret void, !dbg !167
// 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: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !145
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !145
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !181
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !181
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !137 {
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !169 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !138
// CHECK:STDOUT: ret void, !dbg !138
// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !170
// CHECK:STDOUT: ret void, !dbg !170
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -405,9 +490,9 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %struct.X, align 4
// CHECK:STDOUT: %agg.tmp.coerce = alloca { i64, i32 }, align 4
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !145
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !145
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !147
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !181
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !181
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !183
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp.coerce, ptr align 4 %agg.tmp, i64 12, i1 false)
// CHECK:STDOUT: %2 = getelementptr inbounds nuw { i64, i32 }, ptr %agg.tmp.coerce, i32 0, i32 0
// CHECK:STDOUT: %3 = load i64, ptr %2, align 4
@@ -417,13 +502,19 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %self) #0 !dbg !171 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !173
// 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)) #4
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr sret([12 x i8]) %return) #0 !dbg !139 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !142
// CHECK:STDOUT: ret void, !dbg !143
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr sret([12 x i8]) %return) #0 !dbg !175 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !178
// CHECK:STDOUT: ret void, !dbg !179
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z11pass_struct1X(i64, i32) #5
@@ -441,9 +532,9 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #5 = { "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.dbg.cu = !{!124}
// CHECK:STDOUT: !llvm.module.flags = !{!118, !119, !120, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!122}
// CHECK:STDOUT: !llvm.dbg.cu = !{!156}
// CHECK:STDOUT: !llvm.module.flags = !{!150, !151, !152, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!154}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -451,36 +542,42 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: !40 = !{null}
// CHECK:STDOUT: !41 = !DISubroutineType(types: !40)
// CHECK:STDOUT: !42 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !104 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !105 = !{!"omnipotent char", !104, i64 0}
// CHECK:STDOUT: !106 = !{!"any pointer", !105, i64 0}
// CHECK:STDOUT: !112 = !{!"int", !105, i64 0}
// CHECK:STDOUT: !113 = !{!112, !112, i64 0}
// CHECK:STDOUT: !118 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !119 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !120 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !121 = !{!"__libc_errno", !112, i64 0}
// CHECK:STDOUT: !122 = !{!121, !112, i64 0}
// CHECK:STDOUT: !123 = !DIFile(filename: "import_struct.carbon", directory: "")
// CHECK:STDOUT: !124 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !123, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !125 = !{!42}
// CHECK:STDOUT: !126 = !DISubroutineType(types: !125)
// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !123, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !124)
// CHECK:STDOUT: !128 = !DILocation(line: 7, column: 3, scope: !127)
// CHECK:STDOUT: !130 = !DILocation(line: 8, column: 3, scope: !127)
// CHECK:STDOUT: !131 = !DILocation(line: 9, column: 3, scope: !127)
// CHECK:STDOUT: !132 = !DILocation(line: 10, column: 3, scope: !127)
// CHECK:STDOUT: !134 = !DILocation(line: 11, column: 3, scope: !127)
// CHECK:STDOUT: !135 = !DILocation(line: 6, column: 1, scope: !127)
// CHECK:STDOUT: !136 = !DIFile(filename: "./struct.h", directory: "")
// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !136, line: 2, type: !126, spFlags: DISPFlagDefinition, unit: !124)
// CHECK:STDOUT: !138 = !DILocation(line: 2, column: 8, scope: !137)
// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !26, line: 9, type: !126, spFlags: DISPFlagDefinition, unit: !124)
// CHECK:STDOUT: !142 = !DILocation(line: 9, column: 28, scope: !139)
// CHECK:STDOUT: !143 = !DILocation(line: 9, column: 21, scope: !139)
// CHECK:STDOUT: !144 = !{!"p1 _ZTS1X", !106, i64 0}
// CHECK:STDOUT: !59 = !{null, !42}
// CHECK:STDOUT: !60 = !DISubroutineType(types: !59)
// CHECK:STDOUT: !136 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !137 = !{!"omnipotent char", !136, i64 0}
// CHECK:STDOUT: !138 = !{!"any pointer", !137, i64 0}
// CHECK:STDOUT: !144 = !{!"int", !137, i64 0}
// CHECK:STDOUT: !145 = !{!144, !144, i64 0}
// CHECK:STDOUT: !147 = !{i64 0, i64 4, !113, i64 4, i64 4, !113, i64 8, i64 4, !113}
// CHECK:STDOUT: !150 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !151 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !152 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !153 = !{!"__libc_errno", !144, i64 0}
// CHECK:STDOUT: !154 = !{!153, !144, i64 0}
// CHECK:STDOUT: !155 = !DIFile(filename: "import_struct.carbon", directory: "")
// CHECK:STDOUT: !156 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !155, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !157 = !{!42}
// CHECK:STDOUT: !158 = !DISubroutineType(types: !157)
// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !155, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !156)
// CHECK:STDOUT: !160 = !DILocation(line: 7, column: 3, scope: !159)
// CHECK:STDOUT: !162 = !DILocation(line: 8, column: 3, scope: !159)
// CHECK:STDOUT: !163 = !DILocation(line: 9, column: 3, scope: !159)
// CHECK:STDOUT: !164 = !DILocation(line: 10, column: 3, scope: !159)
// CHECK:STDOUT: !166 = !DILocation(line: 11, column: 3, scope: !159)
// CHECK:STDOUT: !167 = !DILocation(line: 6, column: 1, scope: !159)
// CHECK:STDOUT: !168 = !DIFile(filename: "./struct.h", directory: "")
// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !168, line: 2, type: !158, spFlags: DISPFlagDefinition, unit: !156)
// CHECK:STDOUT: !170 = !DILocation(line: 2, column: 8, scope: !169)
// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core", scope: null, file: !155, line: 7, type: !60, spFlags: DISPFlagDefinition, unit: !156, retainedNodes: !174)
// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !42)
// CHECK:STDOUT: !173 = !DILocation(line: 7, column: 3, scope: !171)
// CHECK:STDOUT: !174 = !{!172}
// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !26, line: 9, type: !158, spFlags: DISPFlagDefinition, unit: !156)
// CHECK:STDOUT: !178 = !DILocation(line: 9, column: 28, scope: !175)
// CHECK:STDOUT: !179 = !DILocation(line: 9, column: 21, scope: !175)
// CHECK:STDOUT: !180 = !{!"p1 _ZTS1X", !138, i64 0}
// CHECK:STDOUT: !181 = !{!180, !180, i64 0}
// CHECK:STDOUT: !183 = !{i64 0, i64 4, !145, i64 4, i64 4, !145, i64 8, i64 4, !145}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'import_class_with_nontrivial_copy.carbon'
@@ -491,18 +588,19 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: %class.Y = type { i32, i32, i32 }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassRefExpr.Main() #0 !dbg !150 {
// CHECK:STDOUT: define void @_CPassRefExpr.Main() #0 !dbg !186 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !151
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !151
// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !153
// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !153
// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !154
// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !154
// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !155
// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !155
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !157
// CHECK:STDOUT: ret void, !dbg !158
// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !187
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !187
// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !189
// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !189
// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !190
// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !190
// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !191
// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !191
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !193
// CHECK:STDOUT: call void @"_CSelfDestruct.988e3d50a7ba5577:core.Destroy.Core"(ptr %y.var), !dbg !187
// CHECK:STDOUT: ret void, !dbg !194
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -510,30 +608,37 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %class.Y, align 4
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !171
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !171
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !211
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !211
// CHECK:STDOUT: call void @_ZN1YC1ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %agg.tmp, ptr noundef nonnull align 4 dereferenceable(12) %1)
// CHECK:STDOUT: call void @_Z11pass_struct1Y(ptr nofreeobj noundef align 4 dead_on_return dereferenceable(12) %agg.tmp)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.988e3d50a7ba5577:core.Destroy.Core"(ptr %self) #0 !dbg !195 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !197
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_CMake.Main(ptr sret([12 x i8]))
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassInitExpr.Main() #0 !dbg !159 {
// CHECK:STDOUT: define void @_CPassInitExpr.Main() #0 !dbg !199 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !160
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !160
// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !160
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !161
// CHECK:STDOUT: ret void, !dbg !162
// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !200
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !200
// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !200
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !201
// CHECK:STDOUT: call void @"_CSelfDestruct.988e3d50a7ba5577:core.Destroy.Core"(ptr %.loc17_24.1.temp), !dbg !200
// CHECK:STDOUT: ret void, !dbg !202
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !163 {
// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !203 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !167
// CHECK:STDOUT: ret void, !dbg !168
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !207
// CHECK:STDOUT: ret void, !dbg !208
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -551,9 +656,9 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #3 = { "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.dbg.cu = !{!149}
// CHECK:STDOUT: !llvm.module.flags = !{!118, !119, !120, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!122}
// CHECK:STDOUT: !llvm.dbg.cu = !{!185}
// CHECK:STDOUT: !llvm.module.flags = !{!150, !151, !152, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!154}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -562,33 +667,37 @@ fn PassValueExpr(y: Cpp.Y) {
// CHECK:STDOUT: !42 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !59 = !{null, !42}
// CHECK:STDOUT: !60 = !DISubroutineType(types: !59)
// CHECK:STDOUT: !104 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !105 = !{!"omnipotent char", !104, i64 0}
// CHECK:STDOUT: !106 = !{!"any pointer", !105, i64 0}
// CHECK:STDOUT: !112 = !{!"int", !105, i64 0}
// CHECK:STDOUT: !118 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !119 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !120 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !121 = !{!"__libc_errno", !112, i64 0}
// CHECK:STDOUT: !122 = !{!121, !112, i64 0}
// CHECK:STDOUT: !148 = !DIFile(filename: "import_class_with_nontrivial_copy.carbon", directory: "")
// CHECK:STDOUT: !149 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !148, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !148, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !149)
// CHECK:STDOUT: !151 = !DILocation(line: 7, column: 3, scope: !150)
// CHECK:STDOUT: !153 = !DILocation(line: 8, column: 3, scope: !150)
// CHECK:STDOUT: !154 = !DILocation(line: 9, column: 3, scope: !150)
// CHECK:STDOUT: !155 = !DILocation(line: 10, column: 3, scope: !150)
// CHECK:STDOUT: !157 = !DILocation(line: 11, column: 3, scope: !150)
// CHECK:STDOUT: !158 = !DILocation(line: 6, column: 1, scope: !150)
// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !148, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !149)
// CHECK:STDOUT: !160 = !DILocation(line: 17, column: 19, scope: !159)
// CHECK:STDOUT: !161 = !DILocation(line: 17, column: 3, scope: !159)
// CHECK:STDOUT: !162 = !DILocation(line: 16, column: 1, scope: !159)
// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !148, line: 20, type: !60, spFlags: DISPFlagDefinition, unit: !149, retainedNodes: !169)
// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !42)
// CHECK:STDOUT: !167 = !DILocation(line: 21, column: 3, scope: !163)
// CHECK:STDOUT: !168 = !DILocation(line: 20, column: 1, scope: !163)
// CHECK:STDOUT: !169 = !{!164}
// CHECK:STDOUT: !170 = !{!"p1 _ZTS1Y", !106, i64 0}
// CHECK:STDOUT: !171 = !{!170, !170, i64 0}
// CHECK:STDOUT: !136 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !137 = !{!"omnipotent char", !136, i64 0}
// CHECK:STDOUT: !138 = !{!"any pointer", !137, i64 0}
// CHECK:STDOUT: !144 = !{!"int", !137, i64 0}
// CHECK:STDOUT: !150 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !151 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !152 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !153 = !{!"__libc_errno", !144, i64 0}
// CHECK:STDOUT: !154 = !{!153, !144, i64 0}
// CHECK:STDOUT: !184 = !DIFile(filename: "import_class_with_nontrivial_copy.carbon", directory: "")
// CHECK:STDOUT: !185 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !184, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !184, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !185)
// CHECK:STDOUT: !187 = !DILocation(line: 7, column: 3, scope: !186)
// CHECK:STDOUT: !189 = !DILocation(line: 8, column: 3, scope: !186)
// CHECK:STDOUT: !190 = !DILocation(line: 9, column: 3, scope: !186)
// CHECK:STDOUT: !191 = !DILocation(line: 10, column: 3, scope: !186)
// CHECK:STDOUT: !193 = !DILocation(line: 11, column: 3, scope: !186)
// CHECK:STDOUT: !194 = !DILocation(line: 6, column: 1, scope: !186)
// CHECK:STDOUT: !195 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.988e3d50a7ba5577:core.Destroy.Core", scope: null, file: !184, line: 7, type: !60, spFlags: DISPFlagDefinition, unit: !185, retainedNodes: !198)
// CHECK:STDOUT: !196 = !DILocalVariable(arg: 1, scope: !195, type: !42)
// CHECK:STDOUT: !197 = !DILocation(line: 7, column: 3, scope: !195)
// CHECK:STDOUT: !198 = !{!196}
// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !184, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !185)
// CHECK:STDOUT: !200 = !DILocation(line: 17, column: 19, scope: !199)
// CHECK:STDOUT: !201 = !DILocation(line: 17, column: 3, scope: !199)
// CHECK:STDOUT: !202 = !DILocation(line: 16, column: 1, scope: !199)
// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !184, line: 20, type: !60, spFlags: DISPFlagDefinition, unit: !185, retainedNodes: !209)
// CHECK:STDOUT: !204 = !DILocalVariable(arg: 1, scope: !203, type: !42)
// CHECK:STDOUT: !207 = !DILocation(line: 21, column: 3, scope: !203)
// CHECK:STDOUT: !208 = !DILocation(line: 20, column: 1, scope: !203)
// CHECK:STDOUT: !209 = !{!204}
// CHECK:STDOUT: !210 = !{!"p1 _ZTS1Y", !138, i64 0}
// CHECK:STDOUT: !211 = !{!210, !210, i64 0}
// CHECK:STDOUT:
@@ -132,10 +132,10 @@ fn Call(x: Cpp.D) -> Cpp.C {
// 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 !199
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !199
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !263
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !263
// CHECK:STDOUT: %call = call noundef zeroext i8 @_Z8ReturnU8v()
// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !200
// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !264
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -153,10 +153,10 @@ fn Call(x: Cpp.D) -> Cpp.C {
// 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 !203
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !203
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !267
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !267
// CHECK:STDOUT: %call = call noundef zeroext i16 @_Z9ReturnU16v()
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !204
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !268
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -192,10 +192,10 @@ fn Call(x: Cpp.D) -> Cpp.C {
// 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 !199
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !199
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !263
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !263
// CHECK:STDOUT: %call = call noundef signext i8 @_Z8ReturnI8v()
// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !200
// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !264
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -213,10 +213,10 @@ fn Call(x: Cpp.D) -> Cpp.C {
// 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 !203
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !203
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !267
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !267
// CHECK:STDOUT: %call = call noundef signext i16 @_Z9ReturnI16v()
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !204
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !268
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -264,110 +264,214 @@ fn Call(x: Cpp.D) -> Cpp.C {
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !112
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !115
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.4, i16 %.loc20_35.4, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.4, i16 %.loc25_35.4, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !126
// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc25_35.1.temp), !dbg !109
// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %.loc24_32.1.temp), !dbg !106
// CHECK:STDOUT: call void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr %.loc20_35.1.temp), !dbg !97
// CHECK:STDOUT: call void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !94
// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc25_35.1.temp), !dbg !109
// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %.loc24_32.1.temp), !dbg !106
// CHECK:STDOUT: call void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr %.loc20_35.1.temp), !dbg !97
// CHECK:STDOUT: call void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !94
// CHECK:STDOUT: ret void, !dbg !127
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !128 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core"(ptr %self) #0 !dbg !128 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !130
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !132 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !132 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !134
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !136 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !136 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self), !dbg !138
// CHECK:STDOUT: ret void, !dbg !138
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !140 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core"(ptr %self) #0 !dbg !140 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !142
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !144 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !144 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !145
// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !148
// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !151
// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !154
// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !157
// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !160
// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !163
// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !166
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !145
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %my_u8.var), !dbg !146
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !148
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %my_u16.var), !dbg !149
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !151
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !152
// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !151
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !154
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !155
// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !154
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !157
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %my_i8.var), !dbg !158
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !160
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %my_i16.var), !dbg !161
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !163
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !164
// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !163
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !166
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !167
// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !166
// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !169
// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !170
// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !171
// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !172
// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !173
// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !174
// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !175
// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !176
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !177
// CHECK:STDOUT: call void @"_COp.5aacfd7dcc330b17:core.Destroy.Core"(ptr %my_i64.var), !dbg !166
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %my_i32.var), !dbg !163
// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %my_i16.var), !dbg !160
// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %my_i8.var), !dbg !157
// CHECK:STDOUT: call void @"_COp.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %my_u64.var), !dbg !154
// CHECK:STDOUT: call void @"_COp.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %my_u32.var), !dbg !151
// CHECK:STDOUT: call void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr %my_u16.var), !dbg !148
// CHECK:STDOUT: call void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %my_u8.var), !dbg !145
// CHECK:STDOUT: ret void, !dbg !178
// CHECK:STDOUT: ret void, !dbg !146
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !179 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !148 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !181
// CHECK:STDOUT: call void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self), !dbg !150
// CHECK:STDOUT: ret void, !dbg !150
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !183 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.99892fadd247b492:core.Destroy.Core"(ptr %self) #0 !dbg !152 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !185
// CHECK:STDOUT: ret void, !dbg !154
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %self) #0 !dbg !187 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !156 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !189
// CHECK:STDOUT: ret void, !dbg !158
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %self) #0 !dbg !191 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !160 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !193
// CHECK:STDOUT: call void @"_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self), !dbg !162
// CHECK:STDOUT: ret void, !dbg !162
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core"(ptr %self) #0 !dbg !164 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !166
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !168 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !170
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !172 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self), !dbg !174
// CHECK:STDOUT: ret void, !dbg !174
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !176 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !177
// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !180
// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !183
// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !186
// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !189
// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !192
// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !195
// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !198
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !177
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %my_u8.var), !dbg !178
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !180
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %my_u16.var), !dbg !181
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !183
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !184
// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !183
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !186
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !187
// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !186
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !189
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %my_i8.var), !dbg !190
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !192
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %my_i16.var), !dbg !193
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !195
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !196
// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !195
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !198
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !199
// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !198
// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !201
// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !202
// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !203
// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !204
// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !205
// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !206
// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !207
// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !208
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !209
// CHECK:STDOUT: call void @"_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core"(ptr %my_i64.var), !dbg !198
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %my_i32.var), !dbg !195
// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %my_i16.var), !dbg !192
// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %my_i8.var), !dbg !189
// CHECK:STDOUT: call void @"_CSelfDestruct.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %my_u64.var), !dbg !186
// CHECK:STDOUT: call void @"_CSelfDestruct.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %my_u32.var), !dbg !183
// CHECK:STDOUT: call void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr %my_u16.var), !dbg !180
// CHECK:STDOUT: call void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %my_u8.var), !dbg !177
// CHECK:STDOUT: ret void, !dbg !210
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6e5a4ef51c9e705a:core.Destroy.Core"(ptr %self) #0 !dbg !211 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !213
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !215 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !217
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !219 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self), !dbg !221
// CHECK:STDOUT: ret void, !dbg !221
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !223 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !225
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !227 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !229
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !231 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !233
// CHECK:STDOUT: ret void, !dbg !233
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.98b8c1354df43b20:core.Destroy.Core"(ptr %self) #0 !dbg !235 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !237
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %self) #0 !dbg !239 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !241
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %self) #0 !dbg !243 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %self), !dbg !245
// CHECK:STDOUT: ret void, !dbg !245
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b18ca5df050aa3af:core.Destroy.Core"(ptr %self) #0 !dbg !247 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !249
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %self) #0 !dbg !251 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !253
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %self) #0 !dbg !255 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %self), !dbg !257
// CHECK:STDOUT: ret void, !dbg !257
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -390,8 +494,8 @@ fn Call(x: Cpp.D) -> Cpp.C {
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!210}
// CHECK:STDOUT: !llvm.module.flags = !{!269, !270, !271, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!274}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -474,81 +578,145 @@ fn Call(x: Cpp.D) -> Cpp.C {
// CHECK:STDOUT: !115 = !DILocation(line: 27, column: 21, scope: !93)
// CHECK:STDOUT: !126 = !DILocation(line: 29, column: 3, scope: !93)
// CHECK:STDOUT: !127 = !DILocation(line: 18, column: 1, scope: !93)
// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !131)
// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !131)
// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !11)
// CHECK:STDOUT: !130 = !DILocation(line: 25, column: 21, scope: !128)
// CHECK:STDOUT: !131 = !{!129}
// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4954785a8b134801:core.Destroy.Core", scope: null, file: !4, line: 24, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !135)
// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !10)
// CHECK:STDOUT: !134 = !DILocation(line: 24, column: 19, scope: !132)
// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !135)
// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !11)
// CHECK:STDOUT: !134 = !DILocation(line: 25, column: 21, scope: !132)
// CHECK:STDOUT: !135 = !{!133}
// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !4, line: 20, type: !42, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !139)
// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !7)
// CHECK:STDOUT: !138 = !DILocation(line: 20, column: 21, scope: !136)
// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !139)
// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !11)
// CHECK:STDOUT: !138 = !DILocation(line: 25, column: 21, scope: !136)
// CHECK:STDOUT: !139 = !{!137}
// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "Op", linkageName: "_COp.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 19, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143)
// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !6)
// CHECK:STDOUT: !142 = !DILocation(line: 19, column: 19, scope: !140)
// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core", scope: null, file: !4, line: 24, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143)
// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !10)
// CHECK:STDOUT: !142 = !DILocation(line: 24, column: 19, scope: !140)
// CHECK:STDOUT: !143 = !{!141}
// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !4, line: 32, type: !36, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !145 = !DILocation(line: 33, column: 3, scope: !144)
// CHECK:STDOUT: !146 = !DILocation(line: 33, column: 19, scope: !144)
// CHECK:STDOUT: !148 = !DILocation(line: 34, column: 3, scope: !144)
// CHECK:STDOUT: !149 = !DILocation(line: 34, column: 21, scope: !144)
// CHECK:STDOUT: !151 = !DILocation(line: 35, column: 3, scope: !144)
// CHECK:STDOUT: !152 = !DILocation(line: 35, column: 21, scope: !144)
// CHECK:STDOUT: !154 = !DILocation(line: 36, column: 3, scope: !144)
// CHECK:STDOUT: !155 = !DILocation(line: 36, column: 21, scope: !144)
// CHECK:STDOUT: !157 = !DILocation(line: 38, column: 3, scope: !144)
// CHECK:STDOUT: !158 = !DILocation(line: 38, column: 19, scope: !144)
// CHECK:STDOUT: !160 = !DILocation(line: 39, column: 3, scope: !144)
// CHECK:STDOUT: !161 = !DILocation(line: 39, column: 21, scope: !144)
// CHECK:STDOUT: !163 = !DILocation(line: 40, column: 3, scope: !144)
// CHECK:STDOUT: !164 = !DILocation(line: 40, column: 21, scope: !144)
// CHECK:STDOUT: !166 = !DILocation(line: 41, column: 3, scope: !144)
// CHECK:STDOUT: !167 = !DILocation(line: 41, column: 21, scope: !144)
// CHECK:STDOUT: !169 = !DILocation(line: 43, column: 7, scope: !144)
// CHECK:STDOUT: !170 = !DILocation(line: 43, column: 14, scope: !144)
// CHECK:STDOUT: !171 = !DILocation(line: 43, column: 22, scope: !144)
// CHECK:STDOUT: !172 = !DILocation(line: 43, column: 30, scope: !144)
// CHECK:STDOUT: !173 = !DILocation(line: 43, column: 38, scope: !144)
// CHECK:STDOUT: !174 = !DILocation(line: 43, column: 45, scope: !144)
// CHECK:STDOUT: !175 = !DILocation(line: 43, column: 53, scope: !144)
// CHECK:STDOUT: !176 = !DILocation(line: 43, column: 61, scope: !144)
// CHECK:STDOUT: !177 = !DILocation(line: 43, column: 3, scope: !144)
// CHECK:STDOUT: !178 = !DILocation(line: 32, column: 1, scope: !144)
// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 41, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !182)
// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !13)
// CHECK:STDOUT: !181 = !DILocation(line: 41, column: 3, scope: !179)
// CHECK:STDOUT: !182 = !{!180}
// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !186)
// CHECK:STDOUT: !184 = !DILocalVariable(arg: 1, scope: !183, type: !12)
// CHECK:STDOUT: !185 = !DILocation(line: 40, column: 3, scope: !183)
// CHECK:STDOUT: !186 = !{!184}
// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "Op", linkageName: "_COp.18a2a1ac0d16cf80:core.Destroy.Core", scope: null, file: !4, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !190)
// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !187, type: !9)
// CHECK:STDOUT: !189 = !DILocation(line: 36, column: 3, scope: !187)
// CHECK:STDOUT: !190 = !{!188}
// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ea3ccedbd6a1c75d:core.Destroy.Core", scope: null, file: !4, line: 35, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !194)
// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !8)
// CHECK:STDOUT: !193 = !DILocation(line: 35, column: 3, scope: !191)
// CHECK:STDOUT: !194 = !{!192}
// CHECK:STDOUT: !195 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !196 = !{!"omnipotent char", !195, i64 0}
// CHECK:STDOUT: !197 = !{!"any pointer", !196, i64 0}
// CHECK:STDOUT: !198 = !{!"p1 omnipotent char", !197, i64 0}
// CHECK:STDOUT: !199 = !{!198, !198, i64 0}
// CHECK:STDOUT: !200 = !{!196, !196, i64 0}
// CHECK:STDOUT: !201 = !{!"short", !196, i64 0}
// CHECK:STDOUT: !202 = !{!"p1 short", !197, i64 0}
// CHECK:STDOUT: !203 = !{!202, !202, i64 0}
// CHECK:STDOUT: !204 = !{!201, !201, i64 0}
// CHECK:STDOUT: !205 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !206 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !207 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !208 = !{!"int", !196, i64 0}
// CHECK:STDOUT: !209 = !{!"__libc_errno", !208, i64 0}
// CHECK:STDOUT: !210 = !{!209, !208, i64 0}
// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core", scope: null, file: !4, line: 24, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !147)
// CHECK:STDOUT: !145 = !DILocalVariable(arg: 1, scope: !144, type: !10)
// CHECK:STDOUT: !146 = !DILocation(line: 24, column: 19, scope: !144)
// CHECK:STDOUT: !147 = !{!145}
// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4954785a8b134801:core.Destroy.Core", scope: null, file: !4, line: 24, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !151)
// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !10)
// CHECK:STDOUT: !150 = !DILocation(line: 24, column: 19, scope: !148)
// CHECK:STDOUT: !151 = !{!149}
// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.99892fadd247b492:core.Destroy.Core", scope: null, file: !4, line: 20, type: !42, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !155)
// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !152, type: !7)
// CHECK:STDOUT: !154 = !DILocation(line: 20, column: 21, scope: !152)
// CHECK:STDOUT: !155 = !{!153}
// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !4, line: 20, type: !42, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !159)
// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !7)
// CHECK:STDOUT: !158 = !DILocation(line: 20, column: 21, scope: !156)
// CHECK:STDOUT: !159 = !{!157}
// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !4, line: 20, type: !42, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !163)
// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !7)
// CHECK:STDOUT: !162 = !DILocation(line: 20, column: 21, scope: !160)
// CHECK:STDOUT: !163 = !{!161}
// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core", scope: null, file: !4, line: 19, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !167)
// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !6)
// CHECK:STDOUT: !166 = !DILocation(line: 19, column: 19, scope: !164)
// CHECK:STDOUT: !167 = !{!165}
// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 19, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !171)
// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !6)
// CHECK:STDOUT: !170 = !DILocation(line: 19, column: 19, scope: !168)
// CHECK:STDOUT: !171 = !{!169}
// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 19, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !175)
// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !172, type: !6)
// CHECK:STDOUT: !174 = !DILocation(line: 19, column: 19, scope: !172)
// CHECK:STDOUT: !175 = !{!173}
// CHECK:STDOUT: !176 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !4, line: 32, type: !36, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !177 = !DILocation(line: 33, column: 3, scope: !176)
// CHECK:STDOUT: !178 = !DILocation(line: 33, column: 19, scope: !176)
// CHECK:STDOUT: !180 = !DILocation(line: 34, column: 3, scope: !176)
// CHECK:STDOUT: !181 = !DILocation(line: 34, column: 21, scope: !176)
// CHECK:STDOUT: !183 = !DILocation(line: 35, column: 3, scope: !176)
// CHECK:STDOUT: !184 = !DILocation(line: 35, column: 21, scope: !176)
// CHECK:STDOUT: !186 = !DILocation(line: 36, column: 3, scope: !176)
// CHECK:STDOUT: !187 = !DILocation(line: 36, column: 21, scope: !176)
// CHECK:STDOUT: !189 = !DILocation(line: 38, column: 3, scope: !176)
// CHECK:STDOUT: !190 = !DILocation(line: 38, column: 19, scope: !176)
// CHECK:STDOUT: !192 = !DILocation(line: 39, column: 3, scope: !176)
// CHECK:STDOUT: !193 = !DILocation(line: 39, column: 21, scope: !176)
// CHECK:STDOUT: !195 = !DILocation(line: 40, column: 3, scope: !176)
// CHECK:STDOUT: !196 = !DILocation(line: 40, column: 21, scope: !176)
// CHECK:STDOUT: !198 = !DILocation(line: 41, column: 3, scope: !176)
// CHECK:STDOUT: !199 = !DILocation(line: 41, column: 21, scope: !176)
// CHECK:STDOUT: !201 = !DILocation(line: 43, column: 7, scope: !176)
// CHECK:STDOUT: !202 = !DILocation(line: 43, column: 14, scope: !176)
// CHECK:STDOUT: !203 = !DILocation(line: 43, column: 22, scope: !176)
// CHECK:STDOUT: !204 = !DILocation(line: 43, column: 30, scope: !176)
// CHECK:STDOUT: !205 = !DILocation(line: 43, column: 38, scope: !176)
// CHECK:STDOUT: !206 = !DILocation(line: 43, column: 45, scope: !176)
// CHECK:STDOUT: !207 = !DILocation(line: 43, column: 53, scope: !176)
// CHECK:STDOUT: !208 = !DILocation(line: 43, column: 61, scope: !176)
// CHECK:STDOUT: !209 = !DILocation(line: 43, column: 3, scope: !176)
// CHECK:STDOUT: !210 = !DILocation(line: 32, column: 1, scope: !176)
// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6e5a4ef51c9e705a:core.Destroy.Core", scope: null, file: !4, line: 41, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !214)
// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !13)
// CHECK:STDOUT: !213 = !DILocation(line: 41, column: 3, scope: !211)
// CHECK:STDOUT: !214 = !{!212}
// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 41, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !218)
// CHECK:STDOUT: !216 = !DILocalVariable(arg: 1, scope: !215, type: !13)
// CHECK:STDOUT: !217 = !DILocation(line: 41, column: 3, scope: !215)
// CHECK:STDOUT: !218 = !{!216}
// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 41, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !222)
// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !13)
// CHECK:STDOUT: !221 = !DILocation(line: 41, column: 3, scope: !219)
// CHECK:STDOUT: !222 = !{!220}
// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !226)
// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !12)
// CHECK:STDOUT: !225 = !DILocation(line: 40, column: 3, scope: !223)
// CHECK:STDOUT: !226 = !{!224}
// CHECK:STDOUT: !227 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !230)
// CHECK:STDOUT: !228 = !DILocalVariable(arg: 1, scope: !227, type: !12)
// CHECK:STDOUT: !229 = !DILocation(line: 40, column: 3, scope: !227)
// CHECK:STDOUT: !230 = !{!228}
// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !234)
// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !12)
// CHECK:STDOUT: !233 = !DILocation(line: 40, column: 3, scope: !231)
// CHECK:STDOUT: !234 = !{!232}
// CHECK:STDOUT: !235 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.98b8c1354df43b20:core.Destroy.Core", scope: null, file: !4, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !238)
// CHECK:STDOUT: !236 = !DILocalVariable(arg: 1, scope: !235, type: !9)
// CHECK:STDOUT: !237 = !DILocation(line: 36, column: 3, scope: !235)
// CHECK:STDOUT: !238 = !{!236}
// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.18a2a1ac0d16cf80:core.Destroy.Core", scope: null, file: !4, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !242)
// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !9)
// CHECK:STDOUT: !241 = !DILocation(line: 36, column: 3, scope: !239)
// CHECK:STDOUT: !242 = !{!240}
// CHECK:STDOUT: !243 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.18a2a1ac0d16cf80:core.Destroy.Core", scope: null, file: !4, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !246)
// CHECK:STDOUT: !244 = !DILocalVariable(arg: 1, scope: !243, type: !9)
// CHECK:STDOUT: !245 = !DILocation(line: 36, column: 3, scope: !243)
// CHECK:STDOUT: !246 = !{!244}
// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b18ca5df050aa3af:core.Destroy.Core", scope: null, file: !4, line: 35, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !250)
// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !8)
// CHECK:STDOUT: !249 = !DILocation(line: 35, column: 3, scope: !247)
// CHECK:STDOUT: !250 = !{!248}
// CHECK:STDOUT: !251 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.ea3ccedbd6a1c75d:core.Destroy.Core", scope: null, file: !4, line: 35, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !254)
// CHECK:STDOUT: !252 = !DILocalVariable(arg: 1, scope: !251, type: !8)
// CHECK:STDOUT: !253 = !DILocation(line: 35, column: 3, scope: !251)
// CHECK:STDOUT: !254 = !{!252}
// CHECK:STDOUT: !255 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ea3ccedbd6a1c75d:core.Destroy.Core", scope: null, file: !4, line: 35, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !258)
// CHECK:STDOUT: !256 = !DILocalVariable(arg: 1, scope: !255, type: !8)
// CHECK:STDOUT: !257 = !DILocation(line: 35, column: 3, scope: !255)
// CHECK:STDOUT: !258 = !{!256}
// CHECK:STDOUT: !259 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !260 = !{!"omnipotent char", !259, i64 0}
// CHECK:STDOUT: !261 = !{!"any pointer", !260, i64 0}
// CHECK:STDOUT: !262 = !{!"p1 omnipotent char", !261, i64 0}
// CHECK:STDOUT: !263 = !{!262, !262, i64 0}
// CHECK:STDOUT: !264 = !{!260, !260, i64 0}
// CHECK:STDOUT: !265 = !{!"short", !260, i64 0}
// CHECK:STDOUT: !266 = !{!"p1 short", !261, i64 0}
// CHECK:STDOUT: !267 = !{!266, !266, i64 0}
// CHECK:STDOUT: !268 = !{!265, !265, i64 0}
// CHECK:STDOUT: !269 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !270 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !271 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !272 = !{!"int", !260, i64 0}
// CHECK:STDOUT: !273 = !{!"__libc_errno", !272, i64 0}
// CHECK:STDOUT: !274 = !{!273, !272, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'import_class.carbon'
@@ -559,43 +727,50 @@ fn Call(x: Cpp.D) -> Cpp.C {
// CHECK:STDOUT: %struct.X = type { ptr, ptr }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !215 {
// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !279 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !218
// CHECK:STDOUT: ret void, !dbg !219
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !282
// CHECK:STDOUT: ret void, !dbg !283
// 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: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !231
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !231
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !299
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !299
// CHECK:STDOUT: call void @_Z4Makev(ptr dead_on_unwind writable sret(%struct.X) align 8 %0)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !220 {
// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !284 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !221
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !221
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !221
// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %.loc9_27.1.temp), !dbg !221
// CHECK:STDOUT: ret void, !dbg !224
// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !285
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !285
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !285
// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %.loc9_27.1.temp), !dbg !285
// CHECK:STDOUT: ret void, !dbg !288
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: declare void @_ZN1XD1Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16)) unnamed_addr #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !225 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %self) #0 !dbg !289 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !226
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !226
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !227
// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %_.var), !dbg !226
// CHECK:STDOUT: ret void, !dbg !229
// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %self), !dbg !291
// CHECK:STDOUT: ret void, !dbg !291
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !293 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !294
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !294
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !295
// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %_.var), !dbg !294
// CHECK:STDOUT: ret void, !dbg !297
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -612,40 +787,46 @@ fn Call(x: Cpp.D) -> Cpp.C {
// 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.dbg.cu = !{!212}
// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!210}
// CHECK:STDOUT: !llvm.dbg.cu = !{!276}
// CHECK:STDOUT: !llvm.module.flags = !{!269, !270, !271, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!274}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !17 = !{null, !16}
// CHECK:STDOUT: !18 = !DISubroutineType(types: !17)
// CHECK:STDOUT: !35 = !{null}
// CHECK:STDOUT: !36 = !DISubroutineType(types: !35)
// CHECK:STDOUT: !195 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !196 = !{!"omnipotent char", !195, i64 0}
// CHECK:STDOUT: !197 = !{!"any pointer", !196, i64 0}
// CHECK:STDOUT: !205 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !206 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !207 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !208 = !{!"int", !196, i64 0}
// CHECK:STDOUT: !209 = !{!"__libc_errno", !208, i64 0}
// CHECK:STDOUT: !210 = !{!209, !208, i64 0}
// CHECK:STDOUT: !211 = !DIFile(filename: "import_class.carbon", directory: "")
// CHECK:STDOUT: !212 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !211, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !213 = !{!16}
// CHECK:STDOUT: !214 = !DISubroutineType(types: !213)
// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !211, line: 6, type: !214, spFlags: DISPFlagDefinition, unit: !212)
// CHECK:STDOUT: !218 = !DILocation(line: 6, column: 29, scope: !215)
// CHECK:STDOUT: !219 = !DILocation(line: 6, column: 22, scope: !215)
// CHECK:STDOUT: !220 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !211, line: 8, type: !36, spFlags: DISPFlagDefinition, unit: !212)
// CHECK:STDOUT: !221 = !DILocation(line: 9, column: 18, scope: !220)
// CHECK:STDOUT: !224 = !DILocation(line: 8, column: 1, scope: !220)
// CHECK:STDOUT: !225 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !211, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !212)
// CHECK:STDOUT: !226 = !DILocation(line: 13, column: 3, scope: !225)
// CHECK:STDOUT: !227 = !DILocation(line: 13, column: 18, scope: !225)
// CHECK:STDOUT: !229 = !DILocation(line: 12, column: 1, scope: !225)
// CHECK:STDOUT: !230 = !{!"p1 _ZTS1X", !197, i64 0}
// CHECK:STDOUT: !231 = !{!230, !230, i64 0}
// CHECK:STDOUT: !259 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !260 = !{!"omnipotent char", !259, i64 0}
// CHECK:STDOUT: !261 = !{!"any pointer", !260, i64 0}
// CHECK:STDOUT: !269 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !270 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !271 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !272 = !{!"int", !260, i64 0}
// CHECK:STDOUT: !273 = !{!"__libc_errno", !272, i64 0}
// CHECK:STDOUT: !274 = !{!273, !272, i64 0}
// CHECK:STDOUT: !275 = !DIFile(filename: "import_class.carbon", directory: "")
// CHECK:STDOUT: !276 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !275, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !277 = !{!16}
// CHECK:STDOUT: !278 = !DISubroutineType(types: !277)
// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !275, line: 6, type: !278, spFlags: DISPFlagDefinition, unit: !276)
// CHECK:STDOUT: !282 = !DILocation(line: 6, column: 29, scope: !279)
// CHECK:STDOUT: !283 = !DILocation(line: 6, column: 22, scope: !279)
// CHECK:STDOUT: !284 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !275, line: 8, type: !36, spFlags: DISPFlagDefinition, unit: !276)
// CHECK:STDOUT: !285 = !DILocation(line: 9, column: 18, scope: !284)
// CHECK:STDOUT: !288 = !DILocation(line: 8, column: 1, scope: !284)
// CHECK:STDOUT: !289 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core", scope: null, file: !275, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !276, retainedNodes: !292)
// CHECK:STDOUT: !290 = !DILocalVariable(arg: 1, scope: !289, type: !16)
// CHECK:STDOUT: !291 = !DILocation(line: 9, column: 18, scope: !289)
// CHECK:STDOUT: !292 = !{!290}
// CHECK:STDOUT: !293 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !275, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !276)
// CHECK:STDOUT: !294 = !DILocation(line: 13, column: 3, scope: !293)
// CHECK:STDOUT: !295 = !DILocation(line: 13, column: 18, scope: !293)
// CHECK:STDOUT: !297 = !DILocation(line: 12, column: 1, scope: !293)
// CHECK:STDOUT: !298 = !{!"p1 _ZTS1X", !261, i64 0}
// CHECK:STDOUT: !299 = !{!298, !298, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'indirect_return_with_args.carbon'
@@ -657,10 +838,10 @@ fn Call(x: Cpp.D) -> Cpp.C {
// CHECK:STDOUT: %class.C = type { i8 }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !239 {
// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !307 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !245
// CHECK:STDOUT: ret void, !dbg !246
// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !313
// CHECK:STDOUT: ret void, !dbg !314
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -670,10 +851,10 @@ fn Call(x: Cpp.D) -> Cpp.C {
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %class.D, align 1
// CHECK:STDOUT: %undef.agg.tmp = alloca %class.C, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !249
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !251
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !251
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !249
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !317
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !319
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !319
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !317
// CHECK:STDOUT: call void @_Z1f1D()
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -684,33 +865,33 @@ fn Call(x: Cpp.D) -> Cpp.C {
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #2 = { "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.dbg.cu = !{!234}
// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!210}
// CHECK:STDOUT: !llvm.dbg.cu = !{!302}
// CHECK:STDOUT: !llvm.module.flags = !{!269, !270, !271, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!274}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !195 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !196 = !{!"omnipotent char", !195, i64 0}
// CHECK:STDOUT: !197 = !{!"any pointer", !196, i64 0}
// CHECK:STDOUT: !205 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !206 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !207 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !208 = !{!"int", !196, i64 0}
// CHECK:STDOUT: !209 = !{!"__libc_errno", !208, i64 0}
// CHECK:STDOUT: !210 = !{!209, !208, i64 0}
// CHECK:STDOUT: !233 = !DIFile(filename: "indirect_return_with_args.carbon", directory: "")
// CHECK:STDOUT: !234 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !233, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !235 = !{!16, !16}
// CHECK:STDOUT: !236 = !DISubroutineType(types: !235)
// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !233, line: 10, type: !236, spFlags: DISPFlagDefinition, unit: !234, retainedNodes: !247)
// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !16)
// CHECK:STDOUT: !245 = !DILocation(line: 11, column: 10, scope: !239)
// CHECK:STDOUT: !246 = !DILocation(line: 11, column: 3, scope: !239)
// CHECK:STDOUT: !247 = !{!240}
// CHECK:STDOUT: !248 = !{!"p1 _ZTS1D", !197, i64 0}
// CHECK:STDOUT: !249 = !{!248, !248, i64 0}
// CHECK:STDOUT: !250 = !{!"p1 _ZTS1C", !197, i64 0}
// CHECK:STDOUT: !251 = !{!250, !250, i64 0}
// CHECK:STDOUT: !259 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !260 = !{!"omnipotent char", !259, i64 0}
// CHECK:STDOUT: !261 = !{!"any pointer", !260, i64 0}
// CHECK:STDOUT: !269 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !270 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !271 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !272 = !{!"int", !260, i64 0}
// CHECK:STDOUT: !273 = !{!"__libc_errno", !272, i64 0}
// CHECK:STDOUT: !274 = !{!273, !272, i64 0}
// CHECK:STDOUT: !301 = !DIFile(filename: "indirect_return_with_args.carbon", directory: "")
// CHECK:STDOUT: !302 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !301, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !303 = !{!16, !16}
// CHECK:STDOUT: !304 = !DISubroutineType(types: !303)
// CHECK:STDOUT: !307 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !301, line: 10, type: !304, spFlags: DISPFlagDefinition, unit: !302, retainedNodes: !315)
// CHECK:STDOUT: !308 = !DILocalVariable(arg: 1, scope: !307, type: !16)
// CHECK:STDOUT: !313 = !DILocation(line: 11, column: 10, scope: !307)
// CHECK:STDOUT: !314 = !DILocation(line: 11, column: 3, scope: !307)
// CHECK:STDOUT: !315 = !{!308}
// CHECK:STDOUT: !316 = !{!"p1 _ZTS1D", !261, i64 0}
// CHECK:STDOUT: !317 = !{!316, !316, i64 0}
// CHECK:STDOUT: !318 = !{!"p1 _ZTS1C", !261, i64 0}
// CHECK:STDOUT: !319 = !{!318, !318, i64 0}
// CHECK:STDOUT:
+65 -22
View File
@@ -49,7 +49,7 @@ void f() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %call = call noundef ptr @_ZN6CarbonL3GetEv()
// CHECK:STDOUT: %price = getelementptr inbounds nuw %"class.Carbon::A", ptr %call, i32 0, i32 0
// CHECK:STDOUT: %0 = load i32, ptr %price, align 4, !tbaa !38
// CHECK:STDOUT: %0 = load i32, ptr %price, align 4, !tbaa !54
// CHECK:STDOUT: ret i32 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -66,28 +66,55 @@ void f() {
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #2 !dbg !18 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !20
// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !20
// CHECK:STDOUT: ret void, !dbg !20
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !22 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #1 !dbg !22 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !24
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.a58e9b74ce410031:core.Destroy.Core"(ptr %self) #1 !dbg !26 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !26 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !28
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #1 !dbg !30 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !30 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !32
// CHECK:STDOUT: ret void, !dbg !32
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a58e9b74ce410031:core.Destroy.Core"(ptr %self) #1 !dbg !34 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !36
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a58e9b74ce410031:core.Destroy.Core"(ptr %self) #1 !dbg !38 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.a58e9b74ce410031:core.Destroy.Core"(ptr %self), !dbg !40
// CHECK:STDOUT: ret void, !dbg !40
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #1 !dbg !42 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !44
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #1 !dbg !46 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !48
// CHECK:STDOUT: ret void, !dbg !48
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
// CHECK:STDOUT: define internal noundef ptr @_ZN6CarbonL3GetEv() #3 {
// CHECK:STDOUT: entry:
@@ -103,8 +130,8 @@ void f() {
// CHECK:STDOUT: attributes #3 = { 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:
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
// CHECK:STDOUT: !llvm.module.flags = !{!41, !42, !43, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!45}
// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!61}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -124,26 +151,42 @@ void f() {
// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !18, type: !7)
// CHECK:STDOUT: !20 = !DILocation(line: 15, column: 1, scope: !18)
// CHECK:STDOUT: !21 = !{!19}
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25)
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25)
// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !6)
// CHECK:STDOUT: !24 = !DILocation(line: 15, column: 1, scope: !22)
// CHECK:STDOUT: !25 = !{!23}
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a58e9b74ce410031:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29)
// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !7)
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29)
// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !6)
// CHECK:STDOUT: !28 = !DILocation(line: 15, column: 1, scope: !26)
// CHECK:STDOUT: !29 = !{!27}
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33)
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !7)
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33)
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !6)
// CHECK:STDOUT: !32 = !DILocation(line: 15, column: 1, scope: !30)
// CHECK:STDOUT: !33 = !{!31}
// CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0}
// CHECK:STDOUT: !36 = !{!"int", !35, i64 0}
// CHECK:STDOUT: !37 = !{!"_ZTSN6Carbon1AE", !36, i64 0}
// CHECK:STDOUT: !38 = !{!37, !36, i64 0}
// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !44 = !{!"__libc_errno", !36, i64 0}
// CHECK:STDOUT: !45 = !{!44, !36, i64 0}
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a58e9b74ce410031:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37)
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !7)
// CHECK:STDOUT: !36 = !DILocation(line: 15, column: 1, scope: !34)
// CHECK:STDOUT: !37 = !{!35}
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a58e9b74ce410031:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41)
// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !7)
// CHECK:STDOUT: !40 = !DILocation(line: 15, column: 1, scope: !38)
// CHECK:STDOUT: !41 = !{!39}
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45)
// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !7)
// CHECK:STDOUT: !44 = !DILocation(line: 15, column: 1, scope: !42)
// CHECK:STDOUT: !45 = !{!43}
// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49)
// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !7)
// CHECK:STDOUT: !48 = !DILocation(line: 15, column: 1, scope: !46)
// CHECK:STDOUT: !49 = !{!47}
// CHECK:STDOUT: !50 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !51 = !{!"omnipotent char", !50, i64 0}
// CHECK:STDOUT: !52 = !{!"int", !51, i64 0}
// CHECK:STDOUT: !53 = !{!"_ZTSN6Carbon1AE", !52, i64 0}
// CHECK:STDOUT: !54 = !{!53, !52, i64 0}
// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !60 = !{!"__libc_errno", !52, i64 0}
// CHECK:STDOUT: !61 = !{!60, !52, i64 0}
// CHECK:STDOUT:
+199 -121
View File
@@ -65,41 +65,70 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, ptr %.loc12_18.2.temp, align 8, !dbg !17
// CHECK:STDOUT: %.loc12_18.4 = load ptr, ptr %.loc12_18.2.temp, align 8, !dbg !17
// CHECK:STDOUT: call void @_Z7TakePtrPi(ptr %.loc12_18.4), !dbg !18
// CHECK:STDOUT: call void @"_COp.5b309895020f658e:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !17
// CHECK:STDOUT: call void @"_CSelfDestruct.5b309895020f658e:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !17
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !19
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_22.1.temp), !dbg !19
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, ptr %.loc14_22.1.temp, align 8, !dbg !19
// CHECK:STDOUT: call void @_Z11TakeNullptrDn.carbon_thunk._(ptr %.loc14_22.1.temp), !dbg !20
// CHECK:STDOUT: call void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !19
// CHECK:STDOUT: call void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !19
// CHECK:STDOUT: ret void, !dbg !21
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @"_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core"(ptr)
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !23 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !25
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z7TakePtrPi(ptr noundef) #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.0f866e2c9731ba7d:core.Destroy.Core"(ptr %self) #0 !dbg !22 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0f866e2c9731ba7d:core.Destroy.Core"(ptr %self) #0 !dbg !27 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !24
// CHECK:STDOUT: ret void, !dbg !29
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.6204fc8d2f2baaa7:core.Destroy.Core"(ptr %self) #0 !dbg !26 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0f866e2c9731ba7d:core.Destroy.Core"(ptr %self) #0 !dbg !31 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !28
// CHECK:STDOUT: call void @"_CSubobjectDestroy.0f866e2c9731ba7d:core.Destroy.Core"(ptr %self), !dbg !33
// CHECK:STDOUT: ret void, !dbg !33
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.5b309895020f658e:core.Destroy.Core"(ptr %self) #0 !dbg !30 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.729fca203337f92a:core.Destroy.Core"(ptr %self) #0 !dbg !35 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !32
// CHECK:STDOUT: ret void, !dbg !37
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.729fca203337f92a:core.Destroy.Core"(ptr %self) #0 !dbg !39 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.729fca203337f92a:core.Destroy.Core"(ptr %self), !dbg !41
// CHECK:STDOUT: ret void, !dbg !41
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5b309895020f658e:core.Destroy.Core"(ptr %self) #0 !dbg !43 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !45
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5b309895020f658e:core.Destroy.Core"(ptr %self) #0 !dbg !47 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.5b309895020f658e:core.Destroy.Core"(ptr %self), !dbg !49
// CHECK:STDOUT: ret void, !dbg !49
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// 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 !96
// CHECK:STDOUT: %0 = load ptr, ptr %n.addr, align 8, !tbaa !96
// CHECK:STDOUT: store ptr %n, ptr %n.addr, align 8, !tbaa !124
// CHECK:STDOUT: %0 = load ptr, ptr %n.addr, align 8, !tbaa !124
// CHECK:STDOUT: call void @_Z11TakeNullptrDn(ptr null)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -107,89 +136,110 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
// CHECK:STDOUT: declare ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr)
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !34 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !51 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !36
// CHECK:STDOUT: ret void, !dbg !53
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.ddbd3dbdb388ab25:core.Destroy.Core"(ptr %self) #0 !dbg !38 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !55 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !40
// CHECK:STDOUT: call void @"_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core"(ptr %self), !dbg !57
// CHECK:STDOUT: ret void, !dbg !57
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %self) #0 !dbg !42 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core"(ptr %self) #0 !dbg !59 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !44
// CHECK:STDOUT: ret void, !dbg !61
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #0 !dbg !46 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.174120d4d03791b0:core.Destroy.Core"(ptr %self) #0 !dbg !63 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !49
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !50
// CHECK:STDOUT: call void @"_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core"(ptr %self), !dbg !65
// CHECK:STDOUT: ret void, !dbg !65
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !51 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.826ebaace97974ae:core.Destroy.Core"(ptr %self) #0 !dbg !67 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !54
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !54
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !55
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !54
// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !57
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !57
// CHECK:STDOUT: call void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %a.var), !dbg !54
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !58
// CHECK:STDOUT: ret void, !dbg !69
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !59 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %self) #0 !dbg !71 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !62
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !62
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !63
// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !65
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %.loc28_10), !dbg !66
// CHECK:STDOUT: call void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %a.var), !dbg !62
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !66
// CHECK:STDOUT: call void @"_CSubobjectDestroy.826ebaace97974ae:core.Destroy.Core"(ptr %self), !dbg !73
// CHECK:STDOUT: ret void, !dbg !73
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #0 !dbg !75 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !78
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !79
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !80 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !83
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !83
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !84
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !83
// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !86
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !86
// CHECK:STDOUT: call void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %a.var), !dbg !83
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !87
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !88 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !91
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !91
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !92
// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !94
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %.loc28_10), !dbg !95
// CHECK:STDOUT: call void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %a.var), !dbg !91
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !95
// 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: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !96
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !96
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !124
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !124
// CHECK:STDOUT: %call = call ptr @_Z13ReturnNullptrv()
// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !97
// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !125
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !67 {
// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !96 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !70
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !70
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %.loc32_28.1.temp), !dbg !70
// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !70
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %.loc32_28.4), !dbg !71
// CHECK:STDOUT: call void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !70
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !71
// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !99
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !99
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %.loc32_28.1.temp), !dbg !99
// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !99
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %.loc32_28.4), !dbg !100
// CHECK:STDOUT: call void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !99
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !100
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !72 {
// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !101 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr poison), !dbg !75
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !75
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr poison), !dbg !104
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !104
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %self) #0 !dbg !77 {
// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.6e9e957697159b53(), !dbg !82
// CHECK:STDOUT: ret ptr %1, !dbg !83
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %self) #0 !dbg !106 {
// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.6e9e957697159b53(), !dbg !111
// CHECK:STDOUT: ret ptr %1, !dbg !112
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -198,8 +248,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
// CHECK:STDOUT: declare ptr @_CMake.NullptrT.CppCompat.Core()
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.6e9e957697159b53() #0 !dbg !86 {
// CHECK:STDOUT: ret ptr null, !dbg !90
// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.6e9e957697159b53() #0 !dbg !114 {
// CHECK:STDOUT: ret ptr null, !dbg !118
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z11TakeNullptrDn(ptr) #1
@@ -216,8 +266,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
// CHECK:STDOUT: !llvm.module.flags = !{!98, !99, !100, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!103}
// CHECK:STDOUT: !llvm.module.flags = !{!126, !127, !128, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!131}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -238,68 +288,96 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
// CHECK:STDOUT: !19 = !DILocation(line: 14, column: 19, scope: !16)
// CHECK:STDOUT: !20 = !DILocation(line: 14, column: 3, scope: !16)
// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 1, scope: !16)
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0f866e2c9731ba7d:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25)
// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !9)
// CHECK:STDOUT: !24 = !DILocation(line: 12, column: 15, scope: !22)
// CHECK:STDOUT: !25 = !{!23}
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6204fc8d2f2baaa7:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29)
// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !9)
// CHECK:STDOUT: !28 = !DILocation(line: 12, column: 15, scope: !26)
// CHECK:STDOUT: !29 = !{!27}
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5b309895020f658e:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33)
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !9)
// CHECK:STDOUT: !32 = !DILocation(line: 12, column: 15, scope: !30)
// CHECK:STDOUT: !33 = !{!31}
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37)
// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !9)
// CHECK:STDOUT: !36 = !DILocation(line: 14, column: 19, scope: !34)
// CHECK:STDOUT: !37 = !{!35}
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ddbd3dbdb388ab25:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41)
// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !9)
// CHECK:STDOUT: !40 = !DILocation(line: 14, column: 19, scope: !38)
// CHECK:STDOUT: !41 = !{!39}
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.826ebaace97974ae:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45)
// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !9)
// CHECK:STDOUT: !44 = !DILocation(line: 14, column: 19, scope: !42)
// CHECK:STDOUT: !45 = !{!43}
// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !4, line: 17, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !49 = !DILocation(line: 18, column: 10, scope: !46)
// CHECK:STDOUT: !50 = !DILocation(line: 18, column: 3, scope: !46)
// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !4, line: 21, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !54 = !DILocation(line: 22, column: 3, scope: !51)
// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 26, scope: !51)
// CHECK:STDOUT: !57 = !DILocation(line: 23, column: 10, scope: !51)
// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 3, scope: !51)
// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !4, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !62 = !DILocation(line: 27, column: 3, scope: !59)
// CHECK:STDOUT: !63 = !DILocation(line: 27, column: 26, scope: !59)
// CHECK:STDOUT: !65 = !DILocation(line: 28, column: 10, scope: !59)
// CHECK:STDOUT: !66 = !DILocation(line: 28, column: 3, scope: !59)
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !4, line: 31, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !70 = !DILocation(line: 32, column: 10, scope: !67)
// CHECK:STDOUT: !71 = !DILocation(line: 32, column: 3, scope: !67)
// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !4, line: 35, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !75 = !DILocation(line: 36, column: 3, scope: !72)
// CHECK:STDOUT: !76 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "")
// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba", scope: null, file: !76, line: 51, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84)
// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !9)
// CHECK:STDOUT: !82 = !DILocation(line: 52, column: 14, scope: !77)
// CHECK:STDOUT: !83 = !DILocation(line: 52, column: 7, scope: !77)
// CHECK:STDOUT: !84 = !{!78}
// CHECK:STDOUT: !85 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.6e9e957697159b53", scope: null, file: !85, line: 30, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !90 = !DILocation(line: 31, column: 5, scope: !86)
// CHECK:STDOUT: !91 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !92 = !{!"omnipotent char", !91, i64 0}
// CHECK:STDOUT: !93 = !{!"std::nullptr_t", !92, i64 0}
// CHECK:STDOUT: !94 = !{!"any pointer", !92, i64 0}
// CHECK:STDOUT: !95 = !{!"p1 std::nullptr_t", !94, i64 0}
// CHECK:STDOUT: !96 = !{!95, !95, i64 0}
// CHECK:STDOUT: !97 = !{!93, !93, i64 0}
// CHECK:STDOUT: !98 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !99 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !100 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !101 = !{!"int", !92, i64 0}
// CHECK:STDOUT: !102 = !{!"__libc_errno", !101, i64 0}
// CHECK:STDOUT: !103 = !{!102, !101, i64 0}
// CHECK:STDOUT: !22 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !22, line: 164, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26)
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !9)
// CHECK:STDOUT: !25 = !DILocation(line: 164, column: 19, scope: !23)
// CHECK:STDOUT: !26 = !{!24}
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0f866e2c9731ba7d:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30)
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !9)
// CHECK:STDOUT: !29 = !DILocation(line: 12, column: 15, scope: !27)
// CHECK:STDOUT: !30 = !{!28}
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0f866e2c9731ba7d:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34)
// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !9)
// CHECK:STDOUT: !33 = !DILocation(line: 12, column: 15, scope: !31)
// CHECK:STDOUT: !34 = !{!32}
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.729fca203337f92a:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38)
// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !9)
// CHECK:STDOUT: !37 = !DILocation(line: 12, column: 15, scope: !35)
// CHECK:STDOUT: !38 = !{!36}
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.729fca203337f92a:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42)
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !9)
// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 15, scope: !39)
// CHECK:STDOUT: !42 = !{!40}
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5b309895020f658e:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46)
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !9)
// CHECK:STDOUT: !45 = !DILocation(line: 12, column: 15, scope: !43)
// CHECK:STDOUT: !46 = !{!44}
// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5b309895020f658e:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50)
// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !9)
// CHECK:STDOUT: !49 = !DILocation(line: 12, column: 15, scope: !47)
// CHECK:STDOUT: !50 = !{!48}
// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54)
// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !9)
// CHECK:STDOUT: !53 = !DILocation(line: 14, column: 19, scope: !51)
// CHECK:STDOUT: !54 = !{!52}
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58)
// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !9)
// CHECK:STDOUT: !57 = !DILocation(line: 14, column: 19, scope: !55)
// CHECK:STDOUT: !58 = !{!56}
// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62)
// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !9)
// CHECK:STDOUT: !61 = !DILocation(line: 14, column: 19, scope: !59)
// CHECK:STDOUT: !62 = !{!60}
// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.174120d4d03791b0:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !66)
// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !9)
// CHECK:STDOUT: !65 = !DILocation(line: 14, column: 19, scope: !63)
// CHECK:STDOUT: !66 = !{!64}
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.826ebaace97974ae:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !70)
// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !9)
// CHECK:STDOUT: !69 = !DILocation(line: 14, column: 19, scope: !67)
// CHECK:STDOUT: !70 = !{!68}
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.826ebaace97974ae:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74)
// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !9)
// CHECK:STDOUT: !73 = !DILocation(line: 14, column: 19, scope: !71)
// CHECK:STDOUT: !74 = !{!72}
// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !4, line: 17, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !78 = !DILocation(line: 18, column: 10, scope: !75)
// CHECK:STDOUT: !79 = !DILocation(line: 18, column: 3, scope: !75)
// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !4, line: 21, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !83 = !DILocation(line: 22, column: 3, scope: !80)
// CHECK:STDOUT: !84 = !DILocation(line: 22, column: 26, scope: !80)
// CHECK:STDOUT: !86 = !DILocation(line: 23, column: 10, scope: !80)
// CHECK:STDOUT: !87 = !DILocation(line: 23, column: 3, scope: !80)
// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !4, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !91 = !DILocation(line: 27, column: 3, scope: !88)
// CHECK:STDOUT: !92 = !DILocation(line: 27, column: 26, scope: !88)
// CHECK:STDOUT: !94 = !DILocation(line: 28, column: 10, scope: !88)
// CHECK:STDOUT: !95 = !DILocation(line: 28, column: 3, scope: !88)
// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !4, line: 31, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !99 = !DILocation(line: 32, column: 10, scope: !96)
// CHECK:STDOUT: !100 = !DILocation(line: 32, column: 3, scope: !96)
// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !4, line: 35, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !104 = !DILocation(line: 36, column: 3, scope: !101)
// CHECK:STDOUT: !105 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "")
// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba", scope: null, file: !105, line: 51, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !113)
// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !9)
// CHECK:STDOUT: !111 = !DILocation(line: 52, column: 14, scope: !106)
// CHECK:STDOUT: !112 = !DILocation(line: 52, column: 7, scope: !106)
// CHECK:STDOUT: !113 = !{!107}
// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.6e9e957697159b53", scope: null, file: !22, line: 30, type: !15, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !118 = !DILocation(line: 31, column: 5, scope: !114)
// CHECK:STDOUT: !119 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !120 = !{!"omnipotent char", !119, i64 0}
// CHECK:STDOUT: !121 = !{!"std::nullptr_t", !120, i64 0}
// CHECK:STDOUT: !122 = !{!"any pointer", !120, i64 0}
// CHECK:STDOUT: !123 = !{!"p1 std::nullptr_t", !122, i64 0}
// CHECK:STDOUT: !124 = !{!123, !123, i64 0}
// CHECK:STDOUT: !125 = !{!121, !121, i64 0}
// CHECK:STDOUT: !126 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !127 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !128 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !129 = !{!"int", !120, i64 0}
// CHECK:STDOUT: !130 = !{!"__libc_errno", !129, i64 0}
// CHECK:STDOUT: !131 = !{!130, !129, i64 0}
// CHECK:STDOUT:
+414 -283
View File
@@ -215,87 +215,114 @@ fn Convert() {
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %_) #0 !dbg !48 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.51fa064adaeb8681:core.Destroy.Core"(ptr %self) #0 !dbg !49 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !51
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !53 {
// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %_) #0 !dbg !53 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc22_23.2.temp = alloca ptr, align 8, !dbg !56
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !56
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.2.temp), !dbg !56
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_23.2.temp, align 8, !dbg !56
// CHECK:STDOUT: %.loc22_23.4 = load ptr, ptr %.loc22_23.2.temp, align 8, !dbg !56
// CHECK:STDOUT: call void @_Z15TakeNullablePtrP9NullableC(ptr %.loc22_23.4), !dbg !59
// CHECK:STDOUT: call void @"_COp.574ea10b2e6709a0:core.Destroy.Core"(ptr %.loc22_23.2.temp), !dbg !56
// CHECK:STDOUT: ret void, !dbg !60
// CHECK:STDOUT: ret void, !dbg !56
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !58 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc22_23.2.temp = alloca ptr, align 8, !dbg !61
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !61
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.2.temp), !dbg !61
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_23.2.temp, align 8, !dbg !61
// CHECK:STDOUT: %.loc22_23.4 = load ptr, ptr %.loc22_23.2.temp, align 8, !dbg !61
// CHECK:STDOUT: call void @_Z15TakeNullablePtrP9NullableC(ptr %.loc22_23.4), !dbg !64
// CHECK:STDOUT: call void @"_CSelfDestruct.574ea10b2e6709a0:core.Destroy.Core"(ptr %.loc22_23.2.temp), !dbg !61
// CHECK:STDOUT: ret void, !dbg !65
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z15TakeNullablePtrP9NullableC(ptr noundef) #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.6789a803c53632c0:core.Destroy.Core"(ptr %self) #0 !dbg !62 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.6789a803c53632c0:core.Destroy.Core"(ptr %self) #0 !dbg !67 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !64
// CHECK:STDOUT: ret void, !dbg !69
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.d2847b010e2ea8b6:core.Destroy.Core"(ptr %self) #0 !dbg !66 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6789a803c53632c0:core.Destroy.Core"(ptr %self) #0 !dbg !71 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !68
// CHECK:STDOUT: call void @"_CSubobjectDestroy.6789a803c53632c0:core.Destroy.Core"(ptr %self), !dbg !73
// CHECK:STDOUT: ret void, !dbg !73
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.574ea10b2e6709a0:core.Destroy.Core"(ptr %self) #0 !dbg !70 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5cf0c9a25f98a429:core.Destroy.Core"(ptr %self) #0 !dbg !75 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !72
// CHECK:STDOUT: ret void, !dbg !77
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !74 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5cf0c9a25f98a429:core.Destroy.Core"(ptr %self) #0 !dbg !79 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %ReturnNullablePtr.call = call ptr @_Z17ReturnNullablePtrv(), !dbg !77
// CHECK:STDOUT: ret ptr %ReturnNullablePtr.call, !dbg !78
// CHECK:STDOUT: call void @"_CSubobjectDestroy.5cf0c9a25f98a429:core.Destroy.Core"(ptr %self), !dbg !81
// CHECK:STDOUT: ret void, !dbg !81
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.574ea10b2e6709a0:core.Destroy.Core"(ptr %self) #0 !dbg !83 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !85
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.574ea10b2e6709a0:core.Destroy.Core"(ptr %self) #0 !dbg !87 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.574ea10b2e6709a0:core.Destroy.Core"(ptr %self), !dbg !89
// CHECK:STDOUT: ret void, !dbg !89
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !91 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %ReturnNullablePtr.call = call ptr @_Z17ReturnNullablePtrv(), !dbg !94
// CHECK:STDOUT: ret ptr %ReturnNullablePtr.call, !dbg !95
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare noundef ptr @_Z17ReturnNullablePtrv() #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !79 {
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !96 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !82
// CHECK:STDOUT: ret void, !dbg !99
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !84 {
// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !101 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc35_32.2.temp = alloca ptr, align 8, !dbg !87
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !87
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_32.2.temp), !dbg !87
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_32.2.temp, align 8, !dbg !87
// CHECK:STDOUT: %.loc35_32.4 = load ptr, ptr %.loc35_32.2.temp, align 8, !dbg !87
// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr %.loc35_32.4), !dbg !88
// CHECK:STDOUT: call void @"_COp.574ea10b2e6709a0:core.Destroy.Core"(ptr %.loc35_32.2.temp), !dbg !87
// CHECK:STDOUT: ret void, !dbg !89
// CHECK:STDOUT: %.loc35_32.2.temp = alloca ptr, align 8, !dbg !104
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !104
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_32.2.temp), !dbg !104
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_32.2.temp, align 8, !dbg !104
// CHECK:STDOUT: %.loc35_32.4 = load ptr, ptr %.loc35_32.2.temp, align 8, !dbg !104
// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr %.loc35_32.4), !dbg !105
// CHECK:STDOUT: call void @"_CSelfDestruct.574ea10b2e6709a0:core.Destroy.Core"(ptr %.loc35_32.2.temp), !dbg !104
// CHECK:STDOUT: ret void, !dbg !106
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr noundef %0) #2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !136
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !136
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !152
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !152
// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi(ptr noundef %1, i32 noundef 0)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !91 {
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !108 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %ReturnNullablePtrWithThunk__carbon_thunk.call = call ptr @_Z26ReturnNullablePtrWithThunki.carbon_thunk.(), !dbg !94
// CHECK:STDOUT: ret ptr %ReturnNullablePtrWithThunk__carbon_thunk.call, !dbg !95
// CHECK:STDOUT: %ReturnNullablePtrWithThunk__carbon_thunk.call = call ptr @_Z26ReturnNullablePtrWithThunki.carbon_thunk.(), !dbg !111
// CHECK:STDOUT: ret ptr %ReturnNullablePtrWithThunk__carbon_thunk.call, !dbg !112
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -306,35 +333,35 @@ fn Convert() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %self) #0 !dbg !97 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self), !dbg !102
// CHECK:STDOUT: ret ptr %1, !dbg !103
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %self) #0 !dbg !113 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self), !dbg !118
// CHECK:STDOUT: ret ptr %1, !dbg !119
// 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 linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self) #0 !dbg !105 {
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %self), !dbg !111
// CHECK:STDOUT: ret ptr %1, !dbg !112
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self) #0 !dbg !121 {
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %self), !dbg !127
// CHECK:STDOUT: ret ptr %1, !dbg !128
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %value) #0 !dbg !114 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %value), !dbg !119
// CHECK:STDOUT: ret ptr %1, !dbg !120
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %value) #0 !dbg !130 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %value), !dbg !135
// CHECK:STDOUT: ret ptr %1, !dbg !136
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %self) #0 !dbg !122 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !127
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !127
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !127
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !131
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !129
// CHECK:STDOUT: call void @"_COp.d2847b010e2ea8b6:core.Destroy.Core"(ptr %1), !dbg !127
// CHECK:STDOUT: ret ptr %2, !dbg !133
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %self) #0 !dbg !138 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !143
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !143
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !143
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !147
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !145
// CHECK:STDOUT: call void @"_CSelfDestruct.5cf0c9a25f98a429:core.Destroy.Core"(ptr %1), !dbg !143
// CHECK:STDOUT: ret ptr %2, !dbg !149
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z24TakeNullablePtrWithThunkP9NullableCi(ptr noundef, i32 noundef) #1
@@ -372,71 +399,87 @@ fn Convert() {
// CHECK:STDOUT: !45 = !{!44, !43, i64 0}
// CHECK:STDOUT: !46 = !DIFile(filename: "nullable.carbon", directory: "")
// CHECK:STDOUT: !47 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !46, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !46, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !52)
// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !6)
// CHECK:STDOUT: !51 = !DILocation(line: 14, column: 1, scope: !48)
// CHECK:STDOUT: !52 = !{!49}
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !46, line: 19, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !61)
// CHECK:STDOUT: !48 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.51fa064adaeb8681:core.Destroy.Core", scope: null, file: !48, line: 164, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !52)
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !6)
// CHECK:STDOUT: !51 = !DILocation(line: 164, column: 19, scope: !49)
// CHECK:STDOUT: !52 = !{!50}
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !46, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !57)
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !6)
// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 23, scope: !53)
// CHECK:STDOUT: !57 = !{!6, !6}
// CHECK:STDOUT: !58 = !DISubroutineType(types: !57)
// CHECK:STDOUT: !59 = !DILocation(line: 22, column: 3, scope: !53)
// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 1, scope: !53)
// CHECK:STDOUT: !61 = !{!54}
// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6789a803c53632c0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !65)
// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !6)
// CHECK:STDOUT: !64 = !DILocation(line: 22, column: 23, scope: !62)
// CHECK:STDOUT: !65 = !{!63}
// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d2847b010e2ea8b6:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !69)
// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !6)
// CHECK:STDOUT: !68 = !DILocation(line: 22, column: 23, scope: !66)
// CHECK:STDOUT: !69 = !{!67}
// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Op", linkageName: "_COp.574ea10b2e6709a0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !73)
// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !6)
// CHECK:STDOUT: !72 = !DILocation(line: 22, column: 23, scope: !70)
// CHECK:STDOUT: !73 = !{!71}
// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !46, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !47)
// CHECK:STDOUT: !77 = !DILocation(line: 26, column: 10, scope: !74)
// CHECK:STDOUT: !78 = !DILocation(line: 26, column: 3, scope: !74)
// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !46, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !83)
// CHECK:STDOUT: !56 = !DILocation(line: 14, column: 1, scope: !53)
// CHECK:STDOUT: !57 = !{!54}
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !46, line: 19, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !66)
// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !6)
// CHECK:STDOUT: !61 = !DILocation(line: 22, column: 23, scope: !58)
// CHECK:STDOUT: !62 = !{!6, !6}
// CHECK:STDOUT: !63 = !DISubroutineType(types: !62)
// CHECK:STDOUT: !64 = !DILocation(line: 22, column: 3, scope: !58)
// CHECK:STDOUT: !65 = !DILocation(line: 19, column: 1, scope: !58)
// CHECK:STDOUT: !66 = !{!59}
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.6789a803c53632c0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !70)
// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !6)
// CHECK:STDOUT: !69 = !DILocation(line: 22, column: 23, scope: !67)
// CHECK:STDOUT: !70 = !{!68}
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6789a803c53632c0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !74)
// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !6)
// CHECK:STDOUT: !73 = !DILocation(line: 22, column: 23, scope: !71)
// CHECK:STDOUT: !74 = !{!72}
// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5cf0c9a25f98a429:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !78)
// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !6)
// CHECK:STDOUT: !77 = !DILocation(line: 22, column: 23, scope: !75)
// CHECK:STDOUT: !78 = !{!76}
// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5cf0c9a25f98a429:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !82)
// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !6)
// CHECK:STDOUT: !82 = !DILocation(line: 29, column: 1, scope: !79)
// CHECK:STDOUT: !83 = !{!80}
// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !46, line: 34, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !90)
// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !6)
// CHECK:STDOUT: !87 = !DILocation(line: 35, column: 32, scope: !84)
// CHECK:STDOUT: !88 = !DILocation(line: 35, column: 3, scope: !84)
// CHECK:STDOUT: !89 = !DILocation(line: 34, column: 1, scope: !84)
// CHECK:STDOUT: !90 = !{!85}
// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !46, line: 38, type: !10, spFlags: DISPFlagDefinition, unit: !47)
// CHECK:STDOUT: !94 = !DILocation(line: 39, column: 10, scope: !91)
// CHECK:STDOUT: !95 = !DILocation(line: 39, column: 3, scope: !91)
// CHECK:STDOUT: !96 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5", scope: null, file: !96, line: 105, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !104)
// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !6)
// CHECK:STDOUT: !102 = !DILocation(line: 106, column: 12, scope: !97)
// CHECK:STDOUT: !103 = !DILocation(line: 106, column: 5, scope: !97)
// CHECK:STDOUT: !104 = !{!98}
// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2", scope: null, file: !96, line: 80, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !113)
// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !6)
// CHECK:STDOUT: !111 = !DILocation(line: 81, column: 12, scope: !105)
// CHECK:STDOUT: !112 = !DILocation(line: 81, column: 5, scope: !105)
// CHECK:STDOUT: !113 = !{!106}
// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e83c25d1d2fd22c2", scope: null, file: !96, line: 33, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !121)
// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !114, type: !6)
// CHECK:STDOUT: !119 = !DILocation(line: 34, column: 12, scope: !114)
// CHECK:STDOUT: !120 = !DILocation(line: 34, column: 5, scope: !114)
// CHECK:STDOUT: !121 = !{!115}
// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d", scope: null, file: !96, line: 166, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !134)
// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !6)
// CHECK:STDOUT: !127 = !DILocation(line: 167, column: 14, scope: !122)
// CHECK:STDOUT: !129 = !DILocation(line: 167, column: 18, scope: !122)
// CHECK:STDOUT: !131 = !DILocation(line: 169, column: 5, scope: !122)
// CHECK:STDOUT: !133 = !DILocation(line: 170, column: 5, scope: !122)
// CHECK:STDOUT: !134 = !{!123}
// CHECK:STDOUT: !135 = !{!"p1 _ZTS9NullableC", !37, i64 0}
// CHECK:STDOUT: !136 = !{!135, !135, i64 0}
// CHECK:STDOUT: !81 = !DILocation(line: 22, column: 23, scope: !79)
// CHECK:STDOUT: !82 = !{!80}
// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.574ea10b2e6709a0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !86)
// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !6)
// CHECK:STDOUT: !85 = !DILocation(line: 22, column: 23, scope: !83)
// CHECK:STDOUT: !86 = !{!84}
// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.574ea10b2e6709a0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !90)
// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !6)
// CHECK:STDOUT: !89 = !DILocation(line: 22, column: 23, scope: !87)
// CHECK:STDOUT: !90 = !{!88}
// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !46, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !47)
// CHECK:STDOUT: !94 = !DILocation(line: 26, column: 10, scope: !91)
// CHECK:STDOUT: !95 = !DILocation(line: 26, column: 3, scope: !91)
// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !46, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !100)
// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !6)
// CHECK:STDOUT: !99 = !DILocation(line: 29, column: 1, scope: !96)
// CHECK:STDOUT: !100 = !{!97}
// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !46, line: 34, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !107)
// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !6)
// CHECK:STDOUT: !104 = !DILocation(line: 35, column: 32, scope: !101)
// CHECK:STDOUT: !105 = !DILocation(line: 35, column: 3, scope: !101)
// CHECK:STDOUT: !106 = !DILocation(line: 34, column: 1, scope: !101)
// CHECK:STDOUT: !107 = !{!102}
// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !46, line: 38, type: !10, spFlags: DISPFlagDefinition, unit: !47)
// CHECK:STDOUT: !111 = !DILocation(line: 39, column: 10, scope: !108)
// CHECK:STDOUT: !112 = !DILocation(line: 39, column: 3, scope: !108)
// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5", scope: null, file: !48, line: 105, type: !63, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !120)
// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !6)
// CHECK:STDOUT: !118 = !DILocation(line: 106, column: 12, scope: !113)
// CHECK:STDOUT: !119 = !DILocation(line: 106, column: 5, scope: !113)
// CHECK:STDOUT: !120 = !{!114}
// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2", scope: null, file: !48, line: 80, type: !63, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !129)
// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !6)
// CHECK:STDOUT: !127 = !DILocation(line: 81, column: 12, scope: !121)
// CHECK:STDOUT: !128 = !DILocation(line: 81, column: 5, scope: !121)
// CHECK:STDOUT: !129 = !{!122}
// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e83c25d1d2fd22c2", scope: null, file: !48, line: 33, type: !63, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !137)
// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !6)
// CHECK:STDOUT: !135 = !DILocation(line: 34, column: 12, scope: !130)
// CHECK:STDOUT: !136 = !DILocation(line: 34, column: 5, scope: !130)
// CHECK:STDOUT: !137 = !{!131}
// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d", scope: null, file: !48, line: 166, type: !63, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !150)
// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !6)
// CHECK:STDOUT: !143 = !DILocation(line: 167, column: 14, scope: !138)
// CHECK:STDOUT: !145 = !DILocation(line: 167, column: 18, scope: !138)
// CHECK:STDOUT: !147 = !DILocation(line: 169, column: 5, scope: !138)
// CHECK:STDOUT: !149 = !DILocation(line: 170, column: 5, scope: !138)
// CHECK:STDOUT: !150 = !{!139}
// CHECK:STDOUT: !151 = !{!"p1 _ZTS9NullableC", !37, i64 0}
// CHECK:STDOUT: !152 = !{!151, !151, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'add_const.carbon'
@@ -445,140 +488,196 @@ fn Convert() {
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CConvert.Main() #0 !dbg !141 {
// CHECK:STDOUT: define void @_CConvert.Main() #0 !dbg !157 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc11_21.1.temp = alloca ptr, align 8, !dbg !142
// CHECK:STDOUT: %.loc11_21.5.temp = alloca ptr, align 8, !dbg !142
// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !142
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.1.temp), !dbg !142
// CHECK:STDOUT: store ptr %make.call, ptr %.loc11_21.1.temp, align 8, !dbg !142
// CHECK:STDOUT: %.loc11_21.3 = load ptr, ptr %.loc11_21.1.temp, align 8, !dbg !142
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.773fefc3ed9265ca"(ptr %.loc11_21.3), !dbg !142
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.5.temp), !dbg !142
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.5.temp, align 8, !dbg !142
// CHECK:STDOUT: %.loc11_21.7 = load ptr, ptr %.loc11_21.5.temp, align 8, !dbg !142
// CHECK:STDOUT: call void @_Z4takePK6ConstC(ptr %.loc11_21.7), !dbg !143
// CHECK:STDOUT: call void @"_COp.19661d0961df889d:core.Destroy.Core"(ptr %.loc11_21.5.temp), !dbg !142
// CHECK:STDOUT: call void @"_COp.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %.loc11_21.1.temp), !dbg !142
// CHECK:STDOUT: ret void, !dbg !144
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare noundef ptr @_Z4makev() #1
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z4takePK6ConstC(ptr noundef) #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.bdb5ffe218b7af7d:core.Destroy.Core"(ptr %self) #0 !dbg !145 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !147
// CHECK:STDOUT: %.loc11_21.1.temp = alloca ptr, align 8, !dbg !158
// CHECK:STDOUT: %.loc11_21.5.temp = alloca ptr, align 8, !dbg !158
// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !158
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.1.temp), !dbg !158
// CHECK:STDOUT: store ptr %make.call, ptr %.loc11_21.1.temp, align 8, !dbg !158
// CHECK:STDOUT: %.loc11_21.3 = load ptr, ptr %.loc11_21.1.temp, align 8, !dbg !158
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7d29ea9e6f62bf96"(ptr %.loc11_21.3), !dbg !158
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.5.temp), !dbg !158
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.5.temp, align 8, !dbg !158
// CHECK:STDOUT: %.loc11_21.7 = load ptr, ptr %.loc11_21.5.temp, align 8, !dbg !158
// CHECK:STDOUT: call void @_Z4takePK6ConstC(ptr %.loc11_21.7), !dbg !159
// CHECK:STDOUT: call void @"_CSelfDestruct.19661d0961df889d:core.Destroy.Core"(ptr %.loc11_21.5.temp), !dbg !158
// CHECK:STDOUT: call void @"_CSelfDestruct.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %.loc11_21.1.temp), !dbg !158
// CHECK:STDOUT: ret void, !dbg !160
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.7865857458566fb7:core.Destroy.Core"(ptr %self) #0 !dbg !149 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !151
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.19661d0961df889d:core.Destroy.Core"(ptr %self) #0 !dbg !153 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !155
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.e3602e7640dfb844:core.Destroy.Core"(ptr %self) #0 !dbg !157 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !159
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.67387c5c416bcd0b:core.Destroy.Core"(ptr %self) #0 !dbg !161 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.23bb4d554c74e0f1:core.Destroy.Core"(ptr %self) #0 !dbg !161 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !163
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare noundef ptr @_Z4makev() #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %self) #0 !dbg !165 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.131ece8d9a7a4272:core.Destroy.Core"(ptr %self) #0 !dbg !165 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !167
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z4takePK6ConstC(ptr noundef) #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bdb5ffe218b7af7d:core.Destroy.Core"(ptr %self) #0 !dbg !169 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !171
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bdb5ffe218b7af7d:core.Destroy.Core"(ptr %self) #0 !dbg !173 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.bdb5ffe218b7af7d:core.Destroy.Core"(ptr %self), !dbg !175
// CHECK:STDOUT: ret void, !dbg !175
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f914f15dcbbdbae9:core.Destroy.Core"(ptr %self) #0 !dbg !177 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !179
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f914f15dcbbdbae9:core.Destroy.Core"(ptr %self) #0 !dbg !181 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f914f15dcbbdbae9:core.Destroy.Core"(ptr %self), !dbg !183
// CHECK:STDOUT: ret void, !dbg !183
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.19661d0961df889d:core.Destroy.Core"(ptr %self) #0 !dbg !185 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !187
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.19661d0961df889d:core.Destroy.Core"(ptr %self) #0 !dbg !189 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.19661d0961df889d:core.Destroy.Core"(ptr %self), !dbg !191
// CHECK:STDOUT: ret void, !dbg !191
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e3602e7640dfb844:core.Destroy.Core"(ptr %self) #0 !dbg !193 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !195
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e3602e7640dfb844:core.Destroy.Core"(ptr %self) #0 !dbg !197 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.e3602e7640dfb844:core.Destroy.Core"(ptr %self), !dbg !199
// CHECK:STDOUT: ret void, !dbg !199
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bc918cd0012c1190:core.Destroy.Core"(ptr %self) #0 !dbg !201 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !203
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bc918cd0012c1190:core.Destroy.Core"(ptr %self) #0 !dbg !205 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.bc918cd0012c1190:core.Destroy.Core"(ptr %self), !dbg !207
// CHECK:STDOUT: ret void, !dbg !207
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %self) #0 !dbg !209 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !211
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %self) #0 !dbg !213 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %self), !dbg !215
// CHECK:STDOUT: ret void, !dbg !215
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.773fefc3ed9265ca"(ptr %self) #0 !dbg !169 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.9e559524fb018133"(ptr %self), !dbg !174
// CHECK:STDOUT: ret ptr %1, !dbg !175
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7d29ea9e6f62bf96"(ptr %self) #0 !dbg !217 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.c5881e9a6965c8a5"(ptr %self), !dbg !222
// CHECK:STDOUT: ret ptr %1, !dbg !223
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.9e559524fb018133"(ptr %self) #0 !dbg !177 {
// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !184
// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !184
// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !182
// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !183
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.c5881e9a6965c8a5"(ptr %self) #0 !dbg !225 {
// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !232
// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !232
// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !230
// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !231
// CHECK:STDOUT:
// CHECK:STDOUT: 2: ; preds = %0
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !184
// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !184
// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !184
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !184
// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !184
// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !184
// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !184
// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.305e266058820aa4(ptr %5), !dbg !185
// CHECK:STDOUT: ret ptr %6, !dbg !186
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !232
// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !232
// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !232
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !232
// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !232
// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !232
// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !232
// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.305e266058820aa4(ptr %5), !dbg !233
// CHECK:STDOUT: call void @"_CSelfDestruct.131ece8d9a7a4272:core.Destroy.Core"(ptr %temp1), !dbg !232
// CHECK:STDOUT: call void @"_CSelfDestruct.23bb4d554c74e0f1:core.Destroy.Core"(ptr %temp), !dbg !232
// CHECK:STDOUT: ret ptr %6, !dbg !234
// CHECK:STDOUT:
// CHECK:STDOUT: 7: ; preds = %0
// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.305e266058820aa4(), !dbg !187
// CHECK:STDOUT: ret ptr %8, !dbg !188
// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.305e266058820aa4(), !dbg !235
// CHECK:STDOUT: ret ptr %8, !dbg !236
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !190 {
// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !196
// CHECK:STDOUT: ret i1 %1, !dbg !197
// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !238 {
// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !244
// CHECK:STDOUT: ret i1 %1, !dbg !245
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !199 {
// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !205
// CHECK:STDOUT: ret ptr %1, !dbg !206
// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !247 {
// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !253
// CHECK:STDOUT: ret ptr %1, !dbg !254
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.305e266058820aa4(ptr %value) #0 !dbg !208 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %value), !dbg !213
// CHECK:STDOUT: ret ptr %1, !dbg !214
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.305e266058820aa4(ptr %value) #0 !dbg !256 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %value), !dbg !261
// CHECK:STDOUT: ret ptr %1, !dbg !262
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.305e266058820aa4() #0 !dbg !216 {
// CHECK:STDOUT: ret ptr null, !dbg !220
// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.305e266058820aa4() #0 !dbg !264 {
// CHECK:STDOUT: ret ptr null, !dbg !268
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !221 {
// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !227
// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !228
// CHECK:STDOUT: ret i1 %2, !dbg !229
// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !269 {
// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !275
// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !276
// CHECK:STDOUT: ret i1 %2, !dbg !277
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !231 {
// CHECK:STDOUT: ret ptr %value, !dbg !237
// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !279 {
// CHECK:STDOUT: ret ptr %value, !dbg !285
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %self) #0 !dbg !239 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !244
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !244
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !244
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !248
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !246
// CHECK:STDOUT: call void @"_COp.7865857458566fb7:core.Destroy.Core"(ptr %1), !dbg !244
// CHECK:STDOUT: ret ptr %2, !dbg !250
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %self) #0 !dbg !287 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !292
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !292
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !292
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !296
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !294
// CHECK:STDOUT: call void @"_CSelfDestruct.f914f15dcbbdbae9:core.Destroy.Core"(ptr %1), !dbg !292
// CHECK:STDOUT: ret ptr %2, !dbg !298
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
@@ -588,7 +687,7 @@ fn Convert() {
// CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!138}
// CHECK:STDOUT: !llvm.dbg.cu = !{!154}
// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!45}
// CHECK:STDOUT:
@@ -607,88 +706,120 @@ fn Convert() {
// CHECK:STDOUT: !43 = !{!"int", !36, i64 0}
// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0}
// CHECK:STDOUT: !45 = !{!44, !43, i64 0}
// CHECK:STDOUT: !57 = !{!6, !6}
// CHECK:STDOUT: !58 = !DISubroutineType(types: !57)
// CHECK:STDOUT: !96 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !137 = !DIFile(filename: "add_const.carbon", directory: "")
// CHECK:STDOUT: !138 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !137, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !139 = !{null}
// CHECK:STDOUT: !140 = !DISubroutineType(types: !139)
// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !137, line: 10, type: !140, spFlags: DISPFlagDefinition, unit: !138)
// CHECK:STDOUT: !142 = !DILocation(line: 11, column: 12, scope: !141)
// CHECK:STDOUT: !143 = !DILocation(line: 11, column: 3, scope: !141)
// CHECK:STDOUT: !144 = !DILocation(line: 10, column: 1, scope: !141)
// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bdb5ffe218b7af7d:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !148)
// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !6)
// CHECK:STDOUT: !147 = !DILocation(line: 11, column: 12, scope: !145)
// CHECK:STDOUT: !148 = !{!146}
// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7865857458566fb7:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !152)
// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !6)
// CHECK:STDOUT: !151 = !DILocation(line: 11, column: 12, scope: !149)
// CHECK:STDOUT: !152 = !{!150}
// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "Op", linkageName: "_COp.19661d0961df889d:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !156)
// CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !153, type: !6)
// CHECK:STDOUT: !155 = !DILocation(line: 11, column: 12, scope: !153)
// CHECK:STDOUT: !156 = !{!154}
// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e3602e7640dfb844:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !160)
// CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !6)
// CHECK:STDOUT: !159 = !DILocation(line: 11, column: 12, scope: !157)
// CHECK:STDOUT: !160 = !{!158}
// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "Op", linkageName: "_COp.67387c5c416bcd0b:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !164)
// CHECK:STDOUT: !48 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !62 = !{!6, !6}
// CHECK:STDOUT: !63 = !DISubroutineType(types: !62)
// CHECK:STDOUT: !153 = !DIFile(filename: "add_const.carbon", directory: "")
// CHECK:STDOUT: !154 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !153, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !155 = !{null}
// CHECK:STDOUT: !156 = !DISubroutineType(types: !155)
// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !153, line: 10, type: !156, spFlags: DISPFlagDefinition, unit: !154)
// CHECK:STDOUT: !158 = !DILocation(line: 11, column: 12, scope: !157)
// CHECK:STDOUT: !159 = !DILocation(line: 11, column: 3, scope: !157)
// CHECK:STDOUT: !160 = !DILocation(line: 10, column: 1, scope: !157)
// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.23bb4d554c74e0f1:core.Destroy.Core", scope: null, file: !48, line: 164, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !164)
// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !6)
// CHECK:STDOUT: !163 = !DILocation(line: 11, column: 12, scope: !161)
// CHECK:STDOUT: !163 = !DILocation(line: 164, column: 19, scope: !161)
// CHECK:STDOUT: !164 = !{!162}
// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "Op", linkageName: "_COp.78fd6ee82eacbbc3:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !168)
// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.131ece8d9a7a4272:core.Destroy.Core", scope: null, file: !48, line: 164, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !168)
// CHECK:STDOUT: !166 = !DILocalVariable(arg: 1, scope: !165, type: !6)
// CHECK:STDOUT: !167 = !DILocation(line: 11, column: 12, scope: !165)
// CHECK:STDOUT: !167 = !DILocation(line: 164, column: 19, scope: !165)
// CHECK:STDOUT: !168 = !{!166}
// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.773fefc3ed9265ca", scope: null, file: !96, line: 105, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !176)
// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bdb5ffe218b7af7d:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !172)
// CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !169, type: !6)
// CHECK:STDOUT: !174 = !DILocation(line: 106, column: 12, scope: !169)
// CHECK:STDOUT: !175 = !DILocation(line: 106, column: 5, scope: !169)
// CHECK:STDOUT: !176 = !{!170}
// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.9e559524fb018133", scope: null, file: !96, line: 95, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !189)
// CHECK:STDOUT: !171 = !DILocation(line: 11, column: 12, scope: !169)
// CHECK:STDOUT: !172 = !{!170}
// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bdb5ffe218b7af7d:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !176)
// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !6)
// CHECK:STDOUT: !175 = !DILocation(line: 11, column: 12, scope: !173)
// CHECK:STDOUT: !176 = !{!174}
// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f914f15dcbbdbae9:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !180)
// CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !6)
// CHECK:STDOUT: !182 = !DILocation(line: 96, column: 9, scope: !177)
// CHECK:STDOUT: !183 = !DILocation(line: 96, column: 8, scope: !177)
// CHECK:STDOUT: !184 = !DILocation(line: 97, column: 31, scope: !177)
// CHECK:STDOUT: !185 = !DILocation(line: 97, column: 14, scope: !177)
// CHECK:STDOUT: !186 = !DILocation(line: 97, column: 7, scope: !177)
// CHECK:STDOUT: !187 = !DILocation(line: 99, column: 12, scope: !177)
// CHECK:STDOUT: !188 = !DILocation(line: 99, column: 5, scope: !177)
// CHECK:STDOUT: !189 = !{!178}
// CHECK:STDOUT: !190 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.0c3518913b4fb338", scope: null, file: !96, line: 36, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !198)
// CHECK:STDOUT: !191 = !DILocalVariable(arg: 1, scope: !190, type: !6)
// CHECK:STDOUT: !196 = !DILocation(line: 37, column: 12, scope: !190)
// CHECK:STDOUT: !197 = !DILocation(line: 37, column: 5, scope: !190)
// CHECK:STDOUT: !198 = !{!191}
// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.0c3518913b4fb338", scope: null, file: !96, line: 39, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !207)
// CHECK:STDOUT: !200 = !DILocalVariable(arg: 1, scope: !199, type: !6)
// CHECK:STDOUT: !205 = !DILocation(line: 40, column: 12, scope: !199)
// CHECK:STDOUT: !206 = !DILocation(line: 40, column: 5, scope: !199)
// CHECK:STDOUT: !207 = !{!200}
// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.305e266058820aa4", scope: null, file: !96, line: 33, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !215)
// CHECK:STDOUT: !209 = !DILocalVariable(arg: 1, scope: !208, type: !6)
// CHECK:STDOUT: !213 = !DILocation(line: 34, column: 12, scope: !208)
// CHECK:STDOUT: !214 = !DILocation(line: 34, column: 5, scope: !208)
// CHECK:STDOUT: !215 = !{!209}
// CHECK:STDOUT: !216 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.305e266058820aa4", scope: null, file: !96, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !138)
// CHECK:STDOUT: !220 = !DILocation(line: 31, column: 5, scope: !216)
// CHECK:STDOUT: !221 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !96, line: 172, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !230)
// CHECK:STDOUT: !222 = !DILocalVariable(arg: 1, scope: !221, type: !6)
// CHECK:STDOUT: !227 = !DILocation(line: 173, column: 16, scope: !221)
// CHECK:STDOUT: !228 = !DILocation(line: 173, column: 12, scope: !221)
// CHECK:STDOUT: !229 = !DILocation(line: 173, column: 5, scope: !221)
// CHECK:STDOUT: !230 = !{!222}
// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !96, line: 175, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !238)
// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !6)
// CHECK:STDOUT: !237 = !DILocation(line: 176, column: 5, scope: !231)
// CHECK:STDOUT: !238 = !{!232}
// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352", scope: null, file: !96, line: 166, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !251)
// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !6)
// CHECK:STDOUT: !244 = !DILocation(line: 167, column: 14, scope: !239)
// CHECK:STDOUT: !246 = !DILocation(line: 167, column: 18, scope: !239)
// CHECK:STDOUT: !248 = !DILocation(line: 169, column: 5, scope: !239)
// CHECK:STDOUT: !250 = !DILocation(line: 170, column: 5, scope: !239)
// CHECK:STDOUT: !251 = !{!240}
// CHECK:STDOUT: !179 = !DILocation(line: 11, column: 12, scope: !177)
// CHECK:STDOUT: !180 = !{!178}
// CHECK:STDOUT: !181 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f914f15dcbbdbae9:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !184)
// CHECK:STDOUT: !182 = !DILocalVariable(arg: 1, scope: !181, type: !6)
// CHECK:STDOUT: !183 = !DILocation(line: 11, column: 12, scope: !181)
// CHECK:STDOUT: !184 = !{!182}
// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.19661d0961df889d:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !188)
// CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !185, type: !6)
// CHECK:STDOUT: !187 = !DILocation(line: 11, column: 12, scope: !185)
// CHECK:STDOUT: !188 = !{!186}
// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.19661d0961df889d:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !192)
// CHECK:STDOUT: !190 = !DILocalVariable(arg: 1, scope: !189, type: !6)
// CHECK:STDOUT: !191 = !DILocation(line: 11, column: 12, scope: !189)
// CHECK:STDOUT: !192 = !{!190}
// CHECK:STDOUT: !193 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e3602e7640dfb844:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !196)
// CHECK:STDOUT: !194 = !DILocalVariable(arg: 1, scope: !193, type: !6)
// CHECK:STDOUT: !195 = !DILocation(line: 11, column: 12, scope: !193)
// CHECK:STDOUT: !196 = !{!194}
// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e3602e7640dfb844:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !200)
// CHECK:STDOUT: !198 = !DILocalVariable(arg: 1, scope: !197, type: !6)
// CHECK:STDOUT: !199 = !DILocation(line: 11, column: 12, scope: !197)
// CHECK:STDOUT: !200 = !{!198}
// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bc918cd0012c1190:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !204)
// CHECK:STDOUT: !202 = !DILocalVariable(arg: 1, scope: !201, type: !6)
// CHECK:STDOUT: !203 = !DILocation(line: 11, column: 12, scope: !201)
// CHECK:STDOUT: !204 = !{!202}
// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bc918cd0012c1190:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !208)
// CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !205, type: !6)
// CHECK:STDOUT: !207 = !DILocation(line: 11, column: 12, scope: !205)
// CHECK:STDOUT: !208 = !{!206}
// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.78fd6ee82eacbbc3:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !212)
// CHECK:STDOUT: !210 = !DILocalVariable(arg: 1, scope: !209, type: !6)
// CHECK:STDOUT: !211 = !DILocation(line: 11, column: 12, scope: !209)
// CHECK:STDOUT: !212 = !{!210}
// CHECK:STDOUT: !213 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.78fd6ee82eacbbc3:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !216)
// CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !213, type: !6)
// CHECK:STDOUT: !215 = !DILocation(line: 11, column: 12, scope: !213)
// CHECK:STDOUT: !216 = !{!214}
// CHECK:STDOUT: !217 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7d29ea9e6f62bf96", scope: null, file: !48, line: 105, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !224)
// CHECK:STDOUT: !218 = !DILocalVariable(arg: 1, scope: !217, type: !6)
// CHECK:STDOUT: !222 = !DILocation(line: 106, column: 12, scope: !217)
// CHECK:STDOUT: !223 = !DILocation(line: 106, column: 5, scope: !217)
// CHECK:STDOUT: !224 = !{!218}
// CHECK:STDOUT: !225 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.c5881e9a6965c8a5", scope: null, file: !48, line: 95, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !237)
// CHECK:STDOUT: !226 = !DILocalVariable(arg: 1, scope: !225, type: !6)
// CHECK:STDOUT: !230 = !DILocation(line: 96, column: 9, scope: !225)
// CHECK:STDOUT: !231 = !DILocation(line: 96, column: 8, scope: !225)
// CHECK:STDOUT: !232 = !DILocation(line: 97, column: 31, scope: !225)
// CHECK:STDOUT: !233 = !DILocation(line: 97, column: 14, scope: !225)
// CHECK:STDOUT: !234 = !DILocation(line: 97, column: 7, scope: !225)
// CHECK:STDOUT: !235 = !DILocation(line: 99, column: 12, scope: !225)
// CHECK:STDOUT: !236 = !DILocation(line: 99, column: 5, scope: !225)
// CHECK:STDOUT: !237 = !{!226}
// CHECK:STDOUT: !238 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.0c3518913b4fb338", scope: null, file: !48, line: 36, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !246)
// CHECK:STDOUT: !239 = !DILocalVariable(arg: 1, scope: !238, type: !6)
// CHECK:STDOUT: !244 = !DILocation(line: 37, column: 12, scope: !238)
// CHECK:STDOUT: !245 = !DILocation(line: 37, column: 5, scope: !238)
// CHECK:STDOUT: !246 = !{!239}
// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.0c3518913b4fb338", scope: null, file: !48, line: 39, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !255)
// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !6)
// CHECK:STDOUT: !253 = !DILocation(line: 40, column: 12, scope: !247)
// CHECK:STDOUT: !254 = !DILocation(line: 40, column: 5, scope: !247)
// CHECK:STDOUT: !255 = !{!248}
// CHECK:STDOUT: !256 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.305e266058820aa4", scope: null, file: !48, line: 33, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !263)
// CHECK:STDOUT: !257 = !DILocalVariable(arg: 1, scope: !256, type: !6)
// CHECK:STDOUT: !261 = !DILocation(line: 34, column: 12, scope: !256)
// CHECK:STDOUT: !262 = !DILocation(line: 34, column: 5, scope: !256)
// CHECK:STDOUT: !263 = !{!257}
// CHECK:STDOUT: !264 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.305e266058820aa4", scope: null, file: !48, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !154)
// CHECK:STDOUT: !268 = !DILocation(line: 31, column: 5, scope: !264)
// CHECK:STDOUT: !269 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !48, line: 172, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !278)
// CHECK:STDOUT: !270 = !DILocalVariable(arg: 1, scope: !269, type: !6)
// CHECK:STDOUT: !275 = !DILocation(line: 173, column: 16, scope: !269)
// CHECK:STDOUT: !276 = !DILocation(line: 173, column: 12, scope: !269)
// CHECK:STDOUT: !277 = !DILocation(line: 173, column: 5, scope: !269)
// CHECK:STDOUT: !278 = !{!270}
// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !48, line: 175, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !286)
// CHECK:STDOUT: !280 = !DILocalVariable(arg: 1, scope: !279, type: !6)
// CHECK:STDOUT: !285 = !DILocation(line: 176, column: 5, scope: !279)
// CHECK:STDOUT: !286 = !{!280}
// CHECK:STDOUT: !287 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352", scope: null, file: !48, line: 166, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !299)
// CHECK:STDOUT: !288 = !DILocalVariable(arg: 1, scope: !287, type: !6)
// CHECK:STDOUT: !292 = !DILocation(line: 167, column: 14, scope: !287)
// CHECK:STDOUT: !294 = !DILocation(line: 167, column: 18, scope: !287)
// CHECK:STDOUT: !296 = !DILocation(line: 169, column: 5, scope: !287)
// CHECK:STDOUT: !298 = !DILocation(line: 170, column: 5, scope: !287)
// CHECK:STDOUT: !299 = !{!288}
// CHECK:STDOUT:
+261 -189
View File
@@ -150,6 +150,7 @@ fn GetRefs() {
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.1), !dbg !36
// 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 !36
// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk.v(ptr %_.var.1), !dbg !37
// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %_.var.1), !dbg !36
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk._(ptr %c.var), !dbg !39
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !40
// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !40
@@ -157,13 +158,14 @@ fn GetRefs() {
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.2), !dbg !45
// CHECK:STDOUT: store i32 42, ptr %_.var.2, align 4, !dbg !45
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr %_.var.2), !dbg !46
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.2), !dbg !45
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.2), !dbg !45
// CHECK:STDOUT: %.loc25_23.1 = load i32, ptr %n.var, align 4, !dbg !47
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_23.2.temp), !dbg !47
// CHECK:STDOUT: store i32 %.loc25_23.1, ptr %.loc25_23.2.temp, align 4, !dbg !47
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr %.loc25_23.2.temp), !dbg !48
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !47
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !40
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !47
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !40
// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %c.var), !dbg !31
// CHECK:STDOUT: ret void, !dbg !49
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -171,8 +173,8 @@ fn GetRefs() {
// 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 !66
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !66
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !78
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !78
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -189,18 +191,24 @@ fn GetRefs() {
// 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 !66
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: call void @_Z9TakeCRRefO1C(ptr noundef nonnull align 1 dereferenceable(1) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %self) #0 !dbg !53 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !55
// 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: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C(ptr noundef nonnull align 1 dereferenceable(1) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -211,24 +219,37 @@ fn GetRefs() {
// 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 !70
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi(ptr noundef nonnull align 4 dereferenceable(4) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !53 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !57 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !55
// CHECK:STDOUT: ret void, !dbg !59
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !61 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !63
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !65 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !67
// CHECK:STDOUT: ret void, !dbg !67
// 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: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi(ptr noundef nonnull align 4 dereferenceable(4) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -237,9 +258,9 @@ fn GetRefs() {
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #5
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !57 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !60
// CHECK:STDOUT: ret void, !dbg !61
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !69 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !72
// CHECK:STDOUT: ret void, !dbg !73
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -254,7 +275,8 @@ fn GetRefs() {
// CHECK:STDOUT: declare void @_Z15TakeConstIntRefRKi(ptr noundef nonnull align 4 dereferenceable(4)) #3
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 }
// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", { 1, 0 }
// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 }
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
@@ -265,8 +287,8 @@ fn GetRefs() {
// CHECK:STDOUT: attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!19}
// CHECK:STDOUT: !llvm.module.flags = !{!71, !72, !73, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!75}
// CHECK:STDOUT: !llvm.module.flags = !{!83, !84, !85, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!87}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -277,6 +299,8 @@ fn GetRefs() {
// CHECK:STDOUT: !21 = !{null}
// CHECK:STDOUT: !22 = !DISubroutineType(types: !21)
// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !24 = !{null, !23}
// CHECK:STDOUT: !25 = !DISubroutineType(types: !24)
// CHECK:STDOUT: !26 = !{!23}
// CHECK:STDOUT: !27 = !DISubroutineType(types: !26)
// CHECK:STDOUT: !28 = !{null, !20}
@@ -296,26 +320,38 @@ fn GetRefs() {
// CHECK:STDOUT: !49 = !DILocation(line: 16, column: 1, scope: !30)
// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !18, line: 5, type: !27, spFlags: DISPFlagDefinition, unit: !19)
// CHECK:STDOUT: !52 = !DILocation(line: 5, column: 7, scope: !50)
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56)
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !20)
// CHECK:STDOUT: !55 = !DILocation(line: 12, column: 23, scope: !53)
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", scope: null, file: !18, line: 8, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56)
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !23)
// CHECK:STDOUT: !55 = !DILocation(line: 8, column: 19, scope: !53)
// CHECK:STDOUT: !56 = !{!54}
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !19)
// CHECK:STDOUT: !60 = !DILocation(line: 9, column: 28, scope: !57)
// CHECK:STDOUT: !61 = !DILocation(line: 9, column: 21, scope: !57)
// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0}
// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0}
// CHECK:STDOUT: !65 = !{!"p1 _ZTS1C", !64, i64 0}
// CHECK:STDOUT: !66 = !{!65, !65, i64 0}
// CHECK:STDOUT: !68 = !{!"int", !63, i64 0}
// CHECK:STDOUT: !69 = !{!"p1 int", !64, i64 0}
// CHECK:STDOUT: !70 = !{!69, !69, i64 0}
// CHECK:STDOUT: !71 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !72 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !73 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !74 = !{!"__libc_errno", !68, i64 0}
// CHECK:STDOUT: !75 = !{!74, !68, i64 0}
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60)
// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !20)
// CHECK:STDOUT: !59 = !DILocation(line: 12, column: 23, scope: !57)
// CHECK:STDOUT: !60 = !{!58}
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !64)
// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !20)
// CHECK:STDOUT: !63 = !DILocation(line: 12, column: 23, scope: !61)
// CHECK:STDOUT: !64 = !{!62}
// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !68)
// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !20)
// CHECK:STDOUT: !67 = !DILocation(line: 12, column: 23, scope: !65)
// CHECK:STDOUT: !68 = !{!66}
// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !19)
// CHECK:STDOUT: !72 = !DILocation(line: 9, column: 28, scope: !69)
// CHECK:STDOUT: !73 = !DILocation(line: 9, column: 21, scope: !69)
// CHECK:STDOUT: !74 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !75 = !{!"omnipotent char", !74, i64 0}
// CHECK:STDOUT: !76 = !{!"any pointer", !75, i64 0}
// CHECK:STDOUT: !77 = !{!"p1 _ZTS1C", !76, i64 0}
// CHECK:STDOUT: !78 = !{!77, !77, i64 0}
// CHECK:STDOUT: !80 = !{!"int", !75, i64 0}
// CHECK:STDOUT: !81 = !{!"p1 int", !76, i64 0}
// CHECK:STDOUT: !82 = !{!81, !81, i64 0}
// CHECK:STDOUT: !83 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !84 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !85 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !86 = !{!"__libc_errno", !80, i64 0}
// CHECK:STDOUT: !87 = !{!86, !80, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'pass_references_via_thunk.carbon'
@@ -329,49 +365,51 @@ fn GetRefs() {
// CHECK:STDOUT: @C.val.loc20_20.3 = internal constant {} zeroinitializer
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !78 {
// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !90 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !79
// CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 1, !dbg !84
// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !88
// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !93
// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !95
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !79
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !79
// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !83
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !84
// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !85
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !87
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !88
// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !88
// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !92
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !93
// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !93
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !94
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !93
// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !95
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !95
// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !95
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !96
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !95
// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !88
// CHECK:STDOUT: ret void, !dbg !97
// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !91
// CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 1, !dbg !96
// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !100
// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !105
// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !107
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !91
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !91
// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !95
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !96
// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !97
// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr @C.val), !dbg !96
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !99
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !100
// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !100
// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !104
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !105
// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !105
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !106
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !105
// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !107
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !107
// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !107
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !108
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !107
// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !100
// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %c.var), !dbg !91
// CHECK:STDOUT: ret void, !dbg !109
// 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: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !66
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !66
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !78
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !78
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !98 {
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !110 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !100
// CHECK:STDOUT: ret void, !dbg !100
// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !112
// CHECK:STDOUT: ret void, !dbg !112
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -379,8 +417,8 @@ fn GetRefs() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66, !nonnull !110
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78, !nonnull !134
// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -390,19 +428,25 @@ fn GetRefs() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %self) #0 !dbg !113 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !115
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// 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
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -412,8 +456,8 @@ fn GetRefs() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70, !nonnull !110, !align !112
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82, !nonnull !134, !align !136
// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -423,16 +467,29 @@ fn GetRefs() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !101 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !117 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !103
// CHECK:STDOUT: ret void, !dbg !119
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !121 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !123
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !125 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !127
// CHECK:STDOUT: ret void, !dbg !127
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -440,8 +497,8 @@ fn GetRefs() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -450,9 +507,9 @@ fn GetRefs() {
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #4
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !105 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !108
// CHECK:STDOUT: ret void, !dbg !109
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !129 {
// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !132
// CHECK:STDOUT: ret void, !dbg !133
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z8TakeCRefR1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1)) #5
@@ -468,7 +525,8 @@ fn GetRefs() {
// CHECK:STDOUT: declare void @_Z15TakeConstIntRefRKi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4)) #5
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 }
// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", { 1, 0 }
// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 }
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
@@ -478,9 +536,9 @@ fn GetRefs() {
// CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #5 = { "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.dbg.cu = !{!77}
// CHECK:STDOUT: !llvm.module.flags = !{!71, !72, !73, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!75}
// CHECK:STDOUT: !llvm.dbg.cu = !{!89}
// CHECK:STDOUT: !llvm.module.flags = !{!83, !84, !85, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!87}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -489,49 +547,63 @@ fn GetRefs() {
// CHECK:STDOUT: !21 = !{null}
// CHECK:STDOUT: !22 = !DISubroutineType(types: !21)
// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !24 = !{null, !23}
// CHECK:STDOUT: !25 = !DISubroutineType(types: !24)
// CHECK:STDOUT: !26 = !{!23}
// CHECK:STDOUT: !27 = !DISubroutineType(types: !26)
// CHECK:STDOUT: !28 = !{null, !20}
// CHECK:STDOUT: !29 = !DISubroutineType(types: !28)
// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0}
// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0}
// CHECK:STDOUT: !65 = !{!"p1 _ZTS1C", !64, i64 0}
// CHECK:STDOUT: !66 = !{!65, !65, i64 0}
// CHECK:STDOUT: !68 = !{!"int", !63, i64 0}
// CHECK:STDOUT: !69 = !{!"p1 int", !64, i64 0}
// CHECK:STDOUT: !70 = !{!69, !69, i64 0}
// CHECK:STDOUT: !71 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !72 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !73 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !74 = !{!"__libc_errno", !68, i64 0}
// CHECK:STDOUT: !75 = !{!74, !68, i64 0}
// CHECK:STDOUT: !76 = !DIFile(filename: "pass_references_via_thunk.carbon", directory: "")
// CHECK:STDOUT: !77 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !76, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !76, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !77)
// CHECK:STDOUT: !79 = !DILocation(line: 18, column: 3, scope: !78)
// CHECK:STDOUT: !83 = !DILocation(line: 19, column: 3, scope: !78)
// CHECK:STDOUT: !84 = !DILocation(line: 20, column: 17, scope: !78)
// CHECK:STDOUT: !85 = !DILocation(line: 20, column: 3, scope: !78)
// CHECK:STDOUT: !87 = !DILocation(line: 21, column: 3, scope: !78)
// CHECK:STDOUT: !88 = !DILocation(line: 23, column: 3, scope: !78)
// CHECK:STDOUT: !92 = !DILocation(line: 24, column: 3, scope: !78)
// CHECK:STDOUT: !93 = !DILocation(line: 13, column: 23, scope: !78)
// CHECK:STDOUT: !94 = !DILocation(line: 25, column: 3, scope: !78)
// CHECK:STDOUT: !95 = !DILocation(line: 26, column: 23, scope: !78)
// CHECK:STDOUT: !96 = !DILocation(line: 26, column: 3, scope: !78)
// CHECK:STDOUT: !97 = !DILocation(line: 17, column: 1, scope: !78)
// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !76, line: 5, type: !27, spFlags: DISPFlagDefinition, unit: !77)
// CHECK:STDOUT: !100 = !DILocation(line: 5, column: 7, scope: !98)
// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !76, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !77, retainedNodes: !104)
// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !20)
// CHECK:STDOUT: !103 = !DILocation(line: 13, column: 23, scope: !101)
// CHECK:STDOUT: !104 = !{!102}
// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !77)
// CHECK:STDOUT: !108 = !DILocation(line: 9, column: 28, scope: !105)
// CHECK:STDOUT: !109 = !DILocation(line: 9, column: 21, scope: !105)
// CHECK:STDOUT: !110 = !{}
// CHECK:STDOUT: !112 = !{i64 4}
// CHECK:STDOUT: !74 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !75 = !{!"omnipotent char", !74, i64 0}
// CHECK:STDOUT: !76 = !{!"any pointer", !75, i64 0}
// CHECK:STDOUT: !77 = !{!"p1 _ZTS1C", !76, i64 0}
// CHECK:STDOUT: !78 = !{!77, !77, i64 0}
// CHECK:STDOUT: !80 = !{!"int", !75, i64 0}
// CHECK:STDOUT: !81 = !{!"p1 int", !76, i64 0}
// CHECK:STDOUT: !82 = !{!81, !81, i64 0}
// CHECK:STDOUT: !83 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !84 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !85 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !86 = !{!"__libc_errno", !80, i64 0}
// CHECK:STDOUT: !87 = !{!86, !80, i64 0}
// CHECK:STDOUT: !88 = !DIFile(filename: "pass_references_via_thunk.carbon", directory: "")
// CHECK:STDOUT: !89 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !88, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !88, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !89)
// CHECK:STDOUT: !91 = !DILocation(line: 18, column: 3, scope: !90)
// CHECK:STDOUT: !95 = !DILocation(line: 19, column: 3, scope: !90)
// CHECK:STDOUT: !96 = !DILocation(line: 20, column: 17, scope: !90)
// CHECK:STDOUT: !97 = !DILocation(line: 20, column: 3, scope: !90)
// CHECK:STDOUT: !99 = !DILocation(line: 21, column: 3, scope: !90)
// CHECK:STDOUT: !100 = !DILocation(line: 23, column: 3, scope: !90)
// CHECK:STDOUT: !104 = !DILocation(line: 24, column: 3, scope: !90)
// CHECK:STDOUT: !105 = !DILocation(line: 13, column: 23, scope: !90)
// CHECK:STDOUT: !106 = !DILocation(line: 25, column: 3, scope: !90)
// CHECK:STDOUT: !107 = !DILocation(line: 26, column: 23, scope: !90)
// CHECK:STDOUT: !108 = !DILocation(line: 26, column: 3, scope: !90)
// CHECK:STDOUT: !109 = !DILocation(line: 17, column: 1, scope: !90)
// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !88, line: 5, type: !27, spFlags: DISPFlagDefinition, unit: !89)
// CHECK:STDOUT: !112 = !DILocation(line: 5, column: 7, scope: !110)
// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", scope: null, file: !88, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !116)
// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !23)
// CHECK:STDOUT: !115 = !DILocation(line: 20, column: 17, scope: !113)
// CHECK:STDOUT: !116 = !{!114}
// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !88, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !120)
// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !20)
// CHECK:STDOUT: !119 = !DILocation(line: 13, column: 23, scope: !117)
// CHECK:STDOUT: !120 = !{!118}
// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !88, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !124)
// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !20)
// CHECK:STDOUT: !123 = !DILocation(line: 13, column: 23, scope: !121)
// CHECK:STDOUT: !124 = !{!122}
// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !88, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !128)
// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !125, type: !20)
// CHECK:STDOUT: !127 = !DILocation(line: 13, column: 23, scope: !125)
// CHECK:STDOUT: !128 = !{!126}
// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !89)
// CHECK:STDOUT: !132 = !DILocation(line: 9, column: 28, scope: !129)
// CHECK:STDOUT: !133 = !DILocation(line: 9, column: 21, scope: !129)
// CHECK:STDOUT: !134 = !{}
// CHECK:STDOUT: !136 = !{i64 4}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'return_references.carbon'
@@ -540,15 +612,15 @@ fn GetRefs() {
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !115 {
// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !139 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !116
// CHECK:STDOUT: %ReturnCRRef.call = call ptr @_Z11ReturnCRRefv(), !dbg !119
// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !122
// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !125
// CHECK:STDOUT: %ReturnIntRRef.call = call ptr @_Z13ReturnIntRRefv(), !dbg !128
// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !131
// CHECK:STDOUT: ret void, !dbg !134
// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !140
// CHECK:STDOUT: %ReturnCRRef.call = call ptr @_Z11ReturnCRRefv(), !dbg !143
// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !146
// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !149
// CHECK:STDOUT: %ReturnIntRRef.call = call ptr @_Z13ReturnIntRRefv(), !dbg !152
// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !155
// CHECK:STDOUT: ret void, !dbg !158
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRefv() #1
@@ -566,32 +638,32 @@ fn GetRefs() {
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!114}
// CHECK:STDOUT: !llvm.module.flags = !{!71, !72, !73, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!75}
// CHECK:STDOUT: !llvm.dbg.cu = !{!138}
// CHECK:STDOUT: !llvm.module.flags = !{!83, !84, !85, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!87}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !21 = !{null}
// CHECK:STDOUT: !22 = !DISubroutineType(types: !21)
// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0}
// CHECK:STDOUT: !68 = !{!"int", !63, i64 0}
// CHECK:STDOUT: !71 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !72 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !73 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !74 = !{!"__libc_errno", !68, i64 0}
// CHECK:STDOUT: !75 = !{!74, !68, i64 0}
// CHECK:STDOUT: !113 = !DIFile(filename: "return_references.carbon", directory: "")
// CHECK:STDOUT: !114 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !113, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !113, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !114)
// CHECK:STDOUT: !116 = !DILocation(line: 17, column: 22, scope: !115)
// CHECK:STDOUT: !119 = !DILocation(line: 18, column: 22, scope: !115)
// CHECK:STDOUT: !122 = !DILocation(line: 19, column: 28, scope: !115)
// CHECK:STDOUT: !125 = !DILocation(line: 21, column: 20, scope: !115)
// CHECK:STDOUT: !128 = !DILocation(line: 22, column: 20, scope: !115)
// CHECK:STDOUT: !131 = !DILocation(line: 23, column: 26, scope: !115)
// CHECK:STDOUT: !134 = !DILocation(line: 16, column: 1, scope: !115)
// CHECK:STDOUT: !74 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !75 = !{!"omnipotent char", !74, i64 0}
// CHECK:STDOUT: !80 = !{!"int", !75, i64 0}
// CHECK:STDOUT: !83 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !84 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !85 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !86 = !{!"__libc_errno", !80, i64 0}
// CHECK:STDOUT: !87 = !{!86, !80, i64 0}
// CHECK:STDOUT: !137 = !DIFile(filename: "return_references.carbon", directory: "")
// CHECK:STDOUT: !138 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !137, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !137, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !138)
// CHECK:STDOUT: !140 = !DILocation(line: 17, column: 22, scope: !139)
// CHECK:STDOUT: !143 = !DILocation(line: 18, column: 22, scope: !139)
// CHECK:STDOUT: !146 = !DILocation(line: 19, column: 28, scope: !139)
// CHECK:STDOUT: !149 = !DILocation(line: 21, column: 20, scope: !139)
// CHECK:STDOUT: !152 = !DILocation(line: 22, column: 20, scope: !139)
// CHECK:STDOUT: !155 = !DILocation(line: 23, column: 26, scope: !139)
// CHECK:STDOUT: !158 = !DILocation(line: 16, column: 1, scope: !139)
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'return_references_via_thunk.carbon'
@@ -602,15 +674,15 @@ fn GetRefs() {
// CHECK:STDOUT: %class.ForceThunk.23 = type { i8 }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !137 {
// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !161 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !138
// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !141
// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !144
// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !147
// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !150
// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !153
// CHECK:STDOUT: ret void, !dbg !156
// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !162
// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !165
// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !168
// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !171
// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !174
// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !177
// CHECK:STDOUT: ret void, !dbg !180
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -677,30 +749,30 @@ fn GetRefs() {
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #2 = { "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.dbg.cu = !{!136}
// CHECK:STDOUT: !llvm.module.flags = !{!71, !72, !73, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!75}
// CHECK:STDOUT: !llvm.dbg.cu = !{!160}
// CHECK:STDOUT: !llvm.module.flags = !{!83, !84, !85, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!87}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !21 = !{null}
// CHECK:STDOUT: !22 = !DISubroutineType(types: !21)
// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0}
// CHECK:STDOUT: !68 = !{!"int", !63, i64 0}
// CHECK:STDOUT: !71 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !72 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !73 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !74 = !{!"__libc_errno", !68, i64 0}
// CHECK:STDOUT: !75 = !{!74, !68, i64 0}
// CHECK:STDOUT: !135 = !DIFile(filename: "return_references_via_thunk.carbon", directory: "")
// CHECK:STDOUT: !136 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !135, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !135, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !136)
// CHECK:STDOUT: !138 = !DILocation(line: 18, column: 22, scope: !137)
// CHECK:STDOUT: !141 = !DILocation(line: 19, column: 22, scope: !137)
// CHECK:STDOUT: !144 = !DILocation(line: 20, column: 28, scope: !137)
// CHECK:STDOUT: !147 = !DILocation(line: 22, column: 20, scope: !137)
// CHECK:STDOUT: !150 = !DILocation(line: 23, column: 20, scope: !137)
// CHECK:STDOUT: !153 = !DILocation(line: 24, column: 26, scope: !137)
// CHECK:STDOUT: !156 = !DILocation(line: 17, column: 1, scope: !137)
// CHECK:STDOUT: !74 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !75 = !{!"omnipotent char", !74, i64 0}
// CHECK:STDOUT: !80 = !{!"int", !75, i64 0}
// CHECK:STDOUT: !83 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !84 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !85 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !86 = !{!"__libc_errno", !80, i64 0}
// CHECK:STDOUT: !87 = !{!86, !80, i64 0}
// CHECK:STDOUT: !159 = !DIFile(filename: "return_references_via_thunk.carbon", directory: "")
// CHECK:STDOUT: !160 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !159, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !159, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !160)
// CHECK:STDOUT: !162 = !DILocation(line: 18, column: 22, scope: !161)
// CHECK:STDOUT: !165 = !DILocation(line: 19, column: 22, scope: !161)
// CHECK:STDOUT: !168 = !DILocation(line: 20, column: 28, scope: !161)
// CHECK:STDOUT: !171 = !DILocation(line: 22, column: 20, scope: !161)
// CHECK:STDOUT: !174 = !DILocation(line: 23, column: 20, scope: !161)
// CHECK:STDOUT: !177 = !DILocation(line: 24, column: 26, scope: !161)
// CHECK:STDOUT: !180 = !DILocation(line: 17, column: 1, scope: !161)
// CHECK:STDOUT:
+394 -324
View File
@@ -98,6 +98,7 @@ fn CallGeneric() -> i32 {
// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !52
// CHECK:STDOUT: %.loc6_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !54
// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.b, align 4, !dbg !54
// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %a.var), !dbg !51
// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !55
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -105,13 +106,19 @@ fn CallGeneric() -> i32 {
// CHECK:STDOUT: define internal void @_Z6make_av.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 !58
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !58
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #0 !dbg !56 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !58
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
@@ -120,9 +127,9 @@ fn CallGeneric() -> i32 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.A, align 4
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !60
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !64
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !61
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !65
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
@@ -151,17 +158,24 @@ fn CallGeneric() -> i32 {
// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !43 = !{!42}
// CHECK:STDOUT: !44 = !DISubroutineType(types: !43)
// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !46 = !{null, !45}
// CHECK:STDOUT: !47 = !DISubroutineType(types: !46)
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !40, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !41)
// CHECK:STDOUT: !51 = !DILocation(line: 5, column: 3, scope: !48)
// CHECK:STDOUT: !52 = !DILocation(line: 5, column: 18, scope: !48)
// CHECK:STDOUT: !54 = !DILocation(line: 6, column: 10, scope: !48)
// CHECK:STDOUT: !55 = !DILocation(line: 6, column: 3, scope: !48)
// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !57 = !{!"p1 _ZTS1A", !56, i64 0}
// CHECK:STDOUT: !58 = !{!57, !57, i64 0}
// CHECK:STDOUT: !59 = !{!"_ZTS1A", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !60 = !{!59, !7, i64 0}
// CHECK:STDOUT: !61 = !{!59, !7, i64 4}
// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !40, line: 5, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !59)
// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !45)
// CHECK:STDOUT: !58 = !DILocation(line: 5, column: 3, scope: !56)
// CHECK:STDOUT: !59 = !{!57}
// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !61 = !{!"p1 _ZTS1A", !60, i64 0}
// CHECK:STDOUT: !62 = !{!61, !61, i64 0}
// CHECK:STDOUT: !63 = !{!"_ZTS1A", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !64 = !{!63, !7, i64 0}
// CHECK:STDOUT: !65 = !{!63, !7, i64 4}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'use_b.carbon'
@@ -174,27 +188,34 @@ fn CallGeneric() -> i32 {
// CHECK:STDOUT: $_Z6make_bv = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !64 {
// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !68 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !67
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !67
// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !68
// CHECK:STDOUT: %.loc6_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !70
// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.x, align 4, !dbg !70
// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !71
// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !71
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !71
// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !72
// CHECK:STDOUT: %.loc6_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !74
// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.x, align 4, !dbg !74
// CHECK:STDOUT: call void @"_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core"(ptr %b.var), !dbg !71
// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !75
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_bv.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 !73
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !73
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !81
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !81
// CHECK:STDOUT: %call = call i64 @_Z6make_bv()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core"(ptr %self) #0 !dbg !76 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !78
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
@@ -203,9 +224,9 @@ fn CallGeneric() -> i32 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.B, align 4
// CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !75
// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !83
// CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !76
// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !84
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
@@ -215,288 +236,7 @@ fn CallGeneric() -> i32 {
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!63}
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!9}
// CHECK:STDOUT:
// 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 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0}
// CHECK:STDOUT: !7 = !{!"int", !6, i64 0}
// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0}
// CHECK:STDOUT: !9 = !{!8, !7, i64 0}
// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !43 = !{!42}
// CHECK:STDOUT: !44 = !DISubroutineType(types: !43)
// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !62 = !DIFile(filename: "use_b.carbon", directory: "")
// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !62, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !63)
// CHECK:STDOUT: !67 = !DILocation(line: 5, column: 3, scope: !64)
// CHECK:STDOUT: !68 = !DILocation(line: 5, column: 18, scope: !64)
// CHECK:STDOUT: !70 = !DILocation(line: 6, column: 10, scope: !64)
// CHECK:STDOUT: !71 = !DILocation(line: 6, column: 3, scope: !64)
// CHECK:STDOUT: !72 = !{!"p1 _ZTS1B", !56, i64 0}
// CHECK:STDOUT: !73 = !{!72, !72, i64 0}
// CHECK:STDOUT: !74 = !{!"_ZTS1B", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !75 = !{!74, !7, i64 0}
// CHECK:STDOUT: !76 = !{!74, !7, i64 4}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'use_both.carbon'
// CHECK:STDOUT: source_filename = "use_both.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.A.32 = type { i32, i32 }
// CHECK:STDOUT: %struct.B.33 = type { i32, i32 }
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z6make_av = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z6make_bv = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CTestA.Main() #0 !dbg !79 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !82
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !82
// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !83
// CHECK:STDOUT: %.loc7_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !85
// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.b, align 4, !dbg !85
// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !86
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_av.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 !58
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !58
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CTestB.Main() #0 !dbg !87 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !90
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !90
// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !91
// CHECK:STDOUT: %.loc12_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !93
// CHECK:STDOUT: %.loc12_11.2 = load i32, ptr %.loc12_11.1.x, align 4, !dbg !93
// CHECK:STDOUT: ret i32 %.loc12_11.2, !dbg !94
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_bv.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 !73
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !73
// CHECK:STDOUT: %call = call i64 @_Z6make_bv()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.A.32, align 4
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !60
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !61
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_bv() #3 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.B.33, align 4
// CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !75
// CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !76
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!78}
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!9}
// CHECK:STDOUT:
// 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 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0}
// CHECK:STDOUT: !7 = !{!"int", !6, i64 0}
// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0}
// CHECK:STDOUT: !9 = !{!8, !7, i64 0}
// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !43 = !{!42}
// CHECK:STDOUT: !44 = !DISubroutineType(types: !43)
// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !57 = !{!"p1 _ZTS1A", !56, i64 0}
// CHECK:STDOUT: !58 = !{!57, !57, i64 0}
// CHECK:STDOUT: !59 = !{!"_ZTS1A", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !60 = !{!59, !7, i64 0}
// CHECK:STDOUT: !61 = !{!59, !7, i64 4}
// CHECK:STDOUT: !72 = !{!"p1 _ZTS1B", !56, i64 0}
// CHECK:STDOUT: !73 = !{!72, !72, i64 0}
// CHECK:STDOUT: !74 = !{!"_ZTS1B", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !75 = !{!74, !7, i64 0}
// CHECK:STDOUT: !76 = !{!74, !7, i64 4}
// CHECK:STDOUT: !77 = !DIFile(filename: "use_both.carbon", directory: "")
// CHECK:STDOUT: !78 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !77, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "TestA", linkageName: "_CTestA.Main", scope: null, file: !77, line: 5, type: !44, spFlags: DISPFlagDefinition, unit: !78)
// CHECK:STDOUT: !82 = !DILocation(line: 6, column: 3, scope: !79)
// CHECK:STDOUT: !83 = !DILocation(line: 6, column: 18, scope: !79)
// CHECK:STDOUT: !85 = !DILocation(line: 7, column: 10, scope: !79)
// CHECK:STDOUT: !86 = !DILocation(line: 7, column: 3, scope: !79)
// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "TestB", linkageName: "_CTestB.Main", scope: null, file: !77, line: 10, type: !44, spFlags: DISPFlagDefinition, unit: !78)
// CHECK:STDOUT: !90 = !DILocation(line: 11, column: 3, scope: !87)
// CHECK:STDOUT: !91 = !DILocation(line: 11, column: 18, scope: !87)
// CHECK:STDOUT: !93 = !DILocation(line: 12, column: 10, scope: !87)
// CHECK:STDOUT: !94 = !DILocation(line: 12, column: 3, scope: !87)
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'generic_lib.carbon'
// CHECK:STDOUT: source_filename = "generic_lib.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.A.36 = type { i32, i32 }
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z6make_av = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_av.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 !58
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !58
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #1 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.A.36, align 4
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.36, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !60
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.36, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !61
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!96}
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!9}
// CHECK:STDOUT:
// 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 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0}
// CHECK:STDOUT: !7 = !{!"int", !6, i64 0}
// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0}
// CHECK:STDOUT: !9 = !{!8, !7, i64 0}
// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !57 = !{!"p1 _ZTS1A", !56, i64 0}
// CHECK:STDOUT: !58 = !{!57, !57, i64 0}
// CHECK:STDOUT: !59 = !{!"_ZTS1A", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !60 = !{!59, !7, i64 0}
// CHECK:STDOUT: !61 = !{!59, !7, i64 4}
// CHECK:STDOUT: !95 = !DIFile(filename: "generic_lib.carbon", directory: "")
// CHECK:STDOUT: !96 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !95, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'no_cpp_imports.carbon'
// CHECK:STDOUT: source_filename = "no_cpp_imports.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.A.39 = type { i32, i32 }
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z6make_av = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CCallGeneric.Main() #0 !dbg !99 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %MakeA.call = call i32 @_CMakeA.Main.084a2801e0f5d754({} zeroinitializer), !dbg !102
// CHECK:STDOUT: ret i32 %MakeA.call, !dbg !105
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr i32 @_CMakeA.Main.084a2801e0f5d754({} %x) #0 !dbg !106 {
// CHECK:STDOUT: %1 = alloca [8 x i8], align 4, !dbg !111
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !111
// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %1), !dbg !112
// CHECK:STDOUT: %b = getelementptr inbounds nuw [8 x i8], ptr %1, i32 0, i32 4, !dbg !114
// CHECK:STDOUT: %2 = load i32, ptr %b, align 4, !dbg !114
// CHECK:STDOUT: ret i32 %2, !dbg !115
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_av.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 !58
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !58
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.A.39, align 4
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.39, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !60
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.39, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !61
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!98}
// CHECK:STDOUT: !llvm.dbg.cu = !{!67}
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!9}
// CHECK:STDOUT:
@@ -514,25 +254,355 @@ fn CallGeneric() -> i32 {
// CHECK:STDOUT: !43 = !{!42}
// CHECK:STDOUT: !44 = !DISubroutineType(types: !43)
// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !57 = !{!"p1 _ZTS1A", !56, i64 0}
// CHECK:STDOUT: !58 = !{!57, !57, i64 0}
// CHECK:STDOUT: !59 = !{!"_ZTS1A", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !60 = !{!59, !7, i64 0}
// CHECK:STDOUT: !61 = !{!59, !7, i64 4}
// CHECK:STDOUT: !95 = !DIFile(filename: "generic_lib.carbon", directory: "")
// CHECK:STDOUT: !97 = !DIFile(filename: "no_cpp_imports.carbon", directory: "")
// CHECK:STDOUT: !98 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !97, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main", scope: null, file: !97, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !98)
// CHECK:STDOUT: !102 = !DILocation(line: 5, column: 10, scope: !99)
// CHECK:STDOUT: !103 = !{!42, !45}
// CHECK:STDOUT: !104 = !DISubroutineType(types: !103)
// CHECK:STDOUT: !105 = !DILocation(line: 5, column: 3, scope: !99)
// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "MakeA", linkageName: "_CMakeA.Main.084a2801e0f5d754", scope: null, file: !95, line: 4, type: !104, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !116)
// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !45)
// CHECK:STDOUT: !111 = !DILocation(line: 5, column: 3, scope: !106)
// CHECK:STDOUT: !112 = !DILocation(line: 5, column: 18, scope: !106)
// CHECK:STDOUT: !114 = !DILocation(line: 6, column: 10, scope: !106)
// CHECK:STDOUT: !115 = !DILocation(line: 6, column: 3, scope: !106)
// CHECK:STDOUT: !116 = !{!107}
// CHECK:STDOUT: !46 = !{null, !45}
// CHECK:STDOUT: !47 = !DISubroutineType(types: !46)
// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !66 = !DIFile(filename: "use_b.carbon", directory: "")
// CHECK:STDOUT: !67 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !66, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !66, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !67)
// CHECK:STDOUT: !71 = !DILocation(line: 5, column: 3, scope: !68)
// CHECK:STDOUT: !72 = !DILocation(line: 5, column: 18, scope: !68)
// CHECK:STDOUT: !74 = !DILocation(line: 6, column: 10, scope: !68)
// CHECK:STDOUT: !75 = !DILocation(line: 6, column: 3, scope: !68)
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core", scope: null, file: !66, line: 5, type: !47, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !79)
// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !45)
// CHECK:STDOUT: !78 = !DILocation(line: 5, column: 3, scope: !76)
// CHECK:STDOUT: !79 = !{!77}
// CHECK:STDOUT: !80 = !{!"p1 _ZTS1B", !60, i64 0}
// CHECK:STDOUT: !81 = !{!80, !80, i64 0}
// CHECK:STDOUT: !82 = !{!"_ZTS1B", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !83 = !{!82, !7, i64 0}
// CHECK:STDOUT: !84 = !{!82, !7, i64 4}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'use_both.carbon'
// CHECK:STDOUT: source_filename = "use_both.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.A.32 = type { i32, i32 }
// CHECK:STDOUT: %struct.B.33 = type { i32, i32 }
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z6make_av = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z6make_bv = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CTestA.Main() #0 !dbg !87 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !90
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !90
// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !91
// CHECK:STDOUT: %.loc7_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !93
// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.b, align 4, !dbg !93
// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %a.var), !dbg !90
// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !94
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_av.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 !62
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #0 !dbg !95 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !97
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CTestB.Main() #0 !dbg !99 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !102
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !102
// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !103
// CHECK:STDOUT: %.loc12_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !105
// CHECK:STDOUT: %.loc12_11.2 = load i32, ptr %.loc12_11.1.x, align 4, !dbg !105
// CHECK:STDOUT: call void @"_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core"(ptr %b.var), !dbg !102
// CHECK:STDOUT: ret i32 %.loc12_11.2, !dbg !106
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_bv.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 !81
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !81
// CHECK:STDOUT: %call = call i64 @_Z6make_bv()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core"(ptr %self) #0 !dbg !107 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !109
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.A.32, align 4
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !64
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !65
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_bv() #3 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.B.33, align 4
// CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !83
// CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !84
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!86}
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!9}
// CHECK:STDOUT:
// 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 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0}
// CHECK:STDOUT: !7 = !{!"int", !6, i64 0}
// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0}
// CHECK:STDOUT: !9 = !{!8, !7, i64 0}
// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !43 = !{!42}
// CHECK:STDOUT: !44 = !DISubroutineType(types: !43)
// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !46 = !{null, !45}
// CHECK:STDOUT: !47 = !DISubroutineType(types: !46)
// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !61 = !{!"p1 _ZTS1A", !60, i64 0}
// CHECK:STDOUT: !62 = !{!61, !61, i64 0}
// CHECK:STDOUT: !63 = !{!"_ZTS1A", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !64 = !{!63, !7, i64 0}
// CHECK:STDOUT: !65 = !{!63, !7, i64 4}
// CHECK:STDOUT: !80 = !{!"p1 _ZTS1B", !60, i64 0}
// CHECK:STDOUT: !81 = !{!80, !80, i64 0}
// CHECK:STDOUT: !82 = !{!"_ZTS1B", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !83 = !{!82, !7, i64 0}
// CHECK:STDOUT: !84 = !{!82, !7, i64 4}
// CHECK:STDOUT: !85 = !DIFile(filename: "use_both.carbon", directory: "")
// CHECK:STDOUT: !86 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !85, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "TestA", linkageName: "_CTestA.Main", scope: null, file: !85, line: 5, type: !44, spFlags: DISPFlagDefinition, unit: !86)
// CHECK:STDOUT: !90 = !DILocation(line: 6, column: 3, scope: !87)
// CHECK:STDOUT: !91 = !DILocation(line: 6, column: 18, scope: !87)
// CHECK:STDOUT: !93 = !DILocation(line: 7, column: 10, scope: !87)
// CHECK:STDOUT: !94 = !DILocation(line: 7, column: 3, scope: !87)
// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !85, line: 6, type: !47, spFlags: DISPFlagDefinition, unit: !86, retainedNodes: !98)
// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !45)
// CHECK:STDOUT: !97 = !DILocation(line: 6, column: 3, scope: !95)
// CHECK:STDOUT: !98 = !{!96}
// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "TestB", linkageName: "_CTestB.Main", scope: null, file: !85, line: 10, type: !44, spFlags: DISPFlagDefinition, unit: !86)
// CHECK:STDOUT: !102 = !DILocation(line: 11, column: 3, scope: !99)
// CHECK:STDOUT: !103 = !DILocation(line: 11, column: 18, scope: !99)
// CHECK:STDOUT: !105 = !DILocation(line: 12, column: 10, scope: !99)
// CHECK:STDOUT: !106 = !DILocation(line: 12, column: 3, scope: !99)
// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core", scope: null, file: !85, line: 11, type: !47, spFlags: DISPFlagDefinition, unit: !86, retainedNodes: !110)
// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !45)
// CHECK:STDOUT: !109 = !DILocation(line: 11, column: 3, scope: !107)
// CHECK:STDOUT: !110 = !{!108}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'generic_lib.carbon'
// CHECK:STDOUT: source_filename = "generic_lib.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.A.36 = type { i32, i32 }
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z6make_av = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_av.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 !62
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #1 !dbg !113 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !115
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #2 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.A.36, align 4
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.36, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !64
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.36, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !65
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #1 = { nounwind }
// CHECK:STDOUT: attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!112}
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!9}
// CHECK:STDOUT:
// 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 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0}
// CHECK:STDOUT: !7 = !{!"int", !6, i64 0}
// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0}
// CHECK:STDOUT: !9 = !{!8, !7, i64 0}
// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !46 = !{null, !45}
// CHECK:STDOUT: !47 = !DISubroutineType(types: !46)
// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !61 = !{!"p1 _ZTS1A", !60, i64 0}
// CHECK:STDOUT: !62 = !{!61, !61, i64 0}
// CHECK:STDOUT: !63 = !{!"_ZTS1A", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !64 = !{!63, !7, i64 0}
// CHECK:STDOUT: !65 = !{!63, !7, i64 4}
// CHECK:STDOUT: !111 = !DIFile(filename: "generic_lib.carbon", directory: "")
// CHECK:STDOUT: !112 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !111, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !111, line: 5, type: !47, spFlags: DISPFlagDefinition, unit: !112, retainedNodes: !116)
// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !45)
// CHECK:STDOUT: !115 = !DILocation(line: 5, column: 3, scope: !113)
// CHECK:STDOUT: !116 = !{!114}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'no_cpp_imports.carbon'
// CHECK:STDOUT: source_filename = "no_cpp_imports.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.A.39 = type { i32, i32 }
// CHECK:STDOUT:
// CHECK:STDOUT: $_Z6make_av = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define i32 @_CCallGeneric.Main() #0 !dbg !119 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %MakeA.call = call i32 @_CMakeA.Main.084a2801e0f5d754({} zeroinitializer), !dbg !122
// CHECK:STDOUT: ret i32 %MakeA.call, !dbg !125
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr i32 @_CMakeA.Main.084a2801e0f5d754({} %x) #0 !dbg !126 {
// CHECK:STDOUT: %1 = alloca [8 x i8], align 4, !dbg !131
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !131
// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %1), !dbg !132
// CHECK:STDOUT: %b = getelementptr inbounds nuw [8 x i8], ptr %1, i32 0, i32 4, !dbg !134
// CHECK:STDOUT: %2 = load i32, ptr %b, align 4, !dbg !134
// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %1), !dbg !131
// CHECK:STDOUT: ret i32 %2, !dbg !135
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_Z6make_av.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 !62
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: %call = call i64 @_Z6make_av()
// CHECK:STDOUT: store i64 %call, ptr %0, align 4
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr)
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %retval = alloca %struct.A.39, align 4
// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.39, ptr %retval, i32 0, i32 0
// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !64
// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.39, ptr %retval, i32 0, i32 1
// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !65
// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4
// CHECK:STDOUT: ret i64 %0
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!118}
// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!9}
// CHECK:STDOUT:
// 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 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0}
// CHECK:STDOUT: !7 = !{!"int", !6, i64 0}
// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0}
// CHECK:STDOUT: !9 = !{!8, !7, i64 0}
// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !43 = !{!42}
// CHECK:STDOUT: !44 = !DISubroutineType(types: !43)
// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0}
// CHECK:STDOUT: !61 = !{!"p1 _ZTS1A", !60, i64 0}
// CHECK:STDOUT: !62 = !{!61, !61, i64 0}
// CHECK:STDOUT: !63 = !{!"_ZTS1A", !7, i64 0, !7, i64 4}
// CHECK:STDOUT: !64 = !{!63, !7, i64 0}
// CHECK:STDOUT: !65 = !{!63, !7, i64 4}
// CHECK:STDOUT: !111 = !DIFile(filename: "generic_lib.carbon", directory: "")
// CHECK:STDOUT: !117 = !DIFile(filename: "no_cpp_imports.carbon", directory: "")
// CHECK:STDOUT: !118 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !117, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main", scope: null, file: !117, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !118)
// CHECK:STDOUT: !122 = !DILocation(line: 5, column: 10, scope: !119)
// CHECK:STDOUT: !123 = !{!42, !45}
// CHECK:STDOUT: !124 = !DISubroutineType(types: !123)
// CHECK:STDOUT: !125 = !DILocation(line: 5, column: 3, scope: !119)
// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "MakeA", linkageName: "_CMakeA.Main.084a2801e0f5d754", scope: null, file: !111, line: 4, type: !124, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !136)
// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !45)
// CHECK:STDOUT: !131 = !DILocation(line: 5, column: 3, scope: !126)
// CHECK:STDOUT: !132 = !DILocation(line: 5, column: 18, scope: !126)
// CHECK:STDOUT: !134 = !DILocation(line: 6, column: 10, scope: !126)
// CHECK:STDOUT: !135 = !DILocation(line: 6, column: 3, scope: !126)
// CHECK:STDOUT: !136 = !{!127}
// CHECK:STDOUT:
@@ -100,43 +100,77 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !17
// 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 !17
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !20
// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !18
// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !18
// CHECK:STDOUT: call void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %_.var), !dbg !17
// CHECK:STDOUT: ret void, !dbg !21
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !22 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !23 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !24
// CHECK:STDOUT: ret void, !dbg !25
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !26 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !27 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !28
// CHECK:STDOUT: ret void, !dbg !29
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !30 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !31 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !31
// CHECK:STDOUT: %.loc18_36.3.temp = alloca [16 x i8], align 8, !dbg !32
// CHECK:STDOUT: %.loc18_36.5.temp = alloca [3 x i32], align 4, !dbg !32
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !31
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.3.temp), !dbg !32
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.5.temp), !dbg !32
// CHECK:STDOUT: %.loc18_36.6.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 0, !dbg !32
// CHECK:STDOUT: %.loc18_36.9.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 1, !dbg !32
// CHECK:STDOUT: %.loc18_36.12.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 2, !dbg !32
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 0, !dbg !32
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !32
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 8, !dbg !32
// 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 !32
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.3.temp, ptr %_.var), !dbg !31
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !34
// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !32
// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !31
// CHECK:STDOUT: ret void, !dbg !35
// CHECK:STDOUT: ret void, !dbg !33
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !35 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !37
// CHECK:STDOUT: ret void, !dbg !37
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !39 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !41
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !43 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self), !dbg !45
// CHECK:STDOUT: ret void, !dbg !45
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %self) #0 !dbg !47 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !49
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !51 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !52
// CHECK:STDOUT: %.loc18_36.3.temp = alloca [16 x i8], align 8, !dbg !53
// CHECK:STDOUT: %.loc18_36.5.temp = alloca [3 x i32], align 4, !dbg !53
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !52
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.3.temp), !dbg !53
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.5.temp), !dbg !53
// CHECK:STDOUT: %.loc18_36.6.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 0, !dbg !53
// CHECK:STDOUT: %.loc18_36.9.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 1, !dbg !53
// CHECK:STDOUT: %.loc18_36.12.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 2, !dbg !53
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 0, !dbg !53
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !53
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 8, !dbg !53
// 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 !53
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.3.temp, ptr %_.var), !dbg !52
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !55
// CHECK:STDOUT: call void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %.loc18_36.3.temp), !dbg !53
// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !53
// CHECK:STDOUT: call void @"_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core"(ptr %_.var), !dbg !52
// CHECK:STDOUT: ret void, !dbg !56
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -145,11 +179,11 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: %list.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list", align 8
// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !50
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !52
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !52
// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !50
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !57
// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !91
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !93
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !93
// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !91
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !98
// CHECK:STDOUT: %2 = getelementptr inbounds nuw { ptr, ptr }, ptr %agg.tmp, i32 0, i32 0
// CHECK:STDOUT: %3 = load ptr, ptr %2, align 8
// CHECK:STDOUT: %4 = getelementptr inbounds nuw { ptr, ptr }, ptr %agg.tmp, i32 0, i32 1
@@ -162,40 +196,54 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !52
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !93
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !36 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core"(ptr %self) #0 !dbg !57 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !37
// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !38
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !37
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !38
// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !38
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !38
// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !38
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !38
// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !38
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !38
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !37
// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !37
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !37
// CHECK:STDOUT: %initializer_list.initializer_list.call.array.end = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 1, !dbg !37
// CHECK:STDOUT: store ptr %initializer_list.initializer_list.call.array.end, ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !37
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !40
// CHECK:STDOUT: call void @"_COp.71d86972d5684aff:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !38
// CHECK:STDOUT: ret void, !dbg !41
// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %self), !dbg !59
// CHECK:STDOUT: ret void, !dbg !59
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !61 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !62
// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !63
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !62
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !63
// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !63
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !63
// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !63
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !63
// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !63
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !63
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !62
// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !62
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !62
// CHECK:STDOUT: %initializer_list.initializer_list.call.array.end = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 1, !dbg !62
// CHECK:STDOUT: store ptr %initializer_list.initializer_list.call.array.end, ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !62
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !65
// CHECK:STDOUT: call void @"_CSelfDestruct.71d86972d5684aff:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !63
// CHECK:STDOUT: call void @"_CSelfDestruct.b204467699306999:core.Destroy.Core"(ptr %_.var), !dbg !62
// CHECK:STDOUT: ret void, !dbg !66
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3acda3b20248cb70:core.Destroy.Core"(ptr %self) #0 !dbg !67 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !69
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !59
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !59
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !100
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !100
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -204,15 +252,35 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !59
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !100
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !42 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cbb50137a92c3ee4:core.Destroy.Core"(ptr %self) #0 !dbg !71 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !44
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorD2Ev(ptr %self), !dbg !73
// CHECK:STDOUT: ret void, !dbg !73
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !75 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !77
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !79 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core"(ptr %self), !dbg !81
// CHECK:STDOUT: ret void, !dbg !81
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b204467699306999:core.Destroy.Core"(ptr %self) #0 !dbg !83 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !85
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -230,7 +298,7 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8
// CHECK:STDOUT: %1 = getelementptr inbounds nuw { ptr, ptr }, ptr %list, i32 0, i32 1
// CHECK:STDOUT: store ptr %list.coerce1, ptr %1, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !52
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !93
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -239,7 +307,7 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !59
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !100
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -254,8 +322,8 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
// CHECK:STDOUT: !llvm.module.flags = !{!60, !61, !62, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!64}
// CHECK:STDOUT: !llvm.module.flags = !{!101, !102, !103, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!105}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -264,54 +332,95 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !7 = !{null}
// CHECK:STDOUT: !8 = !DISubroutineType(types: !7)
// CHECK:STDOUT: !9 = !{null, !6}
// CHECK:STDOUT: !10 = !DISubroutineType(types: !9)
// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !12 = !{null, !11}
// CHECK:STDOUT: !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !10 = !{null, !9}
// CHECK:STDOUT: !11 = !DISubroutineType(types: !10)
// CHECK:STDOUT: !12 = !{null, !6}
// CHECK:STDOUT: !13 = !DISubroutineType(types: !12)
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !4, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 3, scope: !16)
// CHECK:STDOUT: !18 = !DILocation(line: 13, column: 42, scope: !16)
// CHECK:STDOUT: !20 = !DILocation(line: 14, column: 3, scope: !16)
// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 1, scope: !16)
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25)
// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !6)
// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 42, scope: !22)
// CHECK:STDOUT: !25 = !{!23}
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29)
// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !11)
// CHECK:STDOUT: !28 = !DILocation(line: 13, column: 42, scope: !26)
// CHECK:STDOUT: !29 = !{!27}
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !4, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !31 = !DILocation(line: 18, column: 3, scope: !30)
// CHECK:STDOUT: !32 = !DILocation(line: 18, column: 28, scope: !30)
// CHECK:STDOUT: !34 = !DILocation(line: 19, column: 3, scope: !30)
// CHECK:STDOUT: !35 = !DILocation(line: 17, column: 1, scope: !30)
// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !4, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !37 = !DILocation(line: 23, column: 3, scope: !36)
// CHECK:STDOUT: !38 = !DILocation(line: 23, column: 58, scope: !36)
// CHECK:STDOUT: !40 = !DILocation(line: 24, column: 3, scope: !36)
// CHECK:STDOUT: !41 = !DILocation(line: 22, column: 1, scope: !36)
// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45)
// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !11)
// CHECK:STDOUT: !44 = !DILocation(line: 23, column: 58, scope: !42)
// CHECK:STDOUT: !45 = !{!43}
// CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0}
// CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0}
// CHECK:STDOUT: !49 = !{!"p1 _ZTSSt16initializer_listIiE", !48, i64 0}
// CHECK:STDOUT: !50 = !{!49, !49, i64 0}
// CHECK:STDOUT: !51 = !{!"p1 _ZTS11vector_like", !48, i64 0}
// CHECK:STDOUT: !52 = !{!51, !51, i64 0}
// CHECK:STDOUT: !53 = !{!"int", !47, i64 0}
// CHECK:STDOUT: !54 = !{!"p1 int", !48, i64 0}
// CHECK:STDOUT: !56 = !{!54, !54, i64 0}
// CHECK:STDOUT: !57 = !{i64 0, i64 8, !56, i64 8, i64 8, !56}
// CHECK:STDOUT: !58 = !{!"p1 _ZTS15nontrivial_dtor", !48, i64 0}
// CHECK:STDOUT: !59 = !{!58, !58, i64 0}
// CHECK:STDOUT: !60 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !61 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !62 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !63 = !{!"__libc_errno", !53, i64 0}
// CHECK:STDOUT: !64 = !{!63, !53, i64 0}
// CHECK:STDOUT: !22 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !22, line: 164, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26)
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !9)
// CHECK:STDOUT: !25 = !DILocation(line: 164, column: 19, scope: !23)
// CHECK:STDOUT: !26 = !{!24}
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 13, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30)
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !6)
// CHECK:STDOUT: !29 = !DILocation(line: 13, column: 42, scope: !27)
// CHECK:STDOUT: !30 = !{!28}
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34)
// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !6)
// CHECK:STDOUT: !33 = !DILocation(line: 13, column: 42, scope: !31)
// CHECK:STDOUT: !34 = !{!32}
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38)
// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !6)
// CHECK:STDOUT: !37 = !DILocation(line: 13, column: 42, scope: !35)
// CHECK:STDOUT: !38 = !{!36}
// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42)
// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !9)
// CHECK:STDOUT: !41 = !DILocation(line: 13, column: 42, scope: !39)
// CHECK:STDOUT: !42 = !{!40}
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46)
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !9)
// CHECK:STDOUT: !45 = !DILocation(line: 13, column: 42, scope: !43)
// CHECK:STDOUT: !46 = !{!44}
// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core", scope: null, file: !4, line: 13, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50)
// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !9)
// CHECK:STDOUT: !49 = !DILocation(line: 13, column: 3, scope: !47)
// CHECK:STDOUT: !50 = !{!48}
// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !4, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !52 = !DILocation(line: 18, column: 3, scope: !51)
// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 28, scope: !51)
// CHECK:STDOUT: !55 = !DILocation(line: 19, column: 3, scope: !51)
// CHECK:STDOUT: !56 = !DILocation(line: 17, column: 1, scope: !51)
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core", scope: null, file: !4, line: 18, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !60)
// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !9)
// CHECK:STDOUT: !59 = !DILocation(line: 18, column: 3, scope: !57)
// CHECK:STDOUT: !60 = !{!58}
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !4, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !62 = !DILocation(line: 23, column: 3, scope: !61)
// CHECK:STDOUT: !63 = !DILocation(line: 23, column: 58, scope: !61)
// CHECK:STDOUT: !65 = !DILocation(line: 24, column: 3, scope: !61)
// CHECK:STDOUT: !66 = !DILocation(line: 22, column: 1, scope: !61)
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3acda3b20248cb70:core.Destroy.Core", scope: null, file: !22, line: 164, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !70)
// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !9)
// CHECK:STDOUT: !69 = !DILocation(line: 164, column: 19, scope: !67)
// CHECK:STDOUT: !70 = !{!68}
// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cbb50137a92c3ee4:core.Destroy.Core", scope: null, file: !4, line: 23, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74)
// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !9)
// CHECK:STDOUT: !73 = !DILocation(line: 23, column: 58, scope: !71)
// CHECK:STDOUT: !74 = !{!72}
// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !78)
// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !9)
// CHECK:STDOUT: !77 = !DILocation(line: 23, column: 58, scope: !75)
// CHECK:STDOUT: !78 = !{!76}
// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !82)
// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !9)
// CHECK:STDOUT: !81 = !DILocation(line: 23, column: 58, scope: !79)
// CHECK:STDOUT: !82 = !{!80}
// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b204467699306999:core.Destroy.Core", scope: null, file: !4, line: 23, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !86)
// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !9)
// CHECK:STDOUT: !85 = !DILocation(line: 23, column: 3, scope: !83)
// CHECK:STDOUT: !86 = !{!84}
// CHECK:STDOUT: !87 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !88 = !{!"omnipotent char", !87, i64 0}
// CHECK:STDOUT: !89 = !{!"any pointer", !88, i64 0}
// CHECK:STDOUT: !90 = !{!"p1 _ZTSSt16initializer_listIiE", !89, i64 0}
// CHECK:STDOUT: !91 = !{!90, !90, i64 0}
// CHECK:STDOUT: !92 = !{!"p1 _ZTS11vector_like", !89, i64 0}
// CHECK:STDOUT: !93 = !{!92, !92, i64 0}
// CHECK:STDOUT: !94 = !{!"int", !88, i64 0}
// CHECK:STDOUT: !95 = !{!"p1 int", !89, i64 0}
// CHECK:STDOUT: !97 = !{!95, !95, i64 0}
// CHECK:STDOUT: !98 = !{i64 0, i64 8, !97, i64 8, i64 8, !97}
// CHECK:STDOUT: !99 = !{!"p1 _ZTS15nontrivial_dtor", !89, i64 0}
// CHECK:STDOUT: !100 = !{!99, !99, i64 0}
// CHECK:STDOUT: !101 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !102 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !103 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !104 = !{!"__libc_errno", !94, i64 0}
// CHECK:STDOUT: !105 = !{!104, !94, i64 0}
// CHECK:STDOUT:
@@ -100,43 +100,77 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !18
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !18
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !21
// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !19
// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !19
// CHECK:STDOUT: call void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %_.var), !dbg !18
// CHECK:STDOUT: ret void, !dbg !22
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !23 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !24 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !25
// CHECK:STDOUT: ret void, !dbg !26
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !27 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !28 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !29
// CHECK:STDOUT: ret void, !dbg !30
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !31 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !32 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !32
// CHECK:STDOUT: %.loc18_36.3.temp = alloca [16 x i8], align 8, !dbg !33
// CHECK:STDOUT: %.loc18_36.5.temp = alloca [3 x i32], align 4, !dbg !33
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !32
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.3.temp), !dbg !33
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.5.temp), !dbg !33
// CHECK:STDOUT: %.loc18_36.6.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 0, !dbg !33
// CHECK:STDOUT: %.loc18_36.9.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 1, !dbg !33
// CHECK:STDOUT: %.loc18_36.12.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 2, !dbg !33
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 0, !dbg !33
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !33
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 8, !dbg !33
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !33
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.3.temp, ptr %_.var), !dbg !32
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !35
// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !33
// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !32
// CHECK:STDOUT: ret void, !dbg !36
// CHECK:STDOUT: ret void, !dbg !34
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !38
// CHECK:STDOUT: ret void, !dbg !38
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !40 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !42
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !44 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self), !dbg !46
// CHECK:STDOUT: ret void, !dbg !46
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %self) #0 !dbg !48 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !50
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !52 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !53
// CHECK:STDOUT: %.loc18_36.3.temp = alloca [16 x i8], align 8, !dbg !54
// CHECK:STDOUT: %.loc18_36.5.temp = alloca [3 x i32], align 4, !dbg !54
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !53
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.3.temp), !dbg !54
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.5.temp), !dbg !54
// CHECK:STDOUT: %.loc18_36.6.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 0, !dbg !54
// CHECK:STDOUT: %.loc18_36.9.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 1, !dbg !54
// CHECK:STDOUT: %.loc18_36.12.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 2, !dbg !54
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 0, !dbg !54
// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !54
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 8, !dbg !54
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !54
// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.3.temp, ptr %_.var), !dbg !53
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !56
// CHECK:STDOUT: call void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %.loc18_36.3.temp), !dbg !54
// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !54
// CHECK:STDOUT: call void @"_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core"(ptr %_.var), !dbg !53
// CHECK:STDOUT: ret void, !dbg !57
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -145,11 +179,11 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: %list.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list", align 8
// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !51
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !53
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !53
// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !51
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !60
// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !92
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !94
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !94
// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !92
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !101
// CHECK:STDOUT: %2 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 0
// CHECK:STDOUT: %3 = load ptr, ptr %2, align 8
// CHECK:STDOUT: %4 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 1
@@ -162,39 +196,53 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !37 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core"(ptr %self) #0 !dbg !58 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !38
// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !39
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !38
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !39
// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !39
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !39
// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !39
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !39
// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !39
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !39
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !38
// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !38
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !38
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !38
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !41
// CHECK:STDOUT: call void @"_COp.71d86972d5684aff:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !39
// CHECK:STDOUT: ret void, !dbg !42
// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %self), !dbg !60
// CHECK:STDOUT: ret void, !dbg !60
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !62 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !63
// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !64
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !63
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !64
// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !64
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !64
// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !64
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !64
// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !64
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !64
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !63
// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !63
// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !63
// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !63
// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !66
// CHECK:STDOUT: call void @"_CSelfDestruct.71d86972d5684aff:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !64
// CHECK:STDOUT: call void @"_CSelfDestruct.b204467699306999:core.Destroy.Core"(ptr %_.var), !dbg !63
// CHECK:STDOUT: ret void, !dbg !67
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3acda3b20248cb70:core.Destroy.Core"(ptr %self) #0 !dbg !68 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !70
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
// CHECK:STDOUT: define internal void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !103
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !103
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -203,15 +251,35 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !62
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !103
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !43 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cbb50137a92c3ee4:core.Destroy.Core"(ptr %self) #0 !dbg !72 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !45
// CHECK:STDOUT: call void @_ZN15nontrivial_dtorD2Ev(ptr %self), !dbg !74
// CHECK:STDOUT: ret void, !dbg !74
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !76 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !78
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !80 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core"(ptr %self), !dbg !82
// CHECK:STDOUT: ret void, !dbg !82
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b204467699306999:core.Destroy.Core"(ptr %self) #0 !dbg !84 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !86
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
@@ -229,7 +297,7 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8
// CHECK:STDOUT: %1 = getelementptr inbounds nuw { ptr, i64 }, ptr %list, i32 0, i32 1
// CHECK:STDOUT: store i64 %list.coerce1, ptr %1, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -238,7 +306,7 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !62
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !103
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -253,8 +321,8 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
// CHECK:STDOUT: !llvm.module.flags = !{!63, !64, !65, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!67}
// CHECK:STDOUT: !llvm.module.flags = !{!104, !105, !106, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!108}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -263,56 +331,97 @@ fn InitNontrivialDtor() {
// CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK:STDOUT: !8 = !{null}
// CHECK:STDOUT: !9 = !DISubroutineType(types: !8)
// CHECK:STDOUT: !10 = !{null, !6}
// CHECK:STDOUT: !11 = !DISubroutineType(types: !10)
// CHECK:STDOUT: !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !13 = !{null, !12}
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !11 = !{null, !10}
// CHECK:STDOUT: !12 = !DISubroutineType(types: !11)
// CHECK:STDOUT: !13 = !{null, !6}
// CHECK:STDOUT: !14 = !DISubroutineType(types: !13)
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !4, line: 12, type: !9, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !18 = !DILocation(line: 13, column: 3, scope: !17)
// CHECK:STDOUT: !19 = !DILocation(line: 13, column: 42, scope: !17)
// CHECK:STDOUT: !21 = !DILocation(line: 14, column: 3, scope: !17)
// CHECK:STDOUT: !22 = !DILocation(line: 12, column: 1, scope: !17)
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26)
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !6)
// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 42, scope: !23)
// CHECK:STDOUT: !26 = !{!24}
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30)
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !12)
// CHECK:STDOUT: !29 = !DILocation(line: 13, column: 42, scope: !27)
// CHECK:STDOUT: !30 = !{!28}
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !4, line: 17, type: !9, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !32 = !DILocation(line: 18, column: 3, scope: !31)
// CHECK:STDOUT: !33 = !DILocation(line: 18, column: 28, scope: !31)
// CHECK:STDOUT: !35 = !DILocation(line: 19, column: 3, scope: !31)
// CHECK:STDOUT: !36 = !DILocation(line: 17, column: 1, scope: !31)
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !4, line: 22, type: !9, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !38 = !DILocation(line: 23, column: 3, scope: !37)
// CHECK:STDOUT: !39 = !DILocation(line: 23, column: 58, scope: !37)
// CHECK:STDOUT: !41 = !DILocation(line: 24, column: 3, scope: !37)
// CHECK:STDOUT: !42 = !DILocation(line: 22, column: 1, scope: !37)
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46)
// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !12)
// CHECK:STDOUT: !45 = !DILocation(line: 23, column: 58, scope: !43)
// CHECK:STDOUT: !46 = !{!44}
// CHECK:STDOUT: !47 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !48 = !{!"omnipotent char", !47, i64 0}
// CHECK:STDOUT: !49 = !{!"any pointer", !48, i64 0}
// CHECK:STDOUT: !50 = !{!"p1 _ZTSSt16initializer_listIiE", !49, i64 0}
// CHECK:STDOUT: !51 = !{!50, !50, i64 0}
// CHECK:STDOUT: !52 = !{!"p1 _ZTS11vector_like", !49, i64 0}
// CHECK:STDOUT: !53 = !{!52, !52, i64 0}
// CHECK:STDOUT: !54 = !{!"int", !48, i64 0}
// CHECK:STDOUT: !55 = !{!"p1 int", !49, i64 0}
// CHECK:STDOUT: !56 = !{!"long", !48, i64 0}
// CHECK:STDOUT: !58 = !{!55, !55, i64 0}
// CHECK:STDOUT: !59 = !{!56, !56, i64 0}
// CHECK:STDOUT: !60 = !{i64 0, i64 8, !58, i64 8, i64 8, !59}
// CHECK:STDOUT: !61 = !{!"p1 _ZTS15nontrivial_dtor", !49, i64 0}
// CHECK:STDOUT: !62 = !{!61, !61, i64 0}
// CHECK:STDOUT: !63 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !64 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !65 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !66 = !{!"__libc_errno", !54, i64 0}
// CHECK:STDOUT: !67 = !{!66, !54, i64 0}
// CHECK:STDOUT: !23 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !23, line: 164, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !27)
// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !24, type: !10)
// CHECK:STDOUT: !26 = !DILocation(line: 164, column: 19, scope: !24)
// CHECK:STDOUT: !27 = !{!25}
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31)
// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !6)
// CHECK:STDOUT: !30 = !DILocation(line: 13, column: 42, scope: !28)
// CHECK:STDOUT: !31 = !{!29}
// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35)
// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !6)
// CHECK:STDOUT: !34 = !DILocation(line: 13, column: 42, scope: !32)
// CHECK:STDOUT: !35 = !{!33}
// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39)
// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !6)
// CHECK:STDOUT: !38 = !DILocation(line: 13, column: 42, scope: !36)
// CHECK:STDOUT: !39 = !{!37}
// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43)
// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !10)
// CHECK:STDOUT: !42 = !DILocation(line: 13, column: 42, scope: !40)
// CHECK:STDOUT: !43 = !{!41}
// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47)
// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !10)
// CHECK:STDOUT: !46 = !DILocation(line: 13, column: 42, scope: !44)
// CHECK:STDOUT: !47 = !{!45}
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core", scope: null, file: !4, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51)
// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !10)
// CHECK:STDOUT: !50 = !DILocation(line: 13, column: 3, scope: !48)
// CHECK:STDOUT: !51 = !{!49}
// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !4, line: 17, type: !9, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 3, scope: !52)
// CHECK:STDOUT: !54 = !DILocation(line: 18, column: 28, scope: !52)
// CHECK:STDOUT: !56 = !DILocation(line: 19, column: 3, scope: !52)
// CHECK:STDOUT: !57 = !DILocation(line: 17, column: 1, scope: !52)
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core", scope: null, file: !4, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !61)
// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !10)
// CHECK:STDOUT: !60 = !DILocation(line: 18, column: 3, scope: !58)
// CHECK:STDOUT: !61 = !{!59}
// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !4, line: 22, type: !9, spFlags: DISPFlagDefinition, unit: !5)
// CHECK:STDOUT: !63 = !DILocation(line: 23, column: 3, scope: !62)
// CHECK:STDOUT: !64 = !DILocation(line: 23, column: 58, scope: !62)
// CHECK:STDOUT: !66 = !DILocation(line: 24, column: 3, scope: !62)
// CHECK:STDOUT: !67 = !DILocation(line: 22, column: 1, scope: !62)
// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3acda3b20248cb70:core.Destroy.Core", scope: null, file: !23, line: 164, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71)
// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !10)
// CHECK:STDOUT: !70 = !DILocation(line: 164, column: 19, scope: !68)
// CHECK:STDOUT: !71 = !{!69}
// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cbb50137a92c3ee4:core.Destroy.Core", scope: null, file: !4, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !75)
// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !10)
// CHECK:STDOUT: !74 = !DILocation(line: 23, column: 58, scope: !72)
// CHECK:STDOUT: !75 = !{!73}
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !79)
// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !10)
// CHECK:STDOUT: !78 = !DILocation(line: 23, column: 58, scope: !76)
// CHECK:STDOUT: !79 = !{!77}
// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !83)
// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !10)
// CHECK:STDOUT: !82 = !DILocation(line: 23, column: 58, scope: !80)
// CHECK:STDOUT: !83 = !{!81}
// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b204467699306999:core.Destroy.Core", scope: null, file: !4, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !87)
// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !10)
// CHECK:STDOUT: !86 = !DILocation(line: 23, column: 3, scope: !84)
// CHECK:STDOUT: !87 = !{!85}
// CHECK:STDOUT: !88 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !89 = !{!"omnipotent char", !88, i64 0}
// CHECK:STDOUT: !90 = !{!"any pointer", !89, i64 0}
// CHECK:STDOUT: !91 = !{!"p1 _ZTSSt16initializer_listIiE", !90, i64 0}
// CHECK:STDOUT: !92 = !{!91, !91, i64 0}
// CHECK:STDOUT: !93 = !{!"p1 _ZTS11vector_like", !90, i64 0}
// CHECK:STDOUT: !94 = !{!93, !93, i64 0}
// CHECK:STDOUT: !95 = !{!"int", !89, i64 0}
// CHECK:STDOUT: !96 = !{!"p1 int", !90, i64 0}
// CHECK:STDOUT: !97 = !{!"long", !89, i64 0}
// CHECK:STDOUT: !99 = !{!96, !96, i64 0}
// CHECK:STDOUT: !100 = !{!97, !97, i64 0}
// CHECK:STDOUT: !101 = !{i64 0, i64 8, !99, i64 8, i64 8, !100}
// CHECK:STDOUT: !102 = !{!"p1 _ZTS15nontrivial_dtor", !90, i64 0}
// CHECK:STDOUT: !103 = !{!102, !102, i64 0}
// CHECK:STDOUT: !104 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !105 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !106 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !107 = !{!"__libc_errno", !95, i64 0}
// CHECK:STDOUT: !108 = !{!107, !95, i64 0}
// CHECK:STDOUT:
+42 -26
View File
@@ -280,6 +280,7 @@ fn Call3() {
// CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 1, !dbg !96
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !96
// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk._(ptr @X.val.loc12_14.3), !dbg !97
// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr @X.val), !dbg !96
// CHECK:STDOUT: ret void, !dbg !98
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -288,19 +289,26 @@ fn Call3() {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !112
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !112
// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_()
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !99 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %self) #0 !dbg !99 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 1, !dbg !100
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !100
// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !101
// CHECK:STDOUT: ret void, !dbg !102
// CHECK:STDOUT: ret void, !dbg !101
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !103 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 1, !dbg !104
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !104
// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !105
// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr @X.val), !dbg !104
// CHECK:STDOUT: ret void, !dbg !106
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -309,21 +317,22 @@ fn Call3() {
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
// CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !112
// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !58
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !112
// CHECK:STDOUT: %3 = load i32, ptr %.addr1, align 4, !tbaa !58
// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_(i32 noundef %3)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !103 {
// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !107 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 1, !dbg !104
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !104
// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !105
// CHECK:STDOUT: ret void, !dbg !106
// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 1, !dbg !108
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !108
// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !109
// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr @X.val), !dbg !108
// CHECK:STDOUT: ret void, !dbg !110
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -333,10 +342,10 @@ fn Call3() {
// CHECK:STDOUT: %.addr1 = alloca i32, align 4
// CHECK:STDOUT: %.addr2 = alloca i32, align 4
// CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !112
// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !58
// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !58
// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !108
// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !112
// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !58
// CHECK:STDOUT: %5 = load i32, ptr %.addr2, align 4, !tbaa !58
// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_(i32 noundef %4, i32 noundef %5)
@@ -366,6 +375,7 @@ fn Call3() {
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !55 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !56 = !{!"omnipotent char", !55, i64 0}
// CHECK:STDOUT: !57 = !{!"int", !56, i64 0}
@@ -380,18 +390,24 @@ fn Call3() {
// CHECK:STDOUT: !71 = !DISubroutineType(types: !70)
// CHECK:STDOUT: !87 = !DIFile(filename: "variadic_thunk.carbon", directory: "")
// CHECK:STDOUT: !88 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !87, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !89 = !{null, !23}
// CHECK:STDOUT: !90 = !DISubroutineType(types: !89)
// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !87, line: 10, type: !71, spFlags: DISPFlagDefinition, unit: !88)
// CHECK:STDOUT: !96 = !DILocation(line: 12, column: 11, scope: !95)
// CHECK:STDOUT: !97 = !DILocation(line: 12, column: 3, scope: !95)
// CHECK:STDOUT: !98 = !DILocation(line: 10, column: 1, scope: !95)
// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !87, line: 16, type: !71, spFlags: DISPFlagDefinition, unit: !88)
// CHECK:STDOUT: !100 = !DILocation(line: 18, column: 11, scope: !99)
// CHECK:STDOUT: !101 = !DILocation(line: 18, column: 3, scope: !99)
// CHECK:STDOUT: !102 = !DILocation(line: 16, column: 1, scope: !99)
// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !87, line: 22, type: !71, spFlags: DISPFlagDefinition, unit: !88)
// CHECK:STDOUT: !104 = !DILocation(line: 24, column: 11, scope: !103)
// CHECK:STDOUT: !105 = !DILocation(line: 24, column: 3, scope: !103)
// CHECK:STDOUT: !106 = !DILocation(line: 22, column: 1, scope: !103)
// CHECK:STDOUT: !107 = !{!"p1 _ZTS1X", !59, i64 0}
// CHECK:STDOUT: !108 = !{!107, !107, i64 0}
// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core", scope: null, file: !87, line: 12, type: !90, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !102)
// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !23)
// CHECK:STDOUT: !101 = !DILocation(line: 12, column: 11, scope: !99)
// CHECK:STDOUT: !102 = !{!100}
// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !87, line: 16, type: !71, spFlags: DISPFlagDefinition, unit: !88)
// CHECK:STDOUT: !104 = !DILocation(line: 18, column: 11, scope: !103)
// CHECK:STDOUT: !105 = !DILocation(line: 18, column: 3, scope: !103)
// CHECK:STDOUT: !106 = !DILocation(line: 16, column: 1, scope: !103)
// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !87, line: 22, type: !71, spFlags: DISPFlagDefinition, unit: !88)
// CHECK:STDOUT: !108 = !DILocation(line: 24, column: 11, scope: !107)
// CHECK:STDOUT: !109 = !DILocation(line: 24, column: 3, scope: !107)
// CHECK:STDOUT: !110 = !DILocation(line: 22, column: 1, scope: !107)
// CHECK:STDOUT: !111 = !{!"p1 _ZTS1X", !59, i64 0}
// CHECK:STDOUT: !112 = !{!111, !111, i64 0}
// CHECK:STDOUT:
+211 -152
View File
@@ -111,6 +111,7 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n2.var), !dbg !44
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_34.1.temp), !dbg !45
// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr %n, ptr %n2.var), !dbg !45
// CHECK:STDOUT: call void @"_CSelfDestruct.e015ef96e8aea788:core.Destroy.Core"(ptr %n2.var), !dbg !44
// CHECK:STDOUT: ret void, !dbg !47
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -119,10 +120,10 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !62
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !62
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !62
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !66
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !66
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !66
// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -134,12 +135,18 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: ret void, !dbg !52
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp"(ptr %self) #2 !dbg !54 {
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e015ef96e8aea788:core.Destroy.Core"(ptr %self) #0 !dbg !54 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !56
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp"(ptr %self) #2 !dbg !58 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !60
// 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:
@@ -155,8 +162,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// 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.dbg.cu = !{!33}
// CHECK:STDOUT: !llvm.module.flags = !{!64, !65, !66, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!69}
// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!73}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -178,21 +185,25 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !34)
// CHECK:STDOUT: !52 = !DILocation(line: 4, column: 3, scope: !50)
// CHECK:STDOUT: !53 = !{!51}
// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp", scope: null, file: !49, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !57)
// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e015ef96e8aea788:core.Destroy.Core", scope: null, file: !32, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !57)
// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !34)
// CHECK:STDOUT: !56 = !DILocation(line: 5, column: 3, scope: !54)
// CHECK:STDOUT: !56 = !DILocation(line: 9, column: 3, scope: !54)
// CHECK:STDOUT: !57 = !{!55}
// CHECK:STDOUT: !58 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !59 = !{!"omnipotent char", !58, i64 0}
// CHECK:STDOUT: !60 = !{!"any pointer", !59, i64 0}
// CHECK:STDOUT: !61 = !{!"p1 _ZTS9NeedThunk", !60, i64 0}
// CHECK:STDOUT: !62 = !{!61, !61, i64 0}
// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !67 = !{!"int", !59, i64 0}
// CHECK:STDOUT: !68 = !{!"__libc_errno", !67, i64 0}
// CHECK:STDOUT: !69 = !{!68, !67, i64 0}
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp", scope: null, file: !49, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !61)
// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !34)
// CHECK:STDOUT: !60 = !DILocation(line: 5, column: 3, scope: !58)
// CHECK:STDOUT: !61 = !{!59}
// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0}
// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0}
// CHECK:STDOUT: !65 = !{!"p1 _ZTS9NeedThunk", !64, i64 0}
// CHECK:STDOUT: !66 = !{!65, !65, i64 0}
// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !71 = !{!"int", !63, i64 0}
// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0}
// CHECK:STDOUT: !73 = !{!72, !71, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'thunks_for_distinct_specializations.carbon'
@@ -201,21 +212,21 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !72 {
// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !76 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !77
// CHECK:STDOUT: %.loc12_35.1.temp = alloca [1 x i8], align 1, !dbg !78
// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !80
// CHECK:STDOUT: %.loc13_35.1.temp = alloca [1 x i8], align 1, !dbg !81
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !77
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_35.1.temp), !dbg !78
// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !78
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !80
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_35.1.temp), !dbg !81
// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !81
// CHECK:STDOUT: call void @_ZN3BoxI1BED1Ev(ptr %b2.var), !dbg !80
// CHECK:STDOUT: call void @_ZN3BoxI1AED1Ev(ptr %a2.var), !dbg !77
// CHECK:STDOUT: ret void, !dbg !83
// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !81
// CHECK:STDOUT: %.loc12_35.1.temp = alloca [1 x i8], align 1, !dbg !82
// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !84
// CHECK:STDOUT: %.loc13_35.1.temp = alloca [1 x i8], align 1, !dbg !85
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !81
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_35.1.temp), !dbg !82
// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !82
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !84
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_35.1.temp), !dbg !85
// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !85
// CHECK:STDOUT: call void @"_CSelfDestruct.c6bde88ac44221c1:core.Destroy.Core"(ptr %b2.var), !dbg !84
// CHECK:STDOUT: call void @"_CSelfDestruct.35d03e94f0115619:core.Destroy.Core"(ptr %a2.var), !dbg !81
// CHECK:STDOUT: ret void, !dbg !87
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -223,19 +234,19 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !95
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !95
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !95
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !95
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !107
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !107
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !107
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !107
// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !86 {
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !90 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !88
// CHECK:STDOUT: ret void, !dbg !88
// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !92
// CHECK:STDOUT: ret void, !dbg !92
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -243,27 +254,41 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !99
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !99
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !99
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !99
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !111
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !111
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !111
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !111
// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !90 {
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !94 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !92
// CHECK:STDOUT: ret void, !dbg !92
// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !96
// CHECK:STDOUT: ret void, !dbg !96
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: declare void @_ZN3BoxI1BED1Ev(ptr noundef nonnull align 1 dead_on_return(1) dereferenceable(1)) unnamed_addr #3
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c6bde88ac44221c1:core.Destroy.Core"(ptr %self) #0 !dbg !98 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN3BoxI1BED1Ev(ptr %self), !dbg !100
// CHECK:STDOUT: ret void, !dbg !100
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: declare void @_ZN3BoxI1AED1Ev(ptr noundef nonnull align 1 dead_on_return(1) dereferenceable(1)) unnamed_addr #3
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.35d03e94f0115619:core.Destroy.Core"(ptr %self) #0 !dbg !102 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN3BoxI1AED1Ev(ptr %self), !dbg !104
// CHECK:STDOUT: ret void, !dbg !104
// 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)) #4
// CHECK:STDOUT:
@@ -281,50 +306,60 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT: attributes #5 = { "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.dbg.cu = !{!71}
// CHECK:STDOUT: !llvm.module.flags = !{!64, !65, !66, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!69}
// CHECK:STDOUT: !llvm.dbg.cu = !{!75}
// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!73}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !35 = !{null, !34}
// CHECK:STDOUT: !36 = !DISubroutineType(types: !35)
// CHECK:STDOUT: !37 = !{null, !34, !34}
// CHECK:STDOUT: !38 = !DISubroutineType(types: !37)
// CHECK:STDOUT: !39 = !{!34, !34}
// CHECK:STDOUT: !40 = !DISubroutineType(types: !39)
// CHECK:STDOUT: !58 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !59 = !{!"omnipotent char", !58, i64 0}
// CHECK:STDOUT: !60 = !{!"any pointer", !59, i64 0}
// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !67 = !{!"int", !59, i64 0}
// CHECK:STDOUT: !68 = !{!"__libc_errno", !67, i64 0}
// CHECK:STDOUT: !69 = !{!68, !67, i64 0}
// CHECK:STDOUT: !70 = !DIFile(filename: "thunks_for_distinct_specializations.carbon", directory: "")
// CHECK:STDOUT: !71 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !70, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !70, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !71, retainedNodes: !84)
// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !34)
// CHECK:STDOUT: !74 = !DILocalVariable(arg: 2, scope: !72, type: !34)
// CHECK:STDOUT: !77 = !DILocation(line: 12, column: 3, scope: !72)
// CHECK:STDOUT: !78 = !DILocation(line: 12, column: 35, scope: !72)
// CHECK:STDOUT: !80 = !DILocation(line: 13, column: 3, scope: !72)
// CHECK:STDOUT: !81 = !DILocation(line: 13, column: 35, scope: !72)
// CHECK:STDOUT: !83 = !DILocation(line: 11, column: 1, scope: !72)
// CHECK:STDOUT: !84 = !{!73, !74}
// CHECK:STDOUT: !85 = !DIFile(filename: "./box.h", directory: "")
// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp", scope: null, file: !85, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !71, retainedNodes: !89)
// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !34)
// CHECK:STDOUT: !88 = !DILocation(line: 8, column: 3, scope: !86)
// CHECK:STDOUT: !89 = !{!87}
// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp", scope: null, file: !85, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !71, retainedNodes: !93)
// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0}
// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0}
// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !71 = !{!"int", !63, i64 0}
// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0}
// CHECK:STDOUT: !73 = !{!72, !71, i64 0}
// CHECK:STDOUT: !74 = !DIFile(filename: "thunks_for_distinct_specializations.carbon", directory: "")
// CHECK:STDOUT: !75 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !74, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !74, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !88)
// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !34)
// CHECK:STDOUT: !78 = !DILocalVariable(arg: 2, scope: !76, type: !34)
// CHECK:STDOUT: !81 = !DILocation(line: 12, column: 3, scope: !76)
// CHECK:STDOUT: !82 = !DILocation(line: 12, column: 35, scope: !76)
// CHECK:STDOUT: !84 = !DILocation(line: 13, column: 3, scope: !76)
// CHECK:STDOUT: !85 = !DILocation(line: 13, column: 35, scope: !76)
// CHECK:STDOUT: !87 = !DILocation(line: 11, column: 1, scope: !76)
// CHECK:STDOUT: !88 = !{!77, !78}
// CHECK:STDOUT: !89 = !DIFile(filename: "./box.h", directory: "")
// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp", scope: null, file: !89, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !93)
// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !34)
// CHECK:STDOUT: !92 = !DILocation(line: 8, column: 3, scope: !90)
// CHECK:STDOUT: !93 = !{!91}
// CHECK:STDOUT: !94 = !{!"p1 _ZTS3BoxI1AE", !60, i64 0}
// CHECK:STDOUT: !95 = !{!94, !94, i64 0}
// CHECK:STDOUT: !98 = !{!"p1 _ZTS3BoxI1BE", !60, i64 0}
// CHECK:STDOUT: !99 = !{!98, !98, i64 0}
// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp", scope: null, file: !89, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !97)
// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !34)
// CHECK:STDOUT: !96 = !DILocation(line: 8, column: 3, scope: !94)
// CHECK:STDOUT: !97 = !{!95}
// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c6bde88ac44221c1:core.Destroy.Core", scope: null, file: !74, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !101)
// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !34)
// CHECK:STDOUT: !100 = !DILocation(line: 13, column: 3, scope: !98)
// CHECK:STDOUT: !101 = !{!99}
// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.35d03e94f0115619:core.Destroy.Core", scope: null, file: !74, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !105)
// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !34)
// CHECK:STDOUT: !104 = !DILocation(line: 12, column: 3, scope: !102)
// CHECK:STDOUT: !105 = !{!103}
// CHECK:STDOUT: !106 = !{!"p1 _ZTS3BoxI1AE", !64, i64 0}
// CHECK:STDOUT: !107 = !{!106, !106, i64 0}
// CHECK:STDOUT: !110 = !{!"p1 _ZTS3BoxI1BE", !64, i64 0}
// CHECK:STDOUT: !111 = !{!110, !110, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'thunks_for_anonymous_namespace_collision.carbon'
@@ -337,21 +372,21 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: $_ZN7CollideC2ERKS_ = comdat any
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !104 {
// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !116 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !109
// CHECK:STDOUT: %.loc12_32.1.temp = alloca [1 x i8], align 1, !dbg !110
// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !112
// CHECK:STDOUT: %.loc13_36.1.temp = alloca [1 x i8], align 1, !dbg !113
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !109
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_32.1.temp), !dbg !110
// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !110
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !112
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_36.1.temp), !dbg !113
// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !113
// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr %b2.var), !dbg !112
// CHECK:STDOUT: call void @_ZN7CollideD2Ev(ptr %a2.var), !dbg !109
// CHECK:STDOUT: ret void, !dbg !115
// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !121
// CHECK:STDOUT: %.loc12_32.1.temp = alloca [1 x i8], align 1, !dbg !122
// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !124
// CHECK:STDOUT: %.loc13_36.1.temp = alloca [1 x i8], align 1, !dbg !125
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !121
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_32.1.temp), !dbg !122
// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !122
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !124
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_36.1.temp), !dbg !125
// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !125
// CHECK:STDOUT: call void @"_CSelfDestruct.c4db6b78eb7f0546:core.Destroy.Core"(ptr %b2.var), !dbg !124
// CHECK:STDOUT: call void @"_CSelfDestruct.3cee6f1426a47a6f:core.Destroy.Core"(ptr %a2.var), !dbg !121
// CHECK:STDOUT: ret void, !dbg !127
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -359,19 +394,19 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !127
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !127
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !127
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !127
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !147
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !147
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !147
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !147
// CHECK:STDOUT: call void @_ZN7CollideC2ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !118 {
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !130 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !120
// CHECK:STDOUT: ret void, !dbg !120
// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !132
// CHECK:STDOUT: ret void, !dbg !132
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
@@ -379,39 +414,53 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !130
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !130
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !130
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !130
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !150
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !150
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !150
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !150
// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC2ERKS0_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2)
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !122 {
// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !134 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %self, ptr %return), !dbg !124
// CHECK:STDOUT: ret void, !dbg !124
// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %self, ptr %return), !dbg !136
// CHECK:STDOUT: ret void, !dbg !136
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
// CHECK:STDOUT: define internal void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !130
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !150
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4db6b78eb7f0546:core.Destroy.Core"(ptr %self) #0 !dbg !138 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr %self), !dbg !140
// CHECK:STDOUT: ret void, !dbg !140
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN7CollideD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !127
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !147
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3cee6f1426a47a6f:core.Destroy.Core"(ptr %self) #0 !dbg !142 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_ZN7CollideD2Ev(ptr %self), !dbg !144
// CHECK:STDOUT: ret void, !dbg !144
// 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)) #4
// CHECK:STDOUT:
@@ -420,8 +469,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !127
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !127
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !147
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !147
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -431,8 +480,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
// CHECK:STDOUT: %.addr = alloca ptr, align 8
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !130
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !130
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !150
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !150
// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }
@@ -446,48 +495,58 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) {
// CHECK:STDOUT: attributes #3 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!103}
// CHECK:STDOUT: !llvm.module.flags = !{!64, !65, !66, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!69}
// CHECK:STDOUT: !llvm.dbg.cu = !{!115}
// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!73}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !35 = !{null, !34}
// CHECK:STDOUT: !36 = !DISubroutineType(types: !35)
// CHECK:STDOUT: !37 = !{null, !34, !34}
// CHECK:STDOUT: !38 = !DISubroutineType(types: !37)
// CHECK:STDOUT: !39 = !{!34, !34}
// CHECK:STDOUT: !40 = !DISubroutineType(types: !39)
// CHECK:STDOUT: !58 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !59 = !{!"omnipotent char", !58, i64 0}
// CHECK:STDOUT: !60 = !{!"any pointer", !59, i64 0}
// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !67 = !{!"int", !59, i64 0}
// CHECK:STDOUT: !68 = !{!"__libc_errno", !67, i64 0}
// CHECK:STDOUT: !69 = !{!68, !67, i64 0}
// CHECK:STDOUT: !102 = !DIFile(filename: "thunks_for_anonymous_namespace_collision.carbon", directory: "")
// CHECK:STDOUT: !103 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !102, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !102, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !103, retainedNodes: !116)
// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !34)
// CHECK:STDOUT: !106 = !DILocalVariable(arg: 2, scope: !104, type: !34)
// CHECK:STDOUT: !109 = !DILocation(line: 12, column: 3, scope: !104)
// CHECK:STDOUT: !110 = !DILocation(line: 12, column: 32, scope: !104)
// CHECK:STDOUT: !112 = !DILocation(line: 13, column: 3, scope: !104)
// CHECK:STDOUT: !113 = !DILocation(line: 13, column: 36, scope: !104)
// CHECK:STDOUT: !115 = !DILocation(line: 11, column: 1, scope: !104)
// CHECK:STDOUT: !116 = !{!105, !106}
// CHECK:STDOUT: !117 = !DIFile(filename: "./anonymous_namespace_collision.h", directory: "")
// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp", scope: null, file: !117, line: 17, type: !40, spFlags: DISPFlagDefinition, unit: !103, retainedNodes: !121)
// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !34)
// CHECK:STDOUT: !120 = !DILocation(line: 17, column: 3, scope: !118)
// CHECK:STDOUT: !121 = !{!119}
// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp", scope: null, file: !117, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !103, retainedNodes: !125)
// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !34)
// CHECK:STDOUT: !124 = !DILocation(line: 8, column: 3, scope: !122)
// CHECK:STDOUT: !125 = !{!123}
// CHECK:STDOUT: !126 = !{!"p1 _ZTS7Collide", !60, i64 0}
// CHECK:STDOUT: !127 = !{!126, !126, i64 0}
// CHECK:STDOUT: !129 = !{!"p1 _ZTSN12_GLOBAL__N_17CollideE", !60, i64 0}
// CHECK:STDOUT: !130 = !{!129, !129, i64 0}
// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0}
// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0}
// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !71 = !{!"int", !63, i64 0}
// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0}
// CHECK:STDOUT: !73 = !{!72, !71, i64 0}
// CHECK:STDOUT: !114 = !DIFile(filename: "thunks_for_anonymous_namespace_collision.carbon", directory: "")
// CHECK:STDOUT: !115 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !114, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !114, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !128)
// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !34)
// CHECK:STDOUT: !118 = !DILocalVariable(arg: 2, scope: !116, type: !34)
// CHECK:STDOUT: !121 = !DILocation(line: 12, column: 3, scope: !116)
// CHECK:STDOUT: !122 = !DILocation(line: 12, column: 32, scope: !116)
// CHECK:STDOUT: !124 = !DILocation(line: 13, column: 3, scope: !116)
// CHECK:STDOUT: !125 = !DILocation(line: 13, column: 36, scope: !116)
// CHECK:STDOUT: !127 = !DILocation(line: 11, column: 1, scope: !116)
// CHECK:STDOUT: !128 = !{!117, !118}
// CHECK:STDOUT: !129 = !DIFile(filename: "./anonymous_namespace_collision.h", directory: "")
// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp", scope: null, file: !129, line: 17, type: !40, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !133)
// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !34)
// CHECK:STDOUT: !132 = !DILocation(line: 17, column: 3, scope: !130)
// CHECK:STDOUT: !133 = !{!131}
// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp", scope: null, file: !129, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !137)
// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !134, type: !34)
// CHECK:STDOUT: !136 = !DILocation(line: 8, column: 3, scope: !134)
// CHECK:STDOUT: !137 = !{!135}
// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4db6b78eb7f0546:core.Destroy.Core", scope: null, file: !114, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !141)
// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !34)
// CHECK:STDOUT: !140 = !DILocation(line: 13, column: 3, scope: !138)
// CHECK:STDOUT: !141 = !{!139}
// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3cee6f1426a47a6f:core.Destroy.Core", scope: null, file: !114, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !145)
// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !34)
// CHECK:STDOUT: !144 = !DILocation(line: 12, column: 3, scope: !142)
// CHECK:STDOUT: !145 = !{!143}
// CHECK:STDOUT: !146 = !{!"p1 _ZTS7Collide", !64, i64 0}
// CHECK:STDOUT: !147 = !{!146, !146, i64 0}
// CHECK:STDOUT: !149 = !{!"p1 _ZTSN12_GLOBAL__N_17CollideE", !64, i64 0}
// CHECK:STDOUT: !150 = !{!149, !149, i64 0}
// CHECK:STDOUT:
+359 -238
View File
@@ -71,179 +71,247 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* {
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc7_21.2.temp, align 8, !dbg !13
// CHECK:STDOUT: %.loc7_21.4 = load ptr, ptr %.loc7_21.2.temp, align 8, !dbg !13
// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc7_21.4), !dbg !16
// CHECK:STDOUT: call void @"_COp.14b4a412ddf73a96:core.Destroy.Core"(ptr %.loc7_21.2.temp), !dbg !13
// CHECK:STDOUT: call void @"_CSelfDestruct.14b4a412ddf73a96:core.Destroy.Core"(ptr %.loc7_21.2.temp), !dbg !13
// CHECK:STDOUT: ret void, !dbg !17
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core"(ptr %self) #0 !dbg !20 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !22
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z13take_void_ptrPv(ptr noundef) #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !19 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !24 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !21
// CHECK:STDOUT: ret void, !dbg !26
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.ddbd3dbdb388ab25:core.Destroy.Core"(ptr %self) #0 !dbg !23 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !28 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !25
// CHECK:STDOUT: call void @"_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core"(ptr %self), !dbg !30
// CHECK:STDOUT: ret void, !dbg !30
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.14b4a412ddf73a96:core.Destroy.Core"(ptr %self) #0 !dbg !27 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core"(ptr %self) #0 !dbg !32 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !29
// CHECK:STDOUT: ret void, !dbg !34
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !31 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.174120d4d03791b0:core.Destroy.Core"(ptr %self) #0 !dbg !36 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !34
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.743bdca835b10868"(ptr %a), !dbg !34
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !34
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !34
// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !34
// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !35
// CHECK:STDOUT: call void @"_COp.14b4a412ddf73a96:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !34
// CHECK:STDOUT: ret void, !dbg !36
// CHECK:STDOUT: call void @"_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core"(ptr %self), !dbg !38
// CHECK:STDOUT: ret void, !dbg !38
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !38 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.14b4a412ddf73a96:core.Destroy.Core"(ptr %self) #0 !dbg !40 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !41
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5"(ptr %a), !dbg !41
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !41
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !41
// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !41
// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !42
// CHECK:STDOUT: call void @"_COp.dfb26e502f641cc5:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !41
// CHECK:STDOUT: ret void, !dbg !43
// CHECK:STDOUT: ret void, !dbg !42
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.14b4a412ddf73a96:core.Destroy.Core"(ptr %self) #0 !dbg !44 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.14b4a412ddf73a96:core.Destroy.Core"(ptr %self), !dbg !46
// CHECK:STDOUT: ret void, !dbg !46
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !48 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !51
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6031252d10ea5365"(ptr %a), !dbg !51
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !51
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !51
// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !51
// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !52
// CHECK:STDOUT: call void @"_CSelfDestruct.14b4a412ddf73a96:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !51
// CHECK:STDOUT: ret void, !dbg !53
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !55 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !57
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !59 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !62
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c"(ptr %a), !dbg !62
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !62
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !62
// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !62
// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !63
// CHECK:STDOUT: call void @"_CSelfDestruct.dfb26e502f641cc5:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !62
// CHECK:STDOUT: ret void, !dbg !64
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e9afb99fe676df82:core.Destroy.Core"(ptr %self) #0 !dbg !66 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !68
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_Z19take_const_void_ptrPKv(ptr noundef) #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.8d3ff16138365f48:core.Destroy.Core"(ptr %self) #0 !dbg !45 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8d3ff16138365f48:core.Destroy.Core"(ptr %self) #0 !dbg !70 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !47
// CHECK:STDOUT: ret void, !dbg !72
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.d7d7d0af84cf13b8:core.Destroy.Core"(ptr %self) #0 !dbg !49 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8d3ff16138365f48:core.Destroy.Core"(ptr %self) #0 !dbg !74 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !51
// CHECK:STDOUT: call void @"_CSubobjectDestroy.8d3ff16138365f48:core.Destroy.Core"(ptr %self), !dbg !76
// CHECK:STDOUT: ret void, !dbg !76
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_COp.dfb26e502f641cc5:core.Destroy.Core"(ptr %self) #0 !dbg !53 {
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4e1f0f3b7725eea2:core.Destroy.Core"(ptr %self) #0 !dbg !78 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !55
// CHECK:STDOUT: ret void, !dbg !80
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !57 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4e1f0f3b7725eea2:core.Destroy.Core"(ptr %self) #0 !dbg !82 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !60
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5"(ptr %a), !dbg !60
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !60
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !60
// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !60
// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !61
// CHECK:STDOUT: call void @"_COp.dfb26e502f641cc5:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !60
// CHECK:STDOUT: ret void, !dbg !62
// CHECK:STDOUT: call void @"_CSubobjectDestroy.4e1f0f3b7725eea2:core.Destroy.Core"(ptr %self), !dbg !84
// CHECK:STDOUT: ret void, !dbg !84
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0532bac23645330a"(ptr %self) #0 !dbg !65 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642"(ptr %self), !dbg !70
// CHECK:STDOUT: ret ptr %1, !dbg !71
// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dfb26e502f641cc5:core.Destroy.Core"(ptr %self) #0 !dbg !86 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !88
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dfb26e502f641cc5:core.Destroy.Core"(ptr %self) #0 !dbg !90 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @"_CSubobjectDestroy.dfb26e502f641cc5:core.Destroy.Core"(ptr %self), !dbg !92
// CHECK:STDOUT: ret void, !dbg !92
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !94 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !97
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c"(ptr %a), !dbg !97
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !97
// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !97
// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !97
// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !98
// CHECK:STDOUT: call void @"_CSelfDestruct.dfb26e502f641cc5:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !97
// CHECK:STDOUT: ret void, !dbg !99
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7742c7b82efb7924:core.Destroy.Core"(ptr %self) #0 !dbg !101 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !103
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0532bac23645330a"(ptr %self) #0 !dbg !105 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642"(ptr %self), !dbg !110
// CHECK:STDOUT: ret ptr %1, !dbg !111
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.743bdca835b10868"(ptr %self) #0 !dbg !73 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.fbfbaeeadd5088b8"(ptr %self), !dbg !78
// CHECK:STDOUT: ret ptr %1, !dbg !79
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6031252d10ea5365"(ptr %self) #0 !dbg !113 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.1e16d6a5a3286ade"(ptr %self), !dbg !118
// CHECK:STDOUT: ret ptr %1, !dbg !119
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5"(ptr %self) #0 !dbg !81 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.0d728554b50ee51c"(ptr %self), !dbg !86
// CHECK:STDOUT: ret ptr %1, !dbg !87
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c"(ptr %self) #0 !dbg !121 {
// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ea6f599e1a77a7ea"(ptr %self), !dbg !126
// CHECK:STDOUT: ret ptr %1, !dbg !127
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642"(ptr %self) #0 !dbg !97 {
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %self), !dbg !103
// CHECK:STDOUT: ret ptr %1, !dbg !104
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642"(ptr %self) #0 !dbg !137 {
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %self), !dbg !143
// CHECK:STDOUT: ret ptr %1, !dbg !144
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.fbfbaeeadd5088b8"(ptr %self) #0 !dbg !106 {
// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !111
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !111
// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !111
// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !111
// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %1), !dbg !112
// CHECK:STDOUT: ret ptr %2, !dbg !113
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.1e16d6a5a3286ade"(ptr %self) #0 !dbg !146 {
// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !151
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !151
// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !151
// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !151
// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %1), !dbg !152
// CHECK:STDOUT: call void @"_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core"(ptr %temp), !dbg !151
// CHECK:STDOUT: ret ptr %2, !dbg !153
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.0d728554b50ee51c"(ptr %self) #0 !dbg !115 {
// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !120
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !120
// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self), !dbg !120
// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !120
// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !120
// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.e4523e01ac2590ba(ptr %2), !dbg !121
// CHECK:STDOUT: ret ptr %3, !dbg !122
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ea6f599e1a77a7ea"(ptr %self) #0 !dbg !155 {
// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !160
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !160
// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self), !dbg !160
// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !160
// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !160
// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.e4523e01ac2590ba(ptr %2), !dbg !161
// CHECK:STDOUT: call void @"_CSelfDestruct.e9afb99fe676df82:core.Destroy.Core"(ptr %temp), !dbg !160
// CHECK:STDOUT: ret ptr %3, !dbg !162
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %value) #0 !dbg !133 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %value), !dbg !138
// CHECK:STDOUT: ret ptr %1, !dbg !139
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %value) #0 !dbg !173 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %value), !dbg !178
// CHECK:STDOUT: ret ptr %1, !dbg !179
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self) #3 !dbg !142 {
// CHECK:STDOUT: ret ptr %self, !dbg !145
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self) #3 !dbg !182 {
// CHECK:STDOUT: ret ptr %self, !dbg !185
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e4523e01ac2590ba(ptr %value) #0 !dbg !147 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %value), !dbg !152
// CHECK:STDOUT: ret ptr %1, !dbg !153
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e4523e01ac2590ba(ptr %value) #0 !dbg !187 {
// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %value), !dbg !192
// CHECK:STDOUT: ret ptr %1, !dbg !193
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %self) #0 !dbg !160 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !165
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !165
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !165
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !169
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !167
// CHECK:STDOUT: call void @"_COp.ddbd3dbdb388ab25:core.Destroy.Core"(ptr %1), !dbg !165
// CHECK:STDOUT: ret ptr %2, !dbg !171
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %self) #0 !dbg !200 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !205
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !205
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !205
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !209
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !207
// CHECK:STDOUT: call void @"_CSelfDestruct.174120d4d03791b0:core.Destroy.Core"(ptr %1), !dbg !205
// CHECK:STDOUT: ret ptr %2, !dbg !211
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %self) #0 !dbg !173 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !178
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !178
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !178
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !182
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !180
// CHECK:STDOUT: call void @"_COp.d7d7d0af84cf13b8:core.Destroy.Core"(ptr %1), !dbg !178
// CHECK:STDOUT: ret ptr %2, !dbg !184
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %self) #0 !dbg !213 {
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !218
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !218
// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !218
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !222
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !220
// CHECK:STDOUT: call void @"_CSelfDestruct.4e1f0f3b7725eea2:core.Destroy.Core"(ptr %1), !dbg !218
// CHECK:STDOUT: ret ptr %2, !dbg !224
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 1, 2, 3, 7, 6, 5, 4 }
// CHECK:STDOUT: uselistorder ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5", { 1, 0 }
// CHECK:STDOUT: uselistorder ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c", { 1, 0 }
// CHECK:STDOUT: uselistorder ptr @_CSome.Optional.Core.4201ec9a263c5642, { 1, 0 }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
@@ -252,8 +320,8 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* {
// CHECK:STDOUT: attributes #3 = { alwaysinline nounwind }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
// CHECK:STDOUT: !llvm.module.flags = !{!186, !187, !188, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!193}
// CHECK:STDOUT: !llvm.module.flags = !{!226, !227, !228, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!233}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
@@ -270,118 +338,158 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* {
// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !10)
// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !10)
// CHECK:STDOUT: !18 = !{!11}
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !22)
// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !19, type: !7)
// CHECK:STDOUT: !21 = !DILocation(line: 7, column: 21, scope: !19)
// CHECK:STDOUT: !22 = !{!20}
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ddbd3dbdb388ab25:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26)
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !7)
// CHECK:STDOUT: !25 = !DILocation(line: 7, column: 21, scope: !23)
// CHECK:STDOUT: !26 = !{!24}
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.14b4a412ddf73a96:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30)
// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !7)
// CHECK:STDOUT: !29 = !DILocation(line: 7, column: 21, scope: !27)
// CHECK:STDOUT: !30 = !{!28}
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !4, line: 10, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37)
// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !7)
// CHECK:STDOUT: !34 = !DILocation(line: 11, column: 21, scope: !31)
// CHECK:STDOUT: !35 = !DILocation(line: 11, column: 3, scope: !31)
// CHECK:STDOUT: !36 = !DILocation(line: 10, column: 1, scope: !31)
// CHECK:STDOUT: !37 = !{!32}
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !4, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !44)
// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !7)
// CHECK:STDOUT: !41 = !DILocation(line: 15, column: 27, scope: !38)
// CHECK:STDOUT: !42 = !DILocation(line: 15, column: 3, scope: !38)
// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 1, scope: !38)
// CHECK:STDOUT: !44 = !{!39}
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8d3ff16138365f48:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !48)
// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !7)
// CHECK:STDOUT: !47 = !DILocation(line: 15, column: 27, scope: !45)
// CHECK:STDOUT: !48 = !{!46}
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d7d7d0af84cf13b8:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !52)
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !7)
// CHECK:STDOUT: !51 = !DILocation(line: 15, column: 27, scope: !49)
// CHECK:STDOUT: !52 = !{!50}
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dfb26e502f641cc5:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !56)
// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !7)
// CHECK:STDOUT: !55 = !DILocation(line: 15, column: 27, scope: !53)
// CHECK:STDOUT: !56 = !{!54}
// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63)
// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !7)
// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 27, scope: !57)
// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 3, scope: !57)
// CHECK:STDOUT: !62 = !DILocation(line: 18, column: 1, scope: !57)
// CHECK:STDOUT: !63 = !{!58}
// CHECK:STDOUT: !64 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0532bac23645330a", scope: null, file: !64, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !72)
// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !7)
// CHECK:STDOUT: !70 = !DILocation(line: 106, column: 12, scope: !65)
// CHECK:STDOUT: !71 = !DILocation(line: 106, column: 5, scope: !65)
// CHECK:STDOUT: !72 = !{!66}
// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.743bdca835b10868", scope: null, file: !64, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !80)
// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !7)
// CHECK:STDOUT: !78 = !DILocation(line: 106, column: 12, scope: !73)
// CHECK:STDOUT: !79 = !DILocation(line: 106, column: 5, scope: !73)
// CHECK:STDOUT: !80 = !{!74}
// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5", scope: null, file: !64, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !88)
// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !7)
// CHECK:STDOUT: !86 = !DILocation(line: 106, column: 12, scope: !81)
// CHECK:STDOUT: !87 = !DILocation(line: 106, column: 5, scope: !81)
// CHECK:STDOUT: !88 = !{!82}
// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642", scope: null, file: !64, line: 80, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !105)
// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !7)
// CHECK:STDOUT: !103 = !DILocation(line: 81, column: 12, scope: !97)
// CHECK:STDOUT: !104 = !DILocation(line: 81, column: 5, scope: !97)
// CHECK:STDOUT: !105 = !{!98}
// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.fbfbaeeadd5088b8", scope: null, file: !64, line: 87, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !114)
// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !7)
// CHECK:STDOUT: !111 = !DILocation(line: 88, column: 29, scope: !106)
// CHECK:STDOUT: !112 = !DILocation(line: 88, column: 12, scope: !106)
// CHECK:STDOUT: !113 = !DILocation(line: 88, column: 5, scope: !106)
// CHECK:STDOUT: !114 = !{!107}
// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.0d728554b50ee51c", scope: null, file: !64, line: 87, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !123)
// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !7)
// CHECK:STDOUT: !120 = !DILocation(line: 88, column: 29, scope: !115)
// CHECK:STDOUT: !121 = !DILocation(line: 88, column: 12, scope: !115)
// CHECK:STDOUT: !122 = !DILocation(line: 88, column: 5, scope: !115)
// CHECK:STDOUT: !123 = !{!116}
// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.4201ec9a263c5642", scope: null, file: !64, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !140)
// CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !133, type: !7)
// CHECK:STDOUT: !138 = !DILocation(line: 34, column: 12, scope: !133)
// CHECK:STDOUT: !139 = !DILocation(line: 34, column: 5, scope: !133)
// CHECK:STDOUT: !140 = !{!134}
// CHECK:STDOUT: !141 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "")
// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba", scope: null, file: !141, line: 40, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !146)
// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !7)
// CHECK:STDOUT: !145 = !DILocation(line: 40, column: 3, scope: !142)
// CHECK:STDOUT: !146 = !{!143}
// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e4523e01ac2590ba", scope: null, file: !64, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !154)
// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !7)
// CHECK:STDOUT: !152 = !DILocation(line: 34, column: 12, scope: !147)
// CHECK:STDOUT: !153 = !DILocation(line: 34, column: 5, scope: !147)
// CHECK:STDOUT: !154 = !{!148}
// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271", scope: null, file: !64, line: 166, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !172)
// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !7)
// CHECK:STDOUT: !165 = !DILocation(line: 167, column: 14, scope: !160)
// CHECK:STDOUT: !167 = !DILocation(line: 167, column: 18, scope: !160)
// CHECK:STDOUT: !169 = !DILocation(line: 169, column: 5, scope: !160)
// CHECK:STDOUT: !171 = !DILocation(line: 170, column: 5, scope: !160)
// CHECK:STDOUT: !172 = !{!161}
// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137", scope: null, file: !64, line: 166, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !185)
// CHECK:STDOUT: !19 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !23)
// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !20, type: !7)
// CHECK:STDOUT: !22 = !DILocation(line: 164, column: 19, scope: !20)
// CHECK:STDOUT: !23 = !{!21}
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !27)
// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !24, type: !7)
// CHECK:STDOUT: !26 = !DILocation(line: 7, column: 21, scope: !24)
// CHECK:STDOUT: !27 = !{!25}
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31)
// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !7)
// CHECK:STDOUT: !30 = !DILocation(line: 7, column: 21, scope: !28)
// CHECK:STDOUT: !31 = !{!29}
// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35)
// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !7)
// CHECK:STDOUT: !34 = !DILocation(line: 7, column: 21, scope: !32)
// CHECK:STDOUT: !35 = !{!33}
// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.174120d4d03791b0:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39)
// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !7)
// CHECK:STDOUT: !38 = !DILocation(line: 7, column: 21, scope: !36)
// CHECK:STDOUT: !39 = !{!37}
// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.14b4a412ddf73a96:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43)
// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !7)
// CHECK:STDOUT: !42 = !DILocation(line: 7, column: 21, scope: !40)
// CHECK:STDOUT: !43 = !{!41}
// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.14b4a412ddf73a96:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47)
// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !7)
// CHECK:STDOUT: !46 = !DILocation(line: 7, column: 21, scope: !44)
// CHECK:STDOUT: !47 = !{!45}
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !4, line: 10, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54)
// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !7)
// CHECK:STDOUT: !51 = !DILocation(line: 11, column: 21, scope: !48)
// CHECK:STDOUT: !52 = !DILocation(line: 11, column: 3, scope: !48)
// CHECK:STDOUT: !53 = !DILocation(line: 10, column: 1, scope: !48)
// CHECK:STDOUT: !54 = !{!49}
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58)
// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !7)
// CHECK:STDOUT: !57 = !DILocation(line: 164, column: 19, scope: !55)
// CHECK:STDOUT: !58 = !{!56}
// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !4, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !65)
// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !7)
// CHECK:STDOUT: !62 = !DILocation(line: 15, column: 27, scope: !59)
// CHECK:STDOUT: !63 = !DILocation(line: 15, column: 3, scope: !59)
// CHECK:STDOUT: !64 = !DILocation(line: 14, column: 1, scope: !59)
// CHECK:STDOUT: !65 = !{!60}
// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e9afb99fe676df82:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !69)
// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !7)
// CHECK:STDOUT: !68 = !DILocation(line: 164, column: 19, scope: !66)
// CHECK:STDOUT: !69 = !{!67}
// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8d3ff16138365f48:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !73)
// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !7)
// CHECK:STDOUT: !72 = !DILocation(line: 15, column: 27, scope: !70)
// CHECK:STDOUT: !73 = !{!71}
// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8d3ff16138365f48:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !77)
// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !7)
// CHECK:STDOUT: !76 = !DILocation(line: 15, column: 27, scope: !74)
// CHECK:STDOUT: !77 = !{!75}
// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4e1f0f3b7725eea2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !81)
// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !7)
// CHECK:STDOUT: !80 = !DILocation(line: 15, column: 27, scope: !78)
// CHECK:STDOUT: !81 = !{!79}
// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4e1f0f3b7725eea2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !85)
// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !7)
// CHECK:STDOUT: !84 = !DILocation(line: 15, column: 27, scope: !82)
// CHECK:STDOUT: !85 = !{!83}
// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dfb26e502f641cc5:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !89)
// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !7)
// CHECK:STDOUT: !88 = !DILocation(line: 15, column: 27, scope: !86)
// CHECK:STDOUT: !89 = !{!87}
// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dfb26e502f641cc5:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !93)
// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !7)
// CHECK:STDOUT: !92 = !DILocation(line: 15, column: 27, scope: !90)
// CHECK:STDOUT: !93 = !{!91}
// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !100)
// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !7)
// CHECK:STDOUT: !97 = !DILocation(line: 19, column: 27, scope: !94)
// CHECK:STDOUT: !98 = !DILocation(line: 19, column: 3, scope: !94)
// CHECK:STDOUT: !99 = !DILocation(line: 18, column: 1, scope: !94)
// CHECK:STDOUT: !100 = !{!95}
// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7742c7b82efb7924:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !104)
// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !7)
// CHECK:STDOUT: !103 = !DILocation(line: 164, column: 19, scope: !101)
// CHECK:STDOUT: !104 = !{!102}
// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0532bac23645330a", scope: null, file: !19, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !112)
// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !7)
// CHECK:STDOUT: !110 = !DILocation(line: 106, column: 12, scope: !105)
// CHECK:STDOUT: !111 = !DILocation(line: 106, column: 5, scope: !105)
// CHECK:STDOUT: !112 = !{!106}
// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6031252d10ea5365", scope: null, file: !19, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !120)
// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !7)
// CHECK:STDOUT: !118 = !DILocation(line: 106, column: 12, scope: !113)
// CHECK:STDOUT: !119 = !DILocation(line: 106, column: 5, scope: !113)
// CHECK:STDOUT: !120 = !{!114}
// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c", scope: null, file: !19, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !128)
// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !7)
// CHECK:STDOUT: !126 = !DILocation(line: 106, column: 12, scope: !121)
// CHECK:STDOUT: !127 = !DILocation(line: 106, column: 5, scope: !121)
// CHECK:STDOUT: !128 = !{!122}
// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642", scope: null, file: !19, line: 80, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !145)
// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !7)
// CHECK:STDOUT: !143 = !DILocation(line: 81, column: 12, scope: !137)
// CHECK:STDOUT: !144 = !DILocation(line: 81, column: 5, scope: !137)
// CHECK:STDOUT: !145 = !{!138}
// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.1e16d6a5a3286ade", scope: null, file: !19, line: 87, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !154)
// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !7)
// CHECK:STDOUT: !151 = !DILocation(line: 88, column: 29, scope: !146)
// CHECK:STDOUT: !152 = !DILocation(line: 88, column: 12, scope: !146)
// CHECK:STDOUT: !153 = !DILocation(line: 88, column: 5, scope: !146)
// CHECK:STDOUT: !154 = !{!147}
// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ea6f599e1a77a7ea", scope: null, file: !19, line: 87, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !163)
// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !7)
// CHECK:STDOUT: !160 = !DILocation(line: 88, column: 29, scope: !155)
// CHECK:STDOUT: !161 = !DILocation(line: 88, column: 12, scope: !155)
// CHECK:STDOUT: !162 = !DILocation(line: 88, column: 5, scope: !155)
// CHECK:STDOUT: !163 = !{!156}
// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.4201ec9a263c5642", scope: null, file: !19, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !180)
// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !7)
// CHECK:STDOUT: !178 = !DILocation(line: 167, column: 14, scope: !173)
// CHECK:STDOUT: !180 = !DILocation(line: 167, column: 18, scope: !173)
// CHECK:STDOUT: !182 = !DILocation(line: 169, column: 5, scope: !173)
// CHECK:STDOUT: !184 = !DILocation(line: 170, column: 5, scope: !173)
// CHECK:STDOUT: !185 = !{!174}
// CHECK:STDOUT: !186 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !187 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !188 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !189 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !190 = !{!"omnipotent char", !189, i64 0}
// CHECK:STDOUT: !191 = !{!"int", !190, i64 0}
// CHECK:STDOUT: !192 = !{!"__libc_errno", !191, i64 0}
// CHECK:STDOUT: !193 = !{!192, !191, i64 0}
// CHECK:STDOUT: !178 = !DILocation(line: 34, column: 12, scope: !173)
// CHECK:STDOUT: !179 = !DILocation(line: 34, column: 5, scope: !173)
// CHECK:STDOUT: !180 = !{!174}
// CHECK:STDOUT: !181 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "")
// CHECK:STDOUT: !182 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba", scope: null, file: !181, line: 40, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !186)
// CHECK:STDOUT: !183 = !DILocalVariable(arg: 1, scope: !182, type: !7)
// CHECK:STDOUT: !185 = !DILocation(line: 40, column: 3, scope: !182)
// CHECK:STDOUT: !186 = !{!183}
// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e4523e01ac2590ba", scope: null, file: !19, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !194)
// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !187, type: !7)
// CHECK:STDOUT: !192 = !DILocation(line: 34, column: 12, scope: !187)
// CHECK:STDOUT: !193 = !DILocation(line: 34, column: 5, scope: !187)
// CHECK:STDOUT: !194 = !{!188}
// CHECK:STDOUT: !200 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271", scope: null, file: !19, line: 166, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !212)
// CHECK:STDOUT: !201 = !DILocalVariable(arg: 1, scope: !200, type: !7)
// CHECK:STDOUT: !205 = !DILocation(line: 167, column: 14, scope: !200)
// CHECK:STDOUT: !207 = !DILocation(line: 167, column: 18, scope: !200)
// CHECK:STDOUT: !209 = !DILocation(line: 169, column: 5, scope: !200)
// CHECK:STDOUT: !211 = !DILocation(line: 170, column: 5, scope: !200)
// CHECK:STDOUT: !212 = !{!201}
// CHECK:STDOUT: !213 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137", scope: null, file: !19, line: 166, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !225)
// CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !213, type: !7)
// CHECK:STDOUT: !218 = !DILocation(line: 167, column: 14, scope: !213)
// CHECK:STDOUT: !220 = !DILocation(line: 167, column: 18, scope: !213)
// CHECK:STDOUT: !222 = !DILocation(line: 169, column: 5, scope: !213)
// CHECK:STDOUT: !224 = !DILocation(line: 170, column: 5, scope: !213)
// CHECK:STDOUT: !225 = !{!214}
// CHECK:STDOUT: !226 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !227 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !228 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !229 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !230 = !{!"omnipotent char", !229, i64 0}
// CHECK:STDOUT: !231 = !{!"int", !230, i64 0}
// CHECK:STDOUT: !232 = !{!"__libc_errno", !231, i64 0}
// CHECK:STDOUT: !233 = !{!232, !231, i64 0}
// CHECK:STDOUT:
// CHECK:STDOUT: ; ---
// CHECK:STDOUT: ; ModuleID = 'receive.carbon'
@@ -390,59 +498,72 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* {
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReceiveVoidPtr.Main() #0 !dbg !198 {
// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core"(ptr %self) #0 !dbg !238 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return_void_ptr.call = call ptr @_Z15return_void_ptrv(), !dbg !201
// CHECK:STDOUT: ret ptr %return_void_ptr.call, !dbg !202
// CHECK:STDOUT: ret void, !dbg !240
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CReceiveVoidPtr.Main() #0 !dbg !242 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %return_void_ptr.call = call ptr @_Z15return_void_ptrv(), !dbg !245
// CHECK:STDOUT: ret ptr %return_void_ptr.call, !dbg !246
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare noundef ptr @_Z15return_void_ptrv() #1
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CConvertFromVoidPtr.Main(ptr %p) #0 !dbg !203 {
// CHECK:STDOUT: define ptr @_CConvertFromVoidPtr.Main(ptr %p) #0 !dbg !247 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret ptr %p, !dbg !209
// CHECK:STDOUT: ret ptr %p, !dbg !253
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: ; Function Attrs: nounwind
// CHECK:STDOUT: define ptr @_CConvertFromConstVoidPtr.Main(ptr %p) #0 !dbg !211 {
// CHECK:STDOUT: define ptr @_CConvertFromConstVoidPtr.Main(ptr %p) #0 !dbg !255 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret ptr %p, !dbg !217
// CHECK:STDOUT: ret ptr %p, !dbg !261
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nounwind }
// CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.dbg.cu = !{!195}
// CHECK:STDOUT: !llvm.module.flags = !{!186, !187, !188, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!193}
// CHECK:STDOUT: !llvm.dbg.cu = !{!235}
// CHECK:STDOUT: !llvm.module.flags = !{!226, !227, !228, !2, !3}
// CHECK:STDOUT: !llvm.errno.tbaa = !{!233}
// CHECK:STDOUT:
// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5}
// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
// CHECK:STDOUT: !8 = !{null, !7}
// CHECK:STDOUT: !9 = !DISubroutineType(types: !8)
// CHECK:STDOUT: !14 = !{!7, !7}
// CHECK:STDOUT: !15 = !DISubroutineType(types: !14)
// CHECK:STDOUT: !186 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !187 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !188 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !189 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !190 = !{!"omnipotent char", !189, i64 0}
// CHECK:STDOUT: !191 = !{!"int", !190, i64 0}
// CHECK:STDOUT: !192 = !{!"__libc_errno", !191, i64 0}
// CHECK:STDOUT: !193 = !{!192, !191, i64 0}
// CHECK:STDOUT: !194 = !DIFile(filename: "receive.carbon", directory: "")
// CHECK:STDOUT: !195 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !194, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !196 = !{!7}
// CHECK:STDOUT: !197 = !DISubroutineType(types: !196)
// CHECK:STDOUT: !198 = distinct !DISubprogram(name: "ReceiveVoidPtr", linkageName: "_CReceiveVoidPtr.Main", scope: null, file: !194, line: 6, type: !197, spFlags: DISPFlagDefinition, unit: !195)
// CHECK:STDOUT: !201 = !DILocation(line: 7, column: 10, scope: !198)
// CHECK:STDOUT: !202 = !DILocation(line: 7, column: 3, scope: !198)
// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "ConvertFromVoidPtr", linkageName: "_CConvertFromVoidPtr.Main", scope: null, file: !194, line: 10, type: !15, spFlags: DISPFlagDefinition, unit: !195, retainedNodes: !210)
// CHECK:STDOUT: !204 = !DILocalVariable(arg: 1, scope: !203, type: !7)
// CHECK:STDOUT: !209 = !DILocation(line: 11, column: 3, scope: !203)
// CHECK:STDOUT: !210 = !{!204}
// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "ConvertFromConstVoidPtr", linkageName: "_CConvertFromConstVoidPtr.Main", scope: null, file: !194, line: 14, type: !15, spFlags: DISPFlagDefinition, unit: !195, retainedNodes: !218)
// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !7)
// CHECK:STDOUT: !217 = !DILocation(line: 15, column: 3, scope: !211)
// CHECK:STDOUT: !218 = !{!212}
// CHECK:STDOUT: !19 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
// CHECK:STDOUT: !226 = !{i32 8, !"PIC Level", i32 2}
// CHECK:STDOUT: !227 = !{i32 7, !"PIE Level", i32 2}
// CHECK:STDOUT: !228 = !{i32 7, !"uwtable", i32 2}
// CHECK:STDOUT: !229 = !{!"Simple C++ TBAA"}
// CHECK:STDOUT: !230 = !{!"omnipotent char", !229, i64 0}
// CHECK:STDOUT: !231 = !{!"int", !230, i64 0}
// CHECK:STDOUT: !232 = !{!"__libc_errno", !231, i64 0}
// CHECK:STDOUT: !233 = !{!232, !231, i64 0}
// CHECK:STDOUT: !234 = !DIFile(filename: "receive.carbon", directory: "")
// CHECK:STDOUT: !235 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !234, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !236 = !{!7}
// CHECK:STDOUT: !237 = !DISubroutineType(types: !236)
// CHECK:STDOUT: !238 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !235, retainedNodes: !241)
// CHECK:STDOUT: !239 = !DILocalVariable(arg: 1, scope: !238, type: !7)
// CHECK:STDOUT: !240 = !DILocation(line: 164, column: 19, scope: !238)
// CHECK:STDOUT: !241 = !{!239}
// CHECK:STDOUT: !242 = distinct !DISubprogram(name: "ReceiveVoidPtr", linkageName: "_CReceiveVoidPtr.Main", scope: null, file: !234, line: 6, type: !237, spFlags: DISPFlagDefinition, unit: !235)
// CHECK:STDOUT: !245 = !DILocation(line: 7, column: 10, scope: !242)
// CHECK:STDOUT: !246 = !DILocation(line: 7, column: 3, scope: !242)
// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "ConvertFromVoidPtr", linkageName: "_CConvertFromVoidPtr.Main", scope: null, file: !234, line: 10, type: !15, spFlags: DISPFlagDefinition, unit: !235, retainedNodes: !254)
// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !7)
// CHECK:STDOUT: !253 = !DILocation(line: 11, column: 3, scope: !247)
// CHECK:STDOUT: !254 = !{!248}
// CHECK:STDOUT: !255 = distinct !DISubprogram(name: "ConvertFromConstVoidPtr", linkageName: "_CConvertFromConstVoidPtr.Main", scope: null, file: !234, line: 14, type: !15, spFlags: DISPFlagDefinition, unit: !235, retainedNodes: !262)
// CHECK:STDOUT: !256 = !DILocalVariable(arg: 1, scope: !255, type: !7)
// CHECK:STDOUT: !261 = !DILocation(line: 15, column: 3, scope: !255)
// CHECK:STDOUT: !262 = !{!256}
// CHECK:STDOUT: