-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb][test] Add test for detecting CV-quals of explicit object member functions #125053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…r functions This is XFAILed for now until we find a good way to locate the DW_AT_object_pointer of function declarations (a possible solution being llvm#124790).
@llvm/pr-subscribers-lldb Author: Michael Buch (Michael137) ChangesThis is XFAILed for now until we find a good way to locate the DW_AT_object_pointer of function declarations (a possible solution being #124790). Made it a shell test because I couldn't find any SBAPIs that i could query to find the CV-qualifiers/etc. of member functions. Full diff: https://github.com/llvm/llvm-project/pull/125053.diff 1 Files Affected:
diff --git a/lldb/test/Shell/SymbolFile/DWARF/explicit-member-function-quals.cpp b/lldb/test/Shell/SymbolFile/DWARF/explicit-member-function-quals.cpp
new file mode 100644
index 00000000000000..8e742600dc10e9
--- /dev/null
+++ b/lldb/test/Shell/SymbolFile/DWARF/explicit-member-function-quals.cpp
@@ -0,0 +1,22 @@
+// XFAIL: *
+
+// Tests that we correctly deduce the CV-quals and storage
+// class of explicit object member functions.
+//
+// RUN: %clangxx_host %s -g -std=c++23 -c -o %t
+// RUN: %lldb %t -b -o "type lookup Foo" 2>&1 | FileCheck %s
+//
+// CHECK: (lldb) type lookup Foo
+// CHECK-NEXT: struct Foo {
+// CHECK-NEXT: void Method(Foo);
+// CHECK-NEXT: void cMethod(Foo const&);
+// CHECK-NEXT: void vMethod(Foo volatile&);
+// CHECK-NEXT: void cvMethod(const Foo volatile&) const volatile;
+// CHECK-NEXT: }
+
+struct Foo {
+ void Method(this Foo) {}
+ void cMethod(this Foo const&) {}
+ void vMethod(this Foo volatile&) {}
+ void cvMethod(this Foo const volatile&) {}
+} f;
|
// CHECK-NEXT: void Method(Foo); | ||
// CHECK-NEXT: void cMethod(Foo const&); | ||
// CHECK-NEXT: void vMethod(Foo volatile&); | ||
// CHECK-NEXT: void cvMethod(const Foo volatile&) const volatile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The representation here doesn't look right also. But that's a separate bug probably with the AST that LLDB creates
✅ With the latest revision this PR passed the C/C++ code formatter. |
// Tests that we correctly deduce the CV-quals and storage | ||
// class of explicit object member functions. | ||
// | ||
// RUN: %clangxx_host %s -g -std=c++23 -c -o %t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need -gdwarf to produce dwarf on windows. But maybe it's better to hardcode your favourite triple for reproducibility?
This is XFAILed for now until we find a good way to locate the DW_AT_object_pointer of function declarations (a possible solution being #124790).
Made it a shell test because I couldn't find any SBAPIs that i could query to find the CV-qualifiers/etc. of member functions.