Commit Graph

228 Commits

Author SHA1 Message Date
Tim Kientzle
bf624b1461 Fine-tune what environments should run this test 2025-01-30 08:57:38 -08:00
Tim Kientzle
f48f772396 Test for #78981
**Without #78981**: This test triggers "Reflection section too small to contain next record"
errors, indicating that the field information is broken.

**With #78981**: This test runs to completion without triggering
the error message above.
2025-01-29 18:52:17 -08:00
Tim Kientzle
674c76274e Merge pull request #77062 from tbkka/tbkka-remotemirror-133890406
Let indirect enum cases export spare bits
2025-01-24 19:52:59 -08:00
swift-ci
1df3ffb7cb Merge remote-tracking branch 'origin/main' into rebranch 2024-10-17 09:12:58 -07:00
Tim Kientzle
3abefd1dda Accomodate x86_64 vs. arm64 differences 2024-10-17 08:51:47 -07:00
Tim Kientzle
fe90ad5684 Let indirect enum cases export spare bits
To determine the correct enum layout, we first count various
categories of cases.  Before, we counted indirect generic cases as
"generic", but regular "generic" cases can't export spare bits.

Change this to count "indirect" cases as a separate category.
In particular, this ensures that fully-indirect enums use
spare bits from the pointers even when some or all of the cases
are generic.

Resolves rdar://133890406
2024-10-16 18:31:28 -07:00
Tim Kientzle
502941ca5a More arcana about MPEs carrying class existentials
The first word in a class existential is the class pointer itself.
This pointer exposes spare bits differently depending
on the platform, which becomes apparent when you try to reflect
an Optional carrying such an MPE.

Add new test cases and some logic to zero out the first
word of spare bit information only on platforms with 8-byte pointers.
2024-10-16 16:06:37 -07:00
Tim Kientzle
a105cf5323 Fix multi-payload enums with Class Existential payloads on 32-bit targets
Class existentials expose spare bits from all of the pointers, not just the first one.
Due to a bad bug here, we were properly exposing spare bits from the first pointer,
but then claiming that all bits of subsequent pointers were spare.
This accidentally resulted in the correct operation on 64-bit targets
(it picked the highest-order spare bit, which happened to be spare
in both the broken mask and the correct mask).  But on 32-bit targets,
this exposed the high-order bits of pointers, which is incorrect.

Expand the test a bit while we're here as well.

Resolves rdar://132715829
2024-10-15 09:28:01 -07:00
swift-ci
24c3b5e002 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-07 17:15:46 -07:00
Mike Ash
ceb2853948 [Test] Temporarily disable reflect_Enum_values10 test on ARM64_32.
This test hits a bug on ARM64_32, disable it temporarily until we can fix it.
2024-10-07 16:16:07 -04:00
swift-ci
5e0b892e9e Merge remote-tracking branch 'origin/main' into rebranch 2024-09-20 13:09:36 -07:00
Tim Kientzle
025143138d Update an existing test that now works 2024-09-19 16:25:41 -07:00
Tim Kientzle
e62560c9ca Limit this part to only 64-bit targets 2024-09-19 14:04:11 -07:00
Tim Kientzle
da5383c4c3 Better support CoreFoundation types in RemoteMirror
This plugs a hole where we failed to recognize a CF type when it
appeared as the payload of an enum stored as a property.  Curiously,
RemoteMirror is able to reflect this when the enum appears by itself,
just not when it's stored as a property.

The simplest fix is to hook into the TypeInfo calculation which
computes a TypeInfo (basically, the tree of fields) from a TypeRef
(basically, the name of the type, including generic context).
Specifically, we sometimes end up here with a "type alias" that
none of the lookup support seems to be able to handle.  Fortunately,
these aliases demangle into a pretty predictable shape, so this
just pattern-matches the specific demangle tree shape to recognize
these as "type aliases in the `__C` module whose name starts with `CF`
and ends with `Ref`".

Resolves rdar://82465109
2024-09-19 13:50:41 -07:00
swift-ci
229f81a516 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-29 14:34:05 -07:00
Ben Langmuir
7d11d43d6d [test] Add explicit targets to tests depending on the default
Add specific deployment target versions to some tests that need to test
10.x-specific behaviours and are currently depending on the default
deployment target.

Certain tests were only checking either the stable or unstable ABI
depending on the platform the test was running. In those cases I doubled
up the checks so that we would test both cases on platforms that
supported it. This might use a bit of extra time on targets that only
support the stable ABI, but it seemed worth it for the additional
coverage in CI.
2024-08-29 07:55:14 -07:00
Becca Royal-Gordon
fd84e7273d Rename module.map -> module.modulemap in tests
The legacy `module.map` spelling of module map files was deprecated by llvm/llvm-project#75142 and clang expects to remove support for them in the future. Switch all tests to use the supported spelling.

Fixes rdar://128431478.
2024-08-12 17:47:26 -07:00
Ryan Mansfield
35fb08790b Use num_extra_inhabitants_64bit to fix reflect_CheckedContinuation.swift and
reflect_UnsafeContinuation.swift on non-Darwin platforms.
2024-08-06 16:05:55 -04:00
Tim Kientzle
1aae57a93f Suppress these tests under "asan", not "ASAN" 2024-08-05 14:24:23 -07:00
Tim Kientzle
661f368c6b Merge pull request #75620 from tbkka/tbkka-remotemirror-checkedcontinuation
Basic test for RemoteMirror reflecting checked continuations
2024-08-05 11:33:28 -07:00
Tim Kientzle
4e81902958 Disable these tests under ASAN 2024-08-01 16:35:58 -07:00
Tim Kientzle
9debfbc08c Merge pull request #75607 from tbkka/tbkka-remotemirror-unsafecontinuation
[RemoteMirror] Handle UnsafeContinuation
2024-08-01 13:46:09 -07:00
Tim Kientzle
76adead918 Basic test for RemoteMirror reflecting checked continuations 2024-08-01 09:15:01 -07:00
Tim Kientzle
8935510bcc Do not test with back deployment since this is a new-ish feature area 2024-08-01 07:27:11 -07:00
Tim Kientzle
71f010ead4 Merge pull request #75516 from tbkka/tbkka-new-actor-reflection-test
New reflect_Actor test
2024-07-31 21:01:29 -07:00
Tim Kientzle
9e1dcd6c9f [RemoteMirror] Handle UnsafeContinuation
UnsafeContinuations can be stored in variables or properties,
so it's important for RemoteMirror to be able to at least minimally
recognize them.

This just treats an UnsafeContinuation as a refcounted pointer.
Which might be "good enough" for now.

Working towards rdar://110351406
2024-07-31 18:15:27 -07:00
Tim Kientzle
725dc3c011 Merge pull request #75587 from tbkka/tbkka-remotemirror-generic-depth
[RemoteMirror] Fix generic depth calculation
2024-07-31 17:56:27 -07:00
Tim Kientzle
47de3339bb Only run this test on suitably new systems 2024-07-31 15:25:11 -07:00
Tim Kientzle
039e78d31a [RemoteMirror] Fix generic depth calculation
The "generic depth" is used to match up generic type variables.
For example:
```
struct Foo<T> { // `T` at generic depth 0
  struct Bar {
    struct Baz<U> { // 'U' at generic depth 1
      ...
}}}
```

Note in the above that `Bar` is not counted in the
generic depth.  The previous logic did count `Bar` in
the generic depth calculation, leading to mismatches
when trying to associate references to generic variables.

This adds a new test with cases like the above and of course
corrects the calculation.

Resolves rdar://127450037
2024-07-31 07:08:08 -07:00
LamTrinh.Dev
751a9d0127 Update reflect_multiple_types.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:12:12 +07:00
LamTrinh.Dev
a5b4f69f8e Update reflect_NSString.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:10:53 +07:00
LamTrinh.Dev
0d8d6070a7 Update reflect_NSSet.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:10:32 +07:00
LamTrinh.Dev
9ac94d3ffa Update reflect_NSNumber.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:10:13 +07:00
LamTrinh.Dev
ff63d2284e Update reflect_NSArray.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:09:15 +07:00
LamTrinh.Dev
b2f9976dd8 Update reflect_Enum_values_resilient.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:07:03 +07:00
LamTrinh.Dev
39224a1ebb Update reflect_Enum_values9.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:06:17 +07:00
LamTrinh.Dev
7c47570c63 Update reflect_Enum_values8.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:05:58 +07:00
LamTrinh.Dev
f3800be6d6 Update reflect_Enum_values7.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:05:37 +07:00
LamTrinh.Dev
f35c57e82b Update reflect_Enum_values6.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:05:17 +07:00
LamTrinh.Dev
baed1da4a9 Update reflect_Enum_values5.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:04:57 +07:00
LamTrinh.Dev
bf2f25cfa2 Update reflect_Enum_values4.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:04:36 +07:00
LamTrinh.Dev
aa0a602455 Update reflect_Enum_values3.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:04:15 +07:00
LamTrinh.Dev
cd14ab8e63 Update reflect_Enum_values2.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:03:54 +07:00
LamTrinh.Dev
450f1c6157 Update reflect_Enum_values11.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:02:12 +07:00
LamTrinh.Dev
a175465d5b Update reflect_Enum_values10.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:01:50 +07:00
LamTrinh.Dev
b81067d0b1 Update reflect_Enum_values.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:01:27 +07:00
LamTrinh.Dev
d3204c5433 Update reflect_Enum_value.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 23:00:42 +07:00
LamTrinh.Dev
a004b872c7 Update inherits_ObjCClasses.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 22:59:02 +07:00
LamTrinh.Dev
b9ec7744bf Update inherits_NSObject.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 22:58:24 +07:00
LamTrinh.Dev
6c2f3537fa Update functions_objc.swift
Adding comment for "// REQUIRES: reflection_test_support"
2024-07-29 22:57:54 +07:00