1 // RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck -check-prefix=CHECK %s
2 // RUN: %clang_cc1 -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck -check-prefix=CHECK %s
6 // CHECK: define {{(dso_local )?}}void @test_direct_call()
7 void test_direct_call() {
8 // CHECK: call void @test_call(){{$}}
12 // CHECK: define {{(dso_local )?}}void @test_indirect_call(ptr noundef %[[FP:.*]])
13 void test_indirect_call(void (*fp(void))) {
14 // CHECK: %[[FP_ADDR:.*]] = alloca ptr, align 8
15 // CHECK: store ptr %[[FP]], ptr %[[FP_ADDR]], align 8
16 // CHECK: %[[V0:.*]] = load ptr, ptr %[[FP_ADDR]], align 8
17 // CHECK: %[[CALL:.*]] = call ptr %[[V0]]() [ "ptrauth"(i32 0, i64 0) ]
22 // CHECK: define {{(dso_local )?}}void @test_direct_builtin_call()
23 void test_direct_builtin_call() {
24 // CHECK: call void @abort() {{#[0-9]+$}}
28 // CHECK-LABEL: define {{(dso_local )?}}void @test_memcpy_inline(
29 // CHECK-NOT: call{{.*}}memcpy
31 extern inline __attribute__((__always_inline__
))
32 void *memcpy(void *d
, const void *s
, unsigned long) {
36 void test_memcpy_inline(char *d
, char *s
) {