Files
swift-mirror/test/ModuleInterface/arm64e-fallback.swift
Eric Miotto 6235aa8e5c Configure ModuleInterface/arm64e-fallback to not run in simulators
This would be needed to avoid test failures when running the test suite
on an Apple Silicon machine.

Addresses rdar://108788721
2023-05-03 14:33:19 -07:00

44 lines
1021 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-typecheck-verify-swift -F %S/Inputs -module-cache-path %t -verify-ignore-unknown -Rmodule-interface-rebuild
// PtrAuthFramework only supports these OSes.
//
// REQUIRES: OS=tvos || OS=macosx || OS=ios
// UNSUPPORTED: DARWIN_SIMULATOR={{.*}}
// When run on arm64, this tests that we fall back to the arm64e interface, but
// build it with `#if _ptrauth(_arm64e)` off.
//
// When run on arm64e, this tests that we build the same interface with
// `#if _ptrauth(_arm64e)` on.
//
// REQUIRES: CPU=arm64 || CPU=arm64e
import PtrAuthFramework // expected-remark{{rebuilding module 'PtrAuthFramework' from interface}}
#if os(iOS)
#if _ptrauth(_arm64e)
public let x: Bool = iOSPtrAuth
#else
public let x: Bool = iOSNotPtrAuth
#endif
#elseif os(macOS)
#if _ptrauth(_arm64e)
public let x: Bool = macOSPtrAuth
#else
public let x: Bool = macOSNotPtrAuth
#endif
#else
#if _ptrauth(_arm64e)
public let x: Bool = tvOSPtrAuth
#else
public let x: Bool = tvOSNotPtrAuth
#endif
#endif