Skip to content

Commit 3f42d34

Browse files
authored
[clang][PAC] add ptrauth intptr test (#139338)
Forgot to actually add the test as part of the `__ptrauth` on intptr PR
1 parent 73165de commit 3f42d34

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %clang_cc1 -triple arm64-apple-ios -fsyntax-only -verify -fptrauth-intrinsics %s
2+
3+
char __ptrauth(0) a;
4+
// expected-error@-1{{'__ptrauth' qualifier only applies to pointer or pointer sized integer types; 'char' is invalid}}
5+
unsigned char __ptrauth(0) b;
6+
// expected-error@-1{{'__ptrauth' qualifier only applies to pointer or pointer sized integer types; 'unsigned char' is invalid}}
7+
short __ptrauth(0) c;
8+
// expected-error@-1{{'__ptrauth' qualifier only applies to pointer or pointer sized integer types; 'short' is invalid}}
9+
unsigned short __ptrauth(0) d;
10+
// expected-error@-1{{'__ptrauth' qualifier only applies to pointer or pointer sized integer types; 'unsigned short' is invalid}}
11+
int __ptrauth(0) e;
12+
// expected-error@-1{{'__ptrauth' qualifier only applies to pointer or pointer sized integer types; 'int' is invalid}}
13+
unsigned int __ptrauth(0) f;
14+
// expected-error@-1{{'__ptrauth' qualifier only applies to pointer or pointer sized integer types; 'unsigned int' is invalid}}
15+
__int128_t __ptrauth(0) g;
16+
// expected-error@-1{{'__ptrauth' qualifier only applies to pointer or pointer sized integer types; '__int128_t' (aka '__int128') is invalid}}
17+
unsigned short __ptrauth(0) h;
18+
// expected-error@-1{{'__ptrauth' qualifier only applies to pointer or pointer sized integer types; 'unsigned short' is invalid}}
19+
20+
unsigned long long __ptrauth(0) i;
21+
long long __ptrauth(0) j;
22+
__SIZE_TYPE__ __ptrauth(0) k;
23+
const unsigned long long __ptrauth(0) l;
24+
const long long __ptrauth(0) m;
25+
const __SIZE_TYPE__ __ptrauth(0) n;
26+
27+
struct S1 {
28+
__SIZE_TYPE__ __ptrauth(0) f0;
29+
};
30+
31+
void x(unsigned long long __ptrauth(0) f0);
32+
// expected-error@-1{{parameter type may not be qualified with '__ptrauth'; type is '__ptrauth(0,0,0) unsigned long long'}}
33+
34+
unsigned long long __ptrauth(0) y();
35+
// expected-error@-1{{return type may not be qualified with '__ptrauth'; type is '__ptrauth(0,0,0) unsigned long long'}}

0 commit comments

Comments
 (0)