Commit Graph

3290 Commits

Author SHA1 Message Date
Doug Gregor
4907a984b4 Merge pull request #28355 from DougGregor/no-opt-ast-casts
[Constraint application] Stop optimizing casts in the AST.
2019-11-20 22:57:22 -08:00
Ravi Kandhadai
ba7996712a Merge pull request #28350 from ravikandhadai/oslog-exec-test-enable
[OSLogOptimization] Fix a bug in the replaceAllUsesAndFixLifetimes function of the OSLogOptimization pass
2019-11-20 19:38:35 -08:00
Mao ZiJun
f5ef37ab47 added test case for OptionSet's set algebra methods 2019-11-21 11:25:41 +09:00
Doug Gregor
f95f8e9a7b [Test] Go through the runtime for the "as? NSObject" check.
This prevents runtime differences on as? from affecting this test.
2019-11-20 16:53:59 -08:00
Doug Gregor
72ef0b1043 Remove extraneous function from test 2019-11-20 16:26:04 -08:00
Doug Gregor
c8df9cd234 [Test] Introduce appropriate runtime availability check 2019-11-20 16:23:38 -08:00
Doug Gregor
9975572781 [Runtime] Add test for casting an Error type to NSObject 2019-11-20 15:56:24 -08:00
Brent Royal-Gordon
bc5d59ecb7 Revert "[Runtime] Handle dynamic casting to NSObject via error bridging." 2019-11-20 10:38:44 -08:00
Ravi Kandhadai
f319f15655 [OSLogOptimization] Fix a bug in the replaceAllUsesAndFixLifetimes
function of the OSLogOptimization pass that happens when folding a
guaranteed value with a constant (owned) value. The fix inserts the
constant value at the beginning of the borrowed scope of the guaranteed
value rather than at the definition of the guaranteed value.

Update the SIL tests for the new folding pattern and add a test that
catches this bug.

Also, re-enable the OSLogPrototypeExecTest.swift that was disabled
due to this bug.
2019-11-19 11:50:08 -08:00
swift-ci
6d46eb182a Merge pull request #28353 from DougGregor/error-bridge-to-nsobject 2019-11-19 10:24:30 -08:00
Doug Gregor
76591217fe [Runtime] Add test for casting an Error type to NSObject 2019-11-19 08:46:28 -08:00
Michael Gottesman
0567c2af79 Disable test until ownership lowering after diagnostics transition is complete.
I talked with Ravi (the maintainer) about this and he is cool. I am going to
provide a patch that he can review to the oslog specific pass that also
undisables the test.

This test was passing last week when I originally tested it so that suggests the
special optimization pass is pattern matching too specific of a pattern.
2019-11-17 11:33:12 -08:00
Mike Ash
7d4bf753f4 [Test] Don't test demangling of SwiftObject's name, as it's subject to change.
rdar://problem/57163094
2019-11-15 12:56:24 -05:00
Karoy Lorentey
71f5ceeaf8 Fix closing braces lost during conflict resolution 2019-11-13 16:18:38 -08:00
Karoy Lorentey
21922a4333 Merge branch 'master' into accelerate-vDSP-interpolation-tests 2019-11-13 15:50:02 -08:00
Pavel Yaskevich
ef98b39de9 Merge pull request #28141 from xedin/sr-8411
[TypeChecker] Disambiguite cases of implicit pointer conversions with…
2019-11-08 10:18:46 -08:00
Pavel Yaskevich
3feb25c958 [TypeChecker] Disambiguite cases of implicit pointer conversions with optionals
Currently `{inout, array, string}-to-pointer` conversion doesn't
track whether there was a difference in optionality between involved
types which leads to ambiguity when different overload choices
have different optionality requirements.

Let's fix that by increasing a score in cases if pointer type
is itself optional e.g.:

```swift
func foo(_ x: UnsafeMutablePointer<Int>) {}
func foo(_ x: UnsafeMutablePointer<Int>?) {}

foo(&foo) // Should pick the least optional overload choice.
```

Resolves: [SR-8411](https://bugs.swift.org/browse/SR-8411)
2019-11-07 17:00:59 -08:00
Mishal Shah
c2c8cf5903 Disable objc_mangling and SwiftObjectNSObject test for watchOS (56959761) 2019-11-06 16:43:54 -08:00
Luciano Almeida
1184492d25 [Diagnostics] SR-11419 Diagnose protocol stub note in editor mode only (#28101)
* [TypeChecker] Enclosing stubs protocol note within editor mode

* [test] Removing note from test where there is no -diagnostics-editor-mode flag

* Formatting modified code

* [tests] Fixing tests under validation-tests
2019-11-06 07:42:48 -08:00
Hamish Knight
998434f0da Add a -disable-invalid-ephemeralness-as-error flag
Currently this does nothing, as we're warning by
default, but once we error by default, this will
downgrade the diagnostic to a warning.
2019-11-03 08:42:26 -08:00
Hamish Knight
1bc56dcc11 [stdlib] Mark some parameters @_nonEphemeral
These include the pointer-to-pointer and pointer-to-buffer-pointer
initialiser parameters amongst a couple of others, such as
`Unmanaged.fromOpaque`, and the source for the `move[...]` family of
methods.
2019-11-03 08:42:26 -08:00
Mike Ash
a2cf576d4a [Test] Don't test _swift_willThrow on older runtimes.
rdar://problem/56752866
2019-10-30 15:07:37 -04:00
Mike Ash
55f9d2afca Merge pull request #27863 from mikeash/will-throw-callback
[Runtime] Add a function pointer for intercepting swift_willThrow calls.
2019-10-29 16:50:36 -04:00
Mike Ash
09e2e6888b [Runtime] Fix the error callback test for platforms without ObjC interop.
rdar://problem/53400364
2019-10-28 12:34:04 -04:00
Xi Ge
96523124a9 [test] xfail several stdlib tests failing in CI
10:21:57 Failing Tests (4):
10:21:57     Swift(macosx-x86_64) :: stdlib/SwiftNativeNSBase.swift
10:21:57     Swift(macosx-x86_64) :: stdlib/TestNSString.swift
10:21:57     Swift(macosx-x86_64) :: stdlib/TestJSONEncoder.swift

rdar://55727144
2019-10-25 11:04:52 -07:00
Pavel Yaskevich
58329e0c27 Revert "[Diagnostics][Qol] SR-11295 Emit diagnostics for same type coercion. " 2019-10-25 01:05:07 -07:00
Mike Ash
b8f5e841e2 [Runtime] Add a function pointer for intercepting swift_willThrow calls.
rdar://problem/53400364
2019-10-24 14:06:14 -04:00
Luciano Almeida
5d1eeacbe4 Resolving conflicts 2019-10-23 07:25:55 -03:00
Nathan Hawes
ace5d765aa Merge pull request #27793 from phausler/back_port_foundation_tests
Back port foundation tests
2019-10-22 15:37:55 -07:00
Luciano Almeida
86ca3454d6 Fixing warning UnnecessaryCoercion tests 2019-10-21 23:11:21 -03:00
Philippe Hausler
4315f40d40 TestData.swift fails when backporting to pre-macOS10.15/iOS13 2019-10-19 11:10:48 -07:00
Philippe Hausler
af42f532cc TestDecimal.swift fails when backporting to pre-macOS10.15/iOS13 2019-10-19 11:10:32 -07:00
Jacopo Andrea Giola
afca797192 Builtin types are always be printed with Builtin prefix
ASTPrinter now ignore the Options.FullyQualifiedTypesIfAmbiguous
value if the containing module is the builtin one.
2019-10-19 10:39:16 +02:00
Pavel Yaskevich
e09e8c3d72 [Diagnostics] NFC: Adjust diagnostics improved by extraneous arguments fix 2019-10-16 10:19:26 -07:00
Arnold Schwaighofer
7a54927b03 IRGen: Fix MemoryLayout::offset(of:) for tail allocated C arrays
There is no storage but an offset.

rdar://51194713
2019-10-15 14:04:31 -07:00
Pavel Yaskevich
d90117bb8a [Diagnostics] Remove argument handling from conformance failures
Argument-to-Parameter mismatch handles conformance failures
related to arguments, so the logic in `MissingConformanceFailure`
which wasn't entirely correct is now completely obsolete.

Resolves: rdar://problem/56234611
2019-10-14 00:34:37 -07:00
Mike Ash
c9f9350e74 [Compatibility50] Look up swift_getObjCClassMetadata at runtime.
This is the only dependency it has on libswiftCore. Looking this up at runtime allows its use in programs that don't link libswiftCore but might eventually load and run Swift code, such as xctest.

While we're in there, enable tests in files ending with `.c`.

rdar://problem/55274114
2019-10-10 12:10:39 -04:00
swift-ci
396dd73843 Merge pull request #27437 from mikeash/fix-9999-available-testing-against-os 2019-09-30 10:10:33 -07:00
Mike Ash
9ae7141711 [Test] Modify Runtime.swift.gyb to only test 9999 availability when running against a runtime that isn't part of the OS.
rdar://problem/55727341
2019-09-30 11:00:33 -04:00
Pavel Yaskevich
6aadbc3d52 Merge pull request #27390 from xedin/sr-11491
[Diagnostics] Centralize requirement failure impact assessment
2019-09-27 19:39:36 -07:00
Pavel Yaskevich
694023ac7c [Diagnostics] Centralize requirement failure impact assessment
Conformance requirements get their fixes attached directly where
other requirements have to use (for now) `repairFailure` mechanism.

Regardless of _how_ fixes get recorded there should be a single
way to assess impact of a particular requirement failure.

The rules are:

- If this is a requirement associated with an operator, impact
  is based on use of the type which failed the requirement;

- If this requirement is from conditional extension,
  it is considered a very high impact because failing such
  requirement makes referenced member de facto invisible.

Resolves: rdar://problem/55593998
Resolves: [SR-11491](https://bugs.swift.org/browse/SR-11491)
2019-09-26 12:13:06 -07:00
David Smith
1cce12f20c Add an Array-based NSMutableArray subclass 2019-09-24 18:15:33 -07:00
David Zarzycki
f968f4282d [Testing] Workaroud glibc non-null attributes 2019-09-21 08:15:11 +03:00
taylorswift
87a6ba21a4 Merge remote-tracking branch 'upstream/master' into comparable-enums 2019-09-19 19:32:58 -05:00
taylorswift
e13beb1227 update tests 2019-09-18 21:32:14 -05:00
Pavel Yaskevich
88c39db0c3 [Diagnostics] NFC: Fix improved test-cases related to argument-to-parameter mismatches 2019-09-13 22:35:53 -07:00
Pavel Yaskevich
a1643d94f7 [Diagnostics] NFC: Update all of the improved test-cases 2019-09-13 22:35:52 -07:00
David Smith
b8fb2e5eae Merge pull request #27155 from Catfish-Man/shim-shim-sher-ee-2
Remove stdlib and runtime dependencies on Foundation and CF
2019-09-13 09:43:38 -07:00
David Smith
1efa946caf Remove stdlib and runtime dependencies on Foundation and CF 2019-09-12 18:03:14 -07:00
Doug Gregor
87516934cd [SIMD] Add disambiguating += and -= operators.
The introduction of += and -= default implementations on
AdditiveArithmetic introduces an ambiguity with the += and -=
implementations on SIMD (where Scalar: FloatingPoint). Break the
ambiguity by adding another set of definitions of += and -= on
AdditiveArithmetic & SIMD where Self.Scalar: FloatingPoint.

Fixes rdar://problem/55278156.
2019-09-12 17:54:46 -07:00