30 lines · c
1// RUN: %clang_cc1 -fprofile-instrument=llvm -emit-llvm %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}"2 3// RUN: echo -e "[llvm]\nfunction:foo=skip" > %t0.list4// RUN: %clang_cc1 -fprofile-instrument=llvm -fprofile-list=%t0.list -emit-llvm %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}" --check-prefixes=CHECK,SKIP-FOO5 6// RUN: echo -e "[csllvm]\nfunction:bar=forbid" > %t1.list7// RUN: %clang_cc1 -fprofile-instrument=csllvm -fprofile-list=%t1.list -emit-llvm %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}" --check-prefixes=CHECK,FORBID-BAR8// RUN: %clang_cc1 -fprofile-instrument=llvm -fprofile-list=%t1.list -emit-llvm %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}"9 10// RUN: echo -e "[llvm]\ndefault:forbid\nfunction:foo=allow" > %t2.list11// RUN: %clang_cc1 -fprofile-instrument=llvm -fprofile-list=%t2.list -emit-llvm %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}" --check-prefixes=CHECK,FORBID12 13// RUN: echo "[llvm]" > %t2.list14// RUN: echo "source:%s=forbid" | sed -e 's/\\/\\\\/g' >> %t2.list15// RUN: echo "function:foo=allow" >> %t2.list16// RUN: %clang_cc1 -fprofile-instrument=llvm -fprofile-list=%t2.list -emit-llvm %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}" --check-prefixes=CHECK,FORBID17 18// SKIP-FOO: skipprofile19// CHECK-LABEL: define {{.*}} @foo20int foo(int a) { return 4 * a + 1; }21 22// FORBID-BAR: noprofile23// FORBID: noprofile24// CHECK-LABEL: define {{.*}} @bar25int bar(int a) { return 4 * a + 2; }26 27// FORBID: noprofile28// CHECK-LABEL: define {{.*}} @goo29int goo(int a) { return 4 * a + 3; }30