Files
swift-mirror/test/Parse/ConditionalCompilation/armIOSTarget.swift
T
Allan Shortlidge a303829e6e Basic: Add support for #if os(anyAppleOS).
As a complement to `@available(anyAppleOS ...)`, evaluate `#if os(anyAppleOS)`
to true when targeting Apple's operating systems.

Resolves rdar://172747814.
2026-03-17 09:06:50 -07:00

23 lines
662 B
Swift

// RUN: %swift -typecheck %s -verify -target arm-apple-ios7.0 -parse-stdlib
// RUN: %swift-ide-test -test-input-complete -source-filename=%s -target arm-apple-ios7.0
#if os(tvOS) || os(watchOS)
// This block should not be type checked.
// os(iOS) does not imply os(tvOS) or os(watchOS).
let i: Int = "Hello"
#endif
#if arch(arm) && os(iOS) && _runtime(_ObjC) && _endian(little) && _pointerBitWidth(_32)
#if _hasAtomicBitWidth(_8) && _hasAtomicBitWidth(_16) && _hasAtomicBitWidth(_32) && _hasAtomicBitWidth(_64)
class C {}
var x = C()
#endif
#endif
var y = x
#if os(anyAppleOS)
// os(iOS) implies os(anyAppleOS)
func hasAnyAppleOS() { }
#endif
hasAnyAppleOS()