bfad4fe261db006678e08f065f805057b86d9899
[oota-llvm.git] / test / DebugInfo / X86 / DW_AT_byte_size.ll
1 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
2 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
3
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
8 ; CHECK: DW_TAG
9 ; CHECK: .debug_info contents
10
11 %struct.A = type { i32 }
12
13 define i32 @_Z3fooP1A(%struct.A* %a) nounwind uwtable ssp {
14 entry:
15   %a.addr = alloca %struct.A*, align 8
16   store %struct.A* %a, %struct.A** %a.addr, align 8
17   call void @llvm.dbg.declare(metadata %struct.A** %a.addr, metadata !16, metadata !DIExpression()), !dbg !17
18   %0 = load %struct.A*, %struct.A** %a.addr, align 8, !dbg !18
19   %b = getelementptr inbounds %struct.A, %struct.A* %0, i32 0, i32 0, !dbg !18
20   %1 = load i32, i32* %b, align 4, !dbg !18
21   ret i32 %1, !dbg !18
22 }
23
24 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
25
26 !llvm.dbg.cu = !{!0}
27 !llvm.module.flags = !{!21}
28
29 !0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 150996)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports:  !1)
30 !1 = !{}
31 !3 = !{!5}
32 !5 = !DISubprogram(name: "foo", linkageName: "_Z3fooP1A", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !20, scope: !6, type: !7, function: i32 (%struct.A*)* @_Z3fooP1A)
33 !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo")
34 !7 = !DISubroutineType(types: !8)
35 !8 = !{!9, !10}
36 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
37 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11)
38 !11 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 32, align: 32, file: !20, elements: !12)
39 !12 = !{!13}
40 !13 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 1, size: 32, align: 32, file: !20, scope: !11, baseType: !9)
41 !16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !5, file: !6, type: !10)
42 !17 = !DILocation(line: 3, column: 13, scope: !5)
43 !18 = !DILocation(line: 4, column: 3, scope: !19)
44 !19 = distinct !DILexicalBlock(line: 3, column: 16, file: !20, scope: !5)
45 !20 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo")
46 !21 = !{i32 1, !"Debug Info Version", i32 3}