brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.3 KiB · b1e27a4 Raw
148 lines · plain
1; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s2; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s3 4; Check that we keep namespace scopes around the same way MSVC does.5; We do function scopes slightly differently, but everything should be alright.6 7; C++ source to regenerate:8; namespace foo {9; namespace bar {10; void baz() {11;   struct LocalRecord {12;     int x;13;   } l;14; };15; struct GlobalRecord {16;   int x;17;   void method();18; } g;19; void GlobalRecord::method() {}20; }21; }22 23; CHECK-LABEL:  FuncId ({{.*}}) {24; CHECK-NEXT:    TypeLeafKind: LF_FUNC_ID (0x1601)25; CHECK-NEXT:    ParentScope: foo::bar ({{.*}})26; CHECK-NEXT:    FunctionType: void () ({{.*}})27; CHECK-NEXT:    Name: baz28; CHECK-NEXT:  }29 30; CHECK:  Struct ({{.*}}) {31; CHECK:    TypeLeafKind: LF_STRUCTURE (0x1505)32; CHECK:    MemberCount: 033; CHECK:    Properties [ (0x180)34; CHECK:      ForwardReference (0x80)35; CHECK:      Scoped (0x100)36; CHECK:    ]37; CHECK:    FieldList: 0x038; CHECK:    DerivedFrom: 0x039; CHECK:    VShape: 0x040; CHECK:    SizeOf: 041; CHECK:    Name: foo::bar::baz::LocalRecord42; CHECK:  }43 44; CHECK:  Struct ({{.*}}) {45; CHECK:    TypeLeafKind: LF_STRUCTURE (0x1505)46; CHECK:    MemberCount: 147; CHECK:    Properties [ (0x100)48; CHECK:      Scoped (0x100)49; CHECK:    ]50; CHECK:    Name: foo::bar::baz::LocalRecord51; CHECK:  }52 53; CHECK:  Struct ({{.*}}) {54; CHECK:    TypeLeafKind: LF_STRUCTURE (0x1505)55; CHECK:    MemberCount: 056; CHECK:    Properties [ (0x280)57; CHECK:      ForwardReference (0x80)58; CHECK:      HasUniqueName (0x200)59; CHECK:    ]60; CHECK:    FieldList: 0x061; CHECK:    DerivedFrom: 0x062; CHECK:    VShape: 0x063; CHECK:    SizeOf: 064; CHECK:    Name: foo::bar::GlobalRecord65; CHECK:  }66 67; CHECK-LABEL: MemberFuncId ({{.*}}) {68; CHECK-NEXT:    TypeLeafKind: LF_MFUNC_ID (0x1602)69; CHECK-NEXT:    ClassType: foo::bar::GlobalRecord ({{.*}})70; CHECK-NEXT:    FunctionType: void foo::bar::GlobalRecord::() ({{.*}})71; CHECK-NEXT:    Name: method72; CHECK-NEXT:  }73 74; ModuleID = 't.cpp'75source_filename = "t.cpp"76target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"77target triple = "x86_64-pc-windows-msvc19.0.23918"78 79%"struct.foo::bar::GlobalRecord" = type { i32 }80%struct.LocalRecord = type { i32 }81 82@"\01?g@bar@foo@@3UGlobalRecord@12@A" = global %"struct.foo::bar::GlobalRecord" zeroinitializer, align 4, !dbg !083 84; Function Attrs: nounwind uwtable85define void @"\01?baz@bar@foo@@YAXXZ"() #0 !dbg !20 {86entry:87  %l = alloca %struct.LocalRecord, align 488  call void @llvm.dbg.declare(metadata ptr %l, metadata !23, metadata !27), !dbg !2889  ret void, !dbg !2990}91 92; Function Attrs: nounwind readnone93declare void @llvm.dbg.declare(metadata, metadata, metadata) #194 95; Function Attrs: nounwind uwtable96define void @"\01?method@GlobalRecord@bar@foo@@QEAAXXZ"(ptr %this) #0 align 2 !dbg !30 {97entry:98  %this.addr = alloca ptr, align 899  store ptr %this, ptr %this.addr, align 8100  call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !31, metadata !27), !dbg !33101  %this1 = load ptr, ptr %this.addr, align 8102  ret void, !dbg !34103}104 105attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "use-soft-float"="false" }106attributes #1 = { nounwind readnone }107 108!llvm.dbg.cu = !{!13}109!llvm.module.flags = !{!16, !17, !18}110!llvm.ident = !{!19}111 112!0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())113!1 = !DIGlobalVariable(name: "g", linkageName: "\01?g@bar@foo@@3UGlobalRecord@12@A", scope: !2, file: !3, line: 12, type: !5, isLocal: false, isDefinition: true)114!2 = !DINamespace(name: "bar", scope: !4)115!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")116!4 = !DINamespace(name: "foo", scope: null)117!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "GlobalRecord", scope: !2, file: !3, line: 9, size: 32, align: 32, elements: !6, identifier: ".?AUGlobalRecord@bar@foo@@")118!6 = !{!7, !9}119!7 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !5, file: !3, line: 10, baseType: !8, size: 32, align: 32)120!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)121!9 = !DISubprogram(name: "method", linkageName: "\01?method@GlobalRecord@bar@foo@@QEAAXXZ", scope: !5, file: !3, line: 11, type: !10, isLocal: false, isDefinition: false, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false)122!10 = !DISubroutineType(types: !11)123!11 = !{null, !12}124!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)125!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !14, globals: !15)126!14 = !{}127!15 = !{!0}128!16 = !{i32 2, !"CodeView", i32 1}129!17 = !{i32 2, !"Debug Info Version", i32 3}130!18 = !{i32 1, !"PIC Level", i32 2}131!19 = !{!"clang version 3.9.0 "}132!20 = distinct !DISubprogram(name: "baz", linkageName: "\01?baz@bar@foo@@YAXXZ", scope: !2, file: !3, line: 3, type: !21, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !13, retainedNodes: !14)133!21 = !DISubroutineType(types: !22)134!22 = !{null}135!23 = !DILocalVariable(name: "l", scope: !20, file: !3, line: 6, type: !24)136!24 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "LocalRecord", scope: !20, file: !3, line: 4, size: 32, align: 32, elements: !25)137!25 = !{!26}138!26 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !24, file: !3, line: 5, baseType: !8, size: 32, align: 32)139!27 = !DIExpression()140!28 = !DILocation(line: 6, column: 5, scope: !20)141!29 = !DILocation(line: 7, column: 1, scope: !20)142!30 = distinct !DISubprogram(name: "method", linkageName: "\01?method@GlobalRecord@bar@foo@@QEAAXXZ", scope: !5, file: !3, line: 13, type: !10, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !13, declaration: !9, retainedNodes: !14)143!31 = !DILocalVariable(name: "this", arg: 1, scope: !30, type: !32, flags: DIFlagArtificial | DIFlagObjectPointer)144!32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64)145!33 = !DILocation(line: 0, scope: !30)146!34 = !DILocation(line: 13, column: 30, scope: !30)147 148