1; RUN: true
2; This file belongs to type-unique-simple2-a.ll.
3;
4; $ cat b.cpp
5; #include "ab.h"
6; void A::setFoo() {}
7; const
8; foo_t A::getFoo() { return 1; }
9; ModuleID = 'b.cpp'
10; target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
11; target triple = "x86_64-apple-macosx10.9.0"
12
13%class.A = type { i32 (...)** }
14
15@_ZTV1A = unnamed_addr constant [4 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*), i8* bitcast (void (%class.A*)* @_ZN1A6setFooEv to i8*), i8* bitcast (i32 (%class.A*)* @_ZN1A6getFooEv to i8*)]
16@_ZTVN10__cxxabiv117__class_type_infoE = external global i8*
17@_ZTS1A = constant [3 x i8] c"1A\00"
18@_ZTI1A = unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8]* @_ZTS1A, i32 0, i32 0) }
19
20; Function Attrs: nounwind
21define void @_ZN1A6setFooEv(%class.A* %this) unnamed_addr #0 align 2 {
22entry:
23  %this.addr = alloca %class.A*, align 8
24  store %class.A* %this, %class.A** %this.addr, align 8
25  call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !32, metadata !{!"0x102"}), !dbg !34
26  %this1 = load %class.A** %this.addr
27  ret void, !dbg !35
28}
29
30; Function Attrs: nounwind readnone
31declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
32
33; Function Attrs: nounwind
34define i32 @_ZN1A6getFooEv(%class.A* %this) unnamed_addr #0 align 2 {
35entry:
36  %this.addr = alloca %class.A*, align 8
37  store %class.A* %this, %class.A** %this.addr, align 8
38  call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !36, metadata !{!"0x102"}), !dbg !37
39  %this1 = load %class.A** %this.addr
40  ret i32 1, !dbg !38
41}
42
43attributes #0 = { nounwind }
44attributes #1 = { nounwind readnone }
45
46!llvm.dbg.cu = !{!0}
47!llvm.module.flags = !{!29, !30}
48!llvm.ident = !{!31}
49
50!0 = !{!"0x11\004\00clang version 3.5 \000\00\000\00\000", !1, !2, !3, !25, !2, !2} ; [ DW_TAG_compile_unit ] [/<unknown>] [DW_LANG_C_plus_plus]
51!1 = !{!"<unknown>", !""}
52!2 = !{}
53!3 = !{!4}
54!4 = !{!"0x2\00A\002\0064\0064\000\000\000", !5, null, null, !6, !"_ZTS1A", null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 2, size 64, align 64, offset 0] [def] [from ]
55!5 = !{!"./ab.h", !""}
56!6 = !{!7, !14, !19}
57!7 = !{!"0xd\00_vptr$A\000\0064\000\000\0064", !5, !8, !9} ; [ DW_TAG_member ] [_vptr$A] [line 0, size 64, align 0, offset 0] [artificial] [from ]
58!8 = !{!"0x29", !5}          ; [ DW_TAG_file_type ] [/./ab.h]
59!9 = !{!"0xf\00\000\0064\000\000\000", null, null, !10} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 0, offset 0] [from __vtbl_ptr_type]
60!10 = !{!"0xf\00__vtbl_ptr_type\000\0064\000\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] [__vtbl_ptr_type] [line 0, size 64, align 0, offset 0] [from ]
61!11 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
62!12 = !{!13}
63!13 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
64!14 = !{!"0x2e\00setFoo\00setFoo\00_ZN1A6setFooEv\004\000\000\001\006\00259\000\004", !5, !"_ZTS1A", !15, !"_ZTS1A", null, null, i32 0, !18} ; [ DW_TAG_subprogram ] [line 4] [setFoo]
65!15 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !16, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
66!16 = !{null, !17}
67!17 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A]
68!18 = !{i32 786468}
69!19 = !{!"0x2e\00getFoo\00getFoo\00_ZN1A6getFooEv\005\000\000\001\006\00259\000\005", !5, !"_ZTS1A", !20, !"_ZTS1A", null, null, i32 0, !24} ; [ DW_TAG_subprogram ] [line 5] [getFoo]
70!20 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !21, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
71!21 = !{!22, !17}
72!22 = !{!"0x26\00\000\000\000\000\000", null, null, !23} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from foo_t]
73!23 = !{!"0x16\00foo_t\001\000\000\000\000", !5, null, !13} ; [ DW_TAG_typedef ] [foo_t] [line 1, size 0, align 0, offset 0] [from int]
74!24 = !{i32 786468}
75!25 = !{!26, !28}
76!26 = !{!"0x2e\00setFoo\00setFoo\00_ZN1A6setFooEv\002\000\001\000\006\00259\000\002", !27, !"_ZTS1A", !15, null, void (%class.A*)* @_ZN1A6setFooEv, null, !14, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [setFoo]
77!27 = !{!"b.cpp", !""}
78!28 = !{!"0x2e\00getFoo\00getFoo\00_ZN1A6getFooEv\004\000\001\000\006\00259\000\004", !27, !"_ZTS1A", !20, null, i32 (%class.A*)* @_ZN1A6getFooEv, null, !19, !2} ; [ DW_TAG_subprogram ] [line 4] [def] [getFoo]
79!29 = !{i32 2, !"Dwarf Version", i32 2}
80!30 = !{i32 1, !"Debug Info Version", i32 2}
81!31 = !{!"clang version 3.5 "}
82!32 = !{!"0x101\00this\0016777216\001088", !26, null, !33} ; [ DW_TAG_arg_variable ] [this] [line 0]
83!33 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1A]
84!34 = !MDLocation(line: 0, scope: !26)
85!35 = !MDLocation(line: 2, scope: !26)
86!36 = !{!"0x101\00this\0016777216\001088", !28, null, !33} ; [ DW_TAG_arg_variable ] [this] [line 0]
87!37 = !MDLocation(line: 0, scope: !28)
88!38 = !MDLocation(line: 4, scope: !28)
89