Change the Destroy blanket impls to be more specific (#6098)

The main direction of this change is the edits to `destroy.carbon`
(matching in both prelude and min_prelude).

Previously there was a no-op blanket impl for `Destroy`, which hid all
missing implementations of `Destroy`. This does a few things:

- Sets up builtin aggregate destruction for struct and tuple types as
before, but also adds C++ class types and array types to the same
handling. (all as a TODO for actual implementation)
- Also maybe-unformed destruction, for now at least. (there's a chance I
may try a different approach on this, but the impl lookup wasn't working
as I'd hope in order to write it in code)
- Adds handlers for simple things that are easy to do in code: `type`,
`bool`, pointers. (because these are no-op destruction)
- Redirect `const T` destruction to `T` destruction.

This leaves as future issues:

- `partial T` destruction. (this can't be done similar to `const`
because it only works for non-`final` class types; I think `class`
definitions should just generate what's needed)
- Destruction of other prelude-provided types. (will probably come up as
we implement class destruction, that the adapted builtin type doesn't
implement `Destroy` -- but may end up special-casing that in a way that
moots it)

This moves the `&` operator from `facet_types.carbon` to
`convert.carbon` because more things need to handle type and now that
we're getting separate copy and destroy interfaces. It should be
low-cost (an interface and builtin) so hopefully this is the right
balance for complexity and re-use.

A few tests are also edited in order to focus them more on what they
intend to test, and avoid a `Destroy` dependency.
This commit is contained in:
Jon Ross-Perkins
2025-09-18 22:10:50 +00:00
committed by GitHub
parent 868c4b768c
commit 9704dc670e
143 changed files with 3271 additions and 2413 deletions
@@ -25,7 +25,7 @@ fn H[T:! Core.Copy](x: T) -> T {
// Simple stress test for single depth of calls with change in types.
// Check definitions are emitted for each specific.
fn G[T:! Core.Copy](x: T) -> T {
fn G[T:! Core.Copy & Core.Destroy](x: T) -> T {
H(x);
H(i32);
H(G(x));
@@ -85,12 +85,12 @@ fn M() {
// CHECK:STDOUT: %.loc54 = load i32, ptr %n.var, align 4, !dbg !13
// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %.loc54), !dbg !14
// CHECK:STDOUT: %.loc55_9 = load i32, ptr %n.var, align 4, !dbg !15
// CHECK:STDOUT: %G.call.loc55 = call i32 @_CG.Main.de631560529e9861(i32 %.loc55_9), !dbg !16
// CHECK:STDOUT: %G.call.loc55 = call i32 @_CG.Main.dedae426f8f6526d(i32 %.loc55_9), !dbg !16
// CHECK:STDOUT: store i32 %G.call.loc55, ptr %m.var, align 4, !dbg !17
// CHECK:STDOUT: %.loc56 = load double, ptr %p.var, align 8, !dbg !18
// CHECK:STDOUT: call void @_CF.Main.d4b5665541d5d7a8(double %.loc56), !dbg !19
// CHECK:STDOUT: %.loc57_9 = load double, ptr %p.var, align 8, !dbg !20
// CHECK:STDOUT: %G.call.loc57 = call double @_CG.Main.3836ccc537683c19(double %.loc57_9), !dbg !21
// CHECK:STDOUT: %G.call.loc57 = call double @_CG.Main.42589ad6dce0869e(double %.loc57_9), !dbg !21
// CHECK:STDOUT: store double %G.call.loc57, ptr %q.var, align 8, !dbg !22
// CHECK:STDOUT: ret void, !dbg !23
// CHECK:STDOUT: }
@@ -106,7 +106,7 @@ fn M() {
// CHECK:STDOUT: ret void, !dbg !25
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.de631560529e9861(i32 %x) !dbg !26 {
// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.dedae426f8f6526d(i32 %x) !dbg !26 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc29_6.3.temp = alloca i32, align 4, !dbg !27
// CHECK:STDOUT: %.loc31_8.3.temp = alloca i32, align 4, !dbg !28
@@ -122,7 +122,7 @@ fn M() {
// CHECK:STDOUT: store i32 %H.call.loc29, ptr %.loc29_6.3.temp, align 4, !dbg !27
// CHECK:STDOUT: %H.call.loc30 = call %type @_CH.Main.402deed6b8733082(%type zeroinitializer), !dbg !36
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.3.temp), !dbg !28
// CHECK:STDOUT: %G.call = call i32 @_CG.Main.de631560529e9861(i32 %x), !dbg !28
// CHECK:STDOUT: %G.call = call i32 @_CG.Main.dedae426f8f6526d(i32 %x), !dbg !28
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.3.temp), !dbg !29
// CHECK:STDOUT: store i32 %G.call, ptr %.loc31_8.3.temp, align 4, !dbg !28
// CHECK:STDOUT: %.loc31_8.5 = load i32, ptr %.loc31_8.3.temp, align 4, !dbg !28
@@ -151,7 +151,7 @@ fn M() {
// CHECK:STDOUT: ret void, !dbg !47
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr double @_CG.Main.3836ccc537683c19(double %x) !dbg !48 {
// CHECK:STDOUT: define linkonce_odr double @_CG.Main.42589ad6dce0869e(double %x) !dbg !48 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc29_6.3.temp = alloca double, align 8, !dbg !49
// CHECK:STDOUT: %.loc31_8.3.temp = alloca double, align 8, !dbg !50
@@ -167,7 +167,7 @@ fn M() {
// CHECK:STDOUT: store double %H.call.loc29, ptr %.loc29_6.3.temp, align 8, !dbg !49
// CHECK:STDOUT: %H.call.loc30 = call %type @_CH.Main.402deed6b8733082(%type zeroinitializer), !dbg !58
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.3.temp), !dbg !50
// CHECK:STDOUT: %G.call = call double @_CG.Main.3836ccc537683c19(double %x), !dbg !50
// CHECK:STDOUT: %G.call = call double @_CG.Main.42589ad6dce0869e(double %x), !dbg !50
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.3.temp), !dbg !51
// CHECK:STDOUT: store double %G.call, ptr %.loc31_8.3.temp, align 8, !dbg !50
// CHECK:STDOUT: %.loc31_8.5 = load double, ptr %.loc31_8.3.temp, align 8, !dbg !50
@@ -257,7 +257,7 @@ fn M() {
// CHECK:STDOUT: !23 = !DILocation(line: 48, column: 1, scope: !8)
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !25 = !DILocation(line: 19, column: 1, scope: !24)
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.de631560529e9861", scope: null, file: !3, line: 28, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.dedae426f8f6526d", scope: null, file: !3, line: 28, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !27 = !DILocation(line: 29, column: 3, scope: !26)
// CHECK:STDOUT: !28 = !DILocation(line: 31, column: 5, scope: !26)
// CHECK:STDOUT: !29 = !DILocation(line: 31, column: 3, scope: !26)
@@ -279,7 +279,7 @@ fn M() {
// CHECK:STDOUT: !45 = !DILocation(line: 45, column: 3, scope: !26)
// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d4b5665541d5d7a8", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !47 = !DILocation(line: 19, column: 1, scope: !46)
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.3836ccc537683c19", scope: null, file: !3, line: 28, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.42589ad6dce0869e", scope: null, file: !3, line: 28, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !49 = !DILocation(line: 29, column: 3, scope: !48)
// CHECK:STDOUT: !50 = !DILocation(line: 31, column: 5, scope: !48)
// CHECK:STDOUT: !51 = !DILocation(line: 31, column: 3, scope: !48)
@@ -21,7 +21,7 @@ fn H[T:! Core.Copy](x: T) -> T {
return x;
}
fn G[T:! Core.Copy](x: T) -> T {
fn G[T:! Core.Copy & Core.Destroy](x: T) -> T {
H(x);
F(x);
return x;
@@ -48,7 +48,7 @@ fn M() {
// CHECK:STDOUT: %.loc34 = load i32, ptr %n.var, align 4, !dbg !9
// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(i32 %.loc34), !dbg !10
// CHECK:STDOUT: %.loc35_9 = load i32, ptr %n.var, align 4, !dbg !11
// CHECK:STDOUT: %G.call = call i32 @_CG.Main.de631560529e9861(i32 %.loc35_9), !dbg !12
// CHECK:STDOUT: %G.call = call i32 @_CG.Main.dedae426f8f6526d(i32 %.loc35_9), !dbg !12
// CHECK:STDOUT: store i32 %G.call, ptr %m.var, align 4, !dbg !13
// CHECK:STDOUT: ret void, !dbg !14
// CHECK:STDOUT: }
@@ -61,7 +61,7 @@ fn M() {
// CHECK:STDOUT: ret void, !dbg !16
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.de631560529e9861(i32 %x) !dbg !17 {
// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.dedae426f8f6526d(i32 %x) !dbg !17 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc25_6.3.temp = alloca i32, align 4, !dbg !18
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_6.3.temp), !dbg !18
@@ -102,7 +102,7 @@ fn M() {
// CHECK:STDOUT: !14 = !DILocation(line: 30, column: 1, scope: !4)
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !16 = !DILocation(line: 16, column: 1, scope: !15)
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.de631560529e9861", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.dedae426f8f6526d", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !18 = !DILocation(line: 25, column: 3, scope: !17)
// CHECK:STDOUT: !19 = !DILocation(line: 26, column: 3, scope: !17)
// CHECK:STDOUT: !20 = !DILocation(line: 27, column: 3, scope: !17)
@@ -23,11 +23,11 @@ fn D[U:! Core.Copy](x: U) -> U {
return x;
}
fn B[U:! Core.Copy](x: U*) {
fn B[U:! Core.Copy & Core.Destroy](x: U*) {
D(*x);
}
fn F[T:! Core.Copy](x: T*) {
fn F[T:! Core.Copy & Core.Destroy](x: T*) {
A(i32);
B(x);
}
@@ -52,26 +52,26 @@ fn M() {
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !7
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !8
// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !9
// CHECK:STDOUT: call void @_CF.Main.de631560529e9861(ptr %.loc39_5), !dbg !10
// CHECK:STDOUT: call void @_CF.Main.dedae426f8f6526d(ptr %.loc39_5), !dbg !10
// CHECK:STDOUT: %.loc40_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !11
// CHECK:STDOUT: call void @_CF.Main.3836ccc537683c19(ptr %.loc40_5), !dbg !12
// CHECK:STDOUT: call void @_CF.Main.42589ad6dce0869e(ptr %.loc40_5), !dbg !12
// CHECK:STDOUT: ret void, !dbg !13
// 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)) #0
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.de631560529e9861(ptr %x) !dbg !14 {
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.dedae426f8f6526d(ptr %x) !dbg !14 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %A.call = call %type @_CA.Main.402deed6b8733082(%type zeroinitializer), !dbg !15
// CHECK:STDOUT: call void @_CB.Main.de631560529e9861(ptr %x), !dbg !16
// CHECK:STDOUT: call void @_CB.Main.dedae426f8f6526d(ptr %x), !dbg !16
// CHECK:STDOUT: ret void, !dbg !17
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.3836ccc537683c19(ptr %x) !dbg !18 {
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.42589ad6dce0869e(ptr %x) !dbg !18 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %A.call = call %type @_CA.Main.402deed6b8733082(%type zeroinitializer), !dbg !19
// CHECK:STDOUT: call void @_CB.Main.3836ccc537683c19(ptr %x), !dbg !20
// CHECK:STDOUT: call void @_CB.Main.42589ad6dce0869e(ptr %x), !dbg !20
// CHECK:STDOUT: ret void, !dbg !21
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -80,7 +80,7 @@ fn M() {
// CHECK:STDOUT: ret %type %x, !dbg !23
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.de631560529e9861(ptr %x) !dbg !24 {
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.dedae426f8f6526d(ptr %x) !dbg !24 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc27_7.3.temp = alloca i32, align 4, !dbg !25
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.3.temp), !dbg !25
@@ -90,7 +90,7 @@ fn M() {
// CHECK:STDOUT: ret void, !dbg !27
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.3836ccc537683c19(ptr %x) !dbg !28 {
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.42589ad6dce0869e(ptr %x) !dbg !28 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc27_7.3.temp = alloca double, align 8, !dbg !29
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.3.temp), !dbg !29
@@ -133,21 +133,21 @@ fn M() {
// CHECK:STDOUT: !11 = !DILocation(line: 40, column: 5, scope: !4)
// CHECK:STDOUT: !12 = !DILocation(line: 40, column: 3, scope: !4)
// CHECK:STDOUT: !13 = !DILocation(line: 35, column: 1, scope: !4)
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de631560529e9861", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.dedae426f8f6526d", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !15 = !DILocation(line: 31, column: 3, scope: !14)
// CHECK:STDOUT: !16 = !DILocation(line: 32, column: 3, scope: !14)
// CHECK:STDOUT: !17 = !DILocation(line: 30, column: 1, scope: !14)
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.3836ccc537683c19", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.42589ad6dce0869e", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !19 = !DILocation(line: 31, column: 3, scope: !18)
// CHECK:STDOUT: !20 = !DILocation(line: 32, column: 3, scope: !18)
// CHECK:STDOUT: !21 = !DILocation(line: 30, column: 1, scope: !18)
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.402deed6b8733082", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !23 = !DILocation(line: 19, column: 3, scope: !22)
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.de631560529e9861", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.dedae426f8f6526d", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !25 = !DILocation(line: 27, column: 3, scope: !24)
// CHECK:STDOUT: !26 = !DILocation(line: 27, column: 5, scope: !24)
// CHECK:STDOUT: !27 = !DILocation(line: 26, column: 1, scope: !24)
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.3836ccc537683c19", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.42589ad6dce0869e", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !29 = !DILocation(line: 27, column: 3, scope: !28)
// CHECK:STDOUT: !30 = !DILocation(line: 27, column: 5, scope: !28)
// CHECK:STDOUT: !31 = !DILocation(line: 26, column: 1, scope: !28)
@@ -20,7 +20,7 @@ interface I {
}
fn G(U:! I) {
var x: U.T;
var x: U.T*;
}
class C {}
@@ -37,36 +37,28 @@ fn H() {
G(D);
}
// CHECK:STDOUT: ; ModuleID = 'call_different_associated_const.carbon'
// CHECK:STDOUT: source_filename = "call_different_associated_const.carbon"
// CHECK:STDOUT:
// CHECK:STDOUT: define void @_CH.Main() !dbg !4 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CG.Main.f4fac657790396cb(), !dbg !7
// CHECK:STDOUT: call void @_CG.Main.ac86dba5317b70e7(), !dbg !8
// CHECK:STDOUT: call void @_CG.Main.f4fac657790396cb(), !dbg !8
// CHECK:STDOUT: ret void, !dbg !9
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CG.Main.f4fac657790396cb() !dbg !10 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %x.var = alloca i1, align 1, !dbg !11
// CHECK:STDOUT: %x.var = alloca ptr, align 8, !dbg !11
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !11
// CHECK:STDOUT: ret void, !dbg !12
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CG.Main.ac86dba5317b70e7() !dbg !13 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !14
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !14
// CHECK:STDOUT: ret void, !dbg !15
// 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)) #0
// CHECK:STDOUT:
// CHECK:STDOUT: ; uselistorder directives
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 }
// CHECK:STDOUT: uselistorder ptr @_CG.Main.f4fac657790396cb, { 1, 0 }
// CHECK:STDOUT:
// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
// CHECK:STDOUT:
@@ -86,6 +78,3 @@ fn H() {
// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.f4fac657790396cb", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !11 = !DILocation(line: 23, column: 3, scope: !10)
// CHECK:STDOUT: !12 = !DILocation(line: 22, column: 1, scope: !10)
// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.ac86dba5317b70e7", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !14 = !DILocation(line: 23, column: 3, scope: !13)
// CHECK:STDOUT: !15 = !DILocation(line: 22, column: 1, scope: !13)
@@ -13,7 +13,7 @@
import Core library "io";
interface I {
let T:! type;
let T:! Core.Destroy;
fn F() -> T;
}
class X {}
@@ -61,14 +61,14 @@ fn Run() {
// CHECK:STDOUT:
// CHECK:STDOUT: define void @main() !dbg !12 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CG.Main.0dbf1a1c1733b53e(), !dbg !13
// CHECK:STDOUT: call void @_CG.Main.358c93ba71c2d336(), !dbg !14
// CHECK:STDOUT: call void @_CG.Main.5595bcb1d6932ffa(), !dbg !13
// CHECK:STDOUT: call void @_CG.Main.029df562ae676f5b(), !dbg !14
// CHECK:STDOUT: ret void, !dbg !15
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare i32 @printf(ptr, ...)
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CG.Main.0dbf1a1c1733b53e() !dbg !16 {
// CHECK:STDOUT: define linkonce_odr void @_CG.Main.5595bcb1d6932ffa() !dbg !16 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc37_20.1.temp = alloca i1, align 1, !dbg !17
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc37_20.1.temp), !dbg !17
@@ -80,7 +80,7 @@ fn Run() {
// CHECK:STDOUT: ret void, !dbg !18
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CG.Main.358c93ba71c2d336() !dbg !19 {
// CHECK:STDOUT: define linkonce_odr void @_CG.Main.029df562ae676f5b() !dbg !19 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc37_20.1.temp = alloca i32, align 4, !dbg !20
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc37_20.1.temp), !dbg !20
@@ -118,9 +118,9 @@ fn Run() {
// CHECK:STDOUT: !13 = !DILocation(line: 41, column: 3, scope: !12)
// CHECK:STDOUT: !14 = !DILocation(line: 42, column: 3, scope: !12)
// CHECK:STDOUT: !15 = !DILocation(line: 40, column: 1, scope: !12)
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.0dbf1a1c1733b53e", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.5595bcb1d6932ffa", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !17 = !DILocation(line: 37, column: 16, scope: !16)
// CHECK:STDOUT: !18 = !DILocation(line: 36, column: 1, scope: !16)
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.358c93ba71c2d336", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.029df562ae676f5b", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !20 = !DILocation(line: 37, column: 16, scope: !19)
// CHECK:STDOUT: !21 = !DILocation(line: 36, column: 1, scope: !19)
@@ -30,11 +30,11 @@ fn D[U:! Core.Copy](x: U) -> U {
return x;
}
fn B[U:! Core.Copy](x: U*) {
fn B[U:! Core.Copy & Core.Destroy](x: U*) {
D(*x);
}
fn F[T:! Core.Copy](x: T*) {
fn F[T:! Core.Copy & Core.Destroy](x: T*) {
A(i32);
B(x);
}
@@ -59,26 +59,26 @@ fn M() {
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !7
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !8
// CHECK:STDOUT: %.loc46_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !9
// CHECK:STDOUT: call void @_CF.Main.de631560529e9861(ptr %.loc46_5), !dbg !10
// CHECK:STDOUT: call void @_CF.Main.dedae426f8f6526d(ptr %.loc46_5), !dbg !10
// CHECK:STDOUT: %.loc47_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !11
// CHECK:STDOUT: call void @_CF.Main.3836ccc537683c19(ptr %.loc47_5), !dbg !12
// CHECK:STDOUT: call void @_CF.Main.42589ad6dce0869e(ptr %.loc47_5), !dbg !12
// CHECK:STDOUT: ret void, !dbg !13
// 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)) #0
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.de631560529e9861(ptr %x) !dbg !14 {
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.dedae426f8f6526d(ptr %x) !dbg !14 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %A.call = call %type @_CA.Main.402deed6b8733082(%type zeroinitializer), !dbg !15
// CHECK:STDOUT: call void @_CB.Main.de631560529e9861(ptr %x), !dbg !16
// CHECK:STDOUT: call void @_CB.Main.dedae426f8f6526d(ptr %x), !dbg !16
// CHECK:STDOUT: ret void, !dbg !17
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.3836ccc537683c19(ptr %x) !dbg !18 {
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.42589ad6dce0869e(ptr %x) !dbg !18 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %A.call = call %type @_CA.Main.402deed6b8733082(%type zeroinitializer), !dbg !19
// CHECK:STDOUT: call void @_CB.Main.3836ccc537683c19(ptr %x), !dbg !20
// CHECK:STDOUT: call void @_CB.Main.42589ad6dce0869e(ptr %x), !dbg !20
// CHECK:STDOUT: ret void, !dbg !21
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -87,7 +87,7 @@ fn M() {
// CHECK:STDOUT: ret %type %x, !dbg !23
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.de631560529e9861(ptr %x) !dbg !24 {
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.dedae426f8f6526d(ptr %x) !dbg !24 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc34_7.3.temp = alloca i32, align 4, !dbg !25
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.3.temp), !dbg !25
@@ -97,7 +97,7 @@ fn M() {
// CHECK:STDOUT: ret void, !dbg !27
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.3836ccc537683c19(ptr %x) !dbg !28 {
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.42589ad6dce0869e(ptr %x) !dbg !28 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %.loc34_7.3.temp = alloca double, align 8, !dbg !29
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.3.temp), !dbg !29
@@ -140,21 +140,21 @@ fn M() {
// CHECK:STDOUT: !11 = !DILocation(line: 47, column: 5, scope: !4)
// CHECK:STDOUT: !12 = !DILocation(line: 47, column: 3, scope: !4)
// CHECK:STDOUT: !13 = !DILocation(line: 42, column: 1, scope: !4)
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.de631560529e9861", scope: null, file: !3, line: 37, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.dedae426f8f6526d", scope: null, file: !3, line: 37, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !15 = !DILocation(line: 38, column: 3, scope: !14)
// CHECK:STDOUT: !16 = !DILocation(line: 39, column: 3, scope: !14)
// CHECK:STDOUT: !17 = !DILocation(line: 37, column: 1, scope: !14)
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.3836ccc537683c19", scope: null, file: !3, line: 37, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.42589ad6dce0869e", scope: null, file: !3, line: 37, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !19 = !DILocation(line: 38, column: 3, scope: !18)
// CHECK:STDOUT: !20 = !DILocation(line: 39, column: 3, scope: !18)
// CHECK:STDOUT: !21 = !DILocation(line: 37, column: 1, scope: !18)
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.402deed6b8733082", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !23 = !DILocation(line: 26, column: 3, scope: !22)
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.de631560529e9861", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.dedae426f8f6526d", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !25 = !DILocation(line: 34, column: 3, scope: !24)
// CHECK:STDOUT: !26 = !DILocation(line: 34, column: 5, scope: !24)
// CHECK:STDOUT: !27 = !DILocation(line: 33, column: 1, scope: !24)
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.3836ccc537683c19", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.42589ad6dce0869e", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !29 = !DILocation(line: 34, column: 3, scope: !28)
// CHECK:STDOUT: !30 = !DILocation(line: 34, column: 5, scope: !28)
// CHECK:STDOUT: !31 = !DILocation(line: 33, column: 1, scope: !28)
@@ -14,9 +14,9 @@ interface Copy {
fn Op[self: Self]() -> Self;
}
fn F[T:! Copy](a: T) -> T {
var v: T = a.Op();
return a.Op();
fn F[T:! Copy & Core.Destroy](a: T) -> T {
var v: T = a.(Copy.Op)();
return a.(Copy.Op)();
}
impl i32 as Copy {
@@ -84,7 +84,7 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT:
// CHECK:STDOUT: define i32 @_CF_i32.Main(i32 %a) !dbg !8 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %F.call = call i32 @_CF.Main.c51f5dcf0e081157(i32 %a), !dbg !9
// CHECK:STDOUT: %F.call = call i32 @_CF.Main.91acb171499e2658(i32 %a), !dbg !9
// CHECK:STDOUT: ret i32 %F.call, !dbg !10
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -103,7 +103,7 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT:
// CHECK:STDOUT: define void @_CF_X.Main(ptr sret({ i32, i32 }) %return, ptr %a) !dbg !16 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Main.b1d03582403d0f2e(ptr %return, ptr %a), !dbg !17
// CHECK:STDOUT: call void @_CF.Main.6ef35d4a7684e057(ptr %return, ptr %a), !dbg !17
// CHECK:STDOUT: ret void, !dbg !18
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -114,7 +114,7 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT:
// CHECK:STDOUT: define void @_CF_empty_tuple.Main() !dbg !21 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Main.f0b2e3523ff3fa17(), !dbg !22
// CHECK:STDOUT: call void @_CF.Main.bcfa232a7f7e3dde(), !dbg !22
// CHECK:STDOUT: ret void, !dbg !23
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -133,7 +133,7 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT:
// CHECK:STDOUT: define void @_CF_two_tuple.Main(ptr sret({ i32, i32 }) %return, ptr %a) !dbg !27 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Main.09ed05d6841b72fa(ptr %return, ptr %a), !dbg !28
// CHECK:STDOUT: call void @_CF.Main.fd0a4d4c23847a64(ptr %return, ptr %a), !dbg !28
// CHECK:STDOUT: ret void, !dbg !29
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -152,21 +152,21 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT:
// CHECK:STDOUT: define void @_CF_nested_tuple.Main(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) !dbg !35 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: call void @_CF.Main.6513c914c89dac0d(ptr %return, ptr %a), !dbg !36
// CHECK:STDOUT: call void @_CF.Main.73a97bc8c9926cb5(ptr %return, ptr %a), !dbg !36
// CHECK:STDOUT: ret void, !dbg !37
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.c51f5dcf0e081157(i32 %a) !dbg !38 {
// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.91acb171499e2658(i32 %a) !dbg !38 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %v.var = alloca i32, align 4, !dbg !39
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !39
// CHECK:STDOUT: %.loc18_19 = call i32 @"_COp.Int.Core:Copy.Main"(i32 %a), !dbg !40
// CHECK:STDOUT: store i32 %.loc18_19, ptr %v.var, align 4, !dbg !39
// CHECK:STDOUT: %.loc19_15 = call i32 @"_COp.Int.Core:Copy.Main"(i32 %a), !dbg !41
// CHECK:STDOUT: ret i32 %.loc19_15, !dbg !42
// CHECK:STDOUT: %.loc18_26 = call i32 @"_COp.Int.Core:Copy.Main"(i32 %a), !dbg !40
// CHECK:STDOUT: store i32 %.loc18_26, ptr %v.var, align 4, !dbg !39
// CHECK:STDOUT: %.loc19 = call i32 @"_COp.Int.Core:Copy.Main"(i32 %a), !dbg !41
// CHECK:STDOUT: ret i32 %.loc19, !dbg !42
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.b1d03582403d0f2e(ptr sret({ i32, i32 }) %return, ptr %a) !dbg !43 {
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.6ef35d4a7684e057(ptr sret({ i32, i32 }) %return, ptr %a) !dbg !43 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %v.var = alloca { i32, i32 }, align 8, !dbg !44
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !44
@@ -175,7 +175,7 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT: ret void, !dbg !47
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.f0b2e3523ff3fa17() !dbg !48 {
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.bcfa232a7f7e3dde() !dbg !48 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %v.var = alloca {}, align 8, !dbg !49
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !49
@@ -184,7 +184,7 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT: ret void, !dbg !52
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.09ed05d6841b72fa(ptr sret({ i32, i32 }) %return, ptr %a) !dbg !53 {
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.fd0a4d4c23847a64(ptr sret({ i32, i32 }) %return, ptr %a) !dbg !53 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %v.var = alloca { i32, i32 }, align 8, !dbg !54
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !54
@@ -193,7 +193,7 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT: ret void, !dbg !57
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.6513c914c89dac0d(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) !dbg !58 {
// CHECK:STDOUT: define linkonce_odr void @_CF.Main.73a97bc8c9926cb5(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) !dbg !58 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %v.var = alloca { { i32, i32 }, { i32, i32 } }, align 8, !dbg !59
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !59
@@ -251,27 +251,27 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) {
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "F_nested_tuple", linkageName: "_CF_nested_tuple.Main", scope: null, file: !3, line: 73, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !36 = !DILocation(line: 74, column: 10, scope: !35)
// CHECK:STDOUT: !37 = !DILocation(line: 74, column: 3, scope: !35)
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c51f5dcf0e081157", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.91acb171499e2658", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !39 = !DILocation(line: 18, column: 3, scope: !38)
// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 14, scope: !38)
// CHECK:STDOUT: !41 = !DILocation(line: 19, column: 10, scope: !38)
// CHECK:STDOUT: !42 = !DILocation(line: 19, column: 3, scope: !38)
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b1d03582403d0f2e", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.6ef35d4a7684e057", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !44 = !DILocation(line: 18, column: 3, scope: !43)
// CHECK:STDOUT: !45 = !DILocation(line: 18, column: 14, scope: !43)
// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 10, scope: !43)
// CHECK:STDOUT: !47 = !DILocation(line: 19, column: 3, scope: !43)
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f0b2e3523ff3fa17", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bcfa232a7f7e3dde", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !49 = !DILocation(line: 18, column: 3, scope: !48)
// CHECK:STDOUT: !50 = !DILocation(line: 18, column: 14, scope: !48)
// CHECK:STDOUT: !51 = !DILocation(line: 19, column: 10, scope: !48)
// CHECK:STDOUT: !52 = !DILocation(line: 19, column: 3, scope: !48)
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.09ed05d6841b72fa", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.fd0a4d4c23847a64", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !54 = !DILocation(line: 18, column: 3, scope: !53)
// CHECK:STDOUT: !55 = !DILocation(line: 18, column: 14, scope: !53)
// CHECK:STDOUT: !56 = !DILocation(line: 19, column: 10, scope: !53)
// CHECK:STDOUT: !57 = !DILocation(line: 19, column: 3, scope: !53)
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.6513c914c89dac0d", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.73a97bc8c9926cb5", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !59 = !DILocation(line: 18, column: 3, scope: !58)
// CHECK:STDOUT: !60 = !DILocation(line: 18, column: 14, scope: !58)
// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 10, scope: !58)