Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -O0 -asm-verbose -mtriple=x86_64-macosx -generate-dwarf-pub-sections=Enable < %s | FileCheck %s
      2 ; CHECK-NOT: .asciz "X" ## External Name
      3 ; CHECK: .asciz "Y" ## External Name
      4 ; Test to check type with no definition is listed in pubtypes section.
      5 %struct.X = type opaque
      6 %struct.Y = type { i32 }
      7 
      8 define i32 @foo(%struct.X* %x, %struct.Y* %y) nounwind ssp !dbg !1 {
      9 entry:
     10   %x_addr = alloca %struct.X*                     ; <%struct.X**> [#uses=1]
     11   %y_addr = alloca %struct.Y*                     ; <%struct.Y**> [#uses=1]
     12   %retval = alloca i32                            ; <i32*> [#uses=2]
     13   %0 = alloca i32                                 ; <i32*> [#uses=2]
     14   %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
     15   call void @llvm.dbg.declare(metadata %struct.X** %x_addr, metadata !0, metadata !DIExpression()), !dbg !13
     16   store %struct.X* %x, %struct.X** %x_addr
     17   call void @llvm.dbg.declare(metadata %struct.Y** %y_addr, metadata !14, metadata !DIExpression()), !dbg !13
     18   store %struct.Y* %y, %struct.Y** %y_addr
     19   store i32 0, i32* %0, align 4, !dbg !13
     20   %1 = load i32, i32* %0, align 4, !dbg !13            ; <i32> [#uses=1]
     21   store i32 %1, i32* %retval, align 4, !dbg !13
     22   br label %return, !dbg !13
     23 
     24 return:                                           ; preds = %entry
     25   %retval1 = load i32, i32* %retval, !dbg !13          ; <i32> [#uses=1]
     26   ret i32 %retval1, !dbg !15
     27 }
     28 
     29 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
     30 
     31 !llvm.dbg.cu = !{!3}
     32 !llvm.module.flags = !{!20}
     33 
     34 !0 = !DILocalVariable(name: "x", line: 7, arg: 1, scope: !1, file: !2, type: !7)
     35 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, scopeLine: 7, file: !18, scope: !2, type: !4)
     36 !2 = !DIFile(filename: "a.c", directory: "/tmp/")
     37 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !18, enums: !19, retainedTypes: !19, imports:  null)
     38 !4 = !DISubroutineType(types: !5)
     39 !5 = !{!6, !7, !9}
     40 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
     41 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !18, scope: !2, baseType: !8)
     42 !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 3, flags: DIFlagFwdDecl, file: !18, scope: !2)
     43 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !18, scope: !2, baseType: !10)
     44 !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "Y", line: 4, size: 32, align: 32, file: !18, scope: !2, elements: !11)
     45 !11 = !{!12}
     46 !12 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 5, size: 32, align: 32, file: !18, scope: !10, baseType: !6)
     47 !13 = !DILocation(line: 7, scope: !1)
     48 !14 = !DILocalVariable(name: "y", line: 7, arg: 2, scope: !1, file: !2, type: !9)
     49 !15 = !DILocation(line: 7, scope: !16)
     50 !16 = distinct !DILexicalBlock(line: 7, column: 0, file: !18, scope: !1)
     51 !18 = !DIFile(filename: "a.c", directory: "/tmp/")
     52 !19 = !{}
     53 !20 = !{i32 1, !"Debug Info Version", i32 3}
     54