Commit Graph

26 Commits

Author SHA1 Message Date
Alexis Laferrière
11c448d954 Tests: Use a local cache for many tests importing AppKit
Tests importing AppKit have a tendency to be flaky if they share a
module cache with other builds using a different set of framework search
flags. Make sure they use a local cache to avoid picking incompatible
cached modules.

Alternatively, we could align all builds using the same cache to have
exactly the same framework search paths or enable explicit module
builds. I picked the module cache as it's the most reliable solution in
the short and long term.

The 5 tests below import AppKit and have been known to be flaky.
Adapting them to use a custom cache with require more care. For now,
let's use them as control group to validate that the fix works. If these
5 fail without the fixed ones, we should extend the same corresponding
fix to them.

- Interpreter/SDK/GLKit.swift
- Interpreter/SDK/cf_extensions.swift
- Interpreter/SDK/cf_type_bridging.swift
- Interpreter/SDK/mapkit_header_static.swift
- Interpreter/SDK/objc_ns_enum.swift

rdar://142296731
2025-01-09 12:22:02 -08:00
Ben Langmuir
dc5e6d88c2 [test] ignore deprecations
Ignore some deprecation warnings associated with the deployment target
bump.
2024-08-30 09:10:14 -07:00
Varun Gandhi
a1716fe2a6 [Diagnostics] Update compiler diagnostics to use less jargon. (#31315)
Fixes rdar://problem/62375243.
2020-04-28 14:11:39 -07:00
Rintaro Ishizaki
384ab780e9 [Diagnostic verifier] Make '<unknown>' check optional
Added frontend option '-verify-ignore-unknown'
2017-02-02 10:49:32 +09:00
Rintaro Ishizaki
827c6e7c3d [Diagnostic verifier] Diagnostics at '<unknown>:0' are unexpected 2017-02-02 10:48:54 +09:00
Doug Gregor
8e4efaf51c [Sema] Diagnose availability via TypeReprs rather than Types.
The code that diagnosed availability for types was reverse-engineering
the Type itself, rather than making use of the declaration already
stored within the TypeRepr. 

More importantly, it would completely skip nested types, so it would
fail to diagnose a deprecated/unavailable “Bar” in “Foo.Bar”. 

Replace the type-inspecting check with a much-simpler walk over the 
components of the IdentTypeRepr that looks at the declarations stored 
in the IdentTypeRepr directly. This provides proper source-location
information and handles nested types.

This is a source-breaking change for ill-formed Swift 3 code that used
nested type references to refer to something that should be unavailable.
Given that such Swift 3 code was ill-formed, and most uses of it would
crash at runtime, we likely do not need to provide specific logic to
address this in Swift 3 compatibility mode.
2016-12-02 14:48:54 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Jordan Rose
490aefafcd [ClangImporter] Preserve macros from all implicit submodules. (#3983)
...instead of picking one definition arbitrarily. This comes from the
new "lookup table" design in Swift 3---we no longer just look for any
"visible" (imported) macro definition, but instead need to know them
up front. This works fine when there's only one definition per module,
but for modules like 'OpenGL' on macOS, with mutually-exclusive
submodules 'GL' and 'GL3', the compiler was arbitrarily deciding that
all of the macros the submodules had in common belonged to 'GL'.

The new model tries to decide if it's possible for two modules to be
imported separately, and keeps both macro entries if possible, only
deduplicating equivalent definitions at the last minute (when
importing into Swift). This /still/ doesn't perfectly match the
behavior you'd get in C, where a submodule and its parent module could
theoretically have conflicting definitions and you'd be fine as long
as you only imported one of them, but hopefully (a) it's close enough,
and (b) nobody is doing that. (The Swift compiler will prefer the
definition in the parent module even if the submodule is the only one
imported.)

rdar://problem/26731529
2016-08-04 08:39:45 -07:00
Daniel Duan
7cabf3555b [Parser] update test for SE-0040 changes 2016-03-11 16:01:37 -08:00
Doug Gregor
ae6b41dc37 Clang importer: enable the Swift name lookup tables by default.
Fixes rdar://problem/14776565 (AnyObject lookup for Objective-C
properties with custom getters) and rdar://problem/17184411 (allowing
__attribute__((swift_name("foo"))) to work on anything).
2015-12-21 09:55:21 -08:00
Doug Gregor
d71de5d860 Clang importer: filter out hidden Clang entries from name lookup.
The Swift name lookup tables record name -> declaration mappings
without respect to submodule visibility. When we do name lookup via
those lookup tables, filter out declarations that are not visible.

Note that this implementation is broken in the same way that the
pre-name-lookup-tables implementation is broken, because it uses
Clang's declaration visibility indicators rather than filtering out
based on submodule lookups. We should fix this behavior to provide
proper submodule lookup, but not until after we've matched the
existing behavior with Swift's name lookup tables.
2015-12-17 07:11:48 -08:00
Arnold Schwaighofer
f7771859d8 Rename the optimize_test feature to executable_test and document that feature.
Swift SVN r29213
2015-06-01 23:44:13 +00:00
Arnold Schwaighofer
3643c614a3 Run tests in optimize test modes
This runs all files that have a target-build-swift or target-run-stdlib-swift
RUN line in optimize test mode.

Swift SVN r29206
2015-06-01 21:23:31 +00:00
Ben Langmuir
55bc94778f Remove OpenAL.AL check from submodules_smoke_test.swift
OpenAL.AL is gone.

This module no longer has only explicit submodules, so just remove it.
I'll file a radar to add a synthetic test to fill in the gap since there
are no longer any other modules in the SDK that have this structure.

rdar://21118411

Swift SVN r29077
2015-05-27 21:18:55 +00:00
Chris Lattner
e4b6afb9ae Start moving the testsuite to the "_ = foo()" idiom for evaluating an
expression but ignoring its value.  This is the right canonical way to do
this.  NFC, just testsuite changes.



Swift SVN r28638
2015-05-15 20:15:54 +00:00
Ted Kremenek
62feb5c949 Change @availability to @available.
This came out of today's language review meeting.
The intent is to match #available with the attribute
that describes availability.

This is a divergence from Objective-C.

Swift SVN r28484
2015-05-12 20:06:13 +00:00
Devin Coughlin
d08b98b1ca Sema: Turn on availability checking by default
Enable checking for uses of potentially unavailable APIs. There is
a frontend option to disable it: -disable-availability-checking.

This commit updates the SDK overlays with @availability() annotations for the
declarations where the overlay refers to potentially unavailable APIs. It also changes
several tests that refer to potentially unavailable APIs to use either #available()
or @availability annotations.

Swift SVN r27272
2015-04-14 06:44:01 +00:00
Graham Batty
83b4384fac Update test flags for linux failures and support.
Also removed the sdk 'feature' in favour of the more specific
objc_interop.

Swift SVN r24856
2015-01-30 21:31:48 +00:00
Graham Batty
83f27a8af7 Revert "Mark tests that don't pass on linux as XFAIL."
This reverts commit 2711ca86de7bf6a7885ccea24219a48a590b1e95.

Swift SVN r23577
2014-11-24 17:42:13 +00:00
Graham Batty
198402dcfe Mark tests that don't pass on linux as XFAIL.
Swift SVN r23573
2014-11-24 17:40:37 +00:00
Jordan Rose
903cfacfa5 [DebugInfo] When looking up an imported module, don't include the scope.
i.e. for "import func Darwin.C.sqrt", use the module path "Darwin.C",
not the full path "Darwin.C.sqrt".

<rdar://problem/17895650>

Swift SVN r21097
2014-08-07 21:26:34 +00:00
Jordan Rose
c75bdc81e1 [test] Drop import of UIKit in this test; we don't want to bring in OpenGL.
This was causing the iOS build to fail.

Swift SVN r20943
2014-08-02 02:20:17 +00:00
Jordan Rose
709327b4d7 [test] Fix submodules_smoke_test.swift again.
Per Ben's suggestion, use OpenAL as an example of a module with only
explicit submodules. Continue testing OpenGL on OS X since we've gotten
several bugs about it.

Swift SVN r20320
2014-07-22 17:15:56 +00:00
Greg Parker
0a04eddac1 [test] Disable part of submodules_smoke_test on iOS due to OpenGL differences.
Swift SVN r20302
2014-07-22 09:38:06 +00:00
Jordan Rose
f7b4f167dd [test] Fix submodules_smoke_test.swift to actually build the file.
Swift SVN r20300
2014-07-22 06:03:21 +00:00
Jordan Rose
58befc46e2 [ClangImporter] Handle submodule imports.
Specifically, handle them by also importing the top-level module. This is
unfortunate, but at least lets people /access/ things in explicit submodules,
even if it doesn't let them limit their import to a specific submodule.

    (swift) import OpenGL.GL3
    (swift) glGetString
    // r0 : (GLenum) -> ConstUnsafePointer<GLubyte> = (Function)
    (swift) OpenGL.glGetString
    // r1 : (GLenum) -> ConstUnsafePointer<GLubyte> = (Function)

One unfortunate side effect of having a single Clang ASTContext is that if
one Swift module imports a Clang submodule, every Swift module can now see
it. That means /mixing/ incompatible submodules, such as OpenGL.GL and
OpenGL.GL3, still won't work. Filed <rdar://problem/17756745> for that.

<rdar://problem/13140302>

Swift SVN r20288
2014-07-22 01:31:17 +00:00