diff options
-rw-r--r-- | clang/test/CodeGenObjC/Inputs/instr-profile.profdata | 11 | ||||
-rw-r--r-- | clang/test/Profile/Inputs/c-attributes.profdata (renamed from clang/test/CodeGen/Inputs/instr-attribute.profdata) | 0 | ||||
-rw-r--r-- | clang/test/Profile/Inputs/c-general.profdata (renamed from clang/test/CodeGen/Inputs/instr-profile.profdata) | 2 | ||||
-rw-r--r-- | clang/test/Profile/Inputs/cxx-class.profdata (renamed from clang/test/CodeGenCXX/Inputs/instr-profile-class.profdata) | 0 | ||||
-rw-r--r-- | clang/test/Profile/Inputs/cxx-throws.profdata (renamed from clang/test/CodeGenCXX/Inputs/instr-profile-throws.profdata) | 0 | ||||
-rw-r--r-- | clang/test/Profile/Inputs/objc-general.profdata | 10 | ||||
-rw-r--r-- | clang/test/Profile/README | 8 | ||||
-rw-r--r-- | clang/test/Profile/c-attributes.c (renamed from clang/test/CodeGen/instr-attribute.c) | 2 | ||||
-rw-r--r-- | clang/test/Profile/c-general.c (renamed from clang/test/CodeGen/instr-profile.c) | 13 | ||||
-rw-r--r-- | clang/test/Profile/cxx-class.cpp (renamed from clang/test/CodeGenCXX/instr-profile-class.cpp) | 9 | ||||
-rw-r--r-- | clang/test/Profile/cxx-throws.cpp (renamed from clang/test/CodeGenCXX/instr-profile-throws.cpp) | 10 | ||||
-rw-r--r-- | clang/test/Profile/objc-general.m (renamed from clang/test/CodeGenObjC/instr-profile.m) | 10 |
12 files changed, 32 insertions, 43 deletions
diff --git a/clang/test/CodeGenObjC/Inputs/instr-profile.profdata b/clang/test/CodeGenObjC/Inputs/instr-profile.profdata deleted file mode 100644 index 0fe046e5795..00000000000 --- a/clang/test/CodeGenObjC/Inputs/instr-profile.profdata +++ /dev/null @@ -1,11 +0,0 @@ -instr-profile.m:__13+[A foreach:]_block_invoke 2 -2 -1 - -instr-profile.m:+[A foreach:] 2 -1 -2 - -main 1 -1 - diff --git a/clang/test/CodeGen/Inputs/instr-attribute.profdata b/clang/test/Profile/Inputs/c-attributes.profdata index 0419b3b3bef..0419b3b3bef 100644 --- a/clang/test/CodeGen/Inputs/instr-attribute.profdata +++ b/clang/test/Profile/Inputs/c-attributes.profdata diff --git a/clang/test/CodeGen/Inputs/instr-profile.profdata b/clang/test/Profile/Inputs/c-general.profdata index f6337d23329..e87f78e6b56 100644 --- a/clang/test/CodeGen/Inputs/instr-profile.profdata +++ b/clang/test/Profile/Inputs/c-general.profdata @@ -132,7 +132,7 @@ no_usable_data 5 main 1 1 -instr-profile.c:static_func 2 +c-general.c:static_func 2 1 10 diff --git a/clang/test/CodeGenCXX/Inputs/instr-profile-class.profdata b/clang/test/Profile/Inputs/cxx-class.profdata index 6605eb446c7..6605eb446c7 100644 --- a/clang/test/CodeGenCXX/Inputs/instr-profile-class.profdata +++ b/clang/test/Profile/Inputs/cxx-class.profdata diff --git a/clang/test/CodeGenCXX/Inputs/instr-profile-throws.profdata b/clang/test/Profile/Inputs/cxx-throws.profdata index a49522f5584..a49522f5584 100644 --- a/clang/test/CodeGenCXX/Inputs/instr-profile-throws.profdata +++ b/clang/test/Profile/Inputs/cxx-throws.profdata diff --git a/clang/test/Profile/Inputs/objc-general.profdata b/clang/test/Profile/Inputs/objc-general.profdata new file mode 100644 index 00000000000..da421583b81 --- /dev/null +++ b/clang/test/Profile/Inputs/objc-general.profdata @@ -0,0 +1,10 @@ +objc-general.m:__13+[A foreach:]_block_invoke 2 +2 +1 + +objc-general.m:+[A foreach:] 2 +1 +2 + +main 1 +1 diff --git a/clang/test/Profile/README b/clang/test/Profile/README new file mode 100644 index 00000000000..8cf13c062ff --- /dev/null +++ b/clang/test/Profile/README @@ -0,0 +1,8 @@ +These are tests for instrumentation based profiling. This specifically +means the -fprofile-instr-generate and -fprofile-instr-use driver flags. + +Tests in this directory should test both the generation of profile +data, and the use of that same data. As such, the input source file +should include a main function such that building with -use and +running the resulting program would generate the input data that is +consumed in the -generate case. diff --git a/clang/test/CodeGen/instr-attribute.c b/clang/test/Profile/c-attributes.c index b2399807543..81809551fde 100644 --- a/clang/test/CodeGen/instr-attribute.c +++ b/clang/test/Profile/c-attributes.c @@ -1,6 +1,6 @@ // Test that instrumentation based profiling sets function attributes correctly. -// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-attribute.profdata | FileCheck %s +// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%S/Inputs/c-attributes.profdata | FileCheck %s extern int atoi(const char *); diff --git a/clang/test/CodeGen/instr-profile.c b/clang/test/Profile/c-general.c index 05656ab508e..43ebf511827 100644 --- a/clang/test/CodeGen/instr-profile.c +++ b/clang/test/Profile/c-general.c @@ -1,12 +1,7 @@ -// 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_cc1 -triple x86_64-apple-macosx10.9 -main-file-name instr-profile.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN %s -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name instr-profile.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/instr-profile.profdata | FileCheck -check-prefix=PGOUSE %s +// Test instrumentation of general constructs in C. + +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/c-general.profdata | FileCheck -check-prefix=PGOUSE %s // PGOGEN: @[[SLC:__llvm_pgo_ctr[0-9]*]] = private global [4 x i64] zeroinitializer // PGOGEN: @[[IFC:__llvm_pgo_ctr[0-9]*]] = private global [11 x i64] zeroinitializer diff --git a/clang/test/CodeGenCXX/instr-profile-class.cpp b/clang/test/Profile/cxx-class.cpp index f23aac6f7cb..5934a0adb7d 100644 --- a/clang/test/CodeGenCXX/instr-profile-class.cpp +++ b/clang/test/Profile/cxx-class.cpp @@ -1,9 +1,4 @@ -// 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. +// Tests for instrumentation of C++ methods, constructors, and destructors. // 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 @@ -11,7 +6,7 @@ // 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: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/cxx-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 diff --git a/clang/test/CodeGenCXX/instr-profile-throws.cpp b/clang/test/Profile/cxx-throws.cpp index d25827c5e00..0a8ebf1558b 100644 --- a/clang/test/CodeGenCXX/instr-profile-throws.cpp +++ b/clang/test/Profile/cxx-throws.cpp @@ -1,8 +1,4 @@ -// 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. +// Test instrumentation of C++ exception handling constructs. // FIXME: Don't seek bb labels, like "if.else" // REQUIRES: asserts @@ -10,8 +6,8 @@ // 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 +// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/cxx-throws.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s +// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/cxx-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 diff --git a/clang/test/CodeGenObjC/instr-profile.m b/clang/test/Profile/objc-general.m index c1bb50574de..b5f2673302c 100644 --- a/clang/test/CodeGenObjC/instr-profile.m +++ b/clang/test/Profile/objc-general.m @@ -1,11 +1,7 @@ -// 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. +// Test instrumentation of general constructs in objective C. -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name instr-profile.m %s -o - -emit-llvm -fblocks -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN %s -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name instr-profile.m %s -o - -emit-llvm -fblocks -fprofile-instr-use=%S/Inputs/instr-profile.profdata | FileCheck -check-prefix=PGOUSE %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name objc-general.m %s -o - -emit-llvm -fblocks -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name objc-general.m %s -o - -emit-llvm -fblocks -fprofile-instr-use=%S/Inputs/objc-general.profdata | FileCheck -check-prefix=PGOUSE %s #ifdef HAVE_FOUNDATION |