1 ; RUN: llc %s -o - | FileCheck %s
3 ; This test case caused UDTs to be discovered during UDT emission, which can
4 ; cause iterator invalidation.
15 ; Previously there was an issue were the "a" typedef would be emitted twice.
16 ; Check that there are only two typedefs, a and c.
17 ; CHECK: .short 4360 # Record kind: S_UDT
18 ; CHECK: .long {{.*}} # Type
21 ; CHECK: .short 4360 # Record kind: S_UDT
22 ; CHECK: .long {{.*}} # Type
27 ; CHECK: .cv_filechecksums
31 source_filename = "t.cpp"
32 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
33 target triple = "x86_64-pc-windows-msvc19.16.0"
35 %class.c = type { { i32, i32, i32 } }
37 ; Function Attrs: noinline nounwind optnone
38 define dso_local ptr @"??0c@@AEAA@XZ"(ptr returned %this) unnamed_addr #0 align 2 !dbg !7 {
40 %this.addr = alloca ptr, align 8
41 store ptr %this, ptr %this.addr, align 8
42 call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !20, metadata !DIExpression()), !dbg !22
43 %this1 = load ptr, ptr %this.addr, align 8
44 ret ptr %this1, !dbg !23
47 ; Function Attrs: nounwind readnone speculatable willreturn
48 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
50 attributes #0 = { noinline nounwind optnone }
51 attributes #1 = { nounwind readnone speculatable willreturn }
54 !llvm.module.flags = !{!3, !4, !5}
57 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 11.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
58 !1 = !DIFile(filename: "<stdin>", directory: "C:/src/llvm-project/build", checksumkind: CSK_MD5, checksum: "4cbca1b19718cc292886f5df0b72cf37")
60 !3 = !{i32 2, !"CodeView", i32 1}
61 !4 = !{i32 2, !"Debug Info Version", i32 3}
62 !5 = !{i32 1, !"wchar_size", i32 2}
63 !6 = !{!"clang version 11.0.0 "}
64 !7 = distinct !DISubprogram(name: "c", linkageName: "??0c@@AEAA@XZ", scope: !9, file: !8, line: 7, type: !17, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, declaration: !16, retainedNodes: !2)
65 !8 = !DIFile(filename: "t.cpp", directory: "C:/src/llvm-project/build", checksumkind: CSK_MD5, checksum: "4cbca1b19718cc292886f5df0b72cf37")
66 !9 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "c", file: !8, line: 3, size: 96, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !10, identifier: ".?AVc@@")
68 !11 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !9, file: !8, line: 5, baseType: !12, size: 96)
69 !12 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !13, size: 96, extraData: !15)
70 !13 = !DIDerivedType(tag: DW_TAG_typedef, name: "a", file: !8, line: 1, baseType: !14)
71 !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
72 !15 = !DICompositeType(tag: DW_TAG_structure_type, name: "b", file: !8, line: 2, flags: DIFlagFwdDecl | DIFlagNonTrivial, identifier: ".?AUb@@")
73 !16 = !DISubprogram(name: "c", scope: !9, file: !8, line: 4, type: !17, scopeLine: 4, flags: DIFlagPrototyped, spFlags: 0)
74 !17 = !DISubroutineType(types: !18)
76 !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
77 !20 = !DILocalVariable(name: "this", arg: 1, scope: !7, type: !21, flags: DIFlagArtificial | DIFlagObjectPointer)
78 !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64)
79 !22 = !DILocation(line: 0, scope: !7)
80 !23 = !DILocation(line: 7, scope: !7)