mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 03:29:57 +00:00
886b4505f2
Summary: Currently only calls to mcount were suppressed with no_instrument_function attribute. Linux kernel requires that calls to fentry should also not be generated. This is an extended fix for PR PR33515. Reviewers: hfinkel, rengolin, srhines, rnk, rsmith, rjmccall, hans Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43995 llvm-svn: 326639
19 lines
816 B
C
19 lines
816 B
C
// RUN: %clang_cc1 -pg -mfentry -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s
|
|
// RUN: %clang_cc1 -pg -mfentry -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
|
|
// RUN: %clang_cc1 -mfentry -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=NOPG %s
|
|
// RUN: %clang_cc1 -mfentry -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefix=NOPG %s
|
|
|
|
int foo(void) {
|
|
return 0;
|
|
}
|
|
|
|
int __attribute__((no_instrument_function)) no_instrument(void) {
|
|
return foo();
|
|
}
|
|
|
|
//CHECK: attributes #0 = { {{.*}}"fentry-call"="true"{{.*}} }
|
|
//CHECK: attributes #1 = { {{.*}} }
|
|
//CHECK-NOT: attributes #1 = { {{.*}}"fentry-call"="true"{{.*}} }
|
|
//NOPG-NOT: attributes #0 = { {{.*}}"fentry-call"{{.*}} }
|
|
//NOPG-NOT: attributes #1 = { {{.*}}"fentry-call"{{.*}} }
|