mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Start plumbing through debug info type information with function parameters/return value (#6410)
This adds just enough debug info for i32/int parameters and return
values, with a path forward for adding DWARF type metadata for other
types.
As it happens, return type information is carried separately from
parameter information:
* Return type information is carried in the `type` of the `DISubprogram`
(as a `DISubroutineType` - which does carry parameter type information
as well, but that's unused when the DWARF is emitted by LLVM)
* Parameter information is carried by `DILocalVariable`s with a non-zero
`arg` value (representing the order of function parameters)
In the absence of locations for the parameters (future work), nothing
would usually keep the `DILocalVariable` live/reachable when emitting
DWARF - so for cases where this can happen (for clang, this happens in
optimized builds where all references to the parameter variable might be
optimized away) the variables can be "retained" in a list on the
`DISubprogram` - achieved by passing `AlwaysPreserve` parameter to
`createParameterVariable` (adds them to a list, then that list gets
attached to the `DISubprogram` when it's finalized later)
For now, any unsupported types are emitted as `void*` (except void
return, which is implemented as void) as a placeholder.
Given this example:
```
import Core library "io";
class MyClass {
}
fn Unsupported(v: MyClass) {
}
fn Ret() -> i32 {
return 42;
}
fn Arg(x: i32) {
Core.Print(x);
}
fn Run() {
}
```
this is the resulting DWARF:
```
DW_TAG_compile_unit
DW_AT_name ("test.carbon")
DW_TAG_subprogram
DW_AT_name ("Unsupported")
DW_TAG_formal_parameter
DW_AT_type (0x00000066 "void *")
DW_TAG_subprogram
DW_AT_name ("Ret")
DW_AT_type (0x00000062 "int")
DW_TAG_subprogram
DW_AT_name ("Arg")
DW_TAG_formal_parameter
DW_AT_type (0x00000062 "int")
DW_TAG_subprogram
DW_AT_name ("Run")
DW_TAG_base_type
DW_AT_name ("int")
DW_TAG_pointer_type
```
And the debugger:
```
(gdb) p Ret()
$1 = 42
(gdb) p Arg(4)
4
$2 = void
```
I'm not sure if there's a way this logic should be merged with the logic
for making the `llvm::Function` type (which the `DISubroutineType`
building code was inspired by/copied from) - since they're done at
different times/places, I don't think there's an easy way to do it in
one pass, but maybe the code can be shared (even if it's run twice) in
some generic `SemIR::Function` type walker.
---------
Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
co-authored by
Dana Jansens
parent
0baa74d96f
commit
a179bd461b
+42
-28
@@ -66,18 +66,18 @@ fn Call(b: Cpp.B*) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CConvertPtr.Main(ptr %p) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_11.2.base = getelementptr inbounds nuw [8 x i8], ptr %p, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: ret ptr %.loc7_11.2.base, !dbg !10
|
||||
// CHECK:STDOUT: %.loc7_11.2.base = getelementptr inbounds nuw [8 x i8], ptr %p, i32 0, i32 0, !dbg !13
|
||||
// CHECK:STDOUT: ret ptr %.loc7_11.2.base, !dbg !13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_CAcceptVal.Main(ptr)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CConvertVal.Main(ptr %b) #0 !dbg !11 {
|
||||
// CHECK:STDOUT: define void @_CConvertVal.Main(ptr %b) #0 !dbg !14 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc13_13.1.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !12
|
||||
// CHECK:STDOUT: call void @_CAcceptVal.Main(ptr %.loc13_13.1.base), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: %.loc13_13.1.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !19
|
||||
// CHECK:STDOUT: call void @_CAcceptVal.Main(ptr %.loc13_13.1.base), !dbg !20
|
||||
// CHECK:STDOUT: ret void, !dbg !21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -92,14 +92,21 @@ fn Call(b: Cpp.B*) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "convert.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "ConvertPtr", linkageName: "_CConvertPtr.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "ConvertPtr", linkageName: "_CConvertPtr.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ConvertVal", linkageName: "_CConvertVal.Main", scope: null, file: !6, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 13, column: 13, scope: !11)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 13, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 12, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: !9 = !{!10, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "ConvertVal", linkageName: "_CConvertVal.Main", scope: null, file: !6, line: 12, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !17)
|
||||
// CHECK:STDOUT: !15 = !DISubroutineType(types: !16)
|
||||
// CHECK:STDOUT: !16 = !{null, !10}
|
||||
// CHECK:STDOUT: !17 = !{!18}
|
||||
// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !14, type: !10)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 13, column: 13, scope: !14)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 1, scope: !14)
|
||||
// CHECK:STDOUT: ; ModuleID = 'access_field.carbon'
|
||||
// CHECK:STDOUT: source_filename = "access_field.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -108,10 +115,10 @@ fn Call(b: Cpp.B*) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CAccessVal.Main(ptr %b) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_11.1.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: %.loc7_11.3.a = getelementptr inbounds nuw [4 x i8], ptr %.loc7_11.1.base, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: %.loc7_11.4 = load i32, ptr %.loc7_11.3.a, align 4, !dbg !10
|
||||
// CHECK:STDOUT: ret i32 %.loc7_11.4, !dbg !11
|
||||
// CHECK:STDOUT: %.loc7_11.1.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !14
|
||||
// CHECK:STDOUT: %.loc7_11.3.a = getelementptr inbounds nuw [4 x i8], ptr %.loc7_11.1.base, i32 0, i32 0, !dbg !14
|
||||
// CHECK:STDOUT: %.loc7_11.4 = load i32, ptr %.loc7_11.3.a, align 4, !dbg !14
|
||||
// CHECK:STDOUT: ret i32 %.loc7_11.4, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -126,11 +133,15 @@ fn Call(b: Cpp.B*) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "access_field.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AccessVal", linkageName: "_CAccessVal.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AccessVal", linkageName: "_CAccessVal.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !12)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{!10, !11}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !12 = !{!13}
|
||||
// CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !7, type: !11)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'call_method.carbon'
|
||||
// CHECK:STDOUT: source_filename = "call_method.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -141,9 +152,9 @@ fn Call(b: Cpp.B*) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCall.Main(ptr %b) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_4.2.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: call void @_ZN1A1fEv(ptr %.loc7_4.2.base), !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !11
|
||||
// CHECK:STDOUT: %.loc7_4.2.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !13
|
||||
// CHECK:STDOUT: call void @_ZN1A1fEv(ptr %.loc7_4.2.base), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress noinline nounwind optnone
|
||||
@@ -168,8 +179,11 @@ fn Call(b: Cpp.B*) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call_method.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{null, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
|
||||
+1
-1
@@ -109,6 +109,6 @@ fn F() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_default.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 18, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
|
||||
+25
-18
@@ -157,7 +157,7 @@ fn Call() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "pass_as_arg.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Pass", linkageName: "_CPass.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 11, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 8, column: 11, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 11, scope: !7)
|
||||
@@ -190,18 +190,18 @@ fn Call() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CConvertEnumToI16.Main(i16 %e) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_CTakeI16.Main(i16 %e), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: call void @_CTakeI16.Main(i16 %e), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CConvertI16ToEnum.Main(i16 %n) #0 !dbg !15 {
|
||||
// CHECK:STDOUT: define void @_CConvertI16ToEnum.Main(i16 %n) #0 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc17_13.3.temp = alloca i16, align 2, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_13.3.temp), !dbg !16
|
||||
// CHECK:STDOUT: store i16 %n, ptr %.loc17_13.3.temp, align 2, !dbg !16
|
||||
// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk(ptr %.loc17_13.3.temp), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: %.loc17_13.3.temp = alloca i16, align 2, !dbg !23
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_13.3.temp), !dbg !23
|
||||
// CHECK:STDOUT: store i16 %n, ptr %.loc17_13.3.temp, align 2, !dbg !23
|
||||
// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk(ptr %.loc17_13.3.temp), !dbg !24
|
||||
// CHECK:STDOUT: ret void, !dbg !25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -237,16 +237,23 @@ fn Call() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "convert.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassEnum", linkageName: "_CPassEnum.Main", scope: null, file: !6, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 8, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ConvertEnumToI16", linkageName: "_CConvertEnumToI16.Main", scope: null, file: !6, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 13, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 12, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "ConvertI16ToEnum", linkageName: "_CConvertI16ToEnum.Main", scope: null, file: !6, line: 16, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 17, column: 11, scope: !15)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 17, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 1, scope: !15)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ConvertEnumToI16", linkageName: "_CConvertEnumToI16.Main", scope: null, file: !6, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !16)
|
||||
// CHECK:STDOUT: !13 = !DISubroutineType(types: !14)
|
||||
// CHECK:STDOUT: !14 = !{null, !15}
|
||||
// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !16 = !{!17}
|
||||
// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 13, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 12, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "ConvertI16ToEnum", linkageName: "_CConvertI16ToEnum.Main", scope: null, file: !6, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21)
|
||||
// CHECK:STDOUT: !21 = !{!22}
|
||||
// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !15)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 17, column: 11, scope: !20)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 17, column: 3, scope: !20)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 16, column: 1, scope: !20)
|
||||
// CHECK:STDOUT: ; ModuleID = 'use_bitmask.carbon'
|
||||
// CHECK:STDOUT: source_filename = "use_bitmask.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -275,6 +282,6 @@ fn Call() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "use_bitmask.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 11, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 10, column: 1, scope: !7)
|
||||
|
||||
+19
-14
@@ -130,7 +130,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_extern_c_function.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'extern_c_function_with_cpp_overload_set.carbon'
|
||||
@@ -164,7 +164,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "extern_c_function_with_cpp_overload_set.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 9, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 10, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 11, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 1, scope: !7)
|
||||
@@ -178,8 +178,8 @@ fn MyF() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7 = load i32, ptr @foo, align 4, !dbg !10
|
||||
// CHECK:STDOUT: ret i32 %.loc7, !dbg !11
|
||||
// CHECK:STDOUT: %.loc7 = load i32, ptr @foo, align 4, !dbg !11
|
||||
// CHECK:STDOUT: ret i32 %.loc7, !dbg !12
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -196,9 +196,10 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_extern_c_variable.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{!10}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_extern_c_with_special_name.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_extern_c_with_special_name.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -209,8 +210,8 @@ fn MyF() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main(ptr sret({}) %return, ptr %a, ptr %b) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Zpl1XS_.carbon_thunk(ptr %a, ptr %b, ptr %return), !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !11
|
||||
// CHECK:STDOUT: call void @_Zpl1XS_.carbon_thunk(ptr %a, ptr %b, ptr %return), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress
|
||||
@@ -248,11 +249,15 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_extern_c_with_special_name.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{!10, !10, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12, !13}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocalVariable(arg: 2, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_extern_c_with_asm_label.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_extern_c_with_asm_label.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -281,6 +286,6 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_extern_c_with_asm_label.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
|
||||
+100
-72
@@ -116,17 +116,17 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc9_11.1.n = getelementptr inbounds nuw [32 x i8], ptr %a, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: %.loc9_11.2 = load i32, ptr %.loc9_11.1.n, align 4, !dbg !10
|
||||
// CHECK:STDOUT: ret i32 %.loc9_11.2, !dbg !11
|
||||
// CHECK:STDOUT: %.loc9_11.1.n = getelementptr inbounds nuw [32 x i8], ptr %a, i32 0, i32 0, !dbg !14
|
||||
// CHECK:STDOUT: %.loc9_11.2 = load i32, ptr %.loc9_11.1.n, align 4, !dbg !14
|
||||
// CHECK:STDOUT: ret i32 %.loc9_11.2, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !16 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc13_11.1.m = getelementptr inbounds nuw [32 x i8], ptr %a, i32 0, i32 16, !dbg !13
|
||||
// CHECK:STDOUT: %.loc13_11.2 = load i32, ptr %.loc13_11.1.m, align 4, !dbg !13
|
||||
// CHECK:STDOUT: ret i32 %.loc13_11.2, !dbg !14
|
||||
// CHECK:STDOUT: %.loc13_11.1.m = getelementptr inbounds nuw [32 x i8], ptr %a, i32 0, i32 16, !dbg !19
|
||||
// CHECK:STDOUT: %.loc13_11.2 = load i32, ptr %.loc13_11.1.m, align 4, !dbg !19
|
||||
// CHECK:STDOUT: ret i32 %.loc13_11.2, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -141,14 +141,20 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "access_struct.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !6, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !6, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !12)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 9, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !6, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 13, column: 10, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 13, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !9 = !{!10, !11}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !12 = !{!13}
|
||||
// CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !7, type: !11)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 9, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !6, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !17)
|
||||
// CHECK:STDOUT: !17 = !{!18}
|
||||
// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !16, type: !11)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 13, column: 10, scope: !16)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 3, scope: !16)
|
||||
// CHECK:STDOUT: ; ModuleID = 'assign_struct.carbon'
|
||||
// CHECK:STDOUT: source_filename = "assign_struct.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -157,17 +163,17 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CAssignN.Main(ptr %p) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc9_4.2.n = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc9_4.2.n, align 4, !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !11
|
||||
// CHECK:STDOUT: %.loc9_4.2.n = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 0, !dbg !13
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc9_4.2.n, align 4, !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !15 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc13_4.2.m = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 16, !dbg !13
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc13_4.2.m, align 4, !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: %.loc13_4.2.m = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 16, !dbg !18
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc13_4.2.m, align 4, !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -182,14 +188,19 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "assign_struct.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !6, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !6, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 8, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !6, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 13, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 12, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !9 = !{null, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !6, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !16)
|
||||
// CHECK:STDOUT: !16 = !{!17}
|
||||
// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !15, type: !10)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 13, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 12, column: 1, scope: !15)
|
||||
// CHECK:STDOUT: ; ModuleID = 'access_union.carbon'
|
||||
// CHECK:STDOUT: source_filename = "access_union.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -198,17 +209,17 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !10
|
||||
// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !11
|
||||
// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !14
|
||||
// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !14
|
||||
// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !16 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc11_11.1.m = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !13
|
||||
// CHECK:STDOUT: %.loc11_11.2 = load i32, ptr %.loc11_11.1.m, align 4, !dbg !13
|
||||
// CHECK:STDOUT: ret i32 %.loc11_11.2, !dbg !14
|
||||
// CHECK:STDOUT: %.loc11_11.1.m = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !19
|
||||
// CHECK:STDOUT: %.loc11_11.2 = load i32, ptr %.loc11_11.1.m, align 4, !dbg !19
|
||||
// CHECK:STDOUT: ret i32 %.loc11_11.2, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -223,14 +234,20 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "access_union.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !12)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 11, column: 10, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 11, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !9 = !{!10, !11}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !12 = !{!13}
|
||||
// CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !7, type: !11)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !17)
|
||||
// CHECK:STDOUT: !17 = !{!18}
|
||||
// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !16, type: !11)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 10, scope: !16)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 11, column: 3, scope: !16)
|
||||
// CHECK:STDOUT: ; ModuleID = 'assign_union.carbon'
|
||||
// CHECK:STDOUT: source_filename = "assign_union.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -239,17 +256,17 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CAssignN.Main(ptr %p) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_4.2.n = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc7_4.2.n, align 4, !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !11
|
||||
// CHECK:STDOUT: %.loc7_4.2.n = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !13
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc7_4.2.n, align 4, !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !15 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc11_4.2.m = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !13
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc11_4.2.m, align 4, !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: %.loc11_4.2.m = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !18
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc11_4.2.m, align 4, !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -264,14 +281,19 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "assign_union.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 11, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 10, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !9 = !{null, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !16)
|
||||
// CHECK:STDOUT: !16 = !{!17}
|
||||
// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !15, type: !10)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 10, column: 1, scope: !15)
|
||||
// CHECK:STDOUT: ; ModuleID = 'access_anon_union.carbon'
|
||||
// CHECK:STDOUT: source_filename = "access_anon_union.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -280,18 +302,18 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !10
|
||||
// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !10
|
||||
// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !11
|
||||
// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !14
|
||||
// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !14
|
||||
// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CAccessP.Main(ptr %a) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define i32 @_CAccessP.Main(ptr %a) #0 !dbg !16 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc11_12.1.p = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !13
|
||||
// CHECK:STDOUT: %.loc11_12.2 = load ptr, ptr %.loc11_12.1.p, align 8, !dbg !13
|
||||
// CHECK:STDOUT: %.loc11_10.2 = load i32, ptr %.loc11_12.2, align 4, !dbg !14
|
||||
// CHECK:STDOUT: ret i32 %.loc11_10.2, !dbg !15
|
||||
// CHECK:STDOUT: %.loc11_12.1.p = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !19
|
||||
// CHECK:STDOUT: %.loc11_12.2 = load ptr, ptr %.loc11_12.1.p, align 8, !dbg !19
|
||||
// CHECK:STDOUT: %.loc11_10.2 = load i32, ptr %.loc11_12.2, align 4, !dbg !20
|
||||
// CHECK:STDOUT: ret i32 %.loc11_10.2, !dbg !21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -306,12 +328,18 @@ fn AccessP(a: Cpp.A) -> i32 {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "access_anon_union.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !12)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AccessP", linkageName: "_CAccessP.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 11, column: 11, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 11, column: 10, scope: !12)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 11, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !9 = !{!10, !11}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !12 = !{!13}
|
||||
// CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !7, type: !11)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "AccessP", linkageName: "_CAccessP.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !17)
|
||||
// CHECK:STDOUT: !17 = !{!18}
|
||||
// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !16, type: !11)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 11, scope: !16)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 11, column: 10, scope: !16)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 3, scope: !16)
|
||||
|
||||
@@ -159,7 +159,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_function_decl.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_inline_function_decl.carbon'
|
||||
@@ -197,7 +197,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_inline_function_decl.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_inline_used_function_decl.carbon'
|
||||
@@ -240,7 +240,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_inline_used_function_decl.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_multiple_inline_function_decls.carbon'
|
||||
@@ -296,7 +296,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_multiple_inline_function_decls.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
@@ -346,7 +346,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_inline_recursive_function_decl.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'call_with_default_args.carbon'
|
||||
@@ -428,7 +428,7 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call_with_default_args.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 11, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
|
||||
@@ -67,6 +67,6 @@ fn F() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "use_class_template.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
|
||||
+1
-1
@@ -58,5 +58,5 @@ fn MyF() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_global.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
|
||||
+12
-11
@@ -32,12 +32,12 @@ fn Call() -> i32 {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CCall.Main() #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !10
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !10
|
||||
// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !10
|
||||
// CHECK:STDOUT: call void @_Z1FPi(ptr %n.var), !dbg !11
|
||||
// CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !12
|
||||
// CHECK:STDOUT: ret i32 %.loc24, !dbg !13
|
||||
// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !11
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !11
|
||||
// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !11
|
||||
// CHECK:STDOUT: call void @_Z1FPi(ptr %n.var), !dbg !12
|
||||
// CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !13
|
||||
// CHECK:STDOUT: ret i32 %.loc24, !dbg !14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -69,8 +69,9 @@ fn Call() -> i32 {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_inline.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 21, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 22, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 23, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 24, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 24, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{!10}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 22, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 23, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 24, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 24, column: 3, scope: !7)
|
||||
|
||||
+62
-46
@@ -86,8 +86,8 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %by_val__carbon_thunk.call = call i32 @_ZNK1A6by_valEv.carbon_thunk(ptr %a), !dbg !10
|
||||
// CHECK:STDOUT: ret i32 %by_val__carbon_thunk.call, !dbg !11
|
||||
// CHECK:STDOUT: %by_val__carbon_thunk.call = call i32 @_ZNK1A6by_valEv.carbon_thunk(ptr %a), !dbg !14
|
||||
// CHECK:STDOUT: ret i32 %by_val__carbon_thunk.call, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress
|
||||
@@ -95,7 +95,7 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %this.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !nonnull !9, !align !12
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !nonnull !16, !align !17
|
||||
// CHECK:STDOUT: %call = call i32 @_ZNK1A6by_valEv(ptr nonnull align 8 dereferenceable(12) %0)
|
||||
// CHECK:STDOUT: ret i32 %call
|
||||
// CHECK:STDOUT: }
|
||||
@@ -125,12 +125,17 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call_by_val.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !12)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !{i64 8}
|
||||
// CHECK:STDOUT: !9 = !{!10, !11}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !12 = !{!13}
|
||||
// CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !7, type: !11)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = !{}
|
||||
// CHECK:STDOUT: !17 = !{i64 8}
|
||||
// CHECK:STDOUT: ; ModuleID = 'call_by_ref.carbon'
|
||||
// CHECK:STDOUT: source_filename = "call_by_ref.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -144,8 +149,8 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %A.by_ref.call = call i32 @_ZN1A6by_refEv(ptr %a), !dbg !10
|
||||
// CHECK:STDOUT: ret i32 %A.by_ref.call, !dbg !11
|
||||
// CHECK:STDOUT: %A.by_ref.call = call i32 @_ZN1A6by_refEv(ptr %a), !dbg !14
|
||||
// CHECK:STDOUT: ret i32 %A.by_ref.call, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress noinline nounwind optnone
|
||||
@@ -172,11 +177,15 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call_by_ref.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !12)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{!10, !11}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !12 = !{!13}
|
||||
// CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !7, type: !11)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'call_virtual.carbon'
|
||||
// CHECK:STDOUT: source_filename = "call_virtual.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -185,16 +194,16 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CUseVal.Main(ptr %a) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_4.2.base = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: %Base.virt0.call.vtable = load ptr, ptr %.loc7_4.2.base, align 8, !dbg !10
|
||||
// CHECK:STDOUT: %Base.virt0.call = getelementptr ptr, ptr %Base.virt0.call.vtable, i32 0, !dbg !10
|
||||
// CHECK:STDOUT: %Base.virt0.call.memptr.virtualfn = load ptr, ptr %Base.virt0.call, align 8, !dbg !10
|
||||
// CHECK:STDOUT: call void %Base.virt0.call.memptr.virtualfn(ptr %.loc7_4.2.base), !dbg !10
|
||||
// CHECK:STDOUT: %A.virt1.call.vtable = load ptr, ptr %a, align 8, !dbg !11
|
||||
// CHECK:STDOUT: %A.virt1.call = getelementptr ptr, ptr %A.virt1.call.vtable, i32 1, !dbg !11
|
||||
// CHECK:STDOUT: %A.virt1.call.memptr.virtualfn = load ptr, ptr %A.virt1.call, align 8, !dbg !11
|
||||
// CHECK:STDOUT: call void %A.virt1.call.memptr.virtualfn(ptr %a), !dbg !11
|
||||
// CHECK:STDOUT: ret void, !dbg !12
|
||||
// CHECK:STDOUT: %.loc7_4.2.base = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 0, !dbg !13
|
||||
// CHECK:STDOUT: %Base.virt0.call.vtable = load ptr, ptr %.loc7_4.2.base, align 8, !dbg !13
|
||||
// CHECK:STDOUT: %Base.virt0.call = getelementptr ptr, ptr %Base.virt0.call.vtable, i32 0, !dbg !13
|
||||
// CHECK:STDOUT: %Base.virt0.call.memptr.virtualfn = load ptr, ptr %Base.virt0.call, align 8, !dbg !13
|
||||
// CHECK:STDOUT: call void %Base.virt0.call.memptr.virtualfn(ptr %.loc7_4.2.base), !dbg !13
|
||||
// CHECK:STDOUT: %A.virt1.call.vtable = load ptr, ptr %a, align 8, !dbg !14
|
||||
// CHECK:STDOUT: %A.virt1.call = getelementptr ptr, ptr %A.virt1.call.vtable, i32 1, !dbg !14
|
||||
// CHECK:STDOUT: %A.virt1.call.memptr.virtualfn = load ptr, ptr %A.virt1.call, align 8, !dbg !14
|
||||
// CHECK:STDOUT: call void %A.virt1.call.memptr.virtualfn(ptr %a), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_ZN4Base5virt0Ev(ptr)
|
||||
@@ -213,12 +222,15 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call_virtual.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{null, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'call_thunk.carbon'
|
||||
// CHECK:STDOUT: source_filename = "call_thunk.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -229,15 +241,15 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCall.Main(ptr %n) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_14.3.temp = alloca i8, align 1, !dbg !10
|
||||
// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !11
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !10
|
||||
// CHECK:STDOUT: store i8 1, ptr %.loc7_14.3.temp, align 1, !dbg !10
|
||||
// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk(ptr %n, ptr %.loc7_14.3.temp), !dbg !12
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !11
|
||||
// CHECK:STDOUT: store i8 1, ptr %.loc8_14.3.temp, align 1, !dbg !11
|
||||
// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk(ptr %n, ptr %.loc8_14.3.temp), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: %.loc7_14.3.temp = alloca i8, align 1, !dbg !13
|
||||
// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !13
|
||||
// CHECK:STDOUT: store i8 1, ptr %.loc7_14.3.temp, align 1, !dbg !13
|
||||
// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk(ptr %n, ptr %.loc7_14.3.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !14
|
||||
// CHECK:STDOUT: store i8 1, ptr %.loc8_14.3.temp, align 1, !dbg !14
|
||||
// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk(ptr %n, ptr %.loc8_14.3.temp), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -250,7 +262,7 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: %c.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8
|
||||
// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !nonnull !9
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !nonnull !18
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8
|
||||
// CHECK:STDOUT: %2 = load i8, ptr %1, align 1
|
||||
// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa(ptr nonnull align 1 dereferenceable(1) %0, i8 signext %2)
|
||||
@@ -294,11 +306,15 @@ fn Call(n: Cpp.NeedThunk) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call_thunk.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 14, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 8, column: 14, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{null, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 14, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 14, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !18 = !{}
|
||||
|
||||
+72
-65
@@ -78,59 +78,59 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #0 !dbg !15 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !16
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !17
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !19
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !18 {
|
||||
// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !21 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !19
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !20
|
||||
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !19
|
||||
// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !21
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !21
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !22
|
||||
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !22
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !23
|
||||
// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !22
|
||||
// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !24
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !24
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !23 {
|
||||
// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !26 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !24
|
||||
// CHECK:STDOUT: %.loc27_44.1.temp = alloca ptr, align 8, !dbg !25
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !24
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_44.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc27_44.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: %.loc27_44.2 = load ptr, ptr %.loc27_44.1.temp, align 8, !dbg !25
|
||||
// CHECK:STDOUT: store ptr %.loc27_44.2, ptr %a.var, align 8, !dbg !24
|
||||
// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !26
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4"(ptr %.loc28_10), !dbg !27
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !28 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !29
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !29
|
||||
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc32_28.1.temp), !dbg !29
|
||||
// CHECK:STDOUT: %.loc32_28.2 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !29
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4"(ptr %.loc32_28.2), !dbg !30
|
||||
// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !27
|
||||
// CHECK:STDOUT: %.loc27_44.1.temp = alloca ptr, align 8, !dbg !28
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !27
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_44.1.temp), !dbg !28
|
||||
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc27_44.1.temp), !dbg !28
|
||||
// CHECK:STDOUT: %.loc27_44.2 = load ptr, ptr %.loc27_44.1.temp, align 8, !dbg !28
|
||||
// CHECK:STDOUT: store ptr %.loc27_44.2, ptr %a.var, align 8, !dbg !27
|
||||
// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !29
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4"(ptr %.loc28_10), !dbg !30
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !30
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !31 {
|
||||
// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4"(ptr poison), !dbg !32
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !32
|
||||
// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !32
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !32
|
||||
// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc32_28.1.temp), !dbg !32
|
||||
// CHECK:STDOUT: %.loc32_28.2 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !32
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4"(ptr %.loc32_28.2), !dbg !33
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4"(ptr %self) #0 !dbg !33 {
|
||||
// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.e49c05a5c9dc9c86(), !dbg !35
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !36
|
||||
// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !34 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4"(ptr poison), !dbg !35
|
||||
// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !35
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4"(ptr %self) #0 !dbg !36 {
|
||||
// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.e49c05a5c9dc9c86(), !dbg !42
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !43
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -139,8 +139,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: declare ptr @_CMake.NullptrT.CppCompat.Core()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.e49c05a5c9dc9c86() #0 !dbg !37 {
|
||||
// CHECK:STDOUT: ret ptr null, !dbg !39
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.e49c05a5c9dc9c86() #0 !dbg !44 {
|
||||
// CHECK:STDOUT: ret ptr null, !dbg !46
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress
|
||||
@@ -189,34 +189,41 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "simple.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassNullptr", linkageName: "_CPassNullptr.Main", scope: null, file: !6, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 12, column: 15, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 14, column: 19, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 12, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 11, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !6, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 18, column: 10, scope: !15)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 18, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !6, line: 21, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 22, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 22, column: 26, scope: !18)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 10, scope: !18)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 23, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !6, line: 26, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 27, column: 3, scope: !23)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 27, column: 26, scope: !23)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 28, column: 10, scope: !23)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 28, column: 3, scope: !23)
|
||||
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !6, line: 31, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 32, column: 10, scope: !28)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 32, column: 3, scope: !28)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !6, line: 35, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 36, column: 3, scope: !31)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4", scope: null, file: !34, line: 46, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !34 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "")
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 47, column: 14, scope: !33)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 47, column: 7, scope: !33)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.e49c05a5c9dc9c86", scope: null, file: !38, line: 26, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !38 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
|
||||
// CHECK:STDOUT: !39 = !DILocation(line: 27, column: 5, scope: !37)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !6, line: 17, type: !16, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !16 = !DISubroutineType(types: !17)
|
||||
// CHECK:STDOUT: !17 = !{!18}
|
||||
// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 18, column: 10, scope: !15)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 18, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !6, line: 21, type: !16, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 22, column: 3, scope: !21)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 22, column: 26, scope: !21)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 23, column: 10, scope: !21)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 23, column: 3, scope: !21)
|
||||
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !6, line: 26, type: !16, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 27, column: 3, scope: !26)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 27, column: 26, scope: !26)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 28, column: 10, scope: !26)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 28, column: 3, scope: !26)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !6, line: 31, type: !16, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 32, column: 10, scope: !31)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 32, column: 3, scope: !31)
|
||||
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !6, line: 35, type: !16, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 36, column: 3, scope: !34)
|
||||
// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.Core.b88d1103f417c6d4", scope: null, file: !37, line: 46, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !40)
|
||||
// CHECK:STDOUT: !37 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "")
|
||||
// CHECK:STDOUT: !38 = !DISubroutineType(types: !39)
|
||||
// CHECK:STDOUT: !39 = !{!18, !18}
|
||||
// CHECK:STDOUT: !40 = !{!41}
|
||||
// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !36, type: !18)
|
||||
// CHECK:STDOUT: !42 = !DILocation(line: 47, column: 14, scope: !36)
|
||||
// CHECK:STDOUT: !43 = !DILocation(line: 47, column: 7, scope: !36)
|
||||
// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.e49c05a5c9dc9c86", scope: null, file: !45, line: 26, type: !16, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !45 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 27, column: 5, scope: !44)
|
||||
|
||||
+50
-38
@@ -140,26 +140,26 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #0 !dbg !17 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !18
|
||||
// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !19
|
||||
// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !20
|
||||
// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !18
|
||||
// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc17_18.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !19
|
||||
// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !19
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc18_18.3.temp), !dbg !23
|
||||
// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !20
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !20
|
||||
// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !20
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc19_18.2.temp), !dbg !24
|
||||
// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !21
|
||||
// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc20_28.3.temp), !dbg !25
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !25
|
||||
// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !26
|
||||
// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !27
|
||||
// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !28
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc17_18.1.temp), !dbg !29
|
||||
// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !26
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !26
|
||||
// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !26
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc18_18.3.temp), !dbg !30
|
||||
// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !27
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !27
|
||||
// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !27
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc19_18.2.temp), !dbg !31
|
||||
// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !28
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !28
|
||||
// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !28
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk(ptr %.loc20_28.3.temp), !dbg !32
|
||||
// CHECK:STDOUT: ret void, !dbg !33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -244,7 +244,7 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_ints.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 19, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 22, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 21, scope: !7)
|
||||
@@ -252,16 +252,23 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !6, line: 16, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 18, scope: !17)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 18, column: 18, scope: !17)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 19, column: 18, scope: !17)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 20, column: 18, scope: !17)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 17, column: 3, scope: !17)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 18, column: 3, scope: !17)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 19, column: 3, scope: !17)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 20, column: 3, scope: !17)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 16, column: 1, scope: !17)
|
||||
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !6, line: 16, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !22)
|
||||
// CHECK:STDOUT: !18 = !DISubroutineType(types: !19)
|
||||
// CHECK:STDOUT: !19 = !{null, !20, !21}
|
||||
// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !22 = !{!23, !24}
|
||||
// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !17, type: !20)
|
||||
// CHECK:STDOUT: !24 = !DILocalVariable(arg: 2, scope: !17, type: !21)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 17, column: 18, scope: !17)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 18, column: 18, scope: !17)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 19, column: 18, scope: !17)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 20, column: 18, scope: !17)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 17, column: 3, scope: !17)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 18, column: 3, scope: !17)
|
||||
// CHECK:STDOUT: !31 = !DILocation(line: 19, column: 3, scope: !17)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 20, column: 3, scope: !17)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 16, column: 1, scope: !17)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_struct.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_struct.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -331,7 +338,7 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_struct.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
@@ -375,8 +382,8 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk(ptr %y), !dbg !21
|
||||
// CHECK:STDOUT: ret void, !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk(ptr %y), !dbg !26
|
||||
// CHECK:STDOUT: ret void, !dbg !27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -418,7 +425,7 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_class_with_nontrivial_copy.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
@@ -429,6 +436,11 @@ fn PassValueExpr(y: Cpp.Y) {
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 17, column: 19, scope: !16)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 3, scope: !16)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 1, scope: !16)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !6, line: 20, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 21, column: 3, scope: !20)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 20, column: 1, scope: !20)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !6, line: 20, type: !21, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !24)
|
||||
// CHECK:STDOUT: !21 = !DISubroutineType(types: !22)
|
||||
// CHECK:STDOUT: !22 = !{null, !23}
|
||||
// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !24 = !{!25}
|
||||
// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 21, column: 3, scope: !20)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 20, column: 1, scope: !20)
|
||||
|
||||
+126
-98
@@ -98,33 +98,33 @@ fn ReturnPtrWithThunk() -> Core.Optional(Cpp.C*) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %p) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %p), !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !11
|
||||
// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %p), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z7TakePtrP1C(ptr)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !15 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !13
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !14
|
||||
// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !18
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare ptr @_Z9ReturnPtrv()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %p) #0 !dbg !15 {
|
||||
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %p) #0 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr %p), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr %p), !dbg !23
|
||||
// CHECK:STDOUT: ret void, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !18 {
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk0(), !dbg !19
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !20
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk0(), !dbg !26
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress
|
||||
@@ -162,20 +162,27 @@ fn ReturnPtrWithThunk() -> Core.Optional(Cpp.C*) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "nonnull.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !6, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !6, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 15, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 14, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !6, line: 18, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 19, column: 10, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 19, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !6, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 23, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 22, column: 1, scope: !15)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !6, line: 26, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 27, column: 10, scope: !18)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 27, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !9 = !{null, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 15, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 14, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !6, line: 18, type: !16, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !16 = !DISubroutineType(types: !17)
|
||||
// CHECK:STDOUT: !17 = !{!10}
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 19, column: 10, scope: !15)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 19, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !6, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21)
|
||||
// CHECK:STDOUT: !21 = !{!22}
|
||||
// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !10)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 23, column: 3, scope: !20)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 22, column: 1, scope: !20)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !6, line: 26, type: !16, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 27, column: 10, scope: !25)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 27, column: 3, scope: !25)
|
||||
// CHECK:STDOUT: ; ModuleID = 'nullable.carbon'
|
||||
// CHECK:STDOUT: source_filename = "nullable.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -184,85 +191,85 @@ fn ReturnPtrWithThunk() -> Core.Optional(Cpp.C*) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %p) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !11 {
|
||||
// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !14 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc22_15.2.temp = alloca ptr, align 8, !dbg !12
|
||||
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.78b0d6e062ff6422"(ptr %p), !dbg !12
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_15.2.temp), !dbg !12
|
||||
// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_15.2.temp, align 8, !dbg !12
|
||||
// CHECK:STDOUT: %.loc22_15.4 = load ptr, ptr %.loc22_15.2.temp, align 8, !dbg !12
|
||||
// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %.loc22_15.4), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: %.loc22_15.2.temp = alloca ptr, align 8, !dbg !17
|
||||
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.78b0d6e062ff6422"(ptr %p), !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_15.2.temp), !dbg !17
|
||||
// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_15.2.temp, align 8, !dbg !17
|
||||
// CHECK:STDOUT: %.loc22_15.4 = load ptr, ptr %.loc22_15.2.temp, align 8, !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %.loc22_15.4), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z7TakePtrP1C(ptr)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !15 {
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !16
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !17
|
||||
// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !23
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare ptr @_Z9ReturnPtrv()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %p) #0 !dbg !18 {
|
||||
// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %p) #0 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !20 {
|
||||
// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !29 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !21
|
||||
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.78b0d6e062ff6422"(ptr %p), !dbg !21
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !21
|
||||
// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !21
|
||||
// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !21
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr %.loc35_24.4), !dbg !22
|
||||
// CHECK:STDOUT: ret void, !dbg !23
|
||||
// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !32
|
||||
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.78b0d6e062ff6422"(ptr %p), !dbg !32
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !32
|
||||
// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !32
|
||||
// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !32
|
||||
// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk1(ptr %.loc35_24.4), !dbg !33
|
||||
// CHECK:STDOUT: ret void, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !24 {
|
||||
// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !35 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk0(), !dbg !25
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !26
|
||||
// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk0(), !dbg !36
|
||||
// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.78b0d6e062ff6422"(ptr %self) #0 !dbg !27 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b5eba8f3f1d9af5a"(ptr %self), !dbg !29
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !30
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.78b0d6e062ff6422"(ptr %self) #0 !dbg !38 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b5eba8f3f1d9af5a"(ptr %self), !dbg !44
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !45
|
||||
// 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)) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b5eba8f3f1d9af5a"(ptr %self) #0 !dbg !31 {
|
||||
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.b5eba8f3f1d9af5a(ptr %self), !dbg !32
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !33
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b5eba8f3f1d9af5a"(ptr %self) #0 !dbg !46 {
|
||||
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.b5eba8f3f1d9af5a(ptr %self), !dbg !49
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !50
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.b5eba8f3f1d9af5a(ptr %value) #0 !dbg !34 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.f53db17714b9f655"(ptr %value), !dbg !35
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !36
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.b5eba8f3f1d9af5a(ptr %value) #0 !dbg !51 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.f53db17714b9f655"(ptr %value), !dbg !54
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !55
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.f53db17714b9f655"(ptr %self) #0 !dbg !37 {
|
||||
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !38
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !38
|
||||
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !39
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !40
|
||||
// CHECK:STDOUT: ret ptr %2, !dbg !41
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.f53db17714b9f655"(ptr %self) #0 !dbg !56 {
|
||||
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !59
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !59
|
||||
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !60
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !61
|
||||
// CHECK:STDOUT: ret ptr %2, !dbg !62
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress
|
||||
@@ -305,38 +312,59 @@ fn ReturnPtrWithThunk() -> Core.Optional(Cpp.C*) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "nullable.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !6, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !6, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 14, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !6, line: 19, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 22, column: 15, scope: !11)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 22, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 19, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !6, line: 25, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 26, column: 10, scope: !15)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 26, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !6, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 29, column: 1, scope: !18)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !6, line: 34, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 35, column: 24, scope: !20)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 35, column: 3, scope: !20)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 34, column: 1, scope: !20)
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !6, line: 38, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 39, column: 10, scope: !24)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 39, column: 3, scope: !24)
|
||||
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.f82b7327366b1770:ImplicitAs.Core.78b0d6e062ff6422", scope: null, file: !28, line: 82, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !28 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 83, column: 12, scope: !27)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 83, column: 5, scope: !27)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b5eba8f3f1d9af5a", scope: null, file: !28, line: 68, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 69, column: 12, scope: !31)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 69, column: 5, scope: !31)
|
||||
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b5eba8f3f1d9af5a", scope: null, file: !28, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 30, column: 12, scope: !34)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 30, column: 5, scope: !34)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.4f0b5cc38af595d2:OptionalStorage.Core.f53db17714b9f655", scope: null, file: !28, line: 125, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !38 = !DILocation(line: 126, column: 14, scope: !37)
|
||||
// CHECK:STDOUT: !39 = !DILocation(line: 127, column: 5, scope: !37)
|
||||
// CHECK:STDOUT: !40 = !DILocation(line: 126, column: 18, scope: !37)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 128, column: 5, scope: !37)
|
||||
// CHECK:STDOUT: !9 = !{null, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !6, line: 19, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !15)
|
||||
// CHECK:STDOUT: !15 = !{!16}
|
||||
// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !14, type: !10)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 22, column: 15, scope: !14)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 19, column: 1, scope: !14)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !6, line: 25, type: !21, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !21 = !DISubroutineType(types: !22)
|
||||
// CHECK:STDOUT: !22 = !{!10}
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 26, column: 10, scope: !20)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 26, column: 3, scope: !20)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !6, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26)
|
||||
// CHECK:STDOUT: !26 = !{!27}
|
||||
// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !10)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 29, column: 1, scope: !25)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !6, line: 34, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30)
|
||||
// CHECK:STDOUT: !30 = !{!31}
|
||||
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !10)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 35, column: 24, scope: !29)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 35, column: 3, scope: !29)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 34, column: 1, scope: !29)
|
||||
// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !6, line: 38, type: !21, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 39, column: 10, scope: !35)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 39, column: 3, scope: !35)
|
||||
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.f82b7327366b1770:ImplicitAs.Core.78b0d6e062ff6422", scope: null, file: !39, line: 82, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42)
|
||||
// CHECK:STDOUT: !39 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
|
||||
// CHECK:STDOUT: !40 = !DISubroutineType(types: !41)
|
||||
// CHECK:STDOUT: !41 = !{!10, !10}
|
||||
// CHECK:STDOUT: !42 = !{!43}
|
||||
// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !38, type: !10)
|
||||
// CHECK:STDOUT: !44 = !DILocation(line: 83, column: 12, scope: !38)
|
||||
// CHECK:STDOUT: !45 = !DILocation(line: 83, column: 5, scope: !38)
|
||||
// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b5eba8f3f1d9af5a", scope: null, file: !39, line: 68, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47)
|
||||
// CHECK:STDOUT: !47 = !{!48}
|
||||
// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !10)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 69, column: 12, scope: !46)
|
||||
// CHECK:STDOUT: !50 = !DILocation(line: 69, column: 5, scope: !46)
|
||||
// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b5eba8f3f1d9af5a", scope: null, file: !39, line: 29, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !52)
|
||||
// CHECK:STDOUT: !52 = !{!53}
|
||||
// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !10)
|
||||
// CHECK:STDOUT: !54 = !DILocation(line: 30, column: 12, scope: !51)
|
||||
// CHECK:STDOUT: !55 = !DILocation(line: 30, column: 5, scope: !51)
|
||||
// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.4f0b5cc38af595d2:OptionalStorage.Core.f53db17714b9f655", scope: null, file: !39, line: 125, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !57)
|
||||
// CHECK:STDOUT: !57 = !{!58}
|
||||
// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !56, type: !10)
|
||||
// CHECK:STDOUT: !59 = !DILocation(line: 126, column: 14, scope: !56)
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 127, column: 5, scope: !56)
|
||||
// CHECK:STDOUT: !61 = !DILocation(line: 126, column: 18, scope: !56)
|
||||
// CHECK:STDOUT: !62 = !DILocation(line: 128, column: 5, scope: !56)
|
||||
|
||||
+8
-7
@@ -240,7 +240,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "pass_references.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !6, line: 16, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 19, column: 17, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 22, column: 3, scope: !7)
|
||||
@@ -300,7 +300,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !nonnull !9
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !nonnull !22
|
||||
// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk(ptr nonnull align 1 dereferenceable(1) %1)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -339,7 +339,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !nonnull !9, !align !22
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !nonnull !22, !align !23
|
||||
// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk(ptr nonnull align 4 dereferenceable(4) %1)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
@@ -393,7 +393,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "pass_references_via_thunk.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !6, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 18, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 20, column: 17, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 23, column: 3, scope: !7)
|
||||
@@ -406,7 +406,8 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 25, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 26, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 17, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !22 = !{i64 4}
|
||||
// CHECK:STDOUT: !22 = !{}
|
||||
// CHECK:STDOUT: !23 = !{i64 4}
|
||||
// CHECK:STDOUT: ; ModuleID = 'return_references.carbon'
|
||||
// CHECK:STDOUT: source_filename = "return_references.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -475,7 +476,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "return_references.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !6, line: 16, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 18, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 19, column: 3, scope: !7)
|
||||
@@ -609,7 +610,7 @@ fn GetRefs() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "return_references_via_thunk.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !6, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 18, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 19, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 20, column: 3, scope: !7)
|
||||
|
||||
+233
-203
@@ -120,75 +120,75 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i8 @_CGetU8.Main() #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc6_40.1.temp = alloca i8, align 1, !dbg !10
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_40.1.temp), !dbg !10
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc6_40.1.temp), !dbg !10
|
||||
// CHECK:STDOUT: %.loc6_40.2 = load i8, ptr %.loc6_40.1.temp, align 1, !dbg !10
|
||||
// CHECK:STDOUT: ret i8 %.loc6_40.2, !dbg !11
|
||||
// CHECK:STDOUT: %.loc6_40.1.temp = alloca i8, align 1, !dbg !11
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_40.1.temp), !dbg !11
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc6_40.1.temp), !dbg !11
|
||||
// CHECK:STDOUT: %.loc6_40.2 = load i8, ptr %.loc6_40.1.temp, align 1, !dbg !11
|
||||
// CHECK:STDOUT: ret i8 %.loc6_40.2, !dbg !12
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i16 @_CGetU16.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define i16 @_CGetU16.Main() #0 !dbg !13 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_43.1.temp = alloca i16, align 2, !dbg !13
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_43.1.temp), !dbg !13
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc7_43.1.temp), !dbg !13
|
||||
// CHECK:STDOUT: %.loc7_43.2 = load i16, ptr %.loc7_43.1.temp, align 2, !dbg !13
|
||||
// CHECK:STDOUT: ret i16 %.loc7_43.2, !dbg !14
|
||||
// CHECK:STDOUT: %.loc7_43.1.temp = alloca i16, align 2, !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_43.1.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc7_43.1.temp), !dbg !17
|
||||
// CHECK:STDOUT: %.loc7_43.2 = load i16, ptr %.loc7_43.1.temp, align 2, !dbg !17
|
||||
// CHECK:STDOUT: ret i16 %.loc7_43.2, !dbg !18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CGetU32.Main() #0 !dbg !15 {
|
||||
// CHECK:STDOUT: define i32 @_CGetU32.Main() #0 !dbg !19 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !16
|
||||
// CHECK:STDOUT: ret i32 %ReturnU32.call, !dbg !17
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !23
|
||||
// CHECK:STDOUT: ret i32 %ReturnU32.call, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare i32 @_Z9ReturnU32v()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i64 @_CGetU64.Main() #0 !dbg !18 {
|
||||
// CHECK:STDOUT: define i64 @_CGetU64.Main() #0 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !19
|
||||
// CHECK:STDOUT: ret i64 %ReturnU64.call, !dbg !20
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !29
|
||||
// CHECK:STDOUT: ret i64 %ReturnU64.call, !dbg !30
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare i64 @_Z9ReturnU64v()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i8 @_CGetI8.Main() #0 !dbg !21 {
|
||||
// CHECK:STDOUT: define i8 @_CGetI8.Main() #0 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc11_40.1.temp = alloca i8, align 1, !dbg !22
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_40.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc11_40.1.temp), !dbg !22
|
||||
// CHECK:STDOUT: %.loc11_40.2 = load i8, ptr %.loc11_40.1.temp, align 1, !dbg !22
|
||||
// CHECK:STDOUT: ret i8 %.loc11_40.2, !dbg !23
|
||||
// CHECK:STDOUT: %.loc11_40.1.temp = alloca i8, align 1, !dbg !35
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_40.1.temp), !dbg !35
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc11_40.1.temp), !dbg !35
|
||||
// CHECK:STDOUT: %.loc11_40.2 = load i8, ptr %.loc11_40.1.temp, align 1, !dbg !35
|
||||
// CHECK:STDOUT: ret i8 %.loc11_40.2, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i16 @_CGetI16.Main() #0 !dbg !24 {
|
||||
// CHECK:STDOUT: define i16 @_CGetI16.Main() #0 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc12_43.1.temp = alloca i16, align 2, !dbg !25
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_43.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc12_43.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: %.loc12_43.2 = load i16, ptr %.loc12_43.1.temp, align 2, !dbg !25
|
||||
// CHECK:STDOUT: ret i16 %.loc12_43.2, !dbg !26
|
||||
// CHECK:STDOUT: %.loc12_43.1.temp = alloca i16, align 2, !dbg !41
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_43.1.temp), !dbg !41
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc12_43.1.temp), !dbg !41
|
||||
// CHECK:STDOUT: %.loc12_43.2 = load i16, ptr %.loc12_43.1.temp, align 2, !dbg !41
|
||||
// CHECK:STDOUT: ret i16 %.loc12_43.2, !dbg !42
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CGetI32.Main() #0 !dbg !27 {
|
||||
// CHECK:STDOUT: define i32 @_CGetI32.Main() #0 !dbg !43 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !28
|
||||
// CHECK:STDOUT: ret i32 %ReturnI32.call, !dbg !29
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !47
|
||||
// CHECK:STDOUT: ret i32 %ReturnI32.call, !dbg !48
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare i32 @_Z9ReturnI32v()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i64 @_CGetI64.Main() #0 !dbg !30 {
|
||||
// CHECK:STDOUT: define i64 @_CGetI64.Main() #0 !dbg !49 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !31
|
||||
// CHECK:STDOUT: ret i64 %ReturnI64.call, !dbg !32
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !53
|
||||
// CHECK:STDOUT: ret i64 %ReturnI64.call, !dbg !54
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare i64 @_Z9ReturnI64v()
|
||||
@@ -196,89 +196,89 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: declare void @_CUse.Main(i8, i16, i32, i64, i8, i16, i32, i64)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CLets.Main() #0 !dbg !33 {
|
||||
// CHECK:STDOUT: define void @_CLets.Main() #0 !dbg !55 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc19_32.1.temp = alloca i8, align 1, !dbg !34
|
||||
// CHECK:STDOUT: %.loc20_35.1.temp = alloca i16, align 2, !dbg !35
|
||||
// CHECK:STDOUT: %.loc24_32.1.temp = alloca i8, align 1, !dbg !36
|
||||
// CHECK:STDOUT: %.loc25_35.1.temp = alloca i16, align 2, !dbg !37
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_32.1.temp), !dbg !34
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc19_32.1.temp), !dbg !34
|
||||
// CHECK:STDOUT: %.loc19_32.2 = load i8, ptr %.loc19_32.1.temp, align 1, !dbg !34
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_35.1.temp), !dbg !35
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc20_35.1.temp), !dbg !35
|
||||
// CHECK:STDOUT: %.loc20_35.2 = load i16, ptr %.loc20_35.1.temp, align 2, !dbg !35
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !38
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !39
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_32.1.temp), !dbg !36
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc24_32.1.temp), !dbg !36
|
||||
// CHECK:STDOUT: %.loc24_32.2 = load i8, ptr %.loc24_32.1.temp, align 1, !dbg !36
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_35.1.temp), !dbg !37
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc25_35.1.temp), !dbg !37
|
||||
// CHECK:STDOUT: %.loc25_35.2 = load i16, ptr %.loc25_35.1.temp, align 2, !dbg !37
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !40
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !41
|
||||
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.2, i16 %.loc20_35.2, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.2, i16 %.loc25_35.2, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !42
|
||||
// CHECK:STDOUT: ret void, !dbg !43
|
||||
// CHECK:STDOUT: %.loc19_32.1.temp = alloca i8, align 1, !dbg !58
|
||||
// CHECK:STDOUT: %.loc20_35.1.temp = alloca i16, align 2, !dbg !59
|
||||
// CHECK:STDOUT: %.loc24_32.1.temp = alloca i8, align 1, !dbg !60
|
||||
// CHECK:STDOUT: %.loc25_35.1.temp = alloca i16, align 2, !dbg !61
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_32.1.temp), !dbg !58
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc19_32.1.temp), !dbg !58
|
||||
// CHECK:STDOUT: %.loc19_32.2 = load i8, ptr %.loc19_32.1.temp, align 1, !dbg !58
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_35.1.temp), !dbg !59
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc20_35.1.temp), !dbg !59
|
||||
// CHECK:STDOUT: %.loc20_35.2 = load i16, ptr %.loc20_35.1.temp, align 2, !dbg !59
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !62
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !63
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_32.1.temp), !dbg !60
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc24_32.1.temp), !dbg !60
|
||||
// CHECK:STDOUT: %.loc24_32.2 = load i8, ptr %.loc24_32.1.temp, align 1, !dbg !60
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_35.1.temp), !dbg !61
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc25_35.1.temp), !dbg !61
|
||||
// CHECK:STDOUT: %.loc25_35.2 = load i16, ptr %.loc25_35.1.temp, align 2, !dbg !61
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !64
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !65
|
||||
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.2, i16 %.loc20_35.2, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.2, i16 %.loc25_35.2, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !66
|
||||
// CHECK:STDOUT: ret void, !dbg !67
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !44 {
|
||||
// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !68 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !45
|
||||
// CHECK:STDOUT: %.loc33_32.1.temp = alloca i8, align 1, !dbg !46
|
||||
// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !47
|
||||
// CHECK:STDOUT: %.loc34_35.1.temp = alloca i16, align 2, !dbg !48
|
||||
// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !49
|
||||
// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !50
|
||||
// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !51
|
||||
// CHECK:STDOUT: %.loc38_32.1.temp = alloca i8, align 1, !dbg !52
|
||||
// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !53
|
||||
// CHECK:STDOUT: %.loc39_35.1.temp = alloca i16, align 2, !dbg !54
|
||||
// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !55
|
||||
// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !56
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !45
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc33_32.1.temp), !dbg !46
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc33_32.1.temp), !dbg !46
|
||||
// CHECK:STDOUT: %.loc33_32.2 = load i8, ptr %.loc33_32.1.temp, align 1, !dbg !46
|
||||
// CHECK:STDOUT: store i8 %.loc33_32.2, ptr %my_u8.var, align 1, !dbg !45
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !47
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_35.1.temp), !dbg !48
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc34_35.1.temp), !dbg !48
|
||||
// CHECK:STDOUT: %.loc34_35.2 = load i16, ptr %.loc34_35.1.temp, align 2, !dbg !48
|
||||
// CHECK:STDOUT: store i16 %.loc34_35.2, ptr %my_u16.var, align 2, !dbg !47
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !49
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !57
|
||||
// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !49
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !50
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !58
|
||||
// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 4, !dbg !50
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !51
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc38_32.1.temp), !dbg !52
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc38_32.1.temp), !dbg !52
|
||||
// CHECK:STDOUT: %.loc38_32.2 = load i8, ptr %.loc38_32.1.temp, align 1, !dbg !52
|
||||
// CHECK:STDOUT: store i8 %.loc38_32.2, ptr %my_i8.var, align 1, !dbg !51
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !53
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc39_35.1.temp), !dbg !54
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc39_35.1.temp), !dbg !54
|
||||
// CHECK:STDOUT: %.loc39_35.2 = load i16, ptr %.loc39_35.1.temp, align 2, !dbg !54
|
||||
// CHECK:STDOUT: store i16 %.loc39_35.2, ptr %my_i16.var, align 2, !dbg !53
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !55
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !59
|
||||
// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !55
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !56
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !60
|
||||
// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 4, !dbg !56
|
||||
// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !61
|
||||
// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !62
|
||||
// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !63
|
||||
// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 4, !dbg !64
|
||||
// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !65
|
||||
// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !66
|
||||
// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !67
|
||||
// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 4, !dbg !68
|
||||
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !69
|
||||
// CHECK:STDOUT: ret void, !dbg !70
|
||||
// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !69
|
||||
// CHECK:STDOUT: %.loc33_32.1.temp = alloca i8, align 1, !dbg !70
|
||||
// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !71
|
||||
// CHECK:STDOUT: %.loc34_35.1.temp = alloca i16, align 2, !dbg !72
|
||||
// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !73
|
||||
// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !74
|
||||
// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !75
|
||||
// CHECK:STDOUT: %.loc38_32.1.temp = alloca i8, align 1, !dbg !76
|
||||
// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !77
|
||||
// CHECK:STDOUT: %.loc39_35.1.temp = alloca i16, align 2, !dbg !78
|
||||
// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !79
|
||||
// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !80
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !69
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc33_32.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc33_32.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: %.loc33_32.2 = load i8, ptr %.loc33_32.1.temp, align 1, !dbg !70
|
||||
// CHECK:STDOUT: store i8 %.loc33_32.2, ptr %my_u8.var, align 1, !dbg !69
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !71
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_35.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc34_35.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: %.loc34_35.2 = load i16, ptr %.loc34_35.1.temp, align 2, !dbg !72
|
||||
// CHECK:STDOUT: store i16 %.loc34_35.2, ptr %my_u16.var, align 2, !dbg !71
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !73
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !81
|
||||
// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !73
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !74
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !82
|
||||
// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 4, !dbg !74
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !75
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc38_32.1.temp), !dbg !76
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc38_32.1.temp), !dbg !76
|
||||
// CHECK:STDOUT: %.loc38_32.2 = load i8, ptr %.loc38_32.1.temp, align 1, !dbg !76
|
||||
// CHECK:STDOUT: store i8 %.loc38_32.2, ptr %my_i8.var, align 1, !dbg !75
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !77
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc39_35.1.temp), !dbg !78
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc39_35.1.temp), !dbg !78
|
||||
// CHECK:STDOUT: %.loc39_35.2 = load i16, ptr %.loc39_35.1.temp, align 2, !dbg !78
|
||||
// CHECK:STDOUT: store i16 %.loc39_35.2, ptr %my_i16.var, align 2, !dbg !77
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !79
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !83
|
||||
// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !79
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !80
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !84
|
||||
// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 4, !dbg !80
|
||||
// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !85
|
||||
// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !86
|
||||
// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !87
|
||||
// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 4, !dbg !88
|
||||
// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !89
|
||||
// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !90
|
||||
// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !91
|
||||
// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 4, !dbg !92
|
||||
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !93
|
||||
// CHECK:STDOUT: ret void, !dbg !94
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -356,68 +356,92 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_ints.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "GetU8", linkageName: "_CGetU8.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 6, column: 27, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 20, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "GetU16", linkageName: "_CGetU16.Main", scope: null, file: !6, line: 7, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 29, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 22, scope: !12)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "GetU32", linkageName: "_CGetU32.Main", scope: null, file: !6, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 29, scope: !15)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 8, column: 22, scope: !15)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "GetU64", linkageName: "_CGetU64.Main", scope: null, file: !6, line: 9, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 9, column: 29, scope: !18)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 9, column: 22, scope: !18)
|
||||
// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "GetI8", linkageName: "_CGetI8.Main", scope: null, file: !6, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 27, scope: !21)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 20, scope: !21)
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "GetI16", linkageName: "_CGetI16.Main", scope: null, file: !6, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 12, column: 29, scope: !24)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 12, column: 22, scope: !24)
|
||||
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "GetI32", linkageName: "_CGetI32.Main", scope: null, file: !6, line: 13, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 13, column: 29, scope: !27)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 13, column: 22, scope: !27)
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "GetI64", linkageName: "_CGetI64.Main", scope: null, file: !6, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !31 = !DILocation(line: 14, column: 29, scope: !30)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 14, column: 22, scope: !30)
|
||||
// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Lets", linkageName: "_CLets.Main", scope: null, file: !6, line: 18, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 19, column: 19, scope: !33)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 20, column: 21, scope: !33)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 24, column: 19, scope: !33)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 25, column: 21, scope: !33)
|
||||
// CHECK:STDOUT: !38 = !DILocation(line: 21, column: 21, scope: !33)
|
||||
// CHECK:STDOUT: !39 = !DILocation(line: 22, column: 21, scope: !33)
|
||||
// CHECK:STDOUT: !40 = !DILocation(line: 26, column: 21, scope: !33)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 27, column: 21, scope: !33)
|
||||
// CHECK:STDOUT: !42 = !DILocation(line: 29, column: 3, scope: !33)
|
||||
// CHECK:STDOUT: !43 = !DILocation(line: 18, column: 1, scope: !33)
|
||||
// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !6, line: 32, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !45 = !DILocation(line: 33, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !46 = !DILocation(line: 33, column: 19, scope: !44)
|
||||
// CHECK:STDOUT: !47 = !DILocation(line: 34, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 34, column: 21, scope: !44)
|
||||
// CHECK:STDOUT: !49 = !DILocation(line: 35, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !50 = !DILocation(line: 36, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !51 = !DILocation(line: 38, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !52 = !DILocation(line: 38, column: 19, scope: !44)
|
||||
// CHECK:STDOUT: !53 = !DILocation(line: 39, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !54 = !DILocation(line: 39, column: 21, scope: !44)
|
||||
// CHECK:STDOUT: !55 = !DILocation(line: 40, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !56 = !DILocation(line: 41, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !57 = !DILocation(line: 35, column: 21, scope: !44)
|
||||
// CHECK:STDOUT: !58 = !DILocation(line: 36, column: 21, scope: !44)
|
||||
// CHECK:STDOUT: !59 = !DILocation(line: 40, column: 21, scope: !44)
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 41, column: 21, scope: !44)
|
||||
// CHECK:STDOUT: !61 = !DILocation(line: 43, column: 7, scope: !44)
|
||||
// CHECK:STDOUT: !62 = !DILocation(line: 43, column: 14, scope: !44)
|
||||
// CHECK:STDOUT: !63 = !DILocation(line: 43, column: 22, scope: !44)
|
||||
// CHECK:STDOUT: !64 = !DILocation(line: 43, column: 30, scope: !44)
|
||||
// CHECK:STDOUT: !65 = !DILocation(line: 43, column: 38, scope: !44)
|
||||
// CHECK:STDOUT: !66 = !DILocation(line: 43, column: 45, scope: !44)
|
||||
// CHECK:STDOUT: !67 = !DILocation(line: 43, column: 53, scope: !44)
|
||||
// CHECK:STDOUT: !68 = !DILocation(line: 43, column: 61, scope: !44)
|
||||
// CHECK:STDOUT: !69 = !DILocation(line: 43, column: 3, scope: !44)
|
||||
// CHECK:STDOUT: !70 = !DILocation(line: 32, column: 1, scope: !44)
|
||||
// CHECK:STDOUT: !9 = !{!10}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 27, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 6, column: 20, scope: !7)
|
||||
// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "GetU16", linkageName: "_CGetU16.Main", scope: null, file: !6, line: 7, type: !14, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !14 = !DISubroutineType(types: !15)
|
||||
// CHECK:STDOUT: !15 = !{!16}
|
||||
// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 29, scope: !13)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 22, scope: !13)
|
||||
// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "GetU32", linkageName: "_CGetU32.Main", scope: null, file: !6, line: 8, type: !20, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !20 = !DISubroutineType(types: !21)
|
||||
// CHECK:STDOUT: !21 = !{!22}
|
||||
// CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 8, column: 29, scope: !19)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 8, column: 22, scope: !19)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "GetU64", linkageName: "_CGetU64.Main", scope: null, file: !6, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !26 = !DISubroutineType(types: !27)
|
||||
// CHECK:STDOUT: !27 = !{!28}
|
||||
// CHECK:STDOUT: !28 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 9, column: 29, scope: !25)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 9, column: 22, scope: !25)
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "GetI8", linkageName: "_CGetI8.Main", scope: null, file: !6, line: 11, type: !32, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !32 = !DISubroutineType(types: !33)
|
||||
// CHECK:STDOUT: !33 = !{!34}
|
||||
// CHECK:STDOUT: !34 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 11, column: 27, scope: !31)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 11, column: 20, scope: !31)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "GetI16", linkageName: "_CGetI16.Main", scope: null, file: !6, line: 12, type: !38, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !38 = !DISubroutineType(types: !39)
|
||||
// CHECK:STDOUT: !39 = !{!40}
|
||||
// CHECK:STDOUT: !40 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 29, scope: !37)
|
||||
// CHECK:STDOUT: !42 = !DILocation(line: 12, column: 22, scope: !37)
|
||||
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "GetI32", linkageName: "_CGetI32.Main", scope: null, file: !6, line: 13, type: !44, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !44 = !DISubroutineType(types: !45)
|
||||
// CHECK:STDOUT: !45 = !{!46}
|
||||
// CHECK:STDOUT: !46 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !47 = !DILocation(line: 13, column: 29, scope: !43)
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 13, column: 22, scope: !43)
|
||||
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "GetI64", linkageName: "_CGetI64.Main", scope: null, file: !6, line: 14, type: !50, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !50 = !DISubroutineType(types: !51)
|
||||
// CHECK:STDOUT: !51 = !{!52}
|
||||
// CHECK:STDOUT: !52 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !53 = !DILocation(line: 14, column: 29, scope: !49)
|
||||
// CHECK:STDOUT: !54 = !DILocation(line: 14, column: 22, scope: !49)
|
||||
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Lets", linkageName: "_CLets.Main", scope: null, file: !6, line: 18, type: !56, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !56 = !DISubroutineType(types: !57)
|
||||
// CHECK:STDOUT: !57 = !{null}
|
||||
// CHECK:STDOUT: !58 = !DILocation(line: 19, column: 19, scope: !55)
|
||||
// CHECK:STDOUT: !59 = !DILocation(line: 20, column: 21, scope: !55)
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 24, column: 19, scope: !55)
|
||||
// CHECK:STDOUT: !61 = !DILocation(line: 25, column: 21, scope: !55)
|
||||
// CHECK:STDOUT: !62 = !DILocation(line: 21, column: 21, scope: !55)
|
||||
// CHECK:STDOUT: !63 = !DILocation(line: 22, column: 21, scope: !55)
|
||||
// CHECK:STDOUT: !64 = !DILocation(line: 26, column: 21, scope: !55)
|
||||
// CHECK:STDOUT: !65 = !DILocation(line: 27, column: 21, scope: !55)
|
||||
// CHECK:STDOUT: !66 = !DILocation(line: 29, column: 3, scope: !55)
|
||||
// CHECK:STDOUT: !67 = !DILocation(line: 18, column: 1, scope: !55)
|
||||
// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !6, line: 32, type: !56, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !69 = !DILocation(line: 33, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !70 = !DILocation(line: 33, column: 19, scope: !68)
|
||||
// CHECK:STDOUT: !71 = !DILocation(line: 34, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !72 = !DILocation(line: 34, column: 21, scope: !68)
|
||||
// CHECK:STDOUT: !73 = !DILocation(line: 35, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !74 = !DILocation(line: 36, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !75 = !DILocation(line: 38, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !76 = !DILocation(line: 38, column: 19, scope: !68)
|
||||
// CHECK:STDOUT: !77 = !DILocation(line: 39, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !78 = !DILocation(line: 39, column: 21, scope: !68)
|
||||
// CHECK:STDOUT: !79 = !DILocation(line: 40, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !80 = !DILocation(line: 41, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !81 = !DILocation(line: 35, column: 21, scope: !68)
|
||||
// CHECK:STDOUT: !82 = !DILocation(line: 36, column: 21, scope: !68)
|
||||
// CHECK:STDOUT: !83 = !DILocation(line: 40, column: 21, scope: !68)
|
||||
// CHECK:STDOUT: !84 = !DILocation(line: 41, column: 21, scope: !68)
|
||||
// CHECK:STDOUT: !85 = !DILocation(line: 43, column: 7, scope: !68)
|
||||
// CHECK:STDOUT: !86 = !DILocation(line: 43, column: 14, scope: !68)
|
||||
// CHECK:STDOUT: !87 = !DILocation(line: 43, column: 22, scope: !68)
|
||||
// CHECK:STDOUT: !88 = !DILocation(line: 43, column: 30, scope: !68)
|
||||
// CHECK:STDOUT: !89 = !DILocation(line: 43, column: 38, scope: !68)
|
||||
// CHECK:STDOUT: !90 = !DILocation(line: 43, column: 45, scope: !68)
|
||||
// CHECK:STDOUT: !91 = !DILocation(line: 43, column: 53, scope: !68)
|
||||
// CHECK:STDOUT: !92 = !DILocation(line: 43, column: 61, scope: !68)
|
||||
// CHECK:STDOUT: !93 = !DILocation(line: 43, column: 3, scope: !68)
|
||||
// CHECK:STDOUT: !94 = !DILocation(line: 32, column: 1, scope: !68)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_class.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_class.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -428,26 +452,26 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %return), !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !11
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %return), !dbg !11
|
||||
// CHECK:STDOUT: ret void, !dbg !12
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !13 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 1, !dbg !13
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !13
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %.loc9_27.1.temp), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 1, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %.loc9_27.1.temp), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !15 {
|
||||
// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !18 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.var = alloca [16 x i8], align 1, !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %x.var), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: %x.var = alloca [16 x i8], align 1, !dbg !19
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !19
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk(ptr %x.var), !dbg !20
|
||||
// CHECK:STDOUT: ret void, !dbg !21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -485,16 +509,19 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_class.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 6, column: 29, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 22, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !6, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 9, column: 18, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 1, scope: !12)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !6, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 18, scope: !15)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 1, scope: !15)
|
||||
// CHECK:STDOUT: !9 = !{!10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 6, column: 29, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 6, column: 22, scope: !7)
|
||||
// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !6, line: 8, type: !14, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !14 = !DISubroutineType(types: !15)
|
||||
// CHECK:STDOUT: !15 = !{null}
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 18, scope: !13)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 8, column: 1, scope: !13)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !6, line: 12, type: !14, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 13, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 18, scope: !18)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 1, scope: !18)
|
||||
// CHECK:STDOUT: ; ModuleID = 'indirect_return_with_args.carbon'
|
||||
// CHECK:STDOUT: source_filename = "indirect_return_with_args.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -505,8 +532,8 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk(ptr %x, ptr %return), !dbg !10
|
||||
// CHECK:STDOUT: ret void, !dbg !11
|
||||
// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk(ptr %x, ptr %return), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress
|
||||
@@ -540,8 +567,11 @@ fn Call(x: Cpp.D) -> Cpp.C {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "indirect_return_with_args.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 11, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 11, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !9 = !{!10, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 11, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 11, column: 3, scope: !7)
|
||||
|
||||
+22
-14
@@ -99,15 +99,15 @@ fn Call3() {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CPassI32.Main(i32 %a) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %identity.call = call i32 @_Z8identityIiET_S0_(i32 %a), !dbg !10
|
||||
// CHECK:STDOUT: ret i32 %identity.call, !dbg !11
|
||||
// CHECK:STDOUT: %identity.call = call i32 @_Z8identityIiET_S0_(i32 %a), !dbg !13
|
||||
// CHECK:STDOUT: ret i32 %identity.call, !dbg !14
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassClass.Main(ptr sret({}) %return, ptr %a) #0 !dbg !12 {
|
||||
// CHECK:STDOUT: define void @_CPassClass.Main(ptr sret({}) %return, ptr %a) #0 !dbg !15 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z8identityI5ClassET_S1_.carbon_thunk(ptr %a, ptr %return), !dbg !13
|
||||
// CHECK:STDOUT: ret void, !dbg !14
|
||||
// CHECK:STDOUT: call void @_Z8identityI5ClassET_S1_.carbon_thunk(ptr %a, ptr %return), !dbg !21
|
||||
// CHECK:STDOUT: ret void, !dbg !22
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress
|
||||
@@ -155,14 +155,22 @@ fn Call3() {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassI32", linkageName: "_CPassI32.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassI32", linkageName: "_CPassI32.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassClass", linkageName: "_CPassClass.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 11, column: 10, scope: !12)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 11, column: 3, scope: !12)
|
||||
// CHECK:STDOUT: !9 = !{!10, !10}
|
||||
// CHECK:STDOUT: !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 10, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "PassClass", linkageName: "_CPassClass.Main", scope: null, file: !6, line: 10, type: !16, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !19)
|
||||
// CHECK:STDOUT: !16 = !DISubroutineType(types: !17)
|
||||
// CHECK:STDOUT: !17 = !{!18, !18}
|
||||
// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !19 = !{!20}
|
||||
// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !15, type: !18)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 10, scope: !15)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 3, scope: !15)
|
||||
// CHECK:STDOUT: ; ModuleID = 'variadic.carbon'
|
||||
// CHECK:STDOUT: source_filename = "variadic.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
@@ -209,7 +217,7 @@ fn Call3() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "variadic.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !6, line: 9, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 11, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 9, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !6, line: 15, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
@@ -333,7 +341,7 @@ fn Call3() {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "variadic_thunk.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !6, line: 10, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 12, column: 11, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 12, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 10, column: 1, scope: !7)
|
||||
|
||||
+13
-7
@@ -120,9 +120,9 @@ fn AccessD(d: Cpp.D) -> i32 {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CAccessD.Main(ptr %d) #0 !dbg !13 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc16_11.1.d = getelementptr inbounds nuw [40 x i8], ptr %d, i32 0, i32 28, !dbg !14
|
||||
// CHECK:STDOUT: %.loc16_11.2 = load i32, ptr %.loc16_11.1.d, align 4, !dbg !14
|
||||
// CHECK:STDOUT: ret i32 %.loc16_11.2, !dbg !15
|
||||
// CHECK:STDOUT: %.loc16_11.1.d = getelementptr inbounds nuw [40 x i8], ptr %d, i32 0, i32 28, !dbg !20
|
||||
// CHECK:STDOUT: %.loc16_11.2 = load i32, ptr %.loc16_11.1.d, align 4, !dbg !20
|
||||
// CHECK:STDOUT: ret i32 %.loc16_11.2, !dbg !21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
@@ -188,10 +188,16 @@ fn AccessD(d: Cpp.D) -> i32 {
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "use_diamond.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !9 = !{null}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 11, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 11, column: 18, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "AccessD", linkageName: "_CAccessD.Main", scope: null, file: !6, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 16, column: 10, scope: !13)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 16, column: 3, scope: !13)
|
||||
// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "AccessD", linkageName: "_CAccessD.Main", scope: null, file: !6, line: 14, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !18)
|
||||
// CHECK:STDOUT: !14 = !DISubroutineType(types: !15)
|
||||
// CHECK:STDOUT: !15 = !{!16, !17}
|
||||
// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !18 = !{!19}
|
||||
// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !13, type: !17)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 16, column: 10, scope: !13)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 16, column: 3, scope: !13)
|
||||
|
||||
+55
-42
@@ -32,45 +32,45 @@ fn PassVoidPtr(a: Cpp.void*) {
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassVoidPtr.Main(ptr %a) #0 !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_21.2.temp = alloca ptr, align 8, !dbg !10
|
||||
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7"(ptr %a), !dbg !10
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_21.2.temp), !dbg !10
|
||||
// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc7_21.2.temp, align 8, !dbg !10
|
||||
// CHECK:STDOUT: %.loc7_21.4 = load ptr, ptr %.loc7_21.2.temp, align 8, !dbg !10
|
||||
// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc7_21.4), !dbg !11
|
||||
// CHECK:STDOUT: ret void, !dbg !12
|
||||
// CHECK:STDOUT: %.loc7_21.2.temp = alloca ptr, align 8, !dbg !13
|
||||
// CHECK:STDOUT: %U.binding.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7"(ptr %a), !dbg !13
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_21.2.temp), !dbg !13
|
||||
// CHECK:STDOUT: store ptr %U.binding.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc7_21.2.temp, align 8, !dbg !13
|
||||
// CHECK:STDOUT: %.loc7_21.4 = load ptr, ptr %.loc7_21.2.temp, align 8, !dbg !13
|
||||
// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc7_21.4), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z13take_void_ptrPv(ptr)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7"(ptr %self) #0 !dbg !13 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97"(ptr %self), !dbg !15
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !16
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7"(ptr %self) #0 !dbg !16 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97"(ptr %self), !dbg !22
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !23
|
||||
// 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)) #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97"(ptr %self) #0 !dbg !17 {
|
||||
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.b95abfcde220df97(ptr %self), !dbg !18
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !19
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97"(ptr %self) #0 !dbg !24 {
|
||||
// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.b95abfcde220df97(ptr %self), !dbg !27
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.b95abfcde220df97(ptr %value) #0 !dbg !20 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %value), !dbg !21
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !22
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.b95abfcde220df97(ptr %value) #0 !dbg !29 {
|
||||
// CHECK:STDOUT: %1 = call ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %value), !dbg !32
|
||||
// CHECK:STDOUT: ret ptr %1, !dbg !33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %self) #0 !dbg !23 {
|
||||
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !24
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !24
|
||||
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !25
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !26
|
||||
// CHECK:STDOUT: ret ptr %2, !dbg !27
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299"(ptr %self) #0 !dbg !34 {
|
||||
// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !37
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !37
|
||||
// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !38
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !39
|
||||
// CHECK:STDOUT: ret ptr %2, !dbg !40
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
@@ -86,24 +86,37 @@ fn PassVoidPtr(a: Cpp.void*) {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassVoidPtr", linkageName: "_CPassVoidPtr.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassVoidPtr", linkageName: "_CPassVoidPtr.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !11)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 21, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7", scope: null, file: !14, line: 82, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !14 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 83, column: 12, scope: !13)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 83, column: 5, scope: !13)
|
||||
// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97", scope: null, file: !14, line: 68, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 69, column: 12, scope: !17)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 69, column: 5, scope: !17)
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b95abfcde220df97", scope: null, file: !14, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 30, column: 12, scope: !20)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 30, column: 5, scope: !20)
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299", scope: null, file: !14, line: 125, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 126, column: 14, scope: !23)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 127, column: 5, scope: !23)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 126, column: 18, scope: !23)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 128, column: 5, scope: !23)
|
||||
// CHECK:STDOUT: !9 = !{null, !10}
|
||||
// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
|
||||
// CHECK:STDOUT: !11 = !{!12}
|
||||
// CHECK:STDOUT: !12 = !DILocalVariable(arg: 1, scope: !7, type: !10)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 21, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.f82b7327366b1770:ImplicitAs.Core.1bbd3eba7f2908d7", scope: null, file: !17, line: 82, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !20)
|
||||
// CHECK:STDOUT: !17 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
|
||||
// CHECK:STDOUT: !18 = !DISubroutineType(types: !19)
|
||||
// CHECK:STDOUT: !19 = !{!10, !10}
|
||||
// CHECK:STDOUT: !20 = !{!21}
|
||||
// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !16, type: !10)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 83, column: 12, scope: !16)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 83, column: 5, scope: !16)
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.8d16edc1dfe20a7c:OptionalAs.Core.b95abfcde220df97", scope: null, file: !17, line: 68, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25)
|
||||
// CHECK:STDOUT: !25 = !{!26}
|
||||
// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !10)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 69, column: 12, scope: !24)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 69, column: 5, scope: !24)
|
||||
// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.b95abfcde220df97", scope: null, file: !17, line: 29, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30)
|
||||
// CHECK:STDOUT: !30 = !{!31}
|
||||
// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !10)
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 30, column: 12, scope: !29)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 30, column: 5, scope: !29)
|
||||
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.4f0b5cc38af595d2:OptionalStorage.Core.a3238f3d1f6ba299", scope: null, file: !17, line: 125, type: !18, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35)
|
||||
// CHECK:STDOUT: !35 = !{!36}
|
||||
// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !10)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 126, column: 14, scope: !34)
|
||||
// CHECK:STDOUT: !38 = !DILocation(line: 127, column: 5, scope: !34)
|
||||
// CHECK:STDOUT: !39 = !DILocation(line: 126, column: 18, scope: !34)
|
||||
// CHECK:STDOUT: !40 = !DILocation(line: 128, column: 5, scope: !34)
|
||||
|
||||
Reference in New Issue
Block a user