Commit Graph

15 Commits

Author SHA1 Message Date
Henrik G. Olsson
3373903794 match windows file separator 2025-12-17 12:58:41 -08:00
Henrik G. Olsson
357c298940 [utils] escape backslashes in diagnostics strings
DiagnosticVerifier lexes the contents of expected diagnostics the same
way Swift parses string literals, to allow for escape codes. This makes
for problems when backslashes are followed by something that makes for a
valid escape. In particular, it reaches an llvm_unreachable if it
encounters `\(`, which would create a string interpolation in a string
literal.
2025-12-16 15:01:27 -08:00
Henrik G. Olsson
9c989971af [utils] fix off-by-one line number bug
When folding up lines of nested expansions, the line number would be off
by 1, which would lead to lines being shuffled around.
2025-12-16 15:01:27 -08:00
Henrik G. Olsson
b99945fdb3 [utils] handle diagnostics from unparsed files
Don't try to add expected lines in files that aren't parsed for them -
it will just lead to duplicated expected lines if run over and over.
Because we don't know whether the right choice is to add
-verify-additional-file or -verify-ignore-unrelated, we do nothing.
2025-12-16 15:01:27 -08:00
Henrik G. Olsson
5db7926e09 [utils] add support for expected-remarks to update-verify-tests.py 2025-11-11 16:35:00 -08:00
Henrik G. Olsson
c246140d7f [utils] remove trailing whitespace after removing diag 2025-11-11 16:34:59 -08:00
Henrik G. Olsson
4d5844b723 [utils] only steal 1 diagnostic
This fixes a bug in the diagnostic stealing logic when multiple
diagnostics target the same line, which would trigger an assert.
2025-11-11 16:34:59 -08:00
Henrik G. Olsson
4af20b25d5 [utils] fix bug in diagnostic stealing logic
When replacing expected diagnostic content, we should consider
expected diagnostics targeting the same target, not targeting the line
the expected diagnostic is on.
2025-11-11 16:34:55 -08:00
Henrik G. Olsson
32fd1c0dda Merge pull request #85390 from hnrklssn/update-verify-tests-continuted
[utils] add support for expected-expansion to update-verify-tests
2025-11-11 23:24:55 +00:00
Henrik G. Olsson
3891080750 [utils] add support for expected-expansion to update-verify-tests
`expected-expansion` can be a bit unergonomic to use, because it requires
pointing out not only the line, but also the column (which is not always
obvious), and the nested diagnostics have to refer to absolute lines
that aren't present in the source file. This makes both creating and
updating these test cases easier through automation.
2025-11-07 13:34:39 -08:00
Henrik G. Olsson
88d19e59d9 [utils] mark update-verify-tests tests unsupported with old Python
This utility uses the walrus operator introduced in Python 3.8, but this
causes tests to fail in Amazon Linux 2 CI, which uses Python 3.7. Since
this is not a shipped product, that doesn't really matter, and 3.7 is an
ancient EOL version anyways. The premerge CI uses Python 3.9 and later,
so use that as a basis, just to avoid the same issue in the future in
case some Python 3.9 feature sneaks in.

rdar://164151931
2025-11-07 12:41:00 -08:00
Henrik G. Olsson
8bff12a580 [utils] port update-verify-tests to Swift's -verify
This ports clang's test suite for update-verify-tests from C to Swift,
and adjusts update-verify-tests as needed. The main differences are the
Swift -verify output format being quite different, as well as Swift's
'-verify-additional-prefix foo' working differently than clang's
'-verify=foo'.
2025-11-05 16:02:06 -08:00
Henrik G. Olsson
b624318e4c add REQUIRES swift features 2025-10-17 15:13:59 -07:00
Henrik G. Olsson
7960cf80cf [Utils] test swift-function-caller-generator w/ strict safety 2025-10-17 15:13:58 -07:00
Henrik G. Olsson
99c8fc33fd [Utils] add test cases for swift-function-caller-generator 2025-10-17 15:13:58 -07:00