Commit Graph

38 Commits

Author SHA1 Message Date
Erik Eckstein
c11408ea2f IRGen: Don't let the offset of an empty field be undef.
If the field address comes from a struct_element_addr which is a result of an optimized `MemoryLayout<S>.offset(of: \.field)` we cannot return undef.
We have to be consistent with `offset(of:)`, which returns 0.
Therefore we need to return the base address of the struct.

rdar://117265274
2024-03-11 15:21:03 +01:00
Arnold Schwaighofer
c012196e0f Fix some tests for armv7k 2023-06-23 08:41:17 -07:00
Meghana Gupta
6253cd8c38 Update some more IRGen tests to opaque pointer 2023-06-23 06:57:38 -07:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -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
John McCall
2ba7090fe8 Remove the extra-inhabitant value witness functions.
This is essentially a long-belated follow-up to Arnold's #12606.
The key observation here is that the enum-tag-single-payload witnesses
are strictly more powerful than the XI witnesses: you can simulate
the XI witnesses by using an extra case count that's <= the XI count.
Of course the result is less efficient than the XI witnesses, but
that's less important than overall code size, and we can work on
fast-paths for that.

The extra inhabitant count is stored in a 32-bit field (always present)
following the ValueWitnessFlags, which now occupy a fixed 32 bits.
This inflates non-XI VWTs on 32-bit targets by a word, but the net effect
on XI VWTs is to shrink them by two words, which is likely to be the
more important change.  Also, being able to access the XI count directly
should be a nice win.
2018-12-11 22:18:44 -05: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
Karoy Lorentey
90e894729a [StringGuts] Linux support
Add support for compiling StringGuts without the Objective-C runtime.
2018-01-21 12:37:36 -08:00
Michael Ilseman
3be2faf5d3 [String] Initial implementation of 64-bit StringGuts.
Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
2018-01-21 12:32:26 -08:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Slava Pestov
a24f8a576b IRGen: value witness tables and lazy metadata cache variables never need to be public
This simplifies TBDGen too, even though it's still TBD.
2017-03-30 17:58:45 -07:00
Erik Eckstein
c4a11f4c92 tests: remove the now unused option -new-mangling-for-tests 2017-03-22 11:28:43 -07:00
Erik Eckstein
481c646963 tests: fix test for new mangling for 32-bit targets 2017-02-23 08:19:57 -08:00
Erik Eckstein
8e3b05d2f4 IRGen: Use new mangling for llvm type names.
This should have no effect on the generated binary.
2017-02-22 09:19:10 -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
John McCall
ce1a99a039 Updating 32-bit portion of test. 2016-04-29 18:50:20 -07:00
John McCall
857489c2f6 When a generic type has dependent IR and thus requires each
specialization to be separately lowered in IRGen, use the mangling
of the specialized type as the name of the llvm::StructType instead
of the base, unspecialized type.

This tends to produce fewer collisions between IR type names.
LLVM does unique the names on its own, so that's not strictly
necessary, but it's still a good idea because it makes the test
output more reliable and somewhat easier to read (modulo the
impact of bigger type names).  Collisions will still occur if
the type is specialized at an archetype, since in this case we
will fall back on the unspecialized type.
2016-04-29 16:39:16 -07:00
Slava Pestov
b49a4525c3 SIL: Only give type metadata public linkage if -sil-serialize-all is on
Otherwise, any types referenced from transparent functions must be
public or @_versioned.
2016-03-28 14:14:50 -07:00
Joe Groff
8cb1175e49 IRGen: Emit public definitions with protected visibility on ELF.
This prevents the linker from trying to emit relative relocations to locally-defined public symbols into dynamic libraries, which gives ld.so heartache.
2016-02-08 13:09:27 -08: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
Arnold Schwaighofer
538790a17e Fix IRGen test to use target-swift-frontend instead of target-build-swift
Swift SVN r28687
2015-05-17 23:27:39 +00:00
Arnold Schwaighofer
3b3f895a94 This test case only works in unoptimized mode
Swift SVN r28681
2015-05-17 16:55:48 +00:00
Greg Parker
015e28f4b3 [test] Add PTRSIZE= test feature and %target-ptrsize test substitution.
These are for tests that care about pointer size 
but are otherwise platform-agnostic.


Swift SVN r14678
2014-03-05 07:15:15 +00:00
Greg Parker
8e1bc98cb6 [test] Correct expected 32-bit output of IRGen/struct_layout.sil.
Previously the 32-bit tests were looking for the incorrect output that was 
fixed by r14330.


Swift SVN r14384
2014-02-26 07:24:04 +00:00
Greg Parker
b276e3b369 [test] Make IRGen/struct_layout.sil's tests consistent across architectures.
This removes an armv7 check added for rdar://15410780; that check had grown 
stale due to stdlib changes. 


Swift SVN r14185
2014-02-20 23:54:44 +00:00
Greg Parker
d1157c9635 [test] Add i386 checks to test IRGen/struct_layout.sil.
Swift SVN r14034
2014-02-18 09:08:47 +00:00
Jordan Rose
0b2541b58f Rename the standard library to "Swift" (instead of "swift")
This is more in line with all other modules currently on our system.
If/when we get our final name for the language, we're at least now set
up to rename the library without /too/ much trouble. (This is mostly just
a lot of searching for "import swift", "swift.", "'swift'", and '"swift"'.
The compiler itself is pretty much just using STDLIB_NAME consistently now,
per r13758.)

<rdar://problem/15972383>

Swift SVN r14001
2014-02-17 19:30:47 +00:00
Greg Parker
6b0f90b84a [test] Fix tests for arm64.
Swift SVN r13773
2014-02-11 02:33:06 +00:00
Greg Parker
7361d116c0 [test] Add %target-cpu and %target-os substitutions. Adopt them in a few tests.
Swift SVN r13465
2014-02-05 01:05:17 +00:00
Greg Parker
fe80d335d9 [test] Temporarily disable some tests for which REQUIRES: ARM is insufficient.
Swift SVN r13447
2014-02-04 21:46:54 +00:00
Jordan Rose
934121914c Use -emit-ir instead of -emit-llvm, for better parity with -emit-bc.
-emit-llvm in Clang is a modifier on the -S and -c actions. In Swift,
it's a separate action equivalent to "-S -emit-llvm". Be less ambiguous.

Part of the migration to the new driver.

Swift SVN r13029
2014-01-28 01:42:44 +00:00
Jordan Rose
0c92cc0fe4 Use '-target' instead of '-triple', for consistency with Clang and GCC.
Part of the migration to the new driver.

Swift SVN r13028
2014-01-28 01:42:41 +00:00
Adrian Prantl
599d311cf5 Move REQUIRES closer to RUN.
Swift SVN r10368
2013-11-12 05:47:51 +00:00
Adrian Prantl
f06b3549ea [lit] add targets as features and add REQURES: ARM lines to a couple of tests
Swift SVN r10367
2013-11-12 05:41:17 +00:00
Joe Groff
2950f48021 IRGen: Test other test case from <rdar://problem/15410780>.
Swift SVN r10022
2013-11-07 04:31:41 +00:00
Joe Groff
7b610ae55b IRGen: Don't round payload size up to alignment for single-payload enums.
We pack the tag for a single-payload enum into the padding space. Fixes one of the test cases in <rdar://problem/15410780>.

Swift SVN r10021
2013-11-07 04:25:13 +00:00