@@ -949,42 +949,44 @@ end
949
949
950
950
bar_md = MDNode ([ConstantInt (Int32 (42 )), nothing , MDString (" string" )])
951
951
@test foo_md == bar_md
952
+
953
+ dispose (mod)
952
954
end
953
955
954
956
@testset " debuginfo" begin
955
957
956
958
@dispose ctx= Context () begin
957
- mod = parse (LLVM. Module, raw """
958
- define double @test(i64 signext %0, double %1) !dbg !5 {
959
- top:
960
- %2 = sitofp i64 %0 to double, !dbg !7
961
- %3 = fadd double %2, %1, !dbg !18
962
- ret double %3, !dbg !17
963
- }
964
-
965
- !llvm.module.flags = !{!0, !1}
966
- !llvm.dbg.cu = !{!2}
967
-
968
- !0 = !{i32 2, !"Dwarf Version", i32 4}
969
- !1 = !{i32 1, !"Debug Info Version", i32 3}
970
- !2 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !3, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, nameTableKind: GNU)
971
- !3 = !DIFile(filename: "promotion.jl", directory: ".")
972
- !4 = !{}
973
- !5 = distinct !DISubprogram(name: "+", linkageName: "julia_+_2055", scope: null, file: !3, line: 321, type: !6, scopeLine: 321, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
974
- !6 = !DISubroutineType(types: !4)
975
- !7 = !DILocation(line: 94, scope: !8, inlinedAt: !10)
976
- !8 = distinct !DISubprogram(name: "Float64;", linkageName: "Float64", scope: !9, file: !9, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
977
- !9 = !DIFile(filename: "float.jl", directory: ".")
978
- !10 = !DILocation(line: 7, scope: !11, inlinedAt: !13)
979
- !11 = distinct !DISubprogram(name: "convert;", linkageName: "convert", scope: !12, file: !12, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
980
- !12 = !DIFile(filename: "number.jl", directory: ".")
981
- !13 = !DILocation(line: 269, scope: !14, inlinedAt: !15)
982
- !14 = distinct !DISubprogram(name: "_promote;", linkageName: "_promote", scope: !3, file: !3, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
983
- !15 = !DILocation(line: 292, scope: !16, inlinedAt: !17)
984
- !16 = distinct !DISubprogram(name: "promote;", linkageName: "promote", scope: !3, file: !3, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
985
- !17 = !DILocation(line: 321, scope: !5)
986
- !18 = !DILocation(line: 326, scope: !19, inlinedAt: !17)
987
- !19 = distinct !DISubprogram(name: "+;", linkageName: "+", scope: !9, file: !9, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)""" )
959
+ mod = parse (LLVM. Module, raw """
960
+ define double @test(i64 signext %0, double %1) !dbg !5 {
961
+ top:
962
+ %2 = sitofp i64 %0 to double, !dbg !7
963
+ %3 = fadd double %2, %1, !dbg !18
964
+ ret double %3, !dbg !17
965
+ }
966
+
967
+ !llvm.module.flags = !{!0, !1}
968
+ !llvm.dbg.cu = !{!2}
969
+
970
+ !0 = !{i32 2, !"Dwarf Version", i32 4}
971
+ !1 = !{i32 1, !"Debug Info Version", i32 3}
972
+ !2 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !3, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, nameTableKind: GNU)
973
+ !3 = !DIFile(filename: "promotion.jl", directory: ".")
974
+ !4 = !{}
975
+ !5 = distinct !DISubprogram(name: "+", linkageName: "julia_+_2055", scope: null, file: !3, line: 321, type: !6, scopeLine: 321, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
976
+ !6 = !DISubroutineType(types: !4)
977
+ !7 = !DILocation(line: 94, scope: !8, inlinedAt: !10)
978
+ !8 = distinct !DISubprogram(name: "Float64;", linkageName: "Float64", scope: !9, file: !9, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
979
+ !9 = !DIFile(filename: "float.jl", directory: ".")
980
+ !10 = !DILocation(line: 7, scope: !11, inlinedAt: !13)
981
+ !11 = distinct !DISubprogram(name: "convert;", linkageName: "convert", scope: !12, file: !12, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
982
+ !12 = !DIFile(filename: "number.jl", directory: ".")
983
+ !13 = !DILocation(line: 269, scope: !14, inlinedAt: !15)
984
+ !14 = distinct !DISubprogram(name: "_promote;", linkageName: "_promote", scope: !3, file: !3, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
985
+ !15 = !DILocation(line: 292, scope: !16, inlinedAt: !17)
986
+ !16 = distinct !DISubprogram(name: "promote;", linkageName: "promote", scope: !3, file: !3, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)
987
+ !17 = !DILocation(line: 321, scope: !5)
988
+ !18 = !DILocation(line: 326, scope: !19, inlinedAt: !17)
989
+ !19 = distinct !DISubprogram(name: "+;", linkageName: "+", scope: !9, file: !9, type: !6, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4)""" )
988
990
989
991
fun = functions (mod)[" test" ]
990
992
bb = first (collect (blocks (fun)))
@@ -1023,6 +1025,8 @@ mod = parse(LLVM.Module, raw"""
1023
1025
1024
1026
loc = LLVM. inlined_at (loc)
1025
1027
@test loc === nothing
1028
+
1029
+ dispose (mod)
1026
1030
end
1027
1031
1028
1032
end
0 commit comments