1- // RUN: %clang_cc1 %s -fptrauth-function-pointer-type-discrimination -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s --check-prefix=CHECK --check-prefix=CHECKC
2- // RUN: %clang_cc1 -xc++ %s -fptrauth-function-pointer-type-discrimination -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -disable-llvm-passes -emit-llvm -o- | FileCheck %s --check-prefix=CHECK
3- // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-pch %s -o %t.ast
4- // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-llvm -x ast -o - %t.ast | FileCheck -check-prefix=CHECK --check-prefix=CHECKC %s
1+ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics \
2+ // RUN: -disable-llvm-passes -emit-llvm %s -o- | FileCheck --check-prefixes=CHECK,CHECKC %s
3+ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics \
4+ // RUN: -disable-llvm-passes -emit-llvm -xc++ %s -o- | FileCheck --check-prefix=CHECK %s
5+ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -emit-pch %s -o %t.ast
6+ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics \
7+ // RUN: -emit-llvm -x ast -o - %t.ast | FileCheck --check-prefixes=CHECK,CHECKC %s
8+
9+ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \
10+ // RUN: -disable-llvm-passes -emit-llvm %s -o- | FileCheck --check-prefixes=CHECK,CHECKC %s
11+ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \
12+ // RUN: -disable-llvm-passes -emit-llvm -xc++ %s -o- | FileCheck --check-prefix=CHECK %s
13+ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics -emit-pch %s -o %t.ast
14+ // RUN: %clang_cc1 -fptrauth-function-pointer-type-discrimination -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics \
15+ // RUN: -emit-llvm -x ast -o - %t.ast | FileCheck --check-prefixes=CHECK,CHECKC %s
516
617#ifdef __cplusplus
718extern "C" {
@@ -47,29 +58,29 @@ void (*fptr3)(void) = __builtin_ptrauth_sign_constant(&external_function, 2, 26)
4758// CHECK: @fptr4 = global ptr ptrauth (ptr @external_function, i32 2, i64 26, ptr @fptr4)
4859void (* fptr4 )(void ) = __builtin_ptrauth_sign_constant (& external_function , 2 , __builtin_ptrauth_blend_discriminator (& fptr4 , 26 ));
4960
50- // CHECK-LABEL: define void @test_call()
61+ // CHECK-LABEL: define{{.*}} void @test_call()
5162void test_call () {
5263 // CHECK: [[T0:%.*]] = load ptr, ptr @fnptr,
5364 // CHECK-NEXT: call void [[T0]]() [ "ptrauth"(i32 0, i64 18983) ]
5465 fnptr ();
5566}
5667
57- // CHECK-LABEL: define ptr @test_function_pointer()
68+ // CHECK-LABEL: define{{.*}} ptr @test_function_pointer()
5869// CHECK: ret ptr ptrauth (ptr @external_function, i32 0, i64 18983)
5970void (* test_function_pointer ())(void ) {
6071 return external_function ;
6172}
6273
6374struct InitiallyIncomplete ;
6475extern struct InitiallyIncomplete returns_initially_incomplete (void );
65- // CHECK-LABEL: define void @use_while_incomplete()
76+ // CHECK-LABEL: define{{.*}} void @use_while_incomplete()
6677void use_while_incomplete () {
6778 // CHECK: [[VAR:%.*]] = alloca ptr,
6879 // CHECK-NEXT: store ptr ptrauth (ptr @returns_initially_incomplete, i32 0, i64 25106), ptr [[VAR]]
6980 struct InitiallyIncomplete (* fnptr )(void ) = & returns_initially_incomplete ;
7081}
7182struct InitiallyIncomplete { int x ; };
72- // CHECK-LABEL: define void @use_while_complete()
83+ // CHECK-LABEL: define{{.*}} void @use_while_complete()
7384void use_while_complete () {
7485 // CHECK: [[VAR:%.*]] = alloca ptr,
7586 // CHECK-NEXT: store ptr ptrauth (ptr @returns_initially_incomplete, i32 0, i64 25106), ptr [[VAR]]
@@ -83,7 +94,7 @@ void knr(param)
8394 int param ;
8495{}
8596
86- // CHECKC-LABEL: define void @test_knr
97+ // CHECKC-LABEL: define{{.*}} void @test_knr
8798void test_knr () {
8899 void (* p )() = knr ;
89100 p (0 );
@@ -94,7 +105,7 @@ void test_knr() {
94105 // CHECKC: call void [[LOAD]](i32 noundef 0) [ "ptrauth"(i32 0, i64 18983) ]
95106}
96107
97- // CHECKC-LABEL: define void @test_redeclaration
108+ // CHECKC-LABEL: define{{.*}} void @test_redeclaration
98109void test_redeclaration () {
99110 void redecl ();
100111 void (* ptr )() = redecl ;
@@ -113,7 +124,7 @@ void knr2(param)
113124 int param ;
114125{}
115126
116- // CHECKC-LABEL: define void @test_redecl_knr
127+ // CHECKC-LABEL: define{{.*}} void @test_redecl_knr
117128void test_redecl_knr () {
118129 void (* p )() = knr2 ;
119130 p ();
0 commit comments