[IRGen] Fix copy/paste error.

The schemas for the coro frame de/alloc functions were incorrectly not
being assigned and instead the non-frame de/alloc functions were being
assigned twice.  Fix that and add more tests.

rdar://163330882
This commit is contained in:
Nate Chandler
2025-10-27 14:54:05 -07:00
parent 8ae717af42
commit df273d6f28
2 changed files with 44 additions and 4 deletions

View File

@@ -1094,11 +1094,11 @@ static void setPointerAuthOptions(PointerAuthOptions &opts,
codeKey, /*address*/ false, Discrimination::Constant,
SpecialPointerAuthDiscriminators::CoroDeallocationFunction);
opts.CoroAllocationFunction = PointerAuthSchema(
opts.CoroFrameAllocationFunction = PointerAuthSchema(
codeKey, /*address*/ false, Discrimination::Constant,
SpecialPointerAuthDiscriminators::CoroFrameAllocationFunction);
opts.CoroDeallocationFunction = PointerAuthSchema(
opts.CoroFrameDeallocationFunction = PointerAuthSchema(
codeKey, /*address*/ false, Discrimination::Constant,
SpecialPointerAuthDiscriminators::CoroFrameDeallocationFunction);
}

View File

@@ -37,10 +37,30 @@
// CHECK-arm64e-SAME: i64 40879 },
// CHECK-arm64e-SAME: section "llvm.ptrauth",
// CHECK-arm64e-SAME: align 8
// CHECK-arm64e-LABEL: _swift_coro_malloc.ptrauth.1 = private constant {
// CHECK-arm64e-SAME: ptr @_swift_coro_malloc,
// CHECK-arm64e-SAME: i32 0,
// CHECK-arm64e-SAME: i64 0,
// CHECK-arm64e-SAME: i64 53841 }
// CHECK-arm64e-SAME: section "llvm.ptrauth"
// CHECK-arm64e-SAME: align 8
// CHECK-arm64e-LABEL: _swift_coro_free.ptrauth.2 = private constant {
// CHECK-arm64e-SAME: ptr @_swift_coro_free,
// CHECK-arm64e-SAME: i32 0,
// CHECK-arm64e-SAME: i64 0,
// CHECK-arm64e-SAME: i64 23464 },
// CHECK-arm64e-SAME: section "llvm.ptrauth",
// CHECK-arm64e-SAME: align 8
// CHECK-LABEL: _swift_coro_malloc_allocator = linkonce_odr hidden constant %swift.coro_allocator {
// CHECK-SAME: i32 258,
// CHECK-SAME: malloc
// CHECK-SAME: free
// CHECK-SAME: _swift_coro_malloc
// CHECK-ar64e-SAME: .ptrauth
// CHECK-SAME: _swift_coro_free
// CHECK-ar64e-SAME: .ptrauth
// CHECK-SAME: _swift_coro_malloc
// CHECK-ar64e-SAME: .ptrauth.1
// CHECK-SAME: _swift_coro_free
// CHECK-ar64e-SAME: .ptrauth.2
// CHECK-SAME: }
// CHECK-arm64e-LABEL: _swift_coro_task_alloc.ptrauth = private constant {
// CHECK-arm64e-SAME: ptr @_swift_coro_task_alloc,
@@ -56,10 +76,30 @@
// CHECK-arm64e-SAME: i64 40879 },
// CHECK-arm64e-SAME: section "llvm.ptrauth",
// CHECK-arm64e-SAME: align 8
// CHECK-arm64e-LABEL: _swift_coro_task_alloc.ptrauth.3 = private constant {
// CHECK-arm64e-SAME: ptr @_swift_coro_task_alloc,
// CHECK-arm64e-SAME: i32 0,
// CHECK-arm64e-SAME: i64 0,
// CHECK-arm64e-SAME: i64 53841 }
// CHECK-arm64e-SAME: section "llvm.ptrauth"
// CHECK-arm64e-SAME: align 8
// CHECK-arm64e-LABEL: @_swift_coro_task_dealloc.ptrauth.4 = private constant {
// CHECK-arm64e-SAME: ptr @_swift_coro_task_dealloc,
// CHECK-arm64e-SAME: i32 0,
// CHECK-arm64e-SAME: i64 0,
// CHECK-arm64e-SAME: i64 23464 },
// CHECK-arm64e-SAME: section "llvm.ptrauth",
// CHECK-arm64e-SAME: align 8
// CHECK-LABEL: _swift_coro_async_allocator = linkonce_odr hidden constant %swift.coro_allocator {
// CHECK-SAME: i32 1,
// CHECK-SAME: _swift_coro_task_alloc
// CHECK-ar64e-SAME: .ptrauth
// CHECK-SAME: _swift_coro_task_dealloc
// CHECK-ar64e-SAME: .ptrauth
// CHECK-SAME: _swift_coro_task_alloc
// CHECK-ar64e-SAME: .ptrauth.3
// CHECK-SAME: _swift_coro_task_dealloc
// CHECK-ar64e-SAME: .ptrauth.4
// CHECK-SAME: }
// CHECK-LABEL: @_swift_coro_alloc(