Files
swift-mirror/test/embedded/stdlib-set.swift
2025-07-01 11:43:43 +01:00

31 lines
712 B
Swift

// RUN: %target-swift-frontend -target %target-triple -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 s: Set<Int> = [1, 2, 3]
s.insert(42)
s.sorted()
s.allSatisfy { $0 > 0 }
s.contains { $0 > 0 }
s.map { $0 * 2 }
s.filter { $0 > 0 }
s.firstIndex(of: 42)
s.min()
s.max()
s.reduce(0, +)
s.shuffled()
s.randomElement()
}
test()
// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1)