Commit Graph

36 Commits

Author SHA1 Message Date
Anthony Latsis
55e5618eab [test] Match nocapture to succeed both on main and rebranch
Both the syntax and relative order of the LLVM `nocapture` parameter
attribute changed upstream in 29441e4f5fa5f5c7709f7cf180815ba97f611297.
To reduce conflicts with rebranch, adjust FileCheck patterns to expect
both syntaxes and orders anywhere the presence of the attribute is not
critical to the test. These changes are temporary and will be cleaned
up once rebranch is merged into main.
2025-05-08 23:52:43 +01:00
Arnold Schwaighofer
3b5ebaa46c Fix some tests in IRGen folder 2023-06-21 10:10:32 -07:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -07:00
Slava Pestov
6095fd332e SILGen: Use getABIMembers() instead of getMembers() in a couple of spots 2021-04-21 00:07:28 -04: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
Karoy Lorentey
b2ef455b3a [test] Update tests for _rawHashValue(seed:) changes 2018-09-24 13:31:19 +01: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
3a162d225a [stdlib] Hashable, Hasher: Add non-public top-level hashing interface
The new _rawHashValue(seed:) requirement allows stdlib types to specialize their hashing when they’re hashed on their own (i.e., not as a component of some composite type).

This makes it possible to get rid of discriminator/terminator values and to eliminate most of Hasher’s resiliency overhead, leading to a measurable speedup, especially for tiny keys.
2018-04-30 15:16:47 +01:00
Karoy Lorentey
fa264204e2 [SE-0206][Sema] Add separate hash(into:) impl for enums with no associated values
For enums with no associated values, it is better to move the hasher.combine call out of the switch statement, like this:

func hash(into hasher: inout Hasher) {
  let discriminator: Int
  switch self {
    case a: discriminator = 0
    case b: discriminator = 1
    case c: discriminator = 2
  }
  hasher.combine(discriminator)
}

This enables the optimizer to replace the switch statement with a simple integer promotion, restoring earlier behavior.
2018-04-24 17:43:22 +01:00
Saleem Abdulrasool
d746a6d1db tests: annotate dllstorage on IRGen tests
This adds the dllstorage annotations on the tests.  This first pass gets
most of the IRGen tests passing on Windows (though has dependencies on
other changes).  However, this allows for the changes to be merged more
easily as we cannot regress other platforms here.
2018-04-23 20:21:10 -07:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Pavel Yaskevich
0133827e55 [Mangling/ABI] NFC: Fix IRGen tests to reflect label mangling changes 2017-12-18 15:45:50 -08:00
Alex Hoppen
1c7e289b96 [Mangling] Adjust subscript mangling to not include "subscript"
Change the mangling of accessors to have a variable or subscript node
as their only child node, while subscript nodes no longer contain a decl
name.
2017-09-10 19:44:07 +02:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Arnold Schwaighofer
154896f77c IRGen: Speculatively try to fix test case in resilient build
rdar://31757974
2017-04-21 08:33:27 -07:00
Graydon Hoare
e6027eeb4e Derive @_implements(Equatable, ==(_:_:)) _DerivedEnumEquals, not func==. 2017-04-18 23:21:44 -07:00
Erik Eckstein
c4a11f4c92 tests: remove the now unused option -new-mangling-for-tests 2017-03-22 11:28:43 -07: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
Joe Shajrawi
ee5ed7bdc6 [IRGen] Code Size Reduction: Outline Copy/Consume (Loadable) Enum 2016-12-22 17:08:15 -08:00
Robert Widmann
fe00dc74ea Get rid of _stdlib_didEnterMain
Process arguments are now fetched per-platform
2016-12-12 23:47:48 -05: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
Joe Groff
74fd15f7af IRGen: Don't represent enums with weird-sized LLVM integer types.
In practice, this interferes with FastISel and has exposed lots of latent LLVM backend bugs. Using "normal" power-of-two-bytes sized integers is easier to work with and improves code gen performance for nonoptimizing clients like Swift Playgrounds.
2016-09-28 09:18:14 -07:00
Michael Gottesman
b48b4d96fe Merge remote-tracking branch 'origin/master' into master-next 2016-09-07 15:35:07 -07:00
Dmitri Gribenko
55864d10cb Tests: use 'mkdir -p' 2016-09-02 21:36:45 -07:00
Michael Gottesman
fa1bb95923 Merge remote-tracking branch 'origin/master' into master-next 2016-08-30 19:50:12 -07:00
Doug Gregor
e1545a7d5a [Type checker/runtime] Move default implementation of Error._code into the runtime.
Rather than having Sema provide a default implementation of
Error._code when needed, introduce a runtime function to extract the
default code, so that we can provide a default implementation via a
protocol extension in the standard library.
2016-08-25 16:00:19 -07:00
SpringsUp
f9af1257ef Tighter type-checking of enums with synthesized RawRepresentable
conformance
Fixes SR-2134
2016-08-22 22:49:48 +02:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Doug Gregor
c56f96d237 [Type checker] Synthesize member operator '==' for Equatable enums.
Rather than synthesizing a global operator '==' for Equatable enums,
synthesize a member operator, which is more idiomatic and much
cleaner.

To make sure that these synthesized operators can actually be found,
start considering operator requirements in protocols
more generally in the type checker, so that, e.g., "myEnum == myEnum"
will type-check against Equatable.== and, on successful type-check,
will call the (newly-synthesized) witness for '=='. This both makes it
easier to make sure we find the operators in, e.g., complex multi-file
and lazy-type checking scenarios, and is a step toward the
type-checking improvements described in SE-0091.
2016-07-21 12:54:27 -07:00
Doug Gregor
80f0852504 [SE-0091] Allow 'static' operators to be declared within types and extensions thereof.
Allow 'static' (or, in classes, final 'class') operators to be
declared within types and extensions thereof. Within protocols,
require operators to be marked 'static'. Use a warning with a Fix-It
to stage this in, so we don't break the world's code.

Protocol conformance checking already seems to work, so add some tests
for that. Update a pile of tests and the standard library to include
the required 'static' keywords.

There is an amusing name-mangling change here. Global operators were
getting marked as 'static' (for silly reasons), so their mangled names
had the 'Z' modifier for static methods, even though this doesn't make
sense. Now, operators within types and extensions need to be 'static'
as written.
2016-07-18 23:18:57 -07:00
Mark Lacey
1c00ac4c6d Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	lib/IRGen/IRGen.cpp
	test/DebugInfo/parent-scope.swift
2016-07-15 19:23:53 -07:00
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00
Saleem Abdulrasool
5eb801dea5 tests: fixes for SIL reordering, update for unnamed_local_addr 2016-06-27 21:47:12 -07:00
Slava Pestov
571d703182 Move enum_derived.swift from test/SILGen to test/IRGen since its testing IRGen 2016-03-21 18:04:25 -07:00