Files
swift-mirror/test/SILOptimizer/specialize_by_integer_parameter.swift
Allan Shortlidge d39a6fc31d test: Stop disabling availability checking in value generics tests.
These tests pass -disable-availability-checking to silence diagnostics about
value generics and InlineArray, which require the Swift 6.2 runtime. Pass
-target %target-swift-6.2-abi-triple instead.
2026-09-10 15:46:51 -07:00

14 lines
561 B
Swift

// RUN: %target-swift-frontend -target %target-swift-6.2-abi-triple -emit-sil -O %s | %FileCheck %s
//
public struct Foo<let count: Int> {
// CHECK-LABEL: sil{{.*}} @$s{{.*}}3FooV3bar
// CHECK: [[PARAM_VAL:%.*]] = type_value $Int for count
// CHECK: [[SPEC_INT:%.*]] = integer_literal ${{.*}}, 3
// CHECK: [[PARAM_INT:%.*]] = struct_extract [[PARAM_VAL]], #Int._value
// CHECK: builtin "cmp_eq_Int{{.*}}"([[PARAM_INT]], [[SPEC_INT]])
@specialized(where count == 3)
public func bar() -> Int {
return count
}
}