Commit Graph

7 Commits

Author SHA1 Message Date
Doug Gregor
78b89b201c Parse expression macro expansion buffers as expressions
This started out as a crash, where an expression macro could not be
defined in terms of one of the builtin macros (e.g., `#line`), because
we were expecting a macro expansion expression but didn't get one.
Easy fix.

However, this uncovered a second bug, which is that we couldn't handle
an expression macro expansino to `#line`. This is because we were
parsing the macro expansion buffer as "top level items", which treats
`#line` at the start of a line as a deprecated alias of
`#sourceLocation`. Switch over to parsing a single expression in these
contexts, and fix up an issue where `#isolation` didn't even have that
expression.

Fixes rdar://139372780.
2024-11-06 15:55:38 -08:00
Saleem Abdulrasool
99453fc2e8 test: introduce a new %swift-plugin-dir macro
Use this to define the macro location rather than the "host" dir (which
is actually for the build and not the host).  Furthermore, on Windows,
the build dir is /usr/lib/swift as the host content is in the SDK.

This prepares the tests for Windows.
2023-09-04 13:04:18 -07:00
Saleem Abdulrasool
c549028f88 test: sink -no-toolchain-stdlib-rpath into lit
This is a platform specific option and should be handled by lit patterns
rather than encoded into the tests.
2023-09-04 09:07:27 -07:00
Doug Gregor
cfda29ccd4 [SE-0397] Enable freestanding declaration macros by default.
This proposal has been accepted. Move the feature flag from "experimental"
to "always enabled". Tracked by rdar://108637367.
2023-05-24 09:16:55 -07:00
Hamish Knight
100244a0c3 Avoid computing generated source notes on child notes
This could cause us to double up on the same note
for nested macro expansions, as we'd generate the
note, then when recursing back through the function
we'd compute the same note again. Also remove the
seemingly unused `lastBufferID` param.
2023-05-02 16:21:44 +01:00
Doug Gregor
903505ab02 [Test] Code-sign executable before running it :)
Fixes rdar://108216111.
2023-04-18 13:46:04 -07:00
Doug Gregor
68829ed917 Add test case for expanding a macro defined in terms of another macro 2023-04-16 13:35:55 -04:00