Commit Graph

3245 Commits

Author SHA1 Message Date
Saleem Abdulrasool
cb1aeea9af test: make stdlib/Integer.swift.gyb python 3 friendly
Adjust the division operation to ensure that we get an integral value
back.  Without this, we would attempt to shift a floating point value
by bitwise operations which is not supported.
2020-07-10 14:28:49 -07:00
Nate Chandler
c5270a5968 [Test] Xfail stdlib/NSValueBridging.swift
rdar://problem/64995079
2020-07-10 06:29:52 -07:00
Karoy Lorentey
b42910a430 [test] Reenable NSValueBridging tests on i386
Instead, disable tests we cannot run with a targeted platform conditional.
2020-07-08 22:33:17 -07:00
Mishal Shah
ca87af103b Merge pull request #32705 from apple/apple-silicon-master
[master] Apple Silicon support
2020-07-04 21:53:08 -07:00
Mishal Shah
92ca9fc924 [Apple Silicon] Generalize tests for other macOS architectures
Most of the changes fall into a few categories:
* Replace explicit "x86_64" with %target-cpu in lit tests
* Cope with architecture differences in IR/asm/etc. macOS-specific tests
2020-07-02 16:27:46 -07:00
Dario Rexin
732698e268 Fix symbol visibility test for CentOS 7 2020-07-02 13:21:38 -07:00
tbkka
f989aa2b22 SR-12486: T.self is Any.Protocol is broken (#31662)
* SR-12486: `T.self is Any.Protocol` is broken

This turned out to be fallout from https://github.com/apple/swift/pull/27572
which was in turn motivated by our confusing metatype syntax when generic variables are bound to protocols.

In particular, the earlier PR was an attempt to make the expression
`x is T.Type` (where `T` is a generic type variable bound to a protocol `P`)
behave the same as
`x is P.Type` (where `P` is a protocol).
Unfortunately, the generic `T.Type` actually binds to `P.Protocol` in this case (not `P.Type`), so the original motivation was flawed, and as it happens, `x is T.Type` already behaved the same as `x is P.Protocol` in this situation.

This PR reverts that earlier change and beefs up some of the tests around these behaviors.

Resolves SR-12486

Resolves rdar://62201613

Reverts PR#27572
2020-07-02 13:10:01 -07:00
Robert Widmann
50159d15b7 [Gardening] Use Vendor=apple Where Possible
This simplifies the usual bundle of OS checks

OS=macosx || OS=ios || OS=tvos || OS=watchos

into

VENDOR=apple

which was added in apple/swift#27307
2020-06-30 23:03:01 -07:00
Robert Widmann
cddf73ecdb [Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport

This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
2020-06-30 22:55:58 -07:00
Károly Lőrentey
b3fb7626c1 [test] Don’t import UIKit on iOS 10.3 2020-06-29 18:44:22 -07:00
Karoy Lorentey
73c99acf29 [test] Reinstate CoreGraphics↔︎NSValue bridging tests on iOS/watchOS/tvOS 2020-06-29 16:46:50 -07:00
Saleem Abdulrasool
a817409562 test: make stdlib.NumericParsing Python 3 friendly
Use the proper division operation as the test otherwise generates
different patterns.
2020-06-29 08:55:01 -07:00
Pavel Yaskevich
a8d44bc9ce Merge pull request #32558 from xedin/fix-req-conformace-assessment
[ConstraintSystem] Adjust recording of "fixed" requirements to avoid conflicts
2020-06-26 15:28:13 -07:00
Ben Cohen
87df9961a5 Add fast string interpolation for metatypes (#32113) 2020-06-26 09:46:54 -07:00
Pavel Yaskevich
0ea0b8e27b [ConstraintSystem] Adjust recording of "fixed" requirements to avoid conflicts
Currently it's possible to have a type conflict between different
requirements deduced as the same type which leads to incorrect
diagnostics. To mitigate that let's adjust how "fixed" requirements
are stored - instead of using resolved type for the left-hand side,
let's use originating generic parameter type.
2020-06-25 13:40:15 -07:00
Mishal Shah
ace20bdeb1 Remove comment in TestData.swift 2020-06-23 09:11:39 -07:00
Mishal Shah
52d11fdc57 Remove comment in TestData.swift 2020-06-23 09:11:04 -07:00
Karoy Lorentey
da242bd2d4 [SDK] Remove obsolete overlay code 2020-06-22 15:43:39 -07:00
Mishal Shah
272c466e47 Update master to build with Xcode 12 beta 2020-06-22 15:43:20 -07:00
Pavel Yaskevich
82fcee7bc7 [Diagnostics] NFC: Adjust diagnostic test-cases improved by new ambiguity diagnosis 2020-06-12 13:13:27 -07:00
Pavel Yaskevich
ac2305e7f1 [ConstraintSystem] Increase impact of fixes for some conditional requirements
If there is a conditional requirement failure associated with
member/function reference used in a call let's increase a score
of a fix for such failure because it renders member/function
unreachable in current context or with a given set of arguments.
2020-06-12 11:47:04 -07:00
Pavel Yaskevich
d9594c712a [TypeChecker] NFC: Adjust tests improved by new approach for ambiguity diagnosis 2020-06-12 11:47:03 -07:00
tbkka
db9cf4cd80 Filter out more std::__once_call_impl<>() constructors (#32325)
One of our Ubuntu 16.04 CI machines is seeing different variations
of the std::__once_call_impl<>() constructor than the ones we're already filtering out.

Resolves rdar://64267618
2020-06-12 10:03:13 -07:00
3405691582
7b431b4ddb [test] Mark XFAIL tests for OpenBSD.
These tests are marked XFAIL or UNSUPPORTED because either the tests:
require libc annotation, require Mach-O support, don't recognize calls to
swift-autolink-extract, requires porting alongside Linux, or rely on simd
which is not present.

Additionally, explicit REQUIRES for tsan/asan/fuzzer are added to some
tests, since OpenBSD does not support these sanitizers or fuzzers, since
it's nicer to mark that with REQUIRES rather than XFAIL.
2020-06-10 18:57:19 -04:00
Saleem Abdulrasool
017d99d7e4 test: add a test to prevent weak symbol leakage
The Swift standard library should not export weak symbols.  Ensure that
no public weak symbols are defined in the standard library by adding a
test case.  This would have identified the issue introduced by the
recent changes for the runtime.
2020-06-08 16:24:11 -07:00
Saleem Abdulrasool
63c8c005d7 test: add a ODR violation check for the static standard library
The static version of the standard library was leaking symbols in the
`llvm::` namespace which would result in ODR violations were the
artifact linking against `LLVMSupport` (via another dependency).  In
particular, `llvm::SmallVector` and `llvm::StringSwitch` symbols were
being leaked.  This adds a test case specifically for the static variant
of the library.  The dynamic variant of the library is already tested in
a separate test.
2020-05-29 14:02:25 -07:00
Mishal Shah
d5c40bf231 Revert "Disable objc_mangling.swift and SwiftObjectNSObject.swift test on tvOS"
This reverts commit 7e2c2452ad.
2020-05-28 14:10:40 -07:00
NevinBR
4bb855be4a Created unit tests for DefaultIndices 2020-05-27 09:50:57 -04:00
Mike Ash
28a61eaa19 [Test] Have llvm-support-odr-violation.sh use platform-dylib-dir.
platform-module-dir isn't quite right, since we're looking for libswiftCore.dylib.

rdar://problem/63437032
2020-05-20 11:01:08 -04:00
Robert Widmann
6379387e1d Merge pull request #31883 from gribozavr/enable-unicodescalar-test
Reenable a test for UnicodeScalar
2020-05-19 13:40:03 -07:00
Saleem Abdulrasool
bfb65ecfdb Merge pull request #31870 from compnerd/stdlib-insurance
test: ensure that we do not regress the standard library isolation
2020-05-19 07:54:30 -07:00
Dmitri Gribenko
3f5c53a6b8 Reenable a test for UnicodeScalar
This test was disabled back in 2017 when the new integer protocols were
landing due to regressions in error messages. It is better to have a
working test that verifies the desired behavior (UnicodeScalar not
supporting arithmetic and the type checker producing somewhat readable
messages), rather than a disabled test because the error messages are
not perfect.
2020-05-19 11:53:11 +02:00
Dmitri Gribenko
e055b4bbe3 Merge pull request #31859 from gribozavr/merge-coregraphics
Consolidated four CoreGraphics execution tests
2020-05-19 08:53:59 +02:00
Saleem Abdulrasool
f42a62b9fc Update llvm-support-odr-violation.test-sh
Allow empty input as PE/COFF does not provide a symbol table which results in no visible symbols.
2020-05-18 14:52:00 -07:00
Dmitri Gribenko
30afc6c406 Consolidated four CoreGraphics execution tests
I don't see any reason to split the tests like this. I merged the tests
into the biggest and best-organized test file.

I also removed the `REQUIRES: OS=macosx` line and made some small
adjustments to the test to make it cross-platform.
2020-05-18 23:13:12 +02:00
Saleem Abdulrasool
a92894c530 test: ensure that we do not regress the standard library isolation
Add a test to ensure that the standard library does not accidentally end
up with symbols in the `llvm::` namespace.  The LLVMSupport symbols for
now are namespaced to `__swift::__runtime` with the desire that they
will move into `swift::` and become vended in the swift namespace.
2020-05-18 21:08:16 +00:00
Robert Widmann
7e00f7e6c6 Merge pull request #31853 from 3405691582/Semaphore_Typealias_OpenBSD
[stdlib] sem_t is a nullable pointer on OpenBSD.
2020-05-18 13:05:37 -07:00
3405691582
f1ca2e97cf [stdlib] sem_t is a nullable pointer on OpenBSD.
Platform defines sem_open in Swift that calls through to the underlying
platform functions because sem_open is variadic. However, the
definitions here assume sem_t is non-nullable, but this assumption only
holds when the platform has nullability annotations on the semaphore
type, or the semaphore type on the platform is not an opaque pointer.

On OpenBSD specifically, the semaphore type is an opaque pointer without
any nullability annotations. This means that the type gets inferred as
UnsafeMutablePointer<sem_t?>? instead of UnsafeMutablePointer<sem_t>?.
To make sure the pointer values returned and their types match, we
introduce a conditional typealias.

The other option is to coerce everything to UnsafeMutablePointer<sem_t>?
but this would be a rather blunt instrument. While sem_open is public in
stdlib, it is not so much codified stdlib API, so this is a slightly
nicer approach.
2020-05-17 22:24:06 -04:00
Owen Voorhees
6c646ec1fd Merge pull request #31649 from owenv/ephemeral-edu-notes
[Diagnostics] Add an edu note explaining @_nonEphemeral diags
2020-05-11 23:54:42 -05:00
Owen Voorhees
792fb87da5 [Diagnostics] Add an edu note explaining @_nonEphemeral diags 2020-05-11 13:05:12 -07:00
Robert Widmann
f2b3f8ffb6 Merge pull request #31621 from davezarzycki/pr31621
Remove all uses of -force-single-frontend-invocation
2020-05-08 09:48:48 -07:00
David Zarzycki
5dcc32f98f Remove all uses of -force-single-frontend-invocation
The `-force-single-frontend-invocation` flag predates WMO and is now an
alias for `-whole-module-optimization`. We should use the latter and let
the former fade into history.
2020-05-08 06:37:41 -04:00
Karoy Lorentey
926cc3f9ca Revert "Disable test that is known to fail in asan" 2020-05-07 10:51:43 -07:00
Karoy Lorentey
091a6d877f Merge pull request #31601 from lorentey/data-append
[Foundation] Data.append: Switch to using resetBytes
2020-05-07 10:46:14 -07:00
Arnold Schwaighofer
8ca7b4986e Disable test that is known to fail in asan
rdar://62866069
2020-05-06 06:40:24 -07:00
Karoy Lorentey
658effd928 [test] Data: Add tests exercising Sequence-based init and append 2020-05-05 18:29:25 -07:00
Karoy Lorentey
6537df068a Revert "test: disable several tests failing in CI" 2020-04-29 19:00:17 -07:00
Michael Ilseman
249d2eeb2c [string] Add _deconstructUTF8 for internal usage
Add string deconstruction into contiguous UTF-8 (allocating if
needed).

Comments and docs to come soon, for now doing early testing.
2020-04-24 12:13:41 -07:00
Joe Groff
948372b87c Merge pull request #31087 from jckarter/compatibility-51
Start a Compatibility51 library for backporting fixes to Swift 5.1 runtimes
2020-04-17 15:06:50 -07:00
Joe Groff
42514f42e0 Start a Compatibility51 library for backporting fixes to Swift 5.1 runtimes 2020-04-17 10:41:48 -07:00