Commit Graph

34 Commits

Author SHA1 Message Date
Arnold Schwaighofer
fc766a39d3 Fix some more tests 2023-06-29 16:16:56 -07:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -07:00
Arnold Schwaighofer
9ee12db2a9 Fix tests for LLVM change that added anonymous parameter labeling
Fix for r367755.
2019-08-15 14:57:24 -07:00
Michael Gottesman
fd4828e40a Eliminate -assume-parsing-unqualified-ownership-sil from tests.
I am doing this separately from the actual change to eliminate the option to
make it easier to review.
2018-12-19 12:54:13 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Jordan Rose
0e5100da2e [test] Make sure to use the mock SDK overlays for these IRGen tests
And disable them on non-ObjC platforms again, because those overlays
depend on a stdlib that contains _ObjectiveCBridgeable.
2018-05-03 22:42:00 -06:00
Saleem Abdulrasool
dabbdad811 test: enable additional tests on Linux
Un-XFAIL tests on Linux now that ObjC interop is controllable.  There
are a couple of tests that remain which are dependent on Foundation.
Fix a configuration issue that resulted in a number of tests failing on
Linux.
2018-04-24 11:21:21 -07:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Greg Parker
b7f744c302 [test] Replace CPU=i386_or_x86_64 with CPU=i386 || CPU=x86_64. (#11889) 2017-09-12 19:34:08 -07:00
Erik Eckstein
c4a11f4c92 tests: remove the now unused option -new-mangling-for-tests 2017-03-22 11:28:43 -07:00
Greg Parker
6295f3d8b3 Revert "[test] Remove CPU=i386_or_x86_64 hack."
Swift master uses LLVM swift-4.0-branch, which does not yet have
the lit change implementing this syntax.

This reverts commit dfd10ae485.
2017-02-28 14:59:31 -08:00
Erik Eckstein
1282c6ae78 tests: convert more tests to use new mangling for llvm types
Those tests were missed because they are not executed currently by mistake (rdar://problem/30762030)
2017-02-28 12:33:27 -08:00
Greg Parker
dfd10ae485 [test] Remove CPU=i386_or_x86_64 hack.
LLVM lit now supports boolean expressions in REQUIRES: directives.
2017-02-16 16:27:15 -08:00
Arnold Schwaighofer
39fa2f0228 Use the swift calling convention for swift functions
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.

Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.

Use the 'swiftself' attribute on self parameters and for closures contexts.

Use the 'swifterror' parameter for swift error parameters.

Change functions in the runtime that are called as native swift functions to use
the swift calling convention.

rdar://19978563
2017-02-14 12:17:57 -08:00
Erik Eckstein
1d3724666f tests: convert about 400 tests to the new mangling by using the -new-mangling-for-tests option
When the new mangling is enabled permanently, the option can be removed from the RUN command lines again.
2017-01-24 15:27:45 -08:00
Michael Gottesman
20dd563efb [semantic-arc] Update tests for qualified/unqualified ownership and SILGen emission of copy_value, destroy_value. 2016-10-29 20:11:09 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Xin Tong
d3c6d1f6d7 Revert "Address @gribozavr comments to 273b1495834bcc650642aec523dd0504f8623cfa"
This reverts commit 062d14b422.

Revert "Fix a swift argument initialization bug - swift argument should be initialized"

This reverts commit 273b149583.

This breaks DebugAssert as well as REPL builds. Revert to appease the bots while i
look further.
2016-01-29 08:00:16 -08:00
Xin Tong
273b149583 Fix a swift argument initialization bug - swift argument should be initialized
after argc and argv are initialized. rdar://24250684

I reordered the CHECK statements in some tests to make them pass.

I tested this on Darwin and Linux.
2016-01-28 22:36:14 -08:00
Joe Groff
2368ce774b Remove self types from mangling by default.
And include some supplementary mangling changes:

- Give the first generic param (depth=0, index=0) a single character mangling. Even after removing the self type from method declaration types, 'Self' still shows up very frequently in protocol requirement signatures.
- Fix the mangling of generic parameter counts to elide the count when there's only one parameter at the starting depth of the mangling.

Together these carve another 154KB out of a debug standard library. There's some awkwardness in demangled strings that I'll clean up in subsequent commits; since decl types now only mangle the number of generic params at their own depth, it's context-dependent what depths those represent, which we get wrong now. Currying markers are also wrong, but since free function currying is going away, we can mangle the partial application thunks in different ways.

Swift SVN r32896
2015-10-26 22:05:20 +00:00
Joe Groff
0cd5aa8c7c Change mangling for the Swift module from 'Ss' to 's'.
'Ss' appears in manglings tens of thousands of times in the standard library and is also incredibly frequent in other modules. This alone is enough to shrink the standard library by 59KB.

Swift SVN r32409
2015-10-02 22:39:44 +00:00
Manman Ren
e94aae06da [Function Attribute] add target-cpu and target-features sets if they're non-null.
All llvm::Functions created during IRGen will have target-cpu and target-features
attributes if they are non-null.

Update testing cases to expect the attribute in function definition.
Add testing case function-target-features.swift to verify target-cpu and
target-features.

rdar://20772331


Swift SVN r28186
2015-05-05 23:19:48 +00:00
Joe Groff
8e74c1d70c Revert "Disable IRGen tests" and update tests for codegen changes.
This reverts commit r26615, reenabling and updating the tests (again).

Swift SVN r27672
2015-04-24 03:29:51 +00:00
Joe Groff
b73f89d5e4 Revert "Revert "Disable IRGen tests" and update tests for codegen changes."
This reverts commit r26641, because Clang keeps shifting the emission order of inline functions beneath us.

Swift SVN r26645
2015-03-27 21:08:34 +00:00
Joe Groff
d216feb3f3 Revert "Disable IRGen tests" and update tests for codegen changes.
This reverts commit r26615, reenabling and updating the tests.

Swift SVN r26641
2015-03-27 20:15:30 +00:00
Arnold Schwaighofer
7b28d3f792 Disable IRGen tests
They have been failing on the bots the whole day.

rdar://20308576

Swift SVN r26615
2015-03-27 00:04:34 +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
Erik Eckstein
e59c4b6eb7 Add -primary-file options to prevent whole-module-optimizations.
This is needed for tests which define internal functions which should not be eliminated.

So far this was not needed because of a hack which prevented whole-module-optimizations for tests.



Swift SVN r22658
2014-10-10 09:51:48 +00:00
Erik Eckstein
c16c510167 Set SILLinkage according to visibility.
Now the SILLinkage for functions and global variables is according to the swift visibility (private, internal or public).

In addition, the fact whether a function or global variable is considered as fragile, is kept in a separate flag at SIL level.
Previously the linkage was used for this (e.g. no inlining of less visible functions to more visible functions). But it had no effect,
because everything was public anyway.

For now this isFragile-flag is set for public transparent functions and for everything if a module is compiled with -sil-serialize-all,
i.e. for the stdlib.

For details see <rdar://problem/18201785> Set SILLinkage correctly and better handling of fragile functions.

The benefits of this change are:
*) Enable to eliminate unused private and internal functions
*) It should be possible now to use private in the stdlib
*) The symbol linkage is as one would expect (previously almost all symbols were public).

More details:

Specializations from fragile functions (e.g. from the stdlib) now get linkonce_odr,default
linkage instead of linkonce_odr,hidden, i.e. they have public visibility.
The reason is: if such a function is called from another fragile function (in the same module),
then it has to be visible from a third module, in case the fragile caller is inlined but not
the specialized function.

I had to update lots of test files, because many CHECK-LABEL lines include the linkage, which has changed.

The -sil-serialize-all option is now handled at SILGen and not at the Serializer.
This means that test files in sil format which are compiled with -sil-serialize-all
must have the [fragile] attribute set for all functions and globals.

The -disable-access-control option doesn't help anymore if the accessed module is not compiled
with -sil-serialize-all, because the linker will complain about unresolved symbols.

A final note: I tried to consider all the implications of this change, but it's not a low-risk change.
If you have any comments, please let me know.



Swift SVN r22215
2014-09-23 12:33:18 +00:00
Jordan Rose
ee22004b84 [IRGen] Walk inlineable Clang functions and emit their dependencies.
This handles things like NSSwapHostLongLongToBig and MKMapRectMake that
are static inline functions that themselves call other static inline
functions.

<rdar://problem/17227237>

Swift SVN r21080
2014-08-06 23:21:17 +00:00