Skip to content

Commit 66cb83b

Browse files
committed
Fix testcase.
1 parent 2df94a9 commit 66cb83b

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

clang/test/Sema/attr-cfi-salt.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,24 @@ typedef int (*quux_t)(void) __cfi_salt("salt 'n");
4040
typedef int (*quux_t)(void) __cfi_salt("pepper");
4141
// expected-error@-1{{typedef redefinition with different type}}
4242

43-
void func(int a) __cfi_salt("pepper");
43+
void func1(int a) __cfi_salt("pepper");
4444
// expected-note@-1{{previous declaration is here}}
45-
void func(int a) { }
46-
// expected-error@-1{{conflicting types for 'func'}}
45+
void func1(int a) { }
46+
// expected-error@-1{{conflicting types for 'func1'}}
47+
void (*fp1)(int) = func1;
48+
// expected-error@-1{{incompatible function pointer types initializing 'void (*)(int)' with an expression of type 'void (int)'}}
4749

4850
void func2(int) [[clang::cfi_salt("test")]];
51+
// expected-note@-1{{previous declaration is here}}
4952
void func2(int a) { }
50-
void (*fp)(int) = func2;
53+
// expected-error@-1{{conflicting types for 'func2'}}
54+
void (*fp2)(int) = func2;
55+
// expected-error@-1{{incompatible function pointer types initializing 'void (*)(int)' with an expression of type 'void (int)'}}
56+
57+
void func3(int) __cfi_salt("pepper"); // ok
58+
void func3(int a) __cfi_salt("pepper") { } // ok
59+
void (* __cfi_salt("pepper") fp3)(int) = func3; // ok
60+
61+
void func4(int) [[clang::cfi_salt("test")]]; // ok
62+
void func4(int a) [[clang::cfi_salt("test")]] { } // ok
63+
void (* [[clang::cfi_salt("test")]] fp4)(int) = func4; // ok

0 commit comments

Comments
 (0)