Commit Graph

63 Commits

Author SHA1 Message Date
Karoy Lorentey
b82ce9c3be [stdlib] Adopt _pointerBitWidth conditional 2023-04-27 13:33:24 -07:00
Alsey Coleman Miller
62b7be4e9c [stdlib] Add RISCV64 support 2022-11-01 23:59:42 -07:00
Andrew Trick
9db9c1438e Remove a FIXME from validation-test/stdlib/FixedPoint.swift.gyb
Leave this test in long_test because it takes so long to compile. This
issue has nothing to do with the FIXME comment.
2022-06-07 18:02:26 -07:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Alejandro Alonso
90aa299bc2 Reenable some stdlib long_test 2021-12-14 12:29:33 -08:00
Alejandro Alonso
7db88b2257 Disable some failing tests (#40338)
change to requires
2021-11-30 19:03:44 -08:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
Andrew Trick
eb15f3376c Temporarily move FixedPoint.swift.gyb into long_test
[SR-14363] FixedPoint.swift.gyb slowed down with -Onone copy propagation
2021-03-16 09:13:13 -07:00
Saleem Abdulrasool
8d5c010980 validation: explicitly use integral division
Division behaviour changed between Python 2 and Python 3.  Explicitly
indicate that we wish to use integral division here.
2020-07-13 23:46:00 +00:00
Slava Pestov
94b1a28011 Fix remaining tests that pass -swift-version 3
Fixes <rdar://problem/45749460>.
2018-11-08 15:48:26 -05:00
Karoy Lorentey
b2ef455b3a [test] Update tests for _rawHashValue(seed:) changes 2018-09-24 13:31:19 +01:00
Karoy Lorentey
bf872ec157 [stdlib][SE-0206] Use distinct hash encodings for standard integer types
Fix Hashable conformance of standard integer types so that the number of bits they feed into hasher is exactly Self.bitWidth.

This was intended to be part of SE-0206. However, it would have introduced additional issues with AnyHashable. The custom AnyHashable representations introduced in the previous commit unify hashing for numeric types, eliminating the problem.
2018-06-25 20:14:17 +01: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
Karoy Lorentey
97ec2967e0 [SE-0206][stdlib] Hasher, SipHash: Make non-public declarations internal
Newly internal declarations include Hasher._seed and the integer overloads of Hasher._combine(_:), as well as _SipHash13 and _SipHash24.

Unify the interfaces of these SipHash testing structs with Hasher. Update SipHash test to cover Hasher, too.

Add @usableFromInline to all newly internal stuff. In addition to its normal use, it also enables white box testing; compile tests that need to use these declarations with -disable-access-control.
2018-04-24 17:42:42 +01:00
Karoy Lorentey
45cb8b7123 [SE-0206][stdlib] De-underscore Hasher 2018-04-24 17:42:42 +01:00
Karoy Lorentey
dffbbd1cda [test] FixedPoint: Fix 32-bit regression 2018-04-18 20:19:59 +01:00
Karoy Lorentey
7e66a38af8 [stdlib] De-gyb SipHash; implement full Hasher API 2018-04-18 17:33:24 +01:00
Karoy Lorentey
ccdc218cbd [stdlib] _Hasher: append => combine 2018-04-18 14:18:44 +01:00
Karoy Lorentey
e5eed66b67 [test] Add tests verifying hash randomization. Update tests for new names. 2018-03-13 16:29:43 +00:00
Karoy Lorentey
8cf5bc8bdc [stdlib] Switch to using SipHash-1-3 as the standard hash function
Beyond switching hashing algorithms, this also enables per-execution hash seeds, fulfilling a long-standing prophecy in Hashable’s documentation.

To reduce the possibility of random test failures, StdlibUnittest’s TestSuite overrides the random hash seed on initialization.

rdar://problem/24109692
rdar://problem/35052153
2018-03-09 14:48:59 +00:00
Karoy Lorentey
54b857ed0b [stdlib] Hashable: Add support for resilient hashing
Introduce _Hasher, representing an opaque hash compression function.

Add the method _hash(into:) as a Hashable requirement, decoupling the choice of hash function from Hashable's implementation. The default implementation of _hash(into:) has a default implementation that simply feeds hashValue to the hasher.

Add _hash(into:) implementations for the default integer types. Note that Int.hashValue does not return self anymore.

Add struct _LegacyHasher, emulating Swift 4.1 hashes in the new interface.
2018-03-09 14:34:57 +00:00
Max Moiseev
5da3e1dab3 [test] Fix validation tests 2017-07-26 16:49:14 -07:00
Max Moiseev
6f6c2aee8c Fixing the rest of the tests 2017-03-22 16:06:10 -07:00
Max Moiseev
8ffbc81239 Fixing some validation tests 2017-03-10 17:09:28 -08:00
Max Moiseev
08cf1de65a [WIP] fixing some of the integer related test failures 2016-10-05 15:25:23 -07:00
Dmitri Gribenko
ee773c787a stdlib: add tests for Stride types on integers 2016-08-03 18:57:39 -07:00
Dmitri Gribenko
b868fb1a50 stdlib tests: adapt to removal of Bool.boolValue 2016-07-18 02:41:20 -07:00
Chris Lattner
0917c01922 update validation tests for Boolean removal. 2016-07-17 22:49:20 -07:00
rintaro ishizaki
4b51d85abb [test] Add %target-run-simple-swiftgyb
* Utilize %target-run-simple-swiftgyb where possible
2016-06-15 11:49:44 +09:00
Rintaro Ishizaki
1bdce7ced6 [lit] Add substitutions: %utils and %line-directive
%utils => ${SWIFT_SOURCE_DIR}/utils
%line-directive => ${SWIFT_SOURCE_DIR}/utils/line-directive
2016-06-11 02:41:15 +09:00
Gary Liu
9b881cd8ac Fix String.init test in FixedPoint.swift.gyb for big-endian systems. 2016-05-24 20:04:04 -04:00
Bryan Chan
85fde8b1fb Add support for Linux s390x. LLVM's Swift calling convention support is used to ensure correct operations of C++ code in the runtime. This patch also includes some (incomplete) changes to enum handling to make enums work in most common cases. 2016-05-24 20:03:28 -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
Max Moiseev
859db53d87 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-01 12:56:26 -08:00
practicalswift
f6d6585ee0 [Python] Improve Python consistency: Use function_name(…) throughout (PEP8) 2016-02-29 22:49:19 +01:00
Dmitri Gribenko
0f36bec31f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-18 16:41:35 -08:00
Brian Gesiak
42215042ae [validation-test] More granular FixedPoint tests
`FixedPoint.swift.gyb` generates a massive amount of assertions:
one for each `Int` type (such as `UInt8` and `Int64`) as a source,
to one of each `Int` type as a destination, for each of 27 bit
patterns. By my math that's 8 * 8 * 27 == 1728 assertions.
As a result, when one of those assertions fails, it's difficult to
tell what went wrong.

Split each assertion into its own test case. This makes the test
take a little longer to run, but it produces much more valuable
output when it fails.
2016-02-16 12:03:49 -05:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Anton Blanchard
b1827d8a8f Add powerpc64le Linux support
This patch adds powerpc64le Linux support. While the patch also adds
the matching powerpc64 bits, there are endian issues that need to be
sorted out.

The PowerPC LLVM changes for the swift ABI (eg returning three element
non-homogeneous aggregates) are still in the works, but a simple LLVM
fix to allow those aggregates results in swift passing all but 8
test cases.
2016-01-15 06:48:31 +00:00
practicalswift
21c3d93bea Remove unused imports. 2016-01-09 01:39:22 +01:00
Max Moiseev
2021dd5a4d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-15 12:49:22 -08:00
Erik Eckstein
0830c36974 [tests] add import statements to prevent unresolved symbols when compiling StdlibUnittest with -sil-serialize-all.
This is the second part of 308f39fe56.
It fixes (better: works-around) linker errors when testing in optimized mode.
2015-12-15 10:46:10 -08:00
Max Moiseev
806be29941 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-14 12:05:35 -08:00
Arsen Gasparyan
52890e5c30 Replace if true {} with do {} 2015-12-13 10:54:54 +03:00
Maxim Moiseev
1b6244f3ee integer types renamed 2015-12-10 17:03:40 -08:00
Maxim Moiseev
2c95bb6d51 BooleanType => Boolean 2015-12-10 14:56:32 -08:00
Arnold Schwaighofer
4d4329b0e0 Add executable_test to the validation test suite
Swift SVN r29278
2015-06-03 23:28:43 +00:00
Dave Abrahams
ac3f047496 [stdlib] Renaming fallout from Mirror API review
toString(x)      => String(x)
toDebugString(x) => String(reflecting: x)
Printable        => CustomStringConvertible
DebugPrintable   => CustomDebugStringConvertible

Also updated comments to clarify these protocols

Swift SVN r27090
2015-04-07 20:32:26 +00:00
Graham Batty
0a73f54e98 Implement a glibc module for StdlibUnittest on linux
Swift SVN r25807
2015-03-06 22:05:13 +00:00
Graham Batty
7346a9733d Update test and validation-test flags for linux.
Swift SVN r25506
2015-02-24 18:55:42 +00:00