Files
swift-mirror/test/embedded/stdlib-array.swift
Daniel Rodríguez Troitiño ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00

37 lines
1.1 KiB
Swift

// RUN: %target-swift-frontend -target armv7-apple-none-macho -Xcc -D__MACH__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: CODEGENERATOR=ARM
// REQUIRES: embedded_stdlib_cross_compiling
// REQUIRES: swift_feature_Embedded
// https://github.com/apple/swift/issues/73249
// UNSUPPORTED: OS=windows-msvc
public func test() {
var array: [Int] = [1, 2, 3]
array.append(42)
array.append(contentsOf: [4, 5, 6])
array = array.sorted()
array.sort()
array.allSatisfy { $0 > 0 }
array.contains { $0 > 0 }
array.map { $0 * 2 }
array.filter { $0 > 0 }
array.dropFirst().dropLast().drop(while: { $0 < 0 })
array.firstIndex(of: 42)
array.min()
array.max()
array.partition(by: { $0 > 0 })
array.reduce(0, +)
array.shuffle()
array = array.shuffled()
array.randomElement()
}
test()
// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1)