-
Notifications
You must be signed in to change notification settings - Fork 10.4k
/
Copy pathptrauth-none-macho.swift
28 lines (21 loc) · 1.23 KB
/
ptrauth-none-macho.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
// RUN: %target-swift-frontend -target arm64e-apple-none-macho -enable-experimental-feature Embedded -emit-ir %s -o - -Xcc -D__APPLE__ -Xcc -D__MACH__ | %FileCheck %s
// RUN: %target-swift-frontend -target arm64e-apple-macos14 -enable-experimental-feature Embedded -emit-ir %s -o - -Xcc -D__APPLE__ -Xcc -D__MACH__ | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: OS=macosx
// REQUIRES: embedded_stdlib_cross_compiling
// REQUIRES: swift_feature_Embedded
var callback: (()->())? = nil
var callback2: ((Bool)->())? = nil
var callback3: ((Bool, Bool)->())? = nil
public func foo() {
callback?()
callback2?(true)
callback3?(true, true)
}
// CHECK-LABEL: define swiftcc void @"$e4main3fooyyF"()
// CHECK: [[P1:%.*]] = load ptr, ptr @"$e4main8callbackyycSgvp"
// CHECK: call swiftcc void [[P1:%.*]](ptr swiftself {{.*}}) [ "ptrauth"(i32 0, i64 3848) ]
// CHECK: [[P2:%.*]] = load ptr, ptr @"$e4main9callback2ySbcSgvp"
// CHECK: call swiftcc void [[P2:%.*]](i1 true, ptr swiftself {{.*}}) [ "ptrauth"(i32 0, i64 25457) ]
// CHECK: [[P3:%.*]] = load ptr, ptr @"$e4main9callback3ySb_SbtcSgvp"
// CHECK: call swiftcc void [[P3:%.*]](i1 true, i1 true, ptr swiftself {{.*}}) [ "ptrauth"(i32 0, i64 25424) ]