blob: 08d000dc4131555f247ede8136cd096714ac3c83 [file] [log] [blame]
Jonas Paulsson93767142019-11-05 11:44:04 +01001// RUN: %clang_cc1 -pg -mfentry -mnop-mcount -triple s390x-ibm-linux -emit-llvm \
2// RUN: -o - %s 2>&1 | FileCheck %s
3// RUN: not %clang_cc1 -pg -mnop-mcount -triple s390x-ibm-linux -emit-llvm -o - \
4// RUN: %s 2>&1 | FileCheck -check-prefix=NOMFENTRY %s
5// RUN: %clang_cc1 -mfentry -mnop-mcount -triple s390x-ibm-linux -emit-llvm -o - \
6// RUN: %s 2>&1 | FileCheck -check-prefix=NOPG %s
7// RUN: %clang_cc1 -mnop-mcount -triple s390x-ibm-linux -emit-llvm -o - %s \
8// RUN: 2>&1 | FileCheck -check-prefix=NOPG %s
9// RUN: not %clang_cc1 -pg -mfentry -mnop-mcount -triple x86_64-linux-gnu \
10// RUN: -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=X86 %s
11
12int foo(void) {
13 return 0;
14}
15
16int __attribute__((no_instrument_function)) no_instrument(void) {
17 return foo();
18}
19
20//CHECK: attributes #0 = { {{.*}}"mnop-mcount"="true"{{.*}} }
21//CHECK: attributes #1 = { {{.*}} }
22//CHECK-NOT: attributes #1 = { {{.*}}"mnop-mcount"="true"{{.*}} }
23//NOMFENTRY: error: option '-mnop-mcount' cannot be specified without '-mfentry'
24//NOPG-NOT: attributes #0 = { {{.*}}"mnop-mcount"{{.*}} }
25//NOPG-NOT: attributes #1 = { {{.*}}"mnop-mcount"{{.*}} }
26//X86: error: option '-mnop-mcount' cannot be specified on this target