Skip to content

Commit 5f25574

Browse files
committed
accept snapshots
1 parent 3c95378 commit 5f25574

10 files changed

+1793
-572
lines changed

src/codegen/tests/debug_tests.rs

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -354,25 +354,35 @@ fn dbg_declare_has_valid_metadata_references_for_methods() {
354354
source_filename = "<internal>"
355355
356356
%fb = type {}
357+
%__vtable_fb_type = type { i32*, i32* }
357358
358359
@__fb__init = constant %fb zeroinitializer, !dbg !0
359360
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }]
361+
@____vtable_fb_type__init = constant %__vtable_fb_type zeroinitializer, !dbg !5
362+
@__vtable_fb = global %__vtable_fb_type zeroinitializer, !dbg !13
360363
361-
define void @fb(%fb* %0) !dbg !9 {
364+
define void @fb(%fb* %0) !dbg !19 {
362365
entry:
363-
call void @llvm.dbg.declare(metadata %fb* %0, metadata !12, metadata !DIExpression()), !dbg !13
364-
ret void, !dbg !13
366+
call void @llvm.dbg.declare(metadata %fb* %0, metadata !22, metadata !DIExpression()), !dbg !23
367+
ret void, !dbg !23
365368
}
366369
367-
define void @fb_foo(%fb* %0) !dbg !14 {
370+
define void @fb_foo(%fb* %0) !dbg !24 {
368371
entry:
369-
call void @llvm.dbg.declare(metadata %fb* %0, metadata !15, metadata !DIExpression()), !dbg !16
370-
ret void, !dbg !16
372+
call void @llvm.dbg.declare(metadata %fb* %0, metadata !25, metadata !DIExpression()), !dbg !26
373+
ret void, !dbg !26
371374
}
372375
373376
; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
374377
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
375378
379+
define void @__init___vtable_fb_type(%__vtable_fb_type* %0) {
380+
entry:
381+
%self = alloca %__vtable_fb_type*, align 8
382+
store %__vtable_fb_type* %0, %__vtable_fb_type** %self, align 8
383+
ret void
384+
}
385+
376386
define void @__init_fb(%fb* %0) {
377387
entry:
378388
%self = alloca %fb*, align 8
@@ -389,31 +399,42 @@ fn dbg_declare_has_valid_metadata_references_for_methods() {
389399
390400
define void @__init___Test() {
391401
entry:
402+
call void @__init___vtable_fb_type(%__vtable_fb_type* @__vtable_fb)
392403
ret void
393404
}
394405
395406
attributes #0 = { nofree nosync nounwind readnone speculatable willreturn }
396407
397-
!llvm.module.flags = !{!5, !6}
398-
!llvm.dbg.cu = !{!7}
408+
!llvm.module.flags = !{!15, !16}
409+
!llvm.dbg.cu = !{!17}
399410
400411
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
401412
!1 = distinct !DIGlobalVariable(name: "__fb__init", scope: !2, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
402413
!2 = !DIFile(filename: "<internal>", directory: "")
403414
!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "fb", scope: !2, file: !2, line: 2, align: 64, flags: DIFlagPublic, elements: !4, identifier: "fb")
404415
!4 = !{}
405-
!5 = !{i32 2, !"Dwarf Version", i32 5}
406-
!6 = !{i32 2, !"Debug Info Version", i32 3}
407-
!7 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !8, splitDebugInlining: false)
408-
!8 = !{!0}
409-
!9 = distinct !DISubprogram(name: "fb", linkageName: "fb", scope: !2, file: !2, line: 2, type: !10, scopeLine: 5, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !4)
410-
!10 = !DISubroutineType(flags: DIFlagPublic, types: !11)
411-
!11 = !{null, !3}
412-
!12 = !DILocalVariable(name: "fb", scope: !9, file: !2, line: 5, type: !3)
413-
!13 = !DILocation(line: 5, column: 8, scope: !9)
414-
!14 = distinct !DISubprogram(name: "fb.foo", linkageName: "fb.foo", scope: !9, file: !2, line: 3, type: !10, scopeLine: 4, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !4)
415-
!15 = !DILocalVariable(name: "fb", scope: !14, file: !2, line: 4, type: !3)
416-
!16 = !DILocation(line: 4, column: 8, scope: !14)
416+
!5 = !DIGlobalVariableExpression(var: !6, expr: !DIExpression())
417+
!6 = distinct !DIGlobalVariable(name: "____vtable_fb_type__init", scope: !2, file: !2, type: !7, isLocal: false, isDefinition: true)
418+
!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "__vtable_fb_type", scope: !2, file: !2, size: 128, align: 64, flags: DIFlagPublic, elements: !8, identifier: "__vtable_fb_type")
419+
!8 = !{!9, !12}
420+
!9 = !DIDerivedType(tag: DW_TAG_member, name: "__body", scope: !2, file: !2, baseType: !10, size: 64, align: 64, flags: DIFlagPublic)
421+
!10 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__VOID_POINTER", baseType: !11, size: 64, align: 64, dwarfAddressSpace: 1)
422+
!11 = !DIBasicType(name: "__VOID", encoding: DW_ATE_unsigned, flags: DIFlagPublic)
423+
!12 = !DIDerivedType(tag: DW_TAG_member, name: "fb.foo", scope: !2, file: !2, baseType: !10, size: 64, align: 64, offset: 64, flags: DIFlagPublic)
424+
!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression())
425+
!14 = distinct !DIGlobalVariable(name: "__vtable_fb", scope: !2, file: !2, type: !7, isLocal: false, isDefinition: true)
426+
!15 = !{i32 2, !"Dwarf Version", i32 5}
427+
!16 = !{i32 2, !"Debug Info Version", i32 3}
428+
!17 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !18, splitDebugInlining: false)
429+
!18 = !{!13, !5, !0}
430+
!19 = distinct !DISubprogram(name: "fb", linkageName: "fb", scope: !2, file: !2, line: 2, type: !20, scopeLine: 5, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !4)
431+
!20 = !DISubroutineType(flags: DIFlagPublic, types: !21)
432+
!21 = !{null, !3}
433+
!22 = !DILocalVariable(name: "fb", scope: !19, file: !2, line: 5, type: !3)
434+
!23 = !DILocation(line: 5, column: 8, scope: !19)
435+
!24 = distinct !DISubprogram(name: "fb.foo", linkageName: "fb.foo", scope: !19, file: !2, line: 3, type: !20, scopeLine: 4, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !4)
436+
!25 = !DILocalVariable(name: "fb", scope: !24, file: !2, line: 4, type: !3)
437+
!26 = !DILocation(line: 4, column: 8, scope: !24)
417438
"#);
418439
}
419440

0 commit comments

Comments
 (0)