Clang Project

clang_source_code/test/CodeGen/fentry.c
1// RUN: %clang_cc1 -pg -mfentry -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck  %s
2// RUN: %clang_cc1 -pg -mfentry -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
3// RUN: %clang_cc1 -mfentry -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix=NOPG %s
4// RUN: %clang_cc1 -mfentry -triple x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefix=NOPG %s
5
6int foo(void) {
7  return 0;
8}
9
10int __attribute__((no_instrument_function)) no_instrument(void) {
11  return foo();
12}
13
14//CHECK: attributes #0 = { {{.*}}"fentry-call"="true"{{.*}} }
15//CHECK: attributes #1 = { {{.*}} }
16//CHECK-NOT: attributes #1 = { {{.*}}"fentry-call"="true"{{.*}} }
17//NOPG-NOT: attributes #0 = { {{.*}}"fentry-call"{{.*}} }
18//NOPG-NOT: attributes #1 = { {{.*}}"fentry-call"{{.*}} }
19