-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Stats] Add a test for long input-path bug (0e5b982d) #12279
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
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,16 @@ | ||
// REQUIRES: OS=macosx | ||
// RUN: rm -rf %t && mkdir -p %t | ||
// RUN: mkdir -p %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents | ||
// RUN: cp %s %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents/a-problem-when-combined-with-other-long-path-elements-and-filenames-to-exceed-256-characters-combined-because-yay-arbitrary-limits-amirite.swift | ||
// RUN: touch %t/main.swift | ||
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. Why have a main file at all? 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. Need to get the frontend invoked with a designated primary-file (not just 'all'), and this is the nearest to how it happens in the field: a multi-file compilation. |
||
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t %t/main.swift %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents/a-problem-when-combined-with-other-long-path-elements-and-filenames-to-exceed-256-characters-combined-because-yay-arbitrary-limits-amirite.swift | ||
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. Why 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. I'm not clear on the difference! Does it matter here? 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. I guess it probably doesn't. |
||
// RUN: %utils/process-stats-dir.py --set-csv-baseline %t/frontend.csv %t | ||
// RUN: %FileCheck -input-file %t/frontend.csv %s | ||
|
||
// CHECK: {{"AST.NumSourceLines" [1-9][0-9]*$}} | ||
// CHECK: {{"IRModule.NumIRFunctions" [1-9][0-9]*$}} | ||
// CHECK: {{"LLVM.NumLLVMBytesOutput" [1-9][0-9]*$}} | ||
|
||
public func foo() { | ||
print("hello") | ||
} |
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 assume it doesn't matter that the total path at this point may or may not be over 256?
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.
nope. we're just trying to force it to be >256 when combined with the file and mangled into a string that has no path separators, so we need at least two big segments in the combined path. Extra big segments in %t will just make it fail more-thoroughly.