You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/test/Sema/ptrauth.c
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,17 @@ void test_blend_discriminator(int *dp, int (*fp)(int), int value) {
47
47
float*mismatch=__builtin_ptrauth_blend_discriminator(dp, value); // expected-error {{incompatible integer to pointer conversion initializing 'float *' with an expression of type}}
48
48
}
49
49
50
+
voidtest_string_discriminator(constchar*str) {
51
+
__builtin_ptrauth_string_discriminator(); // expected-error {{too few arguments}}
52
+
__builtin_ptrauth_string_discriminator(str, str); // expected-error {{too many arguments}}
53
+
(void) __builtin_ptrauth_string_discriminator("test string"); // no warning
54
+
55
+
__builtin_ptrauth_string_discriminator(str); // expected-error {{argument must be a string literal}}
56
+
57
+
void*mismatch=__builtin_ptrauth_string_discriminator("test string"); // expected-error {{incompatible integer to pointer conversion initializing 'void *' with an expression of type 'unsigned long'}}
58
+
}
59
+
60
+
50
61
voidtest_sign_unauthenticated(int*dp, int (*fp)(int)) {
51
62
__builtin_ptrauth_sign_unauthenticated(dp, VALID_DATA_KEY); // expected-error {{too few arguments}}
52
63
__builtin_ptrauth_sign_unauthenticated(dp, VALID_DATA_KEY, dp, dp); // expected-error {{too many arguments}}
0 commit comments