Commit Graph

25 Commits

Author SHA1 Message Date
Slava Pestov
1159af50d9 Rename -enable-resilience to -enable-library-evolution and make it a driver flag
Fixes <rdar://problem/47679085>.
2019-03-14 22:24:26 -04:00
Saleem Abdulrasool
d77801abaf test: define and use %target-rpath
Create a new capturing substitution for adding a rpath to a target
library.  This is needed as Windows doesn't really support the concept
of a rpath.  This also makes it possible to remove the parameter from
the command line on windows.
2018-12-12 19:51:08 -08:00
Saleem Abdulrasool
ed1ec54958 test: make %target-library-name work in captures
Thanks to @jrose for the hint about the substitution ordering, the new
substitution now works even inside the capture group.  Replace the
remaining uses to the new macro.
2018-12-12 10:09:58 -08:00
Saleem Abdulrasool
8968fcad5f test: create and use target-library-name 2018-12-12 08:37:59 -08:00
Saleem Abdulrasool
b212229db1 test: add and use prefix substitutions for libraries
The naming convention is different on Windows than on Unix-like
environments.  In order to follow the convention we need to substitute
the prefix and the suffix.  Take the opportunity to rename the
`target-dylib-extension` to the CMake-like variable
`target-shared-library-suffix` and introduce
`target-shared-library-prefix`.  This helps linking the test suite
binaries on Windows.
2018-12-11 15:56:06 -08:00
Arnold Schwaighofer
6eca97add6 Codesign test/Interpreter 2018-08-10 06:58:40 -07:00
Slava Pestov
0e8fe3d382 Executable resilience tests re-build library under a new name now
Building a new dylib with the same name wasn't breaking some internal bots.

Fixes <rdar://problem/34148403>.
2017-10-02 19:11:13 -07:00
Slava Pestov
41d0503164 Fix resilience tests to pass dylibs on command line 2017-09-29 18:26:45 -07:00
Slava Pestov
afe9ad3b27 Fix some resilience tests for device testing
- Pass -install_name @executable_path/libfoo.dylib to the linker
- Pass dylib as an argument to the binary

Fixes <rdar://problem/34148403>.
2017-09-29 00:25:26 -06:00
Slava Pestov
f61c241edd Get resilience tests working on iOS again 2017-09-05 18:29:35 -07:00
Michael Ilseman
4dd3c82b2d Un-break resilience tests on non-mac platforms 2017-09-01 10:21:42 -07:00
Michael Ilseman
a862713999 Disable more failing tests on iOS 2017-08-31 13:10:10 -07:00
Slava Pestov
f8766fa2e3 Fix resilience tests on Linux 2017-08-29 02:13:55 -07:00
Slava Pestov
194b80049c Sema: Lazy property setters should not be transparent
A lazy property setter stores a value to the underlying storage
of the lazy property. The underlying storage is private, and it
is not proper for a public transparent function body to reference
a private member.

In practice, this only failed if the private member had a
non-constant offset, which only occurs with subclasses of @objc
classes, and resilient classes.

For @objc classes we already had a workaround where no accessors
for stored properties are ever transparent. I put this in to fix
this very issue with lazy properties, but now I realize it was
the wrong workaround, because we still had this problem with
resilient classes.

Note that I'm keeping the logic which made @objc accessors
non-transparent in place, because there's a good chance we will
decide that field offset globals should always be private.

Also, to make this issue reproducible in the test, I changed the
resilience execution tests to build the resilient library as a
dylib and link against that instead of just linking .o files
together. This is because .o files can see each other's internal
symbols, so I was not able to reproduce the original failure
this way. I went ahead and updated the other resilient tests to
do this as well. Also, each test now builds in WMO and non-WMO
mode, to exercise different SIL linking behavior. Again, the
WMO variant was needed to reproduce the issue fixed by this
commit, because without WMO we currently discard serialized SIL,
so no cross-module inlining of the lazy property setter was
taking place.
2017-08-29 01:22:11 -07:00
Dmitri Gribenko
486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Dmitri Gribenko
55864d10cb Tests: use 'mkdir -p' 2016-09-02 21:36:45 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Slava Pestov
49c54870c1 Serialization: Auto-linking recursively walks modules imported from -sil-serialize-all modules 2016-04-01 12:21:36 -07:00
Dmitri Gribenko
196188b9c8 stdlib: add 'to:' label to dump() 2016-02-22 18:16:38 -08:00
Dmitri Gribenko
5c9214329d Annotate tests as executable 2016-02-04 09:42:26 -08:00
Erik Eckstein
adef0368bb tests: add import statements to workaround linker errors in all relevant tests.
This is needed if we compile StdlibUnittest with -sil-serialize-all
So far I added the imports only in files which needed them. But this may change, depending on the optimizer (inlining).
Adding them in all files doesn't harm and avoids confusion if someone makes an unrelated change which would result in such a linker error.
2016-01-21 09:59:50 -08:00
Slava Pestov
32bd7705bf IRGen: Test emission of conformances for concrete subclasses of generic classes
This was fixed by Luke Howard as part of some other changes in the
following patch:

<b5880f386b>

After rebasing my fix, I noticed most of it disappeared.
However, it's still worth checking in the tests.

Fixes <rdar://problem/24183374>.
2016-01-15 21:34:53 -08:00
Slava Pestov
304f4f051f IRGen: Fix for fixed-layout enum with resilient payload
If an enum is fixed-layout in our resilience domain but not
universally fixed-layout, other resilience domains will use
runtime functions to project and inject payloads.

These expect to find the payload size in the metadata, so
emit it if the enum is not universally fixed-layout.

Note that we do know the payload size, so it is constant
for us; there's no runtime call required to initialize
the metadata.
2015-12-19 00:47:47 -08:00
Slava Pestov
5fc23a7b7d IRGen: Use metadata templates for non-generic types with fields of resilient type
Let's say that A and B defined in modules X and Y respectively.
This patch adds support for these two cases:

1) Fixed-layout struct A contains resilient struct B
2) Resilient struct A contains resilient struct B

In both cases:

a) Metadata access requires an accessor call
b) Fields of A do not have constant offsets, instead the offsets
   must be loaded from type metadata

A future patch will switch over to initializing the template in-place,
instead of heap-allocating a copy.
2015-11-16 11:11:08 -08:00
Slava Pestov
a05f6c80f6 IRGen: Use metadata accessors for types with resilient layout
If a struct has fixed layout but contains fields which are opaque,
or if the struct itself is opaque, use a metadata accessor function
instead of loading the metadata directly.

Let's say that A and B are two structs defined in the same module,
and B has a fixed size. This patch adds support for these two cases:

1) Fixed-layout struct A contains resilient struct B
2) Resilient struct A contains resilient struct B

In case 1),

a) Inside X: A is fixed-size and has constant metadata
 i) Direct metadata access can be performed on A and B
 ii) Direct field access can be performed on A and B
d) Outside X: B has an opaque layout
 i) Metadata accessor must be called for A and B
 ii) Fields of A do not have constant offsets, instead the offsets
     must be loaded from type metadata

Case 2) is the same as above except ii) does not apply, since fields
of resilient structs are manipulated via accessors.

Eventually, we will use metadata accessor functions for all public
struct and enum types.
2015-11-16 10:37:14 -08:00