85 lines · plain
1; RUN: true2; This file belongs to type-unique-odr-a.ll.3;4; Test ODR-based type uniquing for C++ class members.5; rdar://problem/15851313.6;7; $ cat -n type-unique-odr-b.cpp8; 1 // Make this declaration start on a different line.9; 2 class A {10; 3 int data;11; 4 protected:12; 5 void getFoo();13; 6 };14; 715; 8 void A::getFoo() {}16; 917; 10 static void bar() {}18; 11 void f() { bar(); };19 20; ModuleID = 'type-unique-odr-b.cpp'21 22%class.A = type { i32 }23 24; Function Attrs: nounwind25define void @_ZN1A6getFooEv(ptr %this) #0 align 2 !dbg !15 {26entry:27 %this.addr = alloca ptr, align 828 store ptr %this, ptr %this.addr, align 829 call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !24, metadata !DIExpression()), !dbg !2630 %this1 = load ptr, ptr %this.addr31 ret void, !dbg !2732}33 34; Function Attrs: nounwind readnone35declare void @llvm.dbg.declare(metadata, metadata, metadata) #136 37; Function Attrs: nounwind38define void @_Z1fv() #0 !dbg !16 {39entry:40 call void @_ZL3barv(), !dbg !2841 ret void, !dbg !2842}43 44; Function Attrs: nounwind45define internal void @_ZL3barv() #0 !dbg !20 {46entry:47 ret void, !dbg !2948}49 50attributes #0 = { nounwind }51attributes #1 = { nounwind readnone }52 53!llvm.dbg.cu = !{!0}54!llvm.module.flags = !{!21, !22}55!llvm.ident = !{!23}56 57!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)58!1 = !DIFile(filename: "<unknown>", directory: "")59!2 = !{}60!3 = !{!4}61!4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS1A")62!5 = !DIFile(filename: "type-unique-odr-b.cpp", directory: "")63!6 = !{!7, !9}64!7 = !DIDerivedType(tag: DW_TAG_member, name: "data", line: 3, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !4, baseType: !8)65!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)66!9 = !DISubprogram(name: "getFoo", linkageName: "_ZN1A6getFooEv", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !4, type: !10)67!10 = !DISubroutineType(types: !11)68!11 = !{null, !12}69!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)70!15 = distinct !DISubprogram(name: "getFoo", linkageName: "_ZN1A6getFooEv", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !5, scope: !4, type: !10, declaration: !9, retainedNodes: !2)71!16 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 11, file: !5, scope: !17, type: !18, retainedNodes: !2)72!17 = !DIFile(filename: "type-unique-odr-b.cpp", directory: "")73!18 = !DISubroutineType(types: !19)74!19 = !{null}75!20 = distinct !DISubprogram(name: "bar", linkageName: "_ZL3barv", line: 10, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 10, file: !5, scope: !17, type: !18, retainedNodes: !2)76!21 = !{i32 2, !"Dwarf Version", i32 4}77!22 = !{i32 1, !"Debug Info Version", i32 3}78!23 = !{!"clang version 3.5.0 "}79!24 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !15, type: !25)80!25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)81!26 = !DILocation(line: 0, scope: !15)82!27 = !DILocation(line: 8, scope: !15)83!28 = !DILocation(line: 11, scope: !16)84!29 = !DILocation(line: 10, scope: !20)85