Commit Graph

19 Commits

Author SHA1 Message Date
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
Josh Soref
7aefe0162e Spelling test interpreter (#58566)
* spelling: bridgeable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: constrained

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exist

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overridden

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-04 19:23:25 -07:00
Mike Ash
6473b9d7cd [Runtime] Fix swift_conformsToProtocol crashing on conformances to unavailable classes.
An extension on a class creates a conformance record that's always visible even when that class is not present at runtime. In that case, the type pointer in the conformance record is NULL. The runtime did not like this, and crashed. This fixes it to ignore such records instead.

rdar://problem/54054895
2019-08-13 14:39:20 -04:00
Arnold Schwaighofer
6eca97add6 Codesign test/Interpreter 2018-08-10 06:58:40 -07: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
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
David Farler
8ca30ff2d7 Ask SILFunction link entities' clang nodes for weakness when applicable
When importing C functions with availability attributes, we don't
properly use that information to decide whether a symbol should be
weak_extern, causing load failures in dylibs that reference these
symbols when deployed to an older OS.

This is a very targeted fix and we need a better architecture for
deciding this.

rdar://problem/26359452
2016-06-01 12:52:04 -07:00
Chris Lattner
f51fcdbbb6 stop using deprecated constructs. 2016-04-17 10:20:12 -07:00
Slava Pestov
49c54870c1 Serialization: Auto-linking recursively walks modules imported from -sil-serialize-all modules 2016-04-01 12:21:36 -07:00
Erik Eckstein
adef0368bb tests: add import statements to workaround linker errors in all relevant tests.
This is needed if we compile StdlibUnittest with -sil-serialize-all
So far I added the imports only in files which needed them. But this may change, depending on the optimizer (inlining).
Adding them in all files doesn't harm and avoids confusion if someone makes an unrelated change which would result in such a linker error.
2016-01-21 09:59:50 -08:00
Chris Lattner
82e5c0c592 Update various tests to stop using ++/-- 2015-12-21 18:07:37 -08:00
practicalswift
b88b198660 Fix typo: famework → framework 2015-12-14 00:11:47 +01:00
Dmitri Gribenko
4324e7c903 Remove conditional compilation of tvOS 2015-12-01 14:43:45 -07:00
Devin Coughlin
632a451c29 Tests: Additional run-time tests for Obj-C weak linking.
Add tests that would access Objective-C class metadata by casting and
generic type parameters. Also run these tests with the optimizer turned on.

Swift SVN r30299
2015-07-17 03:11:37 +00:00
Devin Coughlin
7573aebf6c Tests: Make availability_weak_linking.swift require enable_target_appletvos
This fixes a test failure when appletvos is not enabled. Also, stop trying to
link against a swift source file. This was causing the linker to emit a scary
warning.

Swift SVN r30158
2015-07-13 19:16:15 +00:00
Ben Langmuir
d56ad1d6fa Fix casing Objc => ObjC in test
Case-[in]sensitivity strikes again.

Swift SVN r30087
2015-07-10 20:42:28 +00:00
Devin Coughlin
007dfe15bf Runtime: Allow protocol extensions for weakly-linked Objective-C classes
Change ProtocolConformanceRecord::getCanonicalTypeMetadata() to return null if
the class metadata in the protocol conformance record is null. This fixes a
runtime crash in swift_conformsToProtocol when there is a protocol extension of
a missing weakly-linked class.

rdar://problem/21541766

Swift SVN r30012
2015-07-09 03:36:57 +00:00
Devin Coughlin
b8fded0c8c Test: Fix copy-paste error in availability_weak_linking.swift
The goal is to test that we can safely cast to an Objective-C protocol that is
defined in a missing weakly-linked framework, even when the protocol
declaration is missing an availability annotation (this is common in
Objective-C frameworks).

Swift SVN r30010
2015-07-09 01:49:53 +00:00
Devin Coughlin
ecc7307e76 Test: Emulate deployment on older OSes to test weak linking to Objective-C
These tests emulate deploying back to an older OS where newer APIs are not
available by linking to an Objective-C framework where APIs have been
annotated to only be available in the far future and then moving the famework
aside so that it can't be found at run time.

These tests include some basics (global variables and classes), but the focus
is on Objective-C protocols to validate the change allowing types to
conform to protocols less available than the types themselves.

Swift SVN r30005
2015-07-09 00:58:27 +00:00