1
; REQUIRES: object-emission
2
; Test (r)value qualifiers on C++11 non-static member functions.
3
; Generated from tools/clang/test/CodeGenCXX/debug-info-qualifiers.cpp
17
; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s
18
; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes
19
; CHECK-NEXT: DW_AT_reference DW_FORM_flag_present
20
; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes
21
; CHECK-NEXT: DW_AT_rvalue_reference DW_FORM_flag_present
23
; CHECK: DW_TAG_subprogram
24
; CHECK-NOT: DW_TAG_subprogram
25
; CHECK: DW_AT_name {{.*}}"l"
26
; CHECK-NOT: DW_TAG_subprogram
27
; CHECK: DW_AT_reference [DW_FORM_flag_present] (true)
29
; CHECK: DW_TAG_subprogram
30
; CHECK-NOT: DW_TAG_subprogram
31
; CHECK: DW_AT_name {{.*}}"r"
32
; CHECK-NOT: DW_TAG_subprogram
33
; CHECK: DW_AT_rvalue_reference [DW_FORM_flag_present] (true)
35
%class.A = type { i8 }
37
; Function Attrs: nounwind
38
define void @_Z1gv() #0 {
39
%a = alloca %class.A, align 1
40
%pl = alloca { i64, i64 }, align 8
41
%pr = alloca { i64, i64 }, align 8
42
call void @llvm.dbg.declare(metadata %class.A* %a, metadata !24, metadata !DIExpression()), !dbg !25
43
call void @llvm.dbg.declare(metadata { i64, i64 }* %pl, metadata !26, metadata !DIExpression()), !dbg !31
44
store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKR1A1lEv to i64), i64 0 }, { i64, i64 }* %pl, align 8, !dbg !31
45
call void @llvm.dbg.declare(metadata { i64, i64 }* %pr, metadata !32, metadata !DIExpression()), !dbg !35
46
store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKO1A1rEv to i64), i64 0 }, { i64, i64 }* %pr, align 8, !dbg !35
50
; Function Attrs: nounwind readnone
51
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
53
declare void @_ZNKR1A1lEv(%class.A*)
55
declare void @_ZNKO1A1rEv(%class.A*)
57
attributes #0 = { nounwind }
58
attributes #1 = { nounwind readnone }
61
!llvm.module.flags = !{!21, !22}
64
!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2)
65
!1 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")
68
!4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS1A")
69
!5 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")
71
!7 = !DISubprogram(name: "l", linkageName: "_ZNKR1A1lEv", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped | DIFlagLValueReference, isOptimized: false, scopeLine: 5, file: !5, scope: !"_ZTS1A", type: !8)
72
!8 = !DISubroutineType(flags: DIFlagLValueReference, types: !9)
74
!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !11)
75
!11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS1A")
76
!13 = !DISubprogram(name: "r", linkageName: "_ZNKO1A1rEv", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagObjectPointer | DIFlagRValueReference, isOptimized: false, scopeLine: 7, file: !5, scope: !"_ZTS1A", type: !14)
77
!14 = !DISubroutineType(flags: DIFlagRValueReference, types: !9)
79
!17 = !DISubprogram(name: "g", linkageName: "_Z1gv", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !5, scope: !18, type: !19, function: void ()* @_Z1gv, variables: !2)
80
!18 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")
81
!19 = !DISubroutineType(types: !20)
83
!21 = !{i32 2, !"Dwarf Version", i32 4}
84
!22 = !{i32 1, !"Debug Info Version", i32 3}
85
!23 = !{!"clang version 3.5 "}
86
!24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 11, scope: !17, file: !18, type: !4)
87
!25 = !DILocation(line: 11, scope: !17)
88
!26 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "pl", line: 16, scope: !17, file: !18, type: !27)
89
!27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !28, extraData: !"_ZTS1A")
90
!28 = !DISubroutineType(flags: DIFlagLValueReference, types: !29)
92
!30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A")
93
!31 = !DILocation(line: 16, scope: !17)
94
!32 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "pr", line: 21, scope: !17, file: !18, type: !33)
95
!33 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !34, extraData: !"_ZTS1A")
96
!34 = !DISubroutineType(flags: DIFlagRValueReference, types: !29)
97
!35 = !DILocation(line: 21, scope: !17)
98
!36 = !DILocation(line: 22, scope: !17)