-
Notifications
You must be signed in to change notification settings - Fork 16.3k
[cross-project] Add tests for LLDB data-formatters for llvm::ArrayRef #173238
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
Changes from all commits
95dc640
32fb68b
841e2e5
0e9c9d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #include "llvm/ADT/ArrayRef.h" | ||
|
|
||
| int Array[] = {1, 2, 3}; | ||
|
|
||
| llvm::ArrayRef<int> ArrayRef(Array); | ||
| llvm::MutableArrayRef<int> MutableArrayRef(Array); | ||
|
|
||
| int main() { return 0; } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # RUN: split-file %s %t | ||
| # RUN: lldb -b -x -o 'command script import %llvm_src_root/utils/lldbDataFormatters.py' -s %t/commands.input %llvm_tools_dir/check-lldb-llvm-support-arrayref | FileCheck %t/checks | ||
|
|
||
| #--- commands.input | ||
| b main | ||
| run | ||
| p ArrayRef | ||
| p MutableArrayRef | ||
|
|
||
| #--- checks | ||
| # CHECK: (lldb) p ArrayRef | ||
| # CHECK-NEXT: (llvm::ArrayRef<int>) size=3 { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @Michael137 I randomly see this testcase failing on a downstream build bot. I've seen failures like this: so there something unexpected between the expected lines in the output.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm interesting, looks like it's this: That would happen on Linux when LLDB finds the breakpoint on
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I'll keep an eye on our build bot and get back if we see any more flakiness after that. |
||
| # CHECK-NEXT: [0] = 1 | ||
| # CHECK-NEXT: [1] = 2 | ||
| # CHECK-NEXT: [2] = 3 | ||
| # CHECK-NEXT: } | ||
|
|
||
| # CHECK: (lldb) p MutableArrayRef | ||
| # CHECK-NEXT: (llvm::MutableArrayRef<int>) { | ||
| # CHECK-NEXT: llvm::ArrayRef<int> = size=3 { | ||
| # CHECK-NEXT: [0] = 1 | ||
| # CHECK-NEXT: [1] = 2 | ||
| # CHECK-NEXT: [2] = 3 | ||
| # CHECK-NEXT: } | ||
| # CHECK-NEXT: } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import lit.util | ||
|
|
||
| if "native" not in config.available_features or lit.util.which("lldb") is None: | ||
| config.unsupported = True | ||
|
|
||
| config.suffixes = [".test"] |
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.
Hello @Michael137
I noticed that if you compile with
-D_FORTIFY_SOURCE=2we now getwhen compiling cross-project-tests. And if compiling with -Werror, the build then fails.
I suppose it's because of the hardcoded "-O0" in the config above.
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.
Thanks for the ping. Not sure off the top how to best handle this but I'll have a look
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.
Downstream I worked around it by undefining _FORTIFY_SOURCE when we add -O0 like
but I don't know if there is anything better that can be done.
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.
Heh yea maybe that's worth a shot, thanks! I'll put up a review
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.
#174770