Commit Graph

8 Commits

Author SHA1 Message Date
Daniel Rodríguez Troitiño
1e5903773b [test] Fix incorrect usage of swift_obj_root in unified builds
When doing an unified build (Swift being an external project of LLVM),
the Swift build is at `<llvm build dir>/tools/swift`, and that is the
value of `swift_obj_root`. However many products are actually placed in
`<llvm build dir>`, like `bin/`, `include/` and things like
`lib/swift/...` and others.

A couple of macros tests check the error messages printed by the
compiler against `swift_obj_root` (by the replacement done in
`PathSanitizingFileCheck` of `BUILD_DIR`) when it should have been
checking them against the top-level build directory, which will work in
both unified and non-unified builds (like `build-script` builds).
2024-11-01 11:25:59 -07:00
Josh Soref
9a6bf46c0f Spelling silgen
* actually
* arbitrary
* cargo-culted
* clazz
* constrained
* continuation
* coordinator
* coroutine
* derivative
* destroyer
* given
* have
* imported
* initialization
* items
* necessarily
* occurring
* omitting
* overridden
* parameter
* possible
* predecessor
* preparation
* resilience
* should
* struct
* that
* the
* throwing
* unexpectedly
* uniqueness
* using
* value
* villain

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-11-09 21:44:17 -05:00
Brent Royal-Gordon
0e569f5d9e Add support for #fileID
This temporarily breaks -enable-experimental-concise-pound-file.

fixup adding #fileID
2020-07-13 14:05:13 -07:00
Saleem Abdulrasool
683dbd4f8b test: adjust SILGen/magic_identifier_file_conflicting.swift.gyb for python 3
This test has inline python which requires byte-to-text conversions.
Avoid that by using the `io` module.
2020-07-10 15:22:34 -07:00
Saleem Abdulrasool
6c02e6212d test: adjust the test to improve the viability on Windows
Convert the line endings manually since the parser is sensitive to the
trailing whitespace (the writing of the file will create a `\r\n` rather
than `\n`).  This largely fixes the issues for Windows with the issue
that the processing of the file location is currently not properly
processing escape characters and results in issues.

In theory, it should be possible for `getStringLiteralIfNotInterpolated`
to process the literal segments with `getEncodedStringSegment` for each
segment and then return a literal value cooked.  However, doing so will
require that the function return a `std::string` rather than `StringRef`
since the cooking means that we cannot simply provide a reference to the
SourceManager view.
2020-03-11 22:51:41 -07:00
Brent Royal-Gordon
62ab3dfd64 Temporarily disable new #file test on Windows 2020-03-05 23:30:37 -08:00
Brent Royal-Gordon
85599f7582 Keep gyb from messing up line endings on Windows
GYB opens its inputs and outputs in text mode. This is a problem because the recommendation in Windows is to check everything out in LF mode to avoid breaking tests, so gybbing a file ends up converting LFs to CRLFs. That broke test/SILGen/magic_identifier_file_conflicting.swift.gyb.

Modify GYB to open its files in binary mode instead of text mode. This is a no-op everywhere but Windows.

Note that this change is incomplete: it’s somewhat difficult to switch stdin and stdout to binary mode in Python 2. I’ve added FIXME comments about this.
2020-03-05 23:30:37 -08:00
Brent Royal-Gordon
d590823f3c Warn about conflicts between #file strings 2020-03-05 23:30:37 -08:00