File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -DORIG_ATTR_SYN -o - %s | FileCheck %s
12// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -o - %s | FileCheck %s
3+ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -fpatchable-function-entry-offset=3 -DORIG_ATTR_SYN -o - %s | FileCheck %s --check-prefixes=CHECK,OFFSET
24// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -fpatchable-function-entry-offset=3 -o - %s | FileCheck %s --check-prefixes=CHECK,OFFSET
35
46// Note that the interleving of functions, which normally would be in sequence,
810#error Missing kcfi?
911#endif
1012
13+ #ifdef ORIG_ATTR_SYN
14+ #define __cfi_salt __attribute__((cfi_salt("pepper")))
15+ #else
1116#define __cfi_salt [[clang::cfi_salt("pepper")]]
17+ #endif
1218
1319typedef int (* fn_t )(void );
1420typedef int (* __cfi_salt fn_salt_t )(void );
@@ -55,7 +61,8 @@ int f7_typedef_salt(struct cfi_struct *ptr);
5561// CHECK: call{{.*}} i32
5662// CHECK-NOT: "kcfi"
5763// CHECK-SAME: ()
58- int __call (fn_t f ) __attribute__((__no_sanitize__ ("kcfi" ))) {
64+ __attribute__((__no_sanitize__ ("kcfi" )))
65+ int __call (fn_t f ) {
5966 return f ();
6067}
6168
You can’t perform that action at this time.
0 commit comments