mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Make ValueGenerics feature always available
This commit is contained in:
@@ -190,7 +190,6 @@ add_compile_options(
|
||||
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature FreestandingMacros>"
|
||||
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature BitwiseCopyable>"
|
||||
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature Extern>"
|
||||
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature ValueGenerics>"
|
||||
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature AddressableParameters>"
|
||||
# TODO: we should reevaluate if it still makes sense to restrict this
|
||||
# to Darwin, https://github.com/swiftlang/swift/issues/79279
|
||||
|
||||
@@ -8259,8 +8259,6 @@ ERROR(value_generic_unexpected,none,
|
||||
"using value generic %0 here is not allowed", (Type))
|
||||
ERROR(missing_value_generic_type,none,
|
||||
"value generic %0 must have an explicit value type declared", (Identifier))
|
||||
ERROR(value_generics_missing_feature,none,
|
||||
"value generics require '-enable-experimental-feature ValueGenerics'", ())
|
||||
ERROR(availability_value_generic_type_only_version_newer, none,
|
||||
"values in generic types are only available in %0 %1 or newer",
|
||||
(StringRef, llvm::VersionTuple))
|
||||
|
||||
@@ -215,6 +215,7 @@ LANGUAGE_FEATURE(ObjCImplementation, 436, "@objc @implementation extensions")
|
||||
LANGUAGE_FEATURE(NonescapableTypes, 446, "Nonescapable types")
|
||||
LANGUAGE_FEATURE(BuiltinEmplaceTypedThrows, 0, "Builtin.emplace typed throws")
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(MemorySafetyAttributes, 458, "@unsafe attribute")
|
||||
LANGUAGE_FEATURE(ValueGenerics, 452, "Value generics feature (integer generics)")
|
||||
|
||||
// Swift 6
|
||||
UPCOMING_FEATURE(ConciseMagicFile, 274, 6)
|
||||
@@ -426,9 +427,6 @@ EXPERIMENTAL_FEATURE(AssumeResilientCxxTypes, true)
|
||||
// Isolated deinit
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(IsolatedDeinit, 371, "isolated deinit")
|
||||
|
||||
// Enable values in generic signatures, e.g. <let N: Int>
|
||||
EXPERIMENTAL_FEATURE(ValueGenerics, true)
|
||||
|
||||
// When a parameter has unspecified isolation, infer it as main actor isolated.
|
||||
EXPERIMENTAL_FEATURE(UnspecifiedMeansMainActorIsolated, false)
|
||||
|
||||
|
||||
@@ -825,10 +825,6 @@ InferredGenericSignatureRequest::evaluate(
|
||||
"Parsed an empty generic parameter list?");
|
||||
|
||||
for (auto *gpDecl : *gpList) {
|
||||
if (gpDecl->isValue() &&
|
||||
!gpDecl->getASTContext().LangOpts.hasFeature(Feature::ValueGenerics))
|
||||
gpDecl->diagnose(diag::value_generics_missing_feature);
|
||||
|
||||
auto *gpType = gpDecl->getDeclaredInterfaceType()
|
||||
->castTo<GenericTypeParamType>();
|
||||
genericParams.push_back(gpType);
|
||||
|
||||
@@ -319,7 +319,6 @@ list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "Macros")
|
||||
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "FreestandingMacros")
|
||||
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "Extern")
|
||||
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "BitwiseCopyable")
|
||||
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "ValueGenerics")
|
||||
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "AddressableParameters")
|
||||
list(APPEND swift_stdlib_compile_flags "-enable-experimental-feature" "AddressableTypes")
|
||||
list(APPEND swift_stdlib_compile_flags "-strict-memory-safety")
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency -enable-experimental-feature ValueGenerics -enable-experimental-feature ParserASTGen \
|
||||
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency -enable-experimental-feature ParserASTGen \
|
||||
// RUN: | %sanitize-address > %t/astgen.ast
|
||||
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency -enable-experimental-feature ValueGenerics \
|
||||
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency \
|
||||
// RUN: | %sanitize-address > %t/cpp-parser.ast
|
||||
|
||||
// RUN: %diff -u %t/astgen.ast %t/cpp-parser.ast
|
||||
|
||||
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-concurrency -enable-experimental-feature ValueGenerics -enable-experimental-feature ParserASTGen)
|
||||
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-concurrency -enable-experimental-feature ParserASTGen)
|
||||
|
||||
// REQUIRES: executable_test
|
||||
// REQUIRES: swift_swift_parser
|
||||
// REQUIRES: swift_feature_ParserASTGen
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// rdar://116686158
|
||||
// UNSUPPORTED: asan
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// RUN: %target-swift-frontend %s -target %target-cpu-apple-macos14 -emit-ir -g -enable-experimental-feature ValueGenerics -enable-experimental-feature Embedded -wmo -disable-availability-checking -o - | %FileCheck %s
|
||||
// RUN: %target-swift-frontend %s -target %target-cpu-apple-macos14 -emit-ir -g -enable-experimental-feature Embedded -wmo -disable-availability-checking -o - | %FileCheck %s
|
||||
|
||||
// REQUIRES: OS=macosx
|
||||
|
||||
// REQUIRES: swift_feature_Embedded
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "InlineArray",{{.*}}size: 64{{.*}}elements: ![[ELTS:[0-9]+]], runtimeLang: DW_LANG_Swift, templateParams: ![[SLAB_PARAMS:[0-9]+]], identifier: "$es11InlineArrayVy$0_4main8MySpriteVGD", specification:
|
||||
// CHECK-DAG: ![[SLAB_PARAMS]] = !{![[COUNT_PARAM:.*]], ![[ELEMENT_PARAM:.*]]}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// RUN: %target-swift-frontend %s -emit-ir -g -enable-builtin-module -enable-experimental-feature ValueGenerics -disable-availability-checking -o - | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-swift-frontend %s -emit-ir -g -enable-builtin-module -disable-availability-checking -o - | %FileCheck %s
|
||||
|
||||
import Builtin
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// RUN: %target-swift-frontend -emit-ir -disable-availability-checking -enable-experimental-feature ValueGenerics %s | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-swift-frontend -emit-ir -disable-availability-checking %s | %FileCheck %s
|
||||
|
||||
struct VerySmallSlab<T> {
|
||||
var inline: InlineArray<16, T?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %target-swift-frontend -emit-irgen -disable-availability-checking -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule %s | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -emit-irgen -disable-availability-checking -enable-experimental-feature BuiltinModule %s | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
import Builtin
|
||||
import Swift
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %{python} %utils/chex.py < %s > %t/existential-bitwise-borrowability.swift
|
||||
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -enable-experimental-feature ValueGenerics -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift %t/existential-bitwise-borrowability.swift | %FileCheck %t/existential-bitwise-borrowability.swift --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
|
||||
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift %t/existential-bitwise-borrowability.swift | %FileCheck %t/existential-bitwise-borrowability.swift --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
|
||||
|
||||
// REQUIRES: swift_feature_RawLayout
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// Copyable existentials are bitwise-borrowable (because copyable types are
|
||||
// always bitwise-borrowable if they're bitwise-takable, and only bitwise-takable
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// %target-swift-frontend %s -Xllvm -sil-print-after=loadable-address -import-objc-header %S/Inputs/large_c.h -c -o %t/t.o 2>&1 | %FileCheck %s
|
||||
|
||||
// RUN: %target-swift-frontend %s -disable-availability-checking -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule -Xllvm -sil-print-types -Xllvm -sil-print-after=loadable-address -c -o %t/t.o 2>&1 | %FileCheck %s
|
||||
// RUN: %target-swift-frontend %s -disable-availability-checking -enable-experimental-feature BuiltinModule -Xllvm -sil-print-types -Xllvm -sil-print-after=loadable-address -c -o %t/t.o 2>&1 | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// wasm currently disables aggressive reg2mem
|
||||
// UNSUPPORTED: wasm
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %{python} %utils/chex.py < %s > %t/raw_layout.sil
|
||||
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -enable-experimental-feature ValueGenerics -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift %t/raw_layout.sil | %FileCheck %t/raw_layout.sil --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
|
||||
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift %t/raw_layout.sil | %FileCheck %t/raw_layout.sil --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
|
||||
|
||||
// REQUIRES: swift_feature_RawLayout
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
import Builtin
|
||||
import Swift
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %{python} %utils/chex.py < %s > %t/Mutex.swift
|
||||
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -enable-experimental-feature ValueGenerics -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift -module-name stdlib %t/Mutex.swift | %FileCheck %t/Mutex.swift --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
|
||||
// RUN: %target-swift-frontend -enable-experimental-feature RawLayout -emit-ir -disable-availability-checking -I %S/Inputs -cxx-interoperability-mode=upcoming-swift -module-name stdlib %t/Mutex.swift | %FileCheck %t/Mutex.swift --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize
|
||||
|
||||
// REQUIRES: synchronization
|
||||
// REQUIRES: swift_feature_RawLayout
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
import Synchronization
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// RUN: %target-run-simple-swift(-enable-experimental-feature ValueGenerics -Xfrontend -disable-availability-checking) | %FileCheck %s
|
||||
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking) | %FileCheck %s
|
||||
|
||||
// UNSUPPORTED: use_os_stdlib
|
||||
// UNSUPPORTED: back_deployment_runtime
|
||||
|
||||
// REQUIRES: executable_test
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
struct A<let N: Int, let M: Int> {}
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name ValueGeneric -enable-experimental-feature ValueGenerics -disable-availability-checking
|
||||
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name ValueGeneric -disable-availability-checking
|
||||
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name ValueGeneric -disable-availability-checking
|
||||
// RUN: %FileCheck %s < %t.swiftinterface
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// CHECK: public struct Slab<Element, let N : Swift.Int>
|
||||
public struct Slab<Element, let N: Int> {
|
||||
// CHECK-LABEL: public var count: Swift.Int {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// RUN: %target-run-simple-swift(-target %module-target-future -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule -Xfrontend -disable-experimental-parser-round-trip) | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -target %module-target-future -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule -disable-experimental-parser-round-trip -emit-module %s -o %t/Vector.swiftmodule
|
||||
// RUN: %target-run-simple-swift(-target %module-target-future -enable-experimental-feature BuiltinModule -Xfrontend -disable-experimental-parser-round-trip) | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -target %module-target-future -enable-experimental-feature BuiltinModule -disable-experimental-parser-round-trip -emit-module %s -o %t/Vector.swiftmodule
|
||||
|
||||
// REQUIRES: executable_test
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// UNSUPPORTED: use_os_stdlib
|
||||
// UNSUPPORTED: back_deployment_runtime
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -enable-experimental-feature ValueGenerics)
|
||||
// RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking)
|
||||
// REQUIRES: executable_test
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// UNSUPPORTED: CPU=arm64e
|
||||
// UNSUPPORTED: use_os_stdlib
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// RUN: %target-sil-opt -sil-print-types %s -enable-experimental-feature ValueGenerics | %target-sil-opt -sil-print-types -enable-experimental-feature ValueGenerics | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-sil-opt -sil-print-types %s | %target-sil-opt -sil-print-types | %FileCheck %s
|
||||
|
||||
import Builtin
|
||||
import Swift
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// First parse this and then emit a *.sib. Then read in the *.sib, then recreate
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-sil-opt -sil-print-types %s -emit-sib -o %t/tmp.sib -module-name basic2 -enable-experimental-feature ValueGenerics
|
||||
// RUN: %target-sil-opt -sil-print-types %t/tmp.sib -o %t/tmp.2.sib -module-name basic2 -enable-experimental-feature ValueGenerics
|
||||
// RUN: %target-sil-opt -sil-print-types %t/tmp.2.sib -module-name basic2 -emit-sorted-sil -enable-experimental-feature ValueGenerics | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-sil-opt -sil-print-types %s -emit-sib -o %t/tmp.sib -module-name basic2
|
||||
// RUN: %target-sil-opt -sil-print-types %t/tmp.sib -o %t/tmp.2.sib -module-name basic2
|
||||
// RUN: %target-sil-opt -sil-print-types %t/tmp.2.sib -module-name basic2 -emit-sorted-sil | %FileCheck %s
|
||||
|
||||
import Builtin
|
||||
import Swift
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
// RUN: -emit-silgen \
|
||||
// RUN: -target %target-swift-5.1-abi-triple \
|
||||
// RUN: -enable-experimental-feature Sensitive \
|
||||
// RUN: -enable-experimental-feature ValueGenerics \
|
||||
// RUN: -enable-builtin-module
|
||||
|
||||
// REQUIRES: swift_feature_Sensitive
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// REQUIRES: asserts
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -disable-experimental-parser-round-trip -disable-availability-checking -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule %s | %FileCheck %s
|
||||
// RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -disable-experimental-parser-round-trip -disable-availability-checking -enable-experimental-feature BuiltinModule %s | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
import Builtin
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
|
||||
// RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -module-name closures -parse-stdlib -parse-as-library %s -enable-experimental-feature ValueGenerics -disable-availability-checking | %FileCheck %s
|
||||
// RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -module-name closures -parse-stdlib -parse-as-library %s -enable-experimental-feature ValueGenerics -disable-availability-checking | %FileCheck %s --check-prefix=GUARANTEED
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -module-name closures -parse-stdlib -parse-as-library %s -disable-availability-checking | %FileCheck %s
|
||||
// RUN: %target-swift-emit-silgen -Xllvm -sil-print-types -module-name closures -parse-stdlib -parse-as-library %s -disable-availability-checking | %FileCheck %s --check-prefix=GUARANTEED
|
||||
|
||||
import Swift
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// RUN: %target-swift-emit-silgen %s -disable-availability-checking -enable-experimental-feature ValueGenerics | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-swift-emit-silgen %s -disable-availability-checking | %FileCheck %s
|
||||
|
||||
import Synchronization
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// RUN: %target-swift-frontend -emit-sil -enable-experimental-feature BuiltinModule -enable-experimental-feature LifetimeDependence -enable-experimental-feature AddressableTypes -enable-experimental-feature ValueGenerics %s | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -emit-sil -enable-experimental-feature BuiltinModule -enable-experimental-feature LifetimeDependence -enable-experimental-feature AddressableTypes %s | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
// REQUIRES: swift_feature_AddressableTypes
|
||||
// REQUIRES: swift_feature_LifetimeDependence
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
import Builtin
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// RUN: %target-sil-opt -sil-print-types -enable-sil-verify-all %s -update-borrowed-from -cse -enable-experimental-feature ValueGenerics | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-sil-opt -sil-print-types -enable-sil-verify-all %s -update-borrowed-from -cse | %FileCheck %s
|
||||
|
||||
sil_stage canonical
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %target-swift-frontend -emit-sil -disable-experimental-parser-round-trip -disable-availability-checking -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule %s
|
||||
// RUN: %target-swift-frontend -emit-sil -disable-experimental-parser-round-trip -disable-availability-checking -enable-experimental-feature BuiltinModule %s
|
||||
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
import Builtin
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// RUN: %target-sil-opt -sil-print-types -sil-inline-generics -enable-sil-verify-all -inline -function-signature-opts -enable-experimental-feature ValueGenerics %s | %FileCheck %s
|
||||
// RUN: %target-sil-opt -sil-print-types -sil-inline-generics -enable-sil-verify-all -inline -function-signature-opts -enable-experimental-feature ValueGenerics %s | %FileCheck -check-prefix=CHECK-NEGATIVE %s
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-sil-opt -sil-print-types -sil-inline-generics -enable-sil-verify-all -inline -function-signature-opts %s | %FileCheck %s
|
||||
// RUN: %target-sil-opt -sil-print-types -sil-inline-generics -enable-sil-verify-all -inline -function-signature-opts %s | %FileCheck -check-prefix=CHECK-NEGATIVE %s
|
||||
|
||||
import Builtin
|
||||
import Swift
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
// RUN: %target-swift-frontend %s -emit-sil -O \
|
||||
// RUN: -disable-availability-checking \
|
||||
// RUN: -enable-experimental-feature ValueGenerics | %FileCheck %s --check-prefix=CHECK-SIL
|
||||
// RUN: -disable-availability-checking | %FileCheck %s --check-prefix=CHECK-SIL
|
||||
|
||||
// RUN: %target-swift-frontend %s -emit-ir -O \
|
||||
// RUN: -disable-availability-checking \
|
||||
// RUN: -enable-experimental-feature ValueGenerics | %FileCheck %s --check-prefix=CHECK-IR
|
||||
// RUN: -disable-availability-checking | %FileCheck %s --check-prefix=CHECK-IR
|
||||
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// REQUIRES: swift_stdlib_no_asserts, optimized_stdlib
|
||||
|
||||
// Bounds check should be eliminated
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %target-sil-opt -sil-print-types -enable-objc-interop -enable-sil-verify-all %s -sil-combine -enable-experimental-feature ValueGenerics | %FileCheck %s
|
||||
// RUN: %target-sil-opt -sil-print-types -enable-objc-interop -enable-sil-verify-all %s -sil-combine | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// Declare this SIL to be canonical because some tests break raw SIL
|
||||
// conventions. e.g. address-type block args. -enforce-exclusivity=none is also
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
// RUN: %target-swift-frontend -parse-as-library -primary-file %s -O -disable-availability-checking -enable-experimental-feature ValueGenerics -module-name=test -emit-sil | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -parse-as-library -primary-file %s -O -disable-availability-checking -module-name=test -emit-sil | %FileCheck %s
|
||||
|
||||
// Also do an end-to-end test to check all components, including IRGen.
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-build-swift -parse-as-library -O -Xfrontend -disable-availability-checking -enable-experimental-feature ValueGenerics -module-name=test %s -o %t/a.out
|
||||
// RUN: %target-build-swift -parse-as-library -O -Xfrontend -disable-availability-checking -module-name=test %s -o %t/a.out
|
||||
// RUN: %target-codesign %t/a.out
|
||||
// RUN: %target-run %t/a.out | %FileCheck %s -check-prefix=CHECK-OUTPUT
|
||||
|
||||
// REQUIRES: executable_test,optimized_stdlib
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// UNSUPPORTED: back_deployment_runtime
|
||||
|
||||
extension InlineArray: Collection {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// RUN: %target-typecheck-verify-swift \
|
||||
// RUN: -disable-availability-checking \
|
||||
// RUN: -enable-experimental-feature ValueGenerics \
|
||||
// RUN: -enable-experimental-feature Sensitive \
|
||||
// RUN: -enable-builtin-module \
|
||||
// RUN: -debug-diagnostic-names
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// REQUIRES: swift_feature_Sensitive
|
||||
|
||||
//==============================================================================
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %target-swift-frontend -disable-experimental-parser-round-trip -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule -typecheck -verify %s
|
||||
// RUN: %target-swift-frontend -disable-experimental-parser-round-trip -enable-experimental-feature BuiltinModule -typecheck -verify %s
|
||||
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
import Builtin
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %target-swift-frontend -disable-experimental-parser-round-trip -disable-availability-checking -enable-experimental-feature ValueGenerics -enable-experimental-feature BuiltinModule -typecheck -verify %s
|
||||
// RUN: %target-swift-frontend -disable-experimental-parser-round-trip -disable-availability-checking -enable-experimental-feature BuiltinModule -typecheck -verify %s
|
||||
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
import Builtin
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// RUN: %target-typecheck-verify-swift -disable-availability-checking -enable-experimental-feature ValueGenerics
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-typecheck-verify-swift -disable-availability-checking
|
||||
|
||||
let a: InlineArray = [1, 2, 3] // Ok, InlineArray<3, Int>
|
||||
let b: InlineArray<_, Int> = [1, 2, 3] // Ok, InlineArray<3, Int>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// RUN: %target-typecheck-verify-swift -enable-experimental-feature ValueGenerics -disable-availability-checking
|
||||
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
// RUN: %target-typecheck-verify-swift -disable-availability-checking
|
||||
|
||||
protocol P {}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// RUN: %target-typecheck-verify-swift -enable-experimental-feature ValueGenerics
|
||||
// RUN: %target-typecheck-verify-swift
|
||||
|
||||
// REQUIRES: OS=macosx
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
struct A<let N: Int> {} // expected-error {{values in generic types are only available in macOS 99.99.0 or newer}}
|
||||
// expected-note@-1 {{add @available attribute to enclosing generic struct}}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend %s -emit-module -enable-experimental-feature ValueGenerics -enable-experimental-feature RawLayout -disable-availability-checking -parse-as-library -o %t
|
||||
// RUN: %target-swift-frontend %s -emit-module -enable-experimental-feature RawLayout -disable-availability-checking -parse-as-library -o %t
|
||||
// RUN: %target-sil-opt -enable-sil-verify-all %t/value_generics.swiftmodule -o - | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_feature_RawLayout
|
||||
// REQUIRES: swift_feature_ValueGenerics
|
||||
|
||||
// CHECK: @_rawLayout(likeArrayOf: Element, count: Count) struct Vector<Element, let Count : Int> : ~Copyable where Element : ~Copyable {
|
||||
@_rawLayout(likeArrayOf: Element, count: Count)
|
||||
|
||||
Reference in New Issue
Block a user