Commit Graph

20 Commits

Author SHA1 Message Date
Karoy Lorentey
666a22feff [test] Modernize hashing throughout the test suite 2018-11-29 17:38:29 +00:00
Slava Pestov
3701f745c4 Migrate various Sema tests to Swift 4 2018-06-25 01:02:20 -07:00
Slava Pestov
5d2752f7d2 Run tests with -swift-version 4 by default
Some test now fail, so add an explicit -swift-version 3.
2018-06-19 23:24:19 -07: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
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Doug Gregor
7d1a2e8339 Reinstate "Implement support for Clang's objc_runtime_visible attribute."
When a Clang-defined Objective-C class has the objc_runtime_visible
attribute, use objc_lookUpClass to get the Objective-C class object
rather than referencing the symbol directly. Also, ban subclassing of
Objective-C-runtime-visible classes as well as @objc on members of
extensions of such classes.

As a drive-by needed for this test, make
ClassDecl::getObjCRuntimeName() respect the Clang objc_runtime_name
attribute.

Fixes rdar://problem/25494454.

Fix an i32 vs. 64 issue in the IR matching for the IR generation test.

This reverts commit 09973e6956.
2016-04-02 20:10:32 -07:00
Ted Kremenek
09973e6956 Revert "Implement support for Clang's objc_runtime_visible attribute."
This reverts commit 2c1f19a547.

This appears to be breaking all the iOS bots.
2016-04-02 07:33:14 -07:00
Doug Gregor
2c1f19a547 Implement support for Clang's objc_runtime_visible attribute.
When a Clang-defined Objective-C class has the objc_runtime_visible
attribute, use objc_lookUpClass to get the Objective-C class object
rather than referencing the symbol directly. Also, ban subclassing of
Objective-C-runtime-visible classes as well as @objc on members of
extensions of such classes.

As a drive-by needed for this test, make
ClassDecl::getObjCRuntimeName() respect the Clang objc_runtime_name
attribute.

Fixes rdar://problem/25494454.
2016-04-01 23:07:21 -07:00
Doug Gregor
86b7322e87 [Sema -> AST] Refactor "is representable in Objective-C?" checking.
Migrate the check for whether a given type is representable in
Objective-C, which is currently used to verify when @objc can be
inferred or verify that an explicitly-written @objc is well-formed,
from Sema into a set of queries on the Type within the AST library, so
it can be used in other parts of the compiler.

As part of this refactoring, clean up and improve a number of aspects
of this code:

* Unify the "trivially representable" and "representable" code paths
  into a single code path that covers these cases. Clarify the
  different levels of "representable" we have in both the code and
  in comments.

* Distinguish between representation in C vs. representation in
  Objective-C. While we aren't using this now, I'm anticipating it
  being useful to allow exporting C interfaces via @_cdecl (or
  similar).

* Eliminate the special cases for bridging String/Array/Dictionary/Set
  with their Foundation counterparts; we now consult
  _ObjectiveCBridgeable conformances exclusively to get this
  information.

* Cache foreign-representation information on the ASTContext in a
  manner that will let us more easily get the right answer across
  different contexts while providing more sharing than the TypeChecker
  version.

Annoyingly, this only seemed to fix a small class of error where we
were permitting Unsafe(Mutable)Pointer<T> to be representable in
Objective-C when T was representable but not trivially representable,
e.g., T=String or T=AnyObject.Type.
2016-03-16 23:53:48 -07:00
Jordan Rose
8106a11dac Disallow @objc on non-ObjC-rooted classes.
These classes don't show up well in generated headers (rdar://problem/20855568),
can't actually be allocated from Objective-C (rdar://problem/17184317), and
make the story of "what is exposed to Objective-C" more complicated. Better
to just disallow them.

All classes are still "id-compatible" in that they can be converted to
AnyObject and passed to Objective-C, they secretly implement NSObjectProtocol
(via our SwiftObject root class), and their members can still be individually
exposed to Objective-C.

The frontend flag -disable-objc-attr-requires-foundation-module will disable
this requirement as well, which is still necessary for both the standard
library and a variety of tests I didn't feel like transforming.

Swift SVN r29760
2015-06-27 16:27:56 +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
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Dmitri Hrybenko
1eea220932 Use one module cache directory for all the lit tests to speed them up
Doing so is safe even though we have mock SDK.  The include paths for
modules with the same name in the real and mock SDKs are different, and
the module files will be distinct (because they will have a different
hash).

This reduces test runtime on OS X by 30% and brings it under a minute on
a 16-core machine.

This also uncovered some problems with some tests -- even when run for
iOS configurations, some tests would still run with macosx triple.  I
fixed the tests where I noticed this issue.

rdar://problem/19125022

Swift SVN r23683
2014-12-04 11:21: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
Nadav Rotem
accba56e0a Disable the code that adds the 'final' attribute based on access control.
This patch is a part of rdar://17890078



Swift SVN r21137
2014-08-11 21:54:56 +00:00
Michael Ilseman
1df56990bd Also try to add final to non-public members of public classes.
Teaches TryAddFinal to descend into public and objc classes. Only
tries to add final if we're either whole compilation mode, or we're
processing the primary source buffer.

Updates test cases. Includes workarounds for <rdar://problem/17860781>
and <rdar://problem/17862348>.

Swift SVN r20790
2014-07-31 00:32:50 +00:00
Chris Lattner
02999cac51 Reinstate the @ on the @objc attribute. This is largely a revert of r19555 with a few tweaks.
Swift SVN r19706
2014-07-08 21:50:34 +00:00
Chris Lattner
7a56499d61 Start making @objc not start with an @ sign:
- Change the parser to accept "objc" without an @ sign as a contextual
   keyword, including the dance to handle the general parenthesized case.
 - Update all comments to refer to "objc" instead of "@objc".
 - Update all diagnostics accordingly.
 - Update all tests that fail due to the diagnostics change.
 - Switch the stdlib to use the new syntax.

This does not switch all tests to use the new syntax, nor does it warn about
the old syntax yet.  That will be forthcoming.  Also, this needs a bit of 
refactoring, which will be coming up.



Swift SVN r19555
2014-07-04 05:57:57 +00:00
Chris Lattner
2eb92598a7 move test/basic/attr to test/attr, and move the sole name binding test in test/basic/lookup to the test/NameBinding
directory.  We now have no basic tests, just advanced ones :-)



Swift SVN r17941
2014-05-12 16:48:41 +00:00