• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test (r)value qualifiers on C++11 non-static member functions.
2; Generated from tools/clang/test/CodeGenCXX/debug-info-qualifiers.cpp
3;
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 %s
17; CHECK: DW_TAG_subroutine_type     DW_CHILDREN_yes
18; CHECK-NEXT: DW_AT_reference  DW_FORM_flag_present
19; CHECK: DW_TAG_subroutine_type     DW_CHILDREN_yes
20; CHECK-NEXT: DW_AT_rvalue_reference DW_FORM_flag_present
21;
22; CHECK: DW_TAG_subprogram
23; CHECK-NOT: DW_TAG_subprogram
24; CHECK:   DW_AT_name {{.*}}"l"
25; CHECK-NOT: DW_TAG_subprogram
26; CHECK:   DW_AT_reference [DW_FORM_flag_present] (true)
27
28; CHECK: DW_TAG_subprogram
29; CHECK-NOT: DW_TAG_subprogram
30; CHECK:   DW_AT_name {{.*}}"r"
31; CHECK-NOT: DW_TAG_subprogram
32; CHECK:   DW_AT_rvalue_reference [DW_FORM_flag_present] (true)
33
34%class.A = type { i8 }
35
36; Function Attrs: nounwind
37define void @_Z1gv() #0 !dbg !17 {
38  %a = alloca %class.A, align 1
39  %pl = alloca { i64, i64 }, align 8
40  %pr = alloca { i64, i64 }, align 8
41  call void @llvm.dbg.declare(metadata %class.A* %a, metadata !24, metadata !DIExpression()), !dbg !25
42  call void @llvm.dbg.declare(metadata { i64, i64 }* %pl, metadata !26, metadata !DIExpression()), !dbg !31
43  store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKR1A1lEv to i64), i64 0 }, { i64, i64 }* %pl, align 8, !dbg !31
44  call void @llvm.dbg.declare(metadata { i64, i64 }* %pr, metadata !32, metadata !DIExpression()), !dbg !35
45  store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKO1A1rEv to i64), i64 0 }, { i64, i64 }* %pr, align 8, !dbg !35
46  ret void, !dbg !36
47}
48
49; Function Attrs: nounwind readnone
50declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
51
52declare void @_ZNKR1A1lEv(%class.A*)
53
54declare void @_ZNKO1A1rEv(%class.A*)
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