Commit Graph

30 Commits

Author SHA1 Message Date
Tim Kientzle
f73cfa7396 Reflection tests are incompatible with ASAN 2024-07-26 09:55:08 -07:00
Augusto Noronha
a6e2f8b7a0 Conditionalize 'num_extra_inhabitants' in 64 bit platforms' tests (#33136) 2020-07-29 18:49:58 -07:00
Tim Kientzle
03a0042ace API changes in SwiftRemoteMirror make these tests unsuitable for back-deployment testing 2020-03-07 13:13:23 -08:00
Jordan Rose
056979680d Revert "[reflection] Fix tests with bitwise_takable output"
This reverts commit b906348665.
2019-10-16 16:09:56 -07:00
Ivan Smetanin
b906348665 [reflection] Fix tests with bitwise_takable output 2019-10-16 09:03:55 +03:00
Michael Ilseman
5a6d2dfa59 [String] Switch ABI to only use 4 discriminator bits.
In anticipation of potential future HW features, e.g. armv8.5 memory
tagging, only use the high 4 bytes as discriminator bits in
_BridgeObject rather than the top 8 bits. Utilize two perf flags to
cover this instead. This requires shifting around a fair amount of
internal complexity.
2018-12-19 13:54:50 -08:00
Joe Groff
ca402f19b1 Give multi-payload enums extra inhabitants.
Previously, they would forward their unused spare bits to be used by other multi-payload enums, but
did not implement anything for single-payload extra inhabitants.
2018-11-13 18:08:01 -08:00
Joe Groff
ff7afcdfd7 Give more extra inhabitants to BridgeObject.
The standard library never ended up needing the low extra inhabitants (<4G on 64-bit Darwin,
<4K elsewhere), so BridgeObject can have the same set of extra inhabitants as the other refcounted
types, allowing `String?????` and `Array??????????` to still use optimized representations.
rdar://problem/45881464
2018-11-07 19:03:22 -08:00
Slava Pestov
00c1279dbb Reflection: Compute if types are bitwise takable
Bitwise takability is now part of the layout of a type, because
non-bitwise takable types are never stored inline in an
existential or resilient global's buffer, even if they would
fit.

The basic rule is that weak references, unknown-refcounted
unowned references, and aggregates that contain them, are not
bitwise takable, whereas everything else is bitwise takable.

Also, since the bitwise takable for an unowned reference
depends on the reference counting style, we have to record the
superclass of a protocol, if any, to correctly determine the
reference counting style of the protocol existential.
2018-11-07 00:32:12 -05:00
Karoy Lorentey
40aae6b235 [String] 32-bit platform support
Add support for 32-bit platforms for UTF-8 backed String.
2018-11-04 10:42:41 -08:00
Michael Ilseman
e6582c37ee [test] Adjust String tests for UTF-8 representation.
Adjust tests for the UTF-8 representation, in preparation for 32-bit
support. Includes UTF-8 literal update.
2018-11-04 10:42:41 -08:00
Jordan Rose
b7aacec9ce [test] Fix swift-reflection-test issues for all test run environments (#19171)
I stopped trying to guess and actually tested them all, including the
Apple-internal tool I keep breaking. As a bonus, the RUN lines in
validation-test/Reflection/ go back to being simple.

rdar://problem/44154961
2018-09-06 16:05:56 -07:00
Jordan Rose
e3f3e939cb [test] Fix target-based reflection tests for real (#19098)
- Hard-link %target-swift-reflection-test into %t/ for %target-run
  implementations that copy executables, like remote-run.
- Use DYLD_LIBRARY_PATH to undo that for %target-run implementations
  that run the executable in place (host and simulators)

rdar://problem/43809613
2018-09-04 08:45:25 -07:00
Jordan Rose
11bddb49a0 [test] Temporarily disable Reflection tests on non-macOS (#19031)
utils/remote-run will only run things in %t.
An Apple-internal tool doesn't follow symlinks.
Normal macOS and simulator runs find the support libraries relative to
the binary.

I'm not sure what to do yet, but for now let's unbreak the
Apple-internal bots I broke in 01a0de2.
2018-08-29 11:38:27 -07:00
Jordan Rose
01a0de27ec [test] Update for remote-run-ing tests on a different macOS (#18966)
Most of this is just "remember to specify the inputs and outputs on
the command line, so remote-run can see them". A bit is "prefix
environment variables with '%env-'". And the last few are "yeah,
this was never going to work in a remote environment".

In the few cases where I couldn't think of anything reasonable, I just
marked the test as "UNSUPPORTED: remote_run", a new "feature".
2018-08-27 14:50:40 -07:00
Arnold Schwaighofer
5ebc6e77e7 Codesign the reflection tests 2018-08-09 09:18:04 -07:00
Michael Ilseman
3be2faf5d3 [String] Initial implementation of 64-bit StringGuts.
Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
2018-01-21 12:32:26 -08:00
Ben Langmuir
9b283f6b09 [test] Re-enable tests that started XPASSing on resilience bot
https://ci.swift.org/job/oss-swift_tools-RA_stdlib-RDA_test-macos-resilience/164/

XPASS: validation-test/Reflection/reflect_Character.swift
XPASS: validation-test/Reflection/reflect_multiple_types.swift
2018-01-10 10:03:45 -08:00
Greg Parker
9a38e609af [IRGen][runtime] Reduce object header to 8 bytes on 32-bit platforms. (#12790)
SR-4353, rdar://29765800
2017-11-08 02:50:11 -08:00
Slava Pestov
76ec65f4a2 Reflection: Update tests for recent stdlib changes
Fixes <https://bugs.swift.org/browse/SR-5066> / <rdar://problem/32511557>.
2017-06-26 23:03:23 -04:00
Dmitri Gribenko
486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Dave Abrahams
82660324b9 Annotate some XFAILs with Jira/Radar links 2017-06-01 08:26:26 -07:00
Dave Abrahams
b2e4bd5d09 [stdlib] Replace _HeapBuffer with a thin wrapper
...over ManagedBufferPointer
2017-06-01 04:40:52 -07:00
Slava Pestov
db79762c3b Reflection: Fix class layout start offset calculations
Fixes <rdar://problem/29115967>.
2016-11-11 03:13:22 -08:00
Slava Pestov
d28b8ead50 Add resilient_stdlib to available_features and XFAIL remaining failing tests
All unoptimized tests should now pass when Swift is built with
'build-script -- --swift-stdlib-enable-resilience=1'.

There are still some issues when the tests themselves are built
with optimizations via 'check-swift-validation-optimize'.

Fixes <rdar://problem/28409189>.
2016-09-30 18:28:12 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Slava Pestov
95bc009e3e Reflection: Multi-payload enum layout
The approach here is to split this into two cases:

- If all case payloads have a fixed size, spare bits may be
  potentially used to differentiate between cases, and the
  remote reflection library does not have enough information to
  compute the layout itself.

  However, the total size must be fixed, so IRGen just emits a
  builtin type descriptor (which I need to rename to 'fixed type
  descriptor' since these are also used for imported value types,
  and now, certain enums).

- If at least one case has a size that depends on a generic
  parameter or is a resilient type, IRGen does not know the size,
  but this means fancy tricks with spare bits cannot be used either.
  The remote reflection library uses the same approach as the
  runtime, basically taking the maximum of the payload size and
  alignment, and adding a tag byte.

As with single-payload enums, we produce a new kind of
RecordTypeInfo, this time with a field for every enum case.
All cases start at offset zero (but of course this might change,
if for example we put the enum tag before the address point).

Also, just as with single-payload enums, there is no remote
'project case index' operation on ReflectionContext yet.

So the the main benefit from this change is that we don't entirely
give up when doing layout of class instances containing enums;
however, tools still cannot look inside the enum values themselves,
except in the simplest cases involving optionals.

Notably, the remote reflection library finally understands all
of the standard library's collection types -- Array, Character,
Dictionary, Set, and String.
2016-07-01 01:31:25 -07:00
Dmitri Gribenko
d0725fecf4 tests: annotate executable tests with corresponding requirements 2016-05-31 00:48:23 -07:00
Luke Larson
dd3f9165dc Reflection: Update tests for latest reflection changes 2016-05-23 13:42:04 -07:00
Luke Larson
acede5bf97 Reflection: Add tests for single-field classes of various types 2016-05-23 12:57:29 -07:00