IR: Make metadata typeless in assembly
[oota-llvm.git] / test / DebugInfo / X86 / DW_TAG_friend.ll
1 ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
2 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
3
4 ; Check that the friend tag is there and is followed by a DW_AT_friend that has a reference back.
5
6 ; CHECK: [[BACK:0x[0-9a-f]*]]:   DW_TAG_class_type
7 ; CHECK-NEXT: DW_AT_name [DW_FORM_strp]       ( .debug_str[{{.*}}] = "A")
8 ; CHECK: DW_TAG_friend
9 ; CHECK-NEXT: DW_AT_friend [DW_FORM_ref4]   (cu + 0x{{[0-9a-f]*}} => {[[BACK]]})
10
11
12 %class.A = type { i32 }
13 %class.B = type { i32 }
14
15 @a = global %class.A zeroinitializer, align 4
16 @b = global %class.B zeroinitializer, align 4
17
18 !llvm.dbg.cu = !{!0}
19 !llvm.module.flags = !{!29}
20
21 !0 = !{!"0x11\004\00clang version 3.1 (trunk 153413) (llvm/trunk 153428)\000\00\000\00\000", !28, !1, !1, !1, !3,  !1} ; [ DW_TAG_compile_unit ]
22 !1 = !{}
23 !3 = !{!5, !17}
24 !5 = !{!"0x34\00a\00a\00\0010\000\001", null, !6, !7, %class.A* @a, null} ; [ DW_TAG_variable ]
25 !6 = !{!"0x29", !28} ; [ DW_TAG_file_type ]
26 !7 = !{!"0x2\00A\001\0032\0032\000\000\000", !28, null, null, !8, null, null, null} ; [ DW_TAG_class_type ] [A] [line 1, size 32, align 32, offset 0] [def] [from ]
27 !8 = !{!9, !11}
28 !9 = !{!"0xd\00a\002\0032\0032\000\001", !28, !7, !10} ; [ DW_TAG_member ]
29 !10 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ]
30 !11 = !{!"0x2e\00A\00A\00\001\000\000\000\006\00320\000\001", !6, !7, !12, null, null, null, i32 0, !15} ; [ DW_TAG_subprogram ]
31 !12 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !13, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
32 !13 = !{null, !14}
33 !14 = !{!"0xf\00\000\0064\0064\000\0064", i32 0, null, !7} ; [ DW_TAG_pointer_type ]
34 !15 = !{!16}
35 !16 = !{!"0x24"}                      ; [ DW_TAG_base_type ]
36 !17 = !{!"0x34\00b\00b\00\0011\000\001", null, !6, !18, %class.B* @b, null} ; [ DW_TAG_variable ]
37 !18 = !{!"0x2\00B\005\0032\0032\000\000\000", !28, null, null, !19, null, null, null} ; [ DW_TAG_class_type ] [B] [line 5, size 32, align 32, offset 0] [def] [from ]
38 !19 = !{!20, !21, !27}
39 !20 = !{!"0xd\00b\007\0032\0032\000\001", !28, !18, !10} ; [ DW_TAG_member ]
40 !21 = !{!"0x2e\00B\00B\00\005\000\000\000\006\00320\000\005", !6, !18, !22, null, null, null, i32 0, !25} ; [ DW_TAG_subprogram ]
41 !22 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !23, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
42 !23 = !{null, !24}
43 !24 = !{!"0xf\00\000\0064\0064\000\0064", i32 0, null, !18} ; [ DW_TAG_pointer_type ]
44 !25 = !{!26}
45 !26 = !{!"0x24"}                      ; [ DW_TAG_base_type ]
46 !27 = !{!"0x2a\00\000\000\000\000\000", !18, null, !7} ; [ DW_TAG_friend ]
47 !28 = !{!"foo.cpp", !"/Users/echristo/tmp"}
48 !29 = !{i32 1, !"Debug Info Version", i32 2}