1 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
2 ; RUN: llvm-dwarfdump -all %t | FileCheck %s
4 ; Checks that we don't emit a size for a pointer type.
5 ; CHECK: DW_TAG_pointer_type
6 ; CHECK-NEXT: DW_AT_type
7 ; CHECK-NOT: DW_AT_byte_size
9 ; CHECK: .debug_info contents
11 %struct.A = type { i32 }
13 define i32 @_Z3fooP1A(ptr %a) nounwind uwtable ssp !dbg !5 {
15 %a.addr = alloca ptr, align 8
16 store ptr %a, ptr %a.addr, align 8
17 call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !16, metadata !DIExpression()), !dbg !17
18 %0 = load ptr, ptr %a.addr, align 8, !dbg !18
19 %1 = load i32, ptr %0, align 4, !dbg !18
23 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
26 !llvm.module.flags = !{!21}
28 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 150996)", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !1, retainedTypes: !1, globals: !1, imports: !1)
30 !5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooP1A", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !20, scope: !6, type: !7)
31 !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo")
32 !7 = !DISubroutineType(types: !8)
34 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
35 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11)
36 !11 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 32, align: 32, file: !20, elements: !12)
38 !13 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 1, size: 32, align: 32, file: !20, scope: !11, baseType: !9)
39 !16 = !DILocalVariable(name: "a", line: 3, arg: 1, scope: !5, file: !6, type: !10)
40 !17 = !DILocation(line: 3, column: 13, scope: !5)
41 !18 = !DILocation(line: 4, column: 3, scope: !19)
42 !19 = distinct !DILexicalBlock(line: 3, column: 16, file: !20, scope: !5)
43 !20 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo")
44 !21 = !{i32 1, !"Debug Info Version", i32 3}