* Don't use Targets* helper properties in libs projs
This change makes it possible to migrate 200+ (ref+src) projects to use
TargetFramework instead of TargetFrameworks which avoids the additional
outer build evaluation and invocation which ultimately makes the overall
build faster.
Targets* properties (i.e. TargetsWindows, TargetsAnyOS, TargetsUnix,
etc.) rely on the TargetFramework property which usually are set
inside a project. The TargetFramework property is only
available before a project specifies it if it's explicitly set in a props
file or if the project is cross-targeting and the outer-build dispatches
into the inner-build. During the dispatch, the TargetFramework property
is passed in as a global property.
Until now that behavior wasn't a problem because every libraries project
cross-targeted (by setting the TargetFrameworks property) even though
many only include a single TargetFramework (i.e. NetCoreAppCurrent).
To allow projects to use the TargetFramework property instead of
TargetFrameworks, the Targets* helper properties can't be calculated
anymore early in a props file as the TargetFramework property isn't set
at that time.
In general, the guidance by the SDK/msbuild team is to not read from the
TargetFramework property before the project sets it
(in a property group). That effectively means that the TargetFramework
property shouldn't be used in props files at all.
Therefore these helper properties can't be used anymore for property
conditions and I'm replacing their usage with TargetPlatformIdentifier
comparisons for both properties and items.
In nearly all cases, the Targets* helper properties can be replaced with
TargetPlatformIdentifier checks on items and in the few cases where
TargetsUnix or TargetsLinux marks multiple tfms as compatible, the exact
tfms must be used instead for the TargetPlatformIdentifier comparison.
Whenever a project needs to condition properties on the platform, I'm
first setting the TargetPlatformIdentifier the same way the SDK sets it
so that the SDK later doesn't need to set it again to avoid the
additional expensive msbuild function call.
* Use TargetFramework singular to avoid outer builds
Use TargetFramework instead of TargetFrameworks property whenever a
projects only targets a single target framework. This avoid unnecessary
outer builds and evaluations and makes the build faster.
* Bump version of C# compiler
This should be reverted when arcade brings in a new enough compiler.
* Fix a few new warnings from updating compiler
* Enable IDE0190 to employ parameter null checking
* Initial roll out of !!
* Fix more compiler warnings from upgrade, plus some test fixes / reverts
* Fix a few more tests
* Disable profiling test
* Consume renamed TargetFramework package
* Rename CoreLibs generator parent dir
Projects under src/libraries/ which are located under a "gen" directory
are automatically treated as source generator projects. Because the
CoreLib generator was placed under a different directory "generators",
it was treated as a RuntimeAssembly which gets binplaced into the
runtime path. The runtime tests then take the assemblies from there and
copy them into their CORE_ROOT directory.
Renaming the CoreLib source generators parent directory fixes that so
that it is treated as source generator and it brings consistency into
src/libraries.
* Improve "lastChar == firstChar" case, also, use IndexOf directly if value.Length == 1
* Try plain IndexOf first, to optimize cases where even first char of value is never met
* add 1-byte implementation
* copyrights
* fix copy-paste mistake
* Initial LastIndexOf impl
* More efficient LastIndexOf
* fix bug in Char version (we need two clear two lowest bits in the mask) & temporarily remove AdvSimd impl
* use ResetLowestSetBit
* Fix bug
* Add two-byte LastIndexOf
* Fix build
* Minor optimizations
* optimize cases with two-byte/two-char values
* Remove gotos, fix build
* fix bug in LastIndexOf
* Make sure String.LastIndexOf is optimized
* Use xplat simd helpers - implicit ARM support
* fix arm
* Delete \
* Use Vector128.IsHardwareAccelerated
* Fix build
* Use IsAllZero
* Address feedback
* Address feedback
* micro-optimization, do-while is better here since mask is guaranteed to be non-zero
* Address feedabc
* Use clever trick I borrowed from IndexOfAny for trailing elements
* give up on +1 bump for SequenceCompare
* Clean up
* Clean up
* fix build
* Add debug asserts
* Clean up: give up on the unrolled trick - too little value from code bloat
* Add a test
* Fix build
* Add byte-specific test
* Fix build
* Update IndexOfSequence.byte.cs
* Update to Xunit build 2.4.2-pre.13
Also pick up latest pre-release of analyzers
* Disambiguate calls to Assert.Equals(double,double,int)
Xunit added a new Assert overload that caused a lot of ambiguous calls.
https://github.com/xunit/xunit/issues/2393
Workaround by casting to double.
* Fix new instances of xUnit2000 diagnostic
* Workaround xUnit2002 issue with implicit cast
Works around https://github.com/xunit/xunit/issues/2395
* Disable xUnit2014 diagnostic
This diagnostic forces the use of Assert.ThrowsAsync for any async method,
however in our case we may want to test that a method will throw
synchronously to avoid regressing that behavior by moving to the async
portion of the method.
* Use AssertExtensions to test for null ArgumentException.ParamName
Workaround https://github.com/xunit/xunit/issues/2396
* Update to Xunit 2.4.2-pre.22
* Fix another ArugmentException.ParamName == null assert
Update slngen tooling to latest stable version and solution files since
a lot changed since the last time they were updated:
- NET7 (removal of older TFMs)
- Source Generators
* lateapexearlyspeed-issue-30778 Create method: TryReadExact().
* issue-30778 Add test for SequenceReader.TryReadExact().
* issue-30778 Fix comment: format return xml doc.
Co-authored-by: Jeff Handley <[email protected]>
Co-authored-by: Jeff Handley <[email protected]>
With the newest udpate of slngen, the order of elements (configuration, folders, etc.) is in sync with how Visual Studio arranges them.
Also the order is now deterministic.
Based on that, updating all solution files to have the correct ordering of elements. This change also unblocks adding CI protection for
making sure that solution files are up-to-date in regards to their dependencies as slngen is now generating the files deterministically.
* Add/return tests.
* improve the test naming.
* Add a new JitEE method.
with a naive implementation so far.
* Handle generically dissimilar type concerns as well as handle derived type case in the managed compiler
* Fix the field and Unsafe issues.
* fix some failures.
It appeared that we have many trees where we generate unique VN for rhs and don't inform `fgValueNumberBlockAssignment` about it.
For example, for
```
N005 ( 10, 8) [000033] -A--G---R--- * ASG struct (copy)
N004 ( 3, 2) [000031] D------N---- +--* LCL_VAR struct<eightByteStruct, 8> V01 loc1 d:2
N003 ( 6, 5) [000030] n---G------- \--* IND struct
N002 ( 3, 3) [000043] ------------ \--* ADDR byref
N001 ( 3, 2) [000044] -------N---- \--* LCL_VAR struct<largeStruct, 32> V00 loc0 u:6 (last use)
```
we will generate unique rhs but then `fgValueNumberBlockAssignment` will still try to work it as with a non-unique one.
* Fix an oooold bug in VN.
For a tree like:
```
N005 ( 11, 10) [001400] -A------R---- * ASG long
N004 ( 6, 5) [001401] *------N----- +--* IND long
N003 ( 3, 3) [001402] ------------- | \--* ADDR byref Zero Fseq[_00]
N002 ( 3, 2) [001403] U------N----- | \--* LCL_VAR struct<System.Runtime.Intrinsics.Vector128`1[Byte], 16> V45 tmp38 ud:3->4
N001 ( 1, 1) [001404] ------------- \--* LCL_VAR long V69 tmp62 u:2 (last use)
```
SSA was working correctly and printing that `001403` is using SSA-3 and defining SSA-4. However, this code, for some reason, was writing result as a define for SSA-3.
* Add new test cases and a fix for them.
* correct a test copy paste
* response review.
Co-authored-by: David Wrighton <[email protected]>
* Used VectorXYZ.Create for constants in Base64
* Used VectorXYZ.Create for constants in BitArray
* Remove conditional compilation
It's only built for NetCoreAppCurrent, so no need to special case older runtimes.
In effort to assess the state of the iOS library tests, a number of tests will be skipped
Test suites that crash, hang, or have a significant number of failures (mostly 20+ failing unique test methods) are skipped on at the `tests.proj` level. Otherwise, `[ActiveIssue]` attributes have been attached to either the individual test methods that fail or the entire class if the whole test class fails. Any pre-existing `ActiveIssue` attribute associated with iOS had been reassessed to either remain or be closed.
A few test suites have been skipped because they fail with some form of `PlatformNotSupportedException`. `[SkipOnPlatform]` attributes are attached to the failing test methods.
All of the Issues can be tracked at https://github.com/dotnet/runtime/projects/48#column-9236436
The ActiveIssues and `tests.proj` exclusions have been tested on https://github.com/dotnet/runtime/pull/49917 as well.
-----------
This PR makes the following changes in the following files:
`src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj` - Removed `$(NetCoreAppCurrent)-iOS` from target frameworks as it is stated to currently only supported on Windows.
`src/libraries/tests.proj` - Update the test suites that need to be skipped at the project level, reducing the number and categorizing as a skip due to PNSE, a skip due to numerous failures, and a skip due to the suite crashing.
The remaining files changed are either:
`[ActiveIssue("<issue-url>", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]`
`[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS or tvOS.")]`
Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Tammy Qiu <[email protected]>
* Add Array.GetMaxLength<T> implementation.
* Implement Array.MaxLength and fix all remaining references
* Apply suggestions from code review
Co-authored-by: Jan Kotas <[email protected]>
* Apply suggestions from code review
Co-authored-by: Jan Kotas <[email protected]>
* Update src/libraries/System.Collections/tests/Generic/Stack/Stack.Generic.Tests.cs
Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: Stephen Toub <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
Mostly just replacing string.Format calls with equivalent interpolated string uses. In some cases, I replaced lots of string creations with a StringBuilder or equivalent.
* Add new MemoryExtensions.SequenceEqual overloads
* Use MemoryExtensions.SequenceEqual in Enumerable.SequenceEqual
* Use MemoryExtensions.SequenceEqual in a few more places
* Use [NotNullWhen(true)] in more places
Did a quick search/audit for methods that returned bool and took nullable object as the first input, and added [NotNullWhen(true)] where it was obviously correct.
* Address PR feedback