blob: 466fb48c7da78e565e1e22217fe293fd2c61b17b [file] [log] [blame]
Adrian Prantl88dd6972013-12-20 00:37:18 +00001; REQUIRES: object-emission
Adrian Prantl99c7af22013-12-18 21:48:19 +00002; Test (r)value qualifiers on C++11 non-static member functions.
3; Generated from tools/clang/test/CodeGenCXX/debug-info-qualifiers.cpp
4;
Adrian Prantlfeae63d2013-12-19 01:41:16 +00005; class A {
6; public:
7; void l() const &;
8; void r() const &&;
9; };
10;
11; void g() {
12; A a;
13; auto pl = &A::l;
14; auto pr = &A::r;
15; }
16;
Timur Iskhodzhanovf166f6c2014-01-30 01:39:17 +000017; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s
Adrian Prantl99c7af22013-12-18 21:48:19 +000018; 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
22;
23; CHECK: DW_TAG_subprogram
Adrian Prantl99c7af22013-12-18 21:48:19 +000024; 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)
28
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)
34
Adrian Prantl99c7af22013-12-18 21:48:19 +000035%class.A = type { i8 }
36
37; Function Attrs: nounwind
Peter Collingbourned4bff302015-11-05 22:03:56 +000038define void @_Z1gv() #0 !dbg !17 {
Adrian Prantl99c7af22013-12-18 21:48:19 +000039 %a = alloca %class.A, align 1
40 %pl = alloca { i64, i64 }, align 8
41 %pr = alloca { i64, i64 }, align 8
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000042 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
Adrian Prantl99c7af22013-12-18 21:48:19 +000044 store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKR1A1lEv to i64), i64 0 }, { i64, i64 }* %pl, align 8, !dbg !31
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000045 call void @llvm.dbg.declare(metadata { i64, i64 }* %pr, metadata !32, metadata !DIExpression()), !dbg !35
Adrian Prantl99c7af22013-12-18 21:48:19 +000046 store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKO1A1rEv to i64), i64 0 }, { i64, i64 }* %pr, align 8, !dbg !35
47 ret void, !dbg !36
48}
49
50; Function Attrs: nounwind readnone
Adrian Prantl87b7eb92014-10-01 18:55:02 +000051declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
Adrian Prantl99c7af22013-12-18 21:48:19 +000052
53declare void @_ZNKR1A1lEv(%class.A*)
54
55declare void @_ZNKO1A1rEv(%class.A*)
56
57attributes #0 = { nounwind }
58attributes #1 = { nounwind readnone }
59
60!llvm.dbg.cu = !{!0}
61!llvm.module.flags = !{!21, !22}
62!llvm.ident = !{!23}
63
Adrian Prantl75819ae2016-04-15 15:57:41 +000064!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)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000065!1 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000066!2 = !{}
67!3 = !{!4}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000068!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: "")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000070!6 = !{!7, !13}
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000071!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)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000072!8 = !DISubroutineType(flags: DIFlagLValueReference, types: !9)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000073!9 = !{null, !10}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000074!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !11)
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000075!11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !4)
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: !4, type: !14)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000077!14 = !DISubroutineType(flags: DIFlagRValueReference, types: !9)
Adrian Prantl75819ae2016-04-15 15:57:41 +000078!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, variables: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000079!18 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")
80!19 = !DISubroutineType(types: !20)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000081!20 = !{null}
82!21 = !{i32 2, !"Dwarf Version", i32 4}
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000083!22 = !{i32 1, !"Debug Info Version", i32 3}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000084!23 = !{!"clang version 3.5 "}
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +000085!24 = !DILocalVariable(name: "a", line: 11, scope: !17, file: !18, type: !4)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000086!25 = !DILocation(line: 11, scope: !17)
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +000087!26 = !DILocalVariable(name: "pl", line: 16, scope: !17, file: !18, type: !27)
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000088!27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !28, extraData: !4)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000089!28 = !DISubroutineType(flags: DIFlagLValueReference, types: !29)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000090!29 = !{null, !30}
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000091!30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000092!31 = !DILocation(line: 16, scope: !17)
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +000093!32 = !DILocalVariable(name: "pr", line: 21, scope: !17, file: !18, type: !33)
Duncan P. N. Exon Smitha59d3e52016-04-23 21:08:00 +000094!33 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !34, extraData: !4)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000095!34 = !DISubroutineType(flags: DIFlagRValueReference, types: !29)
96!35 = !DILocation(line: 21, scope: !17)
97!36 = !DILocation(line: 22, scope: !17)