mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
27 lines
1.1 KiB
Swift
27 lines
1.1 KiB
Swift
// RUN: %target-swift-frontend -target %target-triple -parse-as-library -module-name main -O -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0 | %FileCheck %s
|
|
// RUN: %target-swift-frontend -target %target-triple -parse-as-library -module-name main -Osize -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0 | %FileCheck %s
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
// REQUIRES: optimized_stdlib
|
|
// REQUIRES: CODEGENERATOR=ARM
|
|
// REQUIRES: embedded_stdlib_cross_compiling
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
let pots = [41,52,99,1,4,4]
|
|
|
|
public enum ValidState {
|
|
case yes
|
|
case no
|
|
case undefined
|
|
}
|
|
|
|
public func checkPot(i: UInt8, testValue: UInt8) -> ValidState {
|
|
guard i < pots.count else { return .undefined }
|
|
return pots[Int(i)] < testValue ? .yes : .no
|
|
}
|
|
|
|
// CHECK: @"$e4main4pots_Wz" = {{.*}}global i32 0
|
|
// CHECK: @"$es20__StaticArrayStorageCN" = {{.*}}global ptr null
|
|
// CHECK: @"$e4main4pots_WZTv_r" = {{.*}}constant %Ts23_ContiguousArrayStorageCySiG_tailelems0 {{.*}}@"$es20__StaticArrayStorageCN"
|
|
// CHECK: @"$e4main4potsSaySiGvp" = {{.*}}constant %TSa {{.*}}@"$e4main4pots_WZTv_r"
|