Commit Graph

22 Commits

Author SHA1 Message Date
Augusto Noronha
50de07ab8f Enable two reflection tests on Linux (aarch64)
With the changes in b6ce889c8d, these
might be fixed.
2025-07-18 16:22:26 -07:00
Augusto Noronha
b6ce889c8d [RemoteMirrors] Fix losing the remote address on StaticMirror
The Offset field of a DynamicRelocation is either an offset or a remote
address, but was being treated only as a remote address on
getDynamicSymbol.
2025-07-11 16:33:19 -07:00
finagolfin
b2f52524c5 [android] Disable a couple Reflection tests and fix an install path (#82620)
The tests broke on the community Android CI since #82325, and I just
noticed the install issue when cross-compiling Testing with a
freshly-built compiler, which I'd never done before. Also, fix the NDK
path shown in the CMake output.
2025-07-02 09:41:59 +05:30
Mike Ash
10feb11d27 [Test] Disable chained fixups when building a few reflection tests.
ObjectFileContext doesn't currently support chained fixups. For now, avoid building the test binaries with chained fixups to avoid issues.

This adds a %no-fixup-chains substitution which resolves to -Xlinker -no_fixup_chains on Darwin, and to nothing on everything else.

rdar://145442500
2025-02-25 13:54:42 -05:00
Allan Shortlidge
082f0ac4b5 Tests: Use a more natural spelling for ABI triple lit substitutions.
`%target-swift-5.8-abi-triple` instead of `%target-swift-abi-5.8-triple`, for
example.
2024-10-18 10:11:36 -07:00
Ben Langmuir
b5f290dc49 [test] Move to earlier deployment target as workaround
We are already using 5.4 target as a workaround for missing
LC_DYLD_CHAINED_FIXUPS support in reflection tools, but we need to
further workaround a linker bug in older versions of ld-prime that
caused appletv simulator platform to be misidentified and use chained
fixups earlier than it should, so move back to 5.2.
2024-08-30 14:03:04 -07:00
Ben Langmuir
5d111db75a Add explicit targets to Reflection tests due to chained fixups issue
When the deployment target is newer than swift-5.4 these tests fail due
to missing/incomplete support for chained fixups.

rdar://134809489
2024-08-29 07:55:14 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
Finagolfin
30ba49e7fa [android][test] Fix a handful of tests and disable one CxxToSwiftToCxx bridging test
Also, make the analogous change to apple/swift-driver#1372, which gets the
sanitizer tests working on Android again, and remove the lld_lto feature in the
tests, which is now unused.
2023-08-12 16:36:35 +05:30
Adrian Prantl
75c42ed43b [swift-reflection-dump] Turn --binary-filename into a positional argument.
I mostly find it annoying to type and this makes the usage of the tool more
consistent with other similar tools like dwarfdump or otool.
2022-10-12 11:18:59 -07:00
Mike Ash
373000eb1d [Test] Re-disable some Reflection tests on ARM64e.
These tests are still broken on ARM64e:

Reflection/conformance_descriptors.swift
Reflection/typeref_decoding_imported.swift
Reflection/typeref_decoding_objc.swift
Reflection/typeref_lowering.swift

rdar://100558042
2022-09-29 09:07:20 -04:00
Mike Ash
cdfbd7b91d [Test] Reenable Reflection tests disabled on ARM64e.
Improvements in our ARM64e support seems to have made these test work again.

rdar://89754240
rdar://89986398
2022-09-22 11:16:21 -04:00
Artem Chikin
bc795187d7 [Static Mirror] Handle anonymous contexts when re-constructing fully-qualified type names
Anonymous contexts (e.g. types nested inside functons) require special handling when we are constructing a fully-qualified name. We construct the name by walking from a type's descriptor to its parent contexts. Previously, we would give up upon encountering an anonymous contexts.

This change refactors fully-qualified name construction to happen in two phases:
1. Collect a full context ancestor chain
2. Walk the chain backwards to reconstruct the fully-qualified name
As opposed to the previous approach which always constructed the name while recursively walking to the parent context. This is required because types nested inside anonymous contexts are represented in the fully-qualified type name as `(type_name in $XXXXXXXX)` where XXXXXXXX is the address of the context descriptor of the parent anonymous context.

Resolves rdar://91073103
2022-05-31 15:56:31 -07:00
Ben Barham
c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Artem Chikin
8d66336342 [Static Mirror] Gather local type extension conformance infos correctly
Conformance Infos for nominal type declarations reference the conforming type by storing an offset to the address in the binary where the type's type descriptor is located. Conformance infos for conformances applied to an extension of a type use a different mechanism: they use an indirect reference to a dynamic symbol, which may be an external symbol **or** a resolved address to a local type descriptor. It is the latter case that the conformance-gather implementation was missing that is added in this PR.

Resolves rdar://93578419
2022-05-19 08:48:50 -07:00
Artem Chikin
b1b9e07f79 [Swift Static Mirror] Report mangled names without a prefix
Leave it to the clients to add it, if necessary.

Resolves rdar://90040835
2022-03-15 13:47:39 -07:00
Hamish Knight
2cba680599 [test] Disable conformance_descriptors.swift on arm64e
rdar://88579818
2022-03-08 13:37:45 +00:00
Artem Chikin
fcba475a36 Pass in libswiftCore.dylib as input to conformance_descriptors.swift
This will make the test more robust in being able to read out the conformances we are looking for (Hashable, Equatable)

Resolves rdar://88579818
2022-02-09 09:13:08 -08:00
Artem Chikin
bc9aedadc8 Disable conformance_descriptors.swift on Linux AArch64
Test failure tracked in rdar://88451721.
2022-02-03 13:18:46 -08:00
Artem Chikin
1d960370bf [Static Mirror] Add mangled names to image-extracted protocol conformance infos.
Collect the mapping of unmangled-to-mangled names from the read out `Fields` section reflection infos and use that to identify the mangled name of a conforming type of a given protocol conformance.
2022-01-30 10:53:09 -08:00
Artem Chikin
cd6d8f975f Extract fully-qualified names for protocol conformances by traversing their parent contexts and extracting their names 2022-01-28 10:51:48 -08:00
Artem Chikin
e934fe201a Add extraction protocol conformance descriptor extraction, as read from an object file image, to TypeRefBuilder. 2022-01-26 13:54:02 -08:00