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
diff --git a/clang/test/CodeGenObjC/Inputs/instr-profile.profdata b/clang/test/CodeGenObjC/Inputs/instr-profile.profdata
deleted file mode 100644
index 0fe046e..0000000
--- 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
similarity index 100%
rename from clang/test/CodeGen/Inputs/instr-attribute.profdata
rename to 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
similarity index 93%
rename from clang/test/CodeGen/Inputs/instr-profile.profdata
rename to clang/test/Profile/Inputs/c-general.profdata
index f6337d2..e87f78e 100644
--- a/clang/test/CodeGen/Inputs/instr-profile.profdata
+++ b/clang/test/Profile/Inputs/c-general.profdata
@@ -132,7 +132,7 @@
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
similarity index 100%
rename from clang/test/CodeGenCXX/Inputs/instr-profile-class.profdata
rename to 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
similarity index 100%
rename from clang/test/CodeGenCXX/Inputs/instr-profile-throws.profdata
rename to 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 0000000..da42158
--- /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 0000000..8cf13c0
--- /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
similarity index 93%
rename from clang/test/CodeGen/instr-attribute.c
rename to clang/test/Profile/c-attributes.c
index b239980..8180955 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
similarity index 96%
rename from clang/test/CodeGen/instr-profile.c
rename to clang/test/Profile/c-general.c
index 05656ab..43ebf51 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.
+// Test instrumentation of general constructs in C.
-// 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
+// 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
similarity index 85%
rename from clang/test/CodeGenCXX/instr-profile-class.cpp
rename to clang/test/Profile/cxx-class.cpp
index f23aac6..5934a0a 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
similarity index 82%
rename from clang/test/CodeGenCXX/instr-profile-throws.cpp
rename to clang/test/Profile/cxx-throws.cpp
index d25827c..0a8ebf1 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
similarity index 75%
rename from clang/test/CodeGenObjC/instr-profile.m
rename to clang/test/Profile/objc-general.m
index c1bb505..b5f2673 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