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
5
16
6
17
#ifdef __cplusplus
7
18
extern "C" {
@@ -47,29 +58,29 @@ void (*fptr3)(void) = __builtin_ptrauth_sign_constant(&external_function, 2, 26)
47
58
// CHECK: @fptr4 = global ptr ptrauth (ptr @external_function, i32 2, i64 26, ptr @fptr4)
48
59
void (* fptr4 )(void ) = __builtin_ptrauth_sign_constant (& external_function , 2 , __builtin_ptrauth_blend_discriminator (& fptr4 , 26 ));
49
60
50
- // CHECK-LABEL: define void @test_call()
61
+ // CHECK-LABEL: define{{.*}} void @test_call()
51
62
void test_call () {
52
63
// CHECK: [[T0:%.*]] = load ptr, ptr @fnptr,
53
64
// CHECK-NEXT: call void [[T0]]() [ "ptrauth"(i32 0, i64 18983) ]
54
65
fnptr ();
55
66
}
56
67
57
- // CHECK-LABEL: define ptr @test_function_pointer()
68
+ // CHECK-LABEL: define{{.*}} ptr @test_function_pointer()
58
69
// CHECK: ret ptr ptrauth (ptr @external_function, i32 0, i64 18983)
59
70
void (* test_function_pointer ())(void ) {
60
71
return external_function ;
61
72
}
62
73
63
74
struct InitiallyIncomplete ;
64
75
extern struct InitiallyIncomplete returns_initially_incomplete (void );
65
- // CHECK-LABEL: define void @use_while_incomplete()
76
+ // CHECK-LABEL: define{{.*}} void @use_while_incomplete()
66
77
void use_while_incomplete () {
67
78
// CHECK: [[VAR:%.*]] = alloca ptr,
68
79
// CHECK-NEXT: store ptr ptrauth (ptr @returns_initially_incomplete, i32 0, i64 25106), ptr [[VAR]]
69
80
struct InitiallyIncomplete (* fnptr )(void ) = & returns_initially_incomplete ;
70
81
}
71
82
struct InitiallyIncomplete { int x ; };
72
- // CHECK-LABEL: define void @use_while_complete()
83
+ // CHECK-LABEL: define{{.*}} void @use_while_complete()
73
84
void use_while_complete () {
74
85
// CHECK: [[VAR:%.*]] = alloca ptr,
75
86
// CHECK-NEXT: store ptr ptrauth (ptr @returns_initially_incomplete, i32 0, i64 25106), ptr [[VAR]]
@@ -83,7 +94,7 @@ void knr(param)
83
94
int param ;
84
95
{}
85
96
86
- // CHECKC-LABEL: define void @test_knr
97
+ // CHECKC-LABEL: define{{.*}} void @test_knr
87
98
void test_knr () {
88
99
void (* p )() = knr ;
89
100
p (0 );
@@ -94,7 +105,7 @@ void test_knr() {
94
105
// CHECKC: call void [[LOAD]](i32 noundef 0) [ "ptrauth"(i32 0, i64 18983) ]
95
106
}
96
107
97
- // CHECKC-LABEL: define void @test_redeclaration
108
+ // CHECKC-LABEL: define{{.*}} void @test_redeclaration
98
109
void test_redeclaration () {
99
110
void redecl ();
100
111
void (* ptr )() = redecl ;
@@ -113,7 +124,7 @@ void knr2(param)
113
124
int param ;
114
125
{}
115
126
116
- // CHECKC-LABEL: define void @test_redecl_knr
127
+ // CHECKC-LABEL: define{{.*}} void @test_redecl_knr
117
128
void test_redecl_knr () {
118
129
void (* p )() = knr2 ;
119
130
p ();
0 commit comments