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
2026-09-24 00:06:28 +00:00
committed by GitHub
parent 03939a9223
commit f7cd39428e
309 changed files with 51760 additions and 15269 deletions
@@ -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: