mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
18 lines
594 B
Swift
18 lines
594 B
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
|
|
|
|
public func test() {
|
|
Bool.random()
|
|
Int.random(in: 0 ..< 100)
|
|
Double.random(in: 0.0 ..< 1.0)
|
|
[1, 2, 3].shuffled()
|
|
[1, 2, 3].randomElement()
|
|
}
|
|
|
|
test()
|
|
|
|
// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1)
|