blob: 8b1eb3bb6d142d230e00170784c80c3ee89f9563 [file] [log] [blame]
Manman Ren60352032013-09-05 18:48:31 +00001; REQUIRES: object-emission
2
Timur Iskhodzhanovf166f6c2014-01-30 01:39:17 +00003; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
Manman Ren60352032013-09-05 18:48:31 +00004; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
Manman Ren60352032013-09-05 18:48:31 +00005; CHECK: DW_TAG_ptr_to_member_type
Manman Renf4c339e2013-10-29 22:49:29 +00006; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]})
7; CHECK: [[TYPE]]: DW_TAG_base_type
Manman Ren60352032013-09-05 18:48:31 +00008; IR generated from clang -g with the following source:
9; struct Foo {
10; int e;
11; };
12; int Foo:*x = 0;
13
14@x = global i64 -1, align 8
15
16!llvm.dbg.cu = !{!0}
Manman Ren409558f2013-11-22 21:49:45 +000017!llvm.module.flags = !{!10, !11}
Manman Ren60352032013-09-05 18:48:31 +000018
Duncan P. N. Exon Smith55ca9642015-08-03 17:26:41 +000019!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !5, imports: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000020!1 = !DIFile(filename: "foo.cpp", directory: ".")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000021!2 = !{}
22!3 = !{!4}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000023!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", line: 1, flags: DIFlagFwdDecl, file: !1, identifier: "_ZTS3Foo")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000024!5 = !{!6}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000025!6 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !7, type: !8, variable: i64* @x)
26!7 = !DIFile(filename: "foo.cpp", directory: ".")
27!8 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, extraData: !"_ZTS3Foo")
28!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000029!10 = !{i32 2, !"Dwarf Version", i32 2}
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000030!11 = !{i32 1, !"Debug Info Version", i32 3}