| 1 | // RUN: %clang_cc1 -std=c++11 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin %s -o - | FileCheck %s |
| 2 | // Test (r)value and CVR qualifiers on C++11 non-static member functions. |
| 3 | class A { |
| 4 | public: |
| 5 | // CHECK: !DISubprogram(name: "l", |
| 6 | // CHECK-SAME: line: [[@LINE+4]] |
| 7 | // CHECK-SAME: type: ![[PLSR:[0-9]+]] |
| 8 | // CHECK-SAME: flags: DIFlagPublic | DIFlagPrototyped | DIFlagLValueReference, |
| 9 | // CHECK: ![[PLSR]] = !DISubroutineType(flags: DIFlagLValueReference, types: ![[ARGS:[0-9]+]]) |
| 10 | void l() const &; |
| 11 | // CHECK: ![[ARGS]] = !{null, ![[THIS:[0-9]+]]} |
| 12 | // CHECK: ![[THIS]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[CONST_A:[0-9]+]] |
| 13 | // CHECK: ![[CONST_A]] = !DIDerivedType(tag: DW_TAG_const_type |
| 14 | // CHECK: !DISubprogram(name: "r" |
| 15 | // CHECK-SAME: line: [[@LINE+4]] |
| 16 | // CHECK-SAME: type: ![[PRSR:[0-9]+]] |
| 17 | // CHECK-SAME: flags: DIFlagPublic | DIFlagPrototyped | DIFlagRValueReference, |
| 18 | // CHECK: ![[PRSR]] = !DISubroutineType(flags: DIFlagRValueReference, types: ![[ARGS]]) |
| 19 | void r() const &&; |
| 20 | }; |
| 21 | |
| 22 | void g() { |
| 23 | A a; |
| 24 | // The type of pl is "void (A::*)() const &". |
| 25 | // CHECK: !DILocalVariable(name: "pl", |
| 26 | // CHECK-SAME: line: [[@LINE+3]] |
| 27 | // CHECK-SAME: type: ![[PL:[0-9]+]] |
| 28 | // CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: ![[PLSR]] |
| 29 | auto pl = &A::l; |
| 30 | |
| 31 | // CHECK: !DILocalVariable(name: "pr", |
| 32 | // CHECK-SAME: line: [[@LINE+3]] |
| 33 | // CHECK-SAME: type: ![[PR:[0-9]+]] |
| 34 | // CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: ![[PRSR]] |
| 35 | auto pr = &A::r; |
| 36 | } |
| 37 | |