forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharm64e-fallback.swift
42 lines (32 loc) · 981 Bytes
/
arm64e-fallback.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// 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
// 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