diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-03-11 04:37:49 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-03-11 04:37:49 +0000 |
commit | 52a6a97d70c2c39ee498ee4802b5130446e5595e (patch) | |
tree | 4189684b546c5a482d0e5e9a62288f153c72685b /clang/test/CodeGenCXX | |
parent | a4fb799d000506ed2e0edd3e01f1de12cc66e826 (diff) | |
download | bcm5719-llvm-52a6a97d70c2c39ee498ee4802b5130446e5595e.tar.gz bcm5719-llvm-52a6a97d70c2c39ee498ee4802b5130446e5595e.zip |
test: Give instrumentation based profiling tests their own directory
These tests are logically related, but they're spread about several
different CodeGen directories. Consolidate them in one place to make
them easier to manage.
llvm-svn: 203541
Diffstat (limited to 'clang/test/CodeGenCXX')
4 files changed, 0 insertions, 192 deletions
diff --git a/clang/test/CodeGenCXX/Inputs/instr-profile-class.profdata b/clang/test/CodeGenCXX/Inputs/instr-profile-class.profdata deleted file mode 100644 index 6605eb446c7..00000000000 --- a/clang/test/CodeGenCXX/Inputs/instr-profile-class.profdata +++ /dev/null @@ -1,20 +0,0 @@ -_ZN6SimpleC2Ei 2 -100 -99 - -_ZN6Simple6methodEv 2 -100 -99 - -_ZN6SimpleD2Ev 2 -100 -99 - -_ZN14simple_wrapperEv 4 -1 -100 -0 -0 - -main 1 -1 diff --git a/clang/test/CodeGenCXX/Inputs/instr-profile-throws.profdata b/clang/test/CodeGenCXX/Inputs/instr-profile-throws.profdata deleted file mode 100644 index a49522f5584..00000000000 --- a/clang/test/CodeGenCXX/Inputs/instr-profile-throws.profdata +++ /dev/null @@ -1,14 +0,0 @@ -_Z6throwsv 9 -1 -100 -100 -66 -33 -17 -50 -33 -100 - -main 1 -1 - diff --git a/clang/test/CodeGenCXX/instr-profile-class.cpp b/clang/test/CodeGenCXX/instr-profile-class.cpp deleted file mode 100644 index f23aac6f7cb..00000000000 --- a/clang/test/CodeGenCXX/instr-profile-class.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// Test that instrumentation based profiling feeds branch prediction -// correctly. This tests both generation of profile data and use of the same, -// and the input file for the -fprofile-instr-use case is expected to be result -// of running the program generated by the -fprofile-instr-generate case -// (excepting no_usable_data). As such, main() should call every function in -// this test. - -// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-generate -fno-exceptions -target %itanium_abi_triple > %tgen -// RUN: FileCheck --input-file=%tgen -check-prefix=CTRGEN %s -// RUN: FileCheck --input-file=%tgen -check-prefix=DTRGEN %s -// RUN: FileCheck --input-file=%tgen -check-prefix=MTHGEN %s -// RUN: FileCheck --input-file=%tgen -check-prefix=WRPGEN %s - -// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile-class.profdata -fno-exceptions -target %itanium_abi_triple > %tuse -// RUN: FileCheck --input-file=%tuse -check-prefix=CTRUSE %s -// RUN: FileCheck --input-file=%tuse -check-prefix=DTRUSE %s -// RUN: FileCheck --input-file=%tuse -check-prefix=MTHUSE %s -// RUN: FileCheck --input-file=%tuse -check-prefix=WRPUSE %s - -class Simple { - int Member; -public: - // CTRGEN-LABEL: define {{.*}} @_ZN6SimpleC2Ei( - // CTRUSE-LABEL: define {{.*}} @_ZN6SimpleC2Ei( - // CTRGEN: store {{.*}} @[[SCC:__llvm_pgo_ctr[0-9]*]], i64 0, i64 0 - explicit Simple(int Member) : Member(Member) { - // CTRGEN: store {{.*}} @[[SCC]], i64 0, i64 1 - // CTRUSE: br {{.*}} !prof ![[SC1:[0-9]+]] - if (Member) {} - // CTRGEN-NOT: store {{.*}} @[[SCC]], - // CTRUSE-NOT: br {{.*}} !prof ![0-9]+ - // CTRUSE: ret - } - // CTRUSE: ![[SC1]] = metadata !{metadata !"branch_weights", i32 100, i32 2} - - // DTRGEN-LABEL: define {{.*}} @_ZN6SimpleD2Ev( - // DTRUSE-LABEL: define {{.*}} @_ZN6SimpleD2Ev( - // DTRGEN: store {{.*}} @[[SDC:__llvm_pgo_ctr[0-9]*]], i64 0, i64 0 - ~Simple() { - // DTRGEN: store {{.*}} @[[SDC]], i64 0, i64 1 - // DTRUSE: br {{.*}} !prof ![[SD1:[0-9]+]] - if (Member) {} - // DTRGEN-NOT: store {{.*}} @[[SDC]], - // DTRUSE-NOT: br {{.*}} !prof ![0-9]+ - // DTRUSE: ret - } - // DTRUSE: ![[SD1]] = metadata !{metadata !"branch_weights", i32 100, i32 2} - - // MTHGEN-LABEL: define {{.*}} @_ZN6Simple6methodEv( - // MTHUSE-LABEL: define {{.*}} @_ZN6Simple6methodEv( - // MTHGEN: store {{.*}} @[[SMC:__llvm_pgo_ctr[0-9]*]], i64 0, i64 0 - void method() { - // MTHGEN: store {{.*}} @[[SMC]], i64 0, i64 1 - // MTHUSE: br {{.*}} !prof ![[SM1:[0-9]+]] - if (Member) {} - // MTHGEN-NOT: store {{.*}} @[[SMC]], - // MTHUSE-NOT: br {{.*}} !prof ![0-9]+ - // MTHUSE: ret - } - // MTHUSE: ![[SM1]] = metadata !{metadata !"branch_weights", i32 100, i32 2} -}; - -// WRPGEN-LABEL: define {{.*}} @_Z14simple_wrapperv( -// WRPUSE-LABEL: define {{.*}} @_Z14simple_wrapperv( -// WRPGEN: store {{.*}} @[[SWC:__llvm_pgo_ctr[0-9]*]], i64 0, i64 0 -void simple_wrapper() { - // WRPGEN: store {{.*}} @[[SWC]], i64 0, i64 1 - // WRPUSE: br {{.*}} !prof ![[SW1:[0-9]+]] - for (int I = 0; I < 100; ++I) { - Simple S(I); - S.method(); - } - // WRPGEN-NOT: store {{.*}} @[[SWC]], - // WRPUSE-NOT: br {{.*}} !prof ![0-9]+ - // WRPUSE: ret -} -// WRPUSE: ![[SW1]] = metadata !{metadata !"branch_weights", i32 100, i32 2} - -int main(int argc, const char *argv[]) { - simple_wrapper(); - return 0; -} diff --git a/clang/test/CodeGenCXX/instr-profile-throws.cpp b/clang/test/CodeGenCXX/instr-profile-throws.cpp deleted file mode 100644 index d25827c5e00..00000000000 --- a/clang/test/CodeGenCXX/instr-profile-throws.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// Test that instrumentation based profiling feeds branch prediction -// correctly. This tests both generation of profile data and use of the same, -// and the input file for the -fprofile-instr-use case is expected to be result -// of running the program generated by the -fprofile-instr-generate case. As -// such, main() should call every function in this test. - -// FIXME: Don't seek bb labels, like "if.else" -// REQUIRES: asserts - -// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN %s -// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN-EXC %s - -// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile-throws.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s -// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile-throws.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s - -// PGOGEN: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [9 x i64] zeroinitializer -// PGOGEN-EXC: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [9 x i64] zeroinitializer - -// PGOGEN-LABEL: @_Z6throwsv() -// PGOUSE-LABEL: @_Z6throwsv() -// PGOGEN: store {{.*}} @[[THC]], i64 0, i64 0 -void throws() { - // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 1 - // PGOUSE: br {{.*}} !prof ![[TH1:[0-9]+]] - for (int i = 0; i < 100; ++i) { - try { - // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 3 - // PGOUSE: br {{.*}} !prof ![[TH2:[0-9]+]] - if (i % 3) { - // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 4 - // PGOUSE: br {{.*}} !prof ![[TH3:[0-9]+]] - if (i < 50) - throw 1; - } else { - // The catch block may be emitted after the throw above, we can skip it - // by looking for an else block, but this will break if anyone puts an - // else in the catch - // PGOUSE: if.else{{.*}}: - // PGOGEN: if.else{{.*}}: - - // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 5 - // PGOUSE: br {{.*}} !prof ![[TH4:[0-9]+]] - if (i >= 50) - throw 0; - } - } catch (int e) { - // PGOUSE-EXC: catch{{.*}}: - // PGOGEN-EXC: catch{{.*}}: - - // PGOGEN-EXC: store {{.*}} @[[THC]], i64 0, i64 6 - // PGOGEN-EXC: store {{.*}} @[[THC]], i64 0, i64 7 - // PGOUSE-EXC: br {{.*}} !prof ![[TH5:[0-9]+]] - if (e) {} - } - // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 2 - - // PGOGEN: store {{.*}} @[[THC]], i64 0, i64 8 - // PGOUSE: br {{.*}} !prof ![[TH6:[0-9]+]] - if (i < 100) {} - } - - // PGOUSE-NOT: br {{.*}} !prof ![0-9]+ - // PGOUSE: ret void -} - -// PGOUSE-DAG: ![[TH1]] = metadata !{metadata !"branch_weights", i32 101, i32 2} -// PGOUSE-DAG: ![[TH2]] = metadata !{metadata !"branch_weights", i32 67, i32 35} -// PGOUSE-DAG: ![[TH3]] = metadata !{metadata !"branch_weights", i32 34, i32 34} -// PGOUSE-DAG: ![[TH4]] = metadata !{metadata !"branch_weights", i32 18, i32 18} -// PGOUSE-EXC: ![[TH5]] = metadata !{metadata !"branch_weights", i32 34, i32 18} -// PGOUSE-DAG: ![[TH6]] = metadata !{metadata !"branch_weights", i32 101, i32 1} - -int main(int argc, const char *argv[]) { - throws(); - return 0; -} |