1 // 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 
foo(void)10 int foo(void) {
11   return 0;
12 }
13 
no_instrument(void)14 int __attribute__((no_instrument_function)) no_instrument(void) {
15   return foo();
16 }
17 
18 //CHECK: attributes #0 = { {{.*}}"mnop-mcount"{{.*}} }
19 //CHECK: attributes #1 = { {{.*}} }
20 //CHECK-NOT: attributes #1 = { {{.*}}"mnop-mcount"{{.*}} }
21 //NOMFENTRY: error: option '-mnop-mcount' cannot be specified without '-mfentry'
22 //NOPG-NOT: attributes #0 = { {{.*}}"mnop-mcount"{{.*}} }
23 //NOPG-NOT: attributes #1 = { {{.*}}"mnop-mcount"{{.*}} }
24