-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
#availableFeature → statements: Availability conditionFeature → statements: Availability conditionMac CatalystPlatform: Mac CatalystPlatform: Mac CatalystSILGenArea → compiler: The SIL generation stageArea → compiler: The SIL generation stageavailabilityThe @available attribute and availability checking in generalThe @available attribute and availability checking in generalbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfif elseFeature → statements: 'if' statementsFeature → statements: 'if' statementsstatementsFeature: statementsFeature: statementsswift 6.0test failureunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
Catalyst builds fail to test in SILGen/availability_query_maccatalyst_zippered_canonical_versions.swift.
The code in question
if #available(OSX 10.16, iOS 51.1.2, *) { }The expected output for a catalyst executable should include checks for both the macOS and the iOS version numbers.
The SILGen emitted from the open-source compiler only includes the check for the macOS version.
Expected:
%2 = integer_literal $Builtin.Word, 10 // user: %9
%3 = integer_literal $Builtin.Word, 16 // user: %9
%4 = integer_literal $Builtin.Word, 0 // user: %9
%5 = integer_literal $Builtin.Word, 51 // user: %9
%6 = integer_literal $Builtin.Word, 1 // user: %9
%7 = integer_literal $Builtin.Word, 2 // user: %9
// function_ref _stdlib_isOSVersionAtLeastOrVariantVersionAtLeast(_:_:_:_:_:_:)
%8 = function_ref @$ss042_stdlib_isOSVersionAtLeastOrVariantVersiondE0yBi1_Bw_BwBwBwBwBwtF : $@convention(thin) (Builtin.Word, Builtin.Word, Builtin.Word, Builtin.Word, Builtin.Word, Builtin.Word) -> Builtin.Int1 // user: %9
%9 = apply %8(%2, %3, %4, %5, %6, %7) : $@convention(thin) (Builtin.Word, Builtin.Word, Builtin.Word, Builtin.Word, Builtin.Word, Builtin.Word) -> Builtin.Int1 // user: %10
Got:
%2 = integer_literal $Builtin.Word, 10 // user: %6
%3 = integer_literal $Builtin.Word, 16 // user: %6
%4 = integer_literal $Builtin.Word, 0 // user: %6
// function_ref _stdlib_isOSVersionAtLeast(_:_:_:)
%5 = function_ref @$ss26_stdlib_isOSVersionAtLeastyBi1_Bw_BwBwtF : $@convention(thin) (Builtin.Word, Builtin.Word, Builtin.Word) -> Builtin.Int1 // user: %6
%6 = apply %5(%2, %3, %4) : $@convention(thin) (Builtin.Word, Builtin.Word, Builtin.Word) -> Builtin.Int1 // user: %7
I've disabled the catalyst build from the nightly toolchain here; #62882
Metadata
Metadata
Labels
#availableFeature → statements: Availability conditionFeature → statements: Availability conditionMac CatalystPlatform: Mac CatalystPlatform: Mac CatalystSILGenArea → compiler: The SIL generation stageArea → compiler: The SIL generation stageavailabilityThe @available attribute and availability checking in generalThe @available attribute and availability checking in generalbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfif elseFeature → statements: 'if' statementsFeature → statements: 'if' statementsstatementsFeature: statementsFeature: statementsswift 6.0test failureunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output