97 lines · plain
1; Test (r)value qualifiers on C++11 non-static member functions.2; Generated from tools/clang/test/CodeGenCXX/debug-info-qualifiers.cpp3;4; class A {5; public:6; void l() const &;7; void r() const &&;8; };9;10; void g() {11; A a;12; auto pl = &A::l;13; auto pr = &A::r;14; }15;16; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -v - | FileCheck %s17; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes18; CHECK-NEXT: DW_AT_reference DW_FORM_flag_present19; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes20; CHECK-NEXT: DW_AT_rvalue_reference DW_FORM_flag_present21;22; CHECK: DW_TAG_subprogram23; CHECK-NOT: DW_TAG_subprogram24; CHECK: DW_AT_name {{.*}}"l"25; CHECK-NOT: DW_TAG_subprogram26; CHECK: DW_AT_reference [DW_FORM_flag_present] (true)27 28; CHECK: DW_TAG_subprogram29; CHECK-NOT: DW_TAG_subprogram30; CHECK: DW_AT_name {{.*}}"r"31; CHECK-NOT: DW_TAG_subprogram32; CHECK: DW_AT_rvalue_reference [DW_FORM_flag_present] (true)33 34%class.A = type { i8 }35 36; Function Attrs: nounwind37define void @_Z1gv() #0 !dbg !17 {38 %a = alloca %class.A, align 139 %pl = alloca { i64, i64 }, align 840 %pr = alloca { i64, i64 }, align 841 call void @llvm.dbg.declare(metadata ptr %a, metadata !24, metadata !DIExpression()), !dbg !2542 call void @llvm.dbg.declare(metadata ptr %pl, metadata !26, metadata !DIExpression()), !dbg !3143 store { i64, i64 } { i64 ptrtoint (ptr @_ZNKR1A1lEv to i64), i64 0 }, ptr %pl, align 8, !dbg !3144 call void @llvm.dbg.declare(metadata ptr %pr, metadata !32, metadata !DIExpression()), !dbg !3545 store { i64, i64 } { i64 ptrtoint (ptr @_ZNKO1A1rEv to i64), i64 0 }, ptr %pr, align 8, !dbg !3546 ret void, !dbg !3647}48 49; Function Attrs: nounwind readnone50declare void @llvm.dbg.declare(metadata, metadata, metadata) #151 52declare void @_ZNKR1A1lEv(ptr)53 54declare void @_ZNKO1A1rEv(ptr)55 56attributes #0 = { nounwind }57attributes #1 = { nounwind readnone }58 59!llvm.dbg.cu = !{!0}60!llvm.module.flags = !{!21, !22}61!llvm.ident = !{!23}62 63!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)64!1 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")65!2 = !{}66!3 = !{!4}67!4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS1A")68!5 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")69!6 = !{!7, !13}70!7 = !DISubprogram(name: "l", linkageName: "_ZNKR1A1lEv", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped | DIFlagLValueReference, isOptimized: false, scopeLine: 5, file: !5, scope: !4, type: !8)71!8 = !DISubroutineType(flags: DIFlagLValueReference, types: !9)72!9 = !{null, !10}73!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !11)74!11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !4)75!13 = !DISubprogram(name: "r", linkageName: "_ZNKO1A1rEv", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagObjectPointer | DIFlagRValueReference, isOptimized: false, scopeLine: 7, file: !5, scope: !4, type: !14)76!14 = !DISubroutineType(flags: DIFlagRValueReference, types: !9)77!17 = distinct !DISubprogram(name: "g", linkageName: "_Z1gv", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 10, file: !5, scope: !18, type: !19, retainedNodes: !2)78!18 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")79!19 = !DISubroutineType(types: !20)80!20 = !{null}81!21 = !{i32 2, !"Dwarf Version", i32 4}82!22 = !{i32 1, !"Debug Info Version", i32 3}83!23 = !{!"clang version 3.5 "}84!24 = !DILocalVariable(name: "a", line: 11, scope: !17, file: !18, type: !4)85!25 = !DILocation(line: 11, scope: !17)86!26 = !DILocalVariable(name: "pl", line: 16, scope: !17, file: !18, type: !27)87!27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !28, extraData: !4)88!28 = !DISubroutineType(flags: DIFlagLValueReference, types: !29)89!29 = !{null, !30}90!30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)91!31 = !DILocation(line: 16, scope: !17)92!32 = !DILocalVariable(name: "pr", line: 21, scope: !17, file: !18, type: !33)93!33 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !34, extraData: !4)94!34 = !DISubroutineType(flags: DIFlagRValueReference, types: !29)95!35 = !DILocation(line: 21, scope: !17)96!36 = !DILocation(line: 22, scope: !17)97