Commit Graph

1637 Commits

Author SHA1 Message Date
Arnold Schwaighofer
b127aac1ce Merge pull request #24781 from aschwaighofer/fix_some_type_dynamic_replacement
Fix dynamic replacement of some type when used with associated types
2019-05-23 16:36:32 -07:00
Slava Pestov
1441ad1ac5 Disable objc_class_resilience_stubs.swift on macOS 10.9 and 10.10 2019-05-23 16:45:18 -04:00
Joe Groff
076e0c0280 Merge pull request #24994 from jckarter/SR-10264-test
Add regression test for SR-10264
2019-05-22 20:44:23 -07:00
Joe Groff
3c0732ab14 Add regression test for SR-10264 2019-05-22 15:14:03 -07:00
Mike Ash
930e0b9860 Merge pull request #24950 from mikeash/objc-getclass-disable-conditionally
[Test] Add availability to the GenericMangled test in objc_getClass.swift
2019-05-22 10:38:18 -04:00
Joe Groff
3a1771c143 Merge pull request #24944 from jckarter/keypath-jit-workaround
IRGen: Work around JIT bug with GOT equivalents.
2019-05-21 19:16:34 -07:00
Joe Groff
81c7f84ec9 IRGen: Work around JIT bug with GOT equivalents.
SR-10590 | rdar://problem/50968433 appears to be caused by an LLVM JIT bug where GOT-equivalent
globals get emitted with incorrect alignment. Not marking the GOT equivalent as unnamed_addr
(which prevents it from getting folded into the GOT, or other equivalent constants) appears
to work around the issue.
2019-05-21 14:17:07 -07:00
Michael Gottesman
25c4183dbf [test] Make sure to ship over the dylib over for the switch_resilience test. 2019-05-21 08:35:55 -07:00
Mike Ash
6746911dde [Test] Add availability to the GenericMangled test in objc_getClass.swift
This is a new test in Swift 5.1 that is not expected to pass when running
with the Swift 5.0 runtime library.

rdar://problem/50175915
2019-05-21 10:26:02 -04:00
Daniel Rodríguez Troitiño
9d22cbb13e [test] Mark mandatory_inlining.swift as executable.
Otherwise the Android CI will fail this test, since no device is
actually attached.
2019-05-20 17:10:55 -07:00
Michael Gottesman
3b029010b9 [mandatory-inlining] When using the linear lifetime checker to insert compensating releases, if we find a double use due to a loop, do not insert an apply at that call site.
Otherwise, one will get use after frees. I added an interpreter test as wlel as
an end to end test.

rdar://50884462
2019-05-20 12:12:13 -07:00
Michael Gottesman
d4d3d9f150 Fix the i386 build by signing the temp dylib linked to by a test. 2019-05-19 00:55:54 -07:00
Michael Gottesman
1e032ad0e0 Merge pull request #24809 from gottesmm/pr-da73ada7a54b312b7e1fc21910cd9593ad94348b
[silgenpattern] When binding values, use a ManagedValue instead of an…
2019-05-18 14:11:54 -07:00
Arnold Schwaighofer
5c3a4d329b Fix dynamic replacement of some type when used with associated types
rdar://50638228
2019-05-18 10:34:52 -07:00
Slava Pestov
ddf6492d63 Remove -target from test/Interpreter/SDK/archive_attributes.swift
It was broken on 10.9, again...

Fixes <rdar://problem/50897660>.
2019-05-17 15:28:06 -04:00
Slava Pestov
1ca80f93f4 test/Interpreter/SDK/archive_attributes.swift only work on the host or simulator
Fixes <rdar://problem/50897246>.
2019-05-17 15:07:39 -04:00
Slava Pestov
49b19f5205 Merge pull request #24833 from slavapestov/cross-platform-stable-abi-tests
Run stable ABI tests on all Apple platforms
2019-05-16 21:09:49 -04:00
Bob Wilson
a579af3d07 Merge pull request #24832 from bob-wilson/rdar50175915
[Test] Add availability to the ResilientNSObject test in objc_getClass.swift
2019-05-16 15:11:27 -07:00
Slava Pestov
5d66bb810a Run stable ABI tests on all Apple platforms
A number of tests exercise features only available in Apple OSes that
shipped with Swift 5.0 in the OS; this includes the following versions:

- macOS 10.14.4
- iOS 12.2
- tvOS 12.2
- watchOS 5.2

Previously these tests were restricted to running on macOS only, with
an explicit -target x86_64-apple-macosx10.14.4. To get better test
coverage, add a new %target-stable-abi-triple substitution which
expands to a triple with the correct OS version on all Apple platforms.

On non-Apple platforms, this is the same as %target-variant-triple,
but for now any test that uses this exercises Apple platform features
anyway.

One caveat is that since iOS 12.2 does not have a 32-bit slice, we
have to skip any tests that use -target %target-stable-abi-triple
on this platform. A new swift_stable_abi feature flag can be tested
with 'REQUIRES: swift_stable_abi'. To get maximum test coverage,
I split off a 'stable_abi' version of a few tests that build with both
an old and new deployment target. This allows the old deployment
target case to still be tested on 32-bit iOS.
2019-05-16 17:02:06 -04:00
Michael Gottesman
adcfda6f6d [silgenpattern] When binding values, use a ManagedValue instead of an RValue to avoid implicitly exploding tuples.
In SILGenPattern, we need to be able to unforward cleanups when we explode
tuples. Thus we can't use RValue in SILGenPattern since it may implicitly
explode tuples (which without modifying RValue itself we can not
unforward). This patch removes a specific RValue usage that we can replace with
the use of a ManagedValue instead.

rdar://49903264
2019-05-16 12:41:08 -07:00
Bob Wilson
dbde6aa65e [Test] Add availability to the ResilientNSObject test in objc_getClass.swift
This is a new test in Swift 5.1 that is not expected to pass when running
with the Swift 5.0 runtime library.

rdar://problem/50175915
2019-05-16 09:43:53 -07:00
eeckstein
8c44da10f5 Merge pull request #24815 from eeckstein/fix-tests
tests: disable check_class_for_archiving checks for older OSes
2019-05-16 07:48:23 -07:00
Joe Groff
0be95f56bd Merge pull request #24798 from jckarter/opaque-type-check-availability
Opaque types require a newer Swift runtime.
2019-05-15 18:05:40 -07:00
Erik Eckstein
3e30d43e10 tests: disable check_class_for_archiving checks for older OSes
rdar://problem/50504765
2019-05-15 16:44:09 -07:00
Joe Groff
cec9e9e33a Opaque types require a newer Swift runtime.
Check the availability of decls that declare an opaque return type to ensure they deploy to a
runtime that supports opaque types.

rdar://problem/50731151
2019-05-15 11:39:53 -07:00
Slava Pestov
36e46c054d IRGen: Fix DynamicSelfType metadata recovery in @objc convenience initializers
An @objc convenience initializer can replace 'self'. Since IRGen
has no way to tell what the new 'self' value is from looking at
SIL, it always refers back to the original 'self' argument when
recovering DynamicSelfType metadata. This could cause a crash
if the metadata was used after the 'self' value had been
replaced.

To fix the crash, always insert the metadata recovery into the
entry block, where the 'self' value should be valid (even if
uninitialized, the 'isa' pointer should be correct).

Fixes <rdar://problem/50594689>.
2019-05-13 23:11:11 -04:00
Mike Ash
0a3b722bf9 Merge pull request #24688 from mikeash/swift-nativensxxxcoding-test-availability
[Test] Guard SwiftNativeNSXXXCoding tests behind #available(9999).
2019-05-13 12:06:18 -04:00
Slava Pestov
12469f5a9b IRGen: Always emit class stubs for classes with resilient ancestry
This logic is no longer guarded by a flag. Sema will still emit certain
diagnostics if the flag is not specified though.

Progress on <rdar://problem/49090631>.
2019-05-10 21:26:10 -04:00
Slava Pestov
97be86bbca Runtime: Don't try to register class stubs on older objc runtimes
This will allow us to emit class stubs unconditionally, rather than
checking the -enable-resilient-objc-class-stubs flag.

Part of <rdar://problem/49090631>.
2019-05-10 21:26:09 -04:00
Slava Pestov
cc53fd9518 Fix archive_attributes test to work on macOS 10.9
That OS doesn't have objc_readClassPair(). This test uses -target to
explicitly select a newer deployment target and then runs the binary
on an old OS to test the behavior. However this means arclite won't
get linked in unless we also pass in -link-objc-runtime.

Fixes <rdar://problem/50610877>.
2019-05-10 14:54:34 -04:00
Mike Ash
5a8a0a816e [Test] Guard SwiftNativeNSXXXCoding tests behind #available(9999).
These tests fail when run against older runtimes since they don't have the fix.

rdar://problem/50504800
2019-05-10 14:51:05 -04:00
Brent Royal-Gordon
4bc22c7f77 Merge pull request #24611 from nathawes/disable-test-interpreter-subclass-existentials-to-unblock-ci
[test] Disable test/Interpreter/subclass_existentials.swift to unblock CI
2019-05-08 12:49:48 -07:00
Nathan Hawes
30c7ab8c27 [test] Disable test/Interpreter/subclass_existentials.swift to unblock CI
It's been failing in CI since enabling the existential specializer by default:
https://ci.swift.org/job/oss-swift_tools-RA_stdlib-RD_test-simulator/2043/
2019-05-08 10:30:50 -07:00
Mike Ash
0ea82d6890 Merge pull request #24534 from mikeash/swiftnativexxx-warnings-fix
[Stdlib] Fix warnings about designated initializers in SwiftNativeXXX classes.
2019-05-08 13:26:28 -04:00
Daniel Rodríguez Troitiño
1813cc3670 [android] Enable some tests that should pass on Android.
Some tests are limited to only Linux, when they should also pass for
Android.

Additionally, InputStream.swift.gyb was disabled for Android ARMv7, but
wasn't for Android AArch64, which allow me to find the error on it and
fix it on #24521.

Finally, StringLowercasedUppercased is interesting in Android because it
checks the used ICU is correct for performing the tasks that the stdlib
needs.
2019-05-06 17:53:51 -07:00
Mike Ash
3ad6e46930 [Stdlib] Fix warnings about designated initializers in SwiftNativeXXX classes. 2019-05-06 17:15:53 -04:00
Brent Royal-Gordon
7311886219 Merge pull request #24334 from brentdax/wherefore-art-thou-api
[TypeChecker] Rephrase platforms in availability diagnostics
2019-05-06 11:00:03 -07:00
Raj Barik
4e719edd75 Merge pull request #24411 from rajbarik/raj-fix-test
Fix Interpreter/dynamic_self.swift test for ExistentialSpecializer
2019-05-05 11:47:22 -07:00
Raj Barik
acd550df4a Fix Intepreter/dynamic_self.swift test for ExistentialSpecializer 2019-05-04 09:53:15 -07:00
Jordan Rose
517f5d6b6a [ClangImporter] Retire the term "adapter" in favor of "overlay" (#24427)
Way back in Swift 1 I was trying to draw a distinction between
"overlays", separate libraries that added Swift content to an existing
Objective-C framework, and "the Swift part of a mixed-source
framework", even though they're implemented in almost exactly the same
way. "Adapter module" was the term that covered both of those. In
practice, however, no one knew what "adapter" meant. Bring an end to
this confusion by just using "overlay" within the compiler even for
the mixed-source framework case.

No intended functionality change.
2019-05-03 11:11:58 -07:00
Mike Ash
8d2b1bbf7b Merge pull request #24394 from mikeash/decode-the-undecodable
[Stdlib] Make the SwiftNativeNSXXXBase classes gracefully handle being decoded with NSKeyedUnarchiver.
2019-05-02 10:06:06 -04:00
Slava Pestov
6d7d13fceb IRGen: Disable eager initialization of NSCoding adopters on newer targets
If a class does not have a custom @objc name, objc_getClass() can find
it at runtime by calling the Swift runtime's metadata demangler hook.

This avoids the static initializer on startup. If the class has a
custom runtime name we still need the static initializer unfortunately.

Fixes <rdar://problem/49660515>.
2019-05-01 17:43:58 -04:00
Mike Ash
7506e9c4f8 [Stdlib] Make the SwiftNativeNSXXXBase classes gracefully handle being decoded with NSKeyedUnarchiver.
These would never be decoded in normal use, but it's possible to construct an archive that will attempt to decode them. Without this override, that throws an exception or worse.

rdar://problem/48429185
2019-05-01 10:04:14 -04:00
Brent Royal-Gordon
3494c0bd88 [TypeChecker] Rephrase platforms in availability diagnostics
This does several different things to improve how platforms are described in availability diagnostics:

• Mentions the platform in diagnostics for platform-specific @available(unavailable) attributes.
• Replaces “OS X” with “macOS”.
• Replaces “fooOS application extension” with “application extensions for fooOS”.
• Replaces “on fooOS” with “in fooOS”.

Fixes <rdar://problem/49963341>.
2019-04-30 16:32:43 -07:00
Slava Pestov
1f6ffa6699 Merge pull request #24325 from slavapestov/alloc-ref-dynamic-fix
SILGen: Allocating entry points for @objc dynamic inits should use alloc_ref_dynamic
2019-04-27 00:05:37 -04:00
Michael Gottesman
f3bda1c59c Merge pull request #24314 from gottesmm/pr-bc2eaca09ec955cbff0218bf32561438e41bb547
[silgen] Fix SILGenBuilder::emitDestructureValueOperation to create a…
2019-04-26 15:32:36 -07:00
Slava Pestov
ffc26fb4d0 SILGen: Allocating entry points for @objc dynamic inits should use alloc_ref_dynamic
If the initializer witnesses a protocol requirement, the protocol witness
thunk references the allocating entry point directly, since it has no
vtable entry. For this reason we must use alloc_ref_dynamic and not
alloc_ref to ensure the right type of instance is allocated.

Fixes <rdar://problem/49560721>, <https://bugs.swift.org/browse/SR-10285>.
2019-04-26 18:13:57 -04:00
Michael Gottesman
ade2df1253 [silgen] Fix SILGenBuilder::emitDestructureValueOperation to create all sub-ManagedValues before invoking the user defined function.
This is necessary since our func may want to emit conditional code with an early
exit, emitting unused cleanups from the current scope via the function
emitBranchAndCleanups(). If we have not yet created those cleanups, we will
introduce a leak along that path.

rdar://49990484
2019-04-26 12:27:06 -07:00
swift-ci
57844d3720 Merge pull request #24245 from mikeash/objc-class-resilience-category-test-10.9-xfail 2019-04-26 10:57:36 -07:00
Arnold Schwaighofer
54cb9dfe8f Merge pull request #24278 from aschwaighofer/initialize_extrainhabitantcount_single_case_enum
Initialize the extraInhabitantCount field of single case enums
2019-04-26 07:27:35 -07:00