]> granicus.if.org Git - clang/commitdiff
test: Give instrumentation based profiling tests their own directory
authorJustin Bogner <mail@justinbogner.com>
Tue, 11 Mar 2014 04:37:49 +0000 (04:37 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 11 Mar 2014 04:37:49 +0000 (04:37 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203541 91177308-0d34-0410-b5e6-96231b3b80d8

12 files changed:
test/CodeGenObjC/Inputs/instr-profile.profdata [deleted file]
test/Profile/Inputs/c-attributes.profdata [moved from test/CodeGen/Inputs/instr-attribute.profdata with 100% similarity]
test/Profile/Inputs/c-general.profdata [moved from test/CodeGen/Inputs/instr-profile.profdata with 93% similarity]
test/Profile/Inputs/cxx-class.profdata [moved from test/CodeGenCXX/Inputs/instr-profile-class.profdata with 100% similarity]
test/Profile/Inputs/cxx-throws.profdata [moved from test/CodeGenCXX/Inputs/instr-profile-throws.profdata with 100% similarity]
test/Profile/Inputs/objc-general.profdata [new file with mode: 0644]
test/Profile/README [new file with mode: 0644]
test/Profile/c-attributes.c [moved from test/CodeGen/instr-attribute.c with 93% similarity]
test/Profile/c-general.c [moved from test/CodeGen/instr-profile.c with 96% similarity]
test/Profile/cxx-class.cpp [moved from test/CodeGenCXX/instr-profile-class.cpp with 85% similarity]
test/Profile/cxx-throws.cpp [moved from test/CodeGenCXX/instr-profile-throws.cpp with 82% similarity]
test/Profile/objc-general.m [moved from test/CodeGenObjC/instr-profile.m with 76% similarity]

diff --git a/test/CodeGenObjC/Inputs/instr-profile.profdata b/test/CodeGenObjC/Inputs/instr-profile.profdata
deleted file mode 100644 (file)
index 0fe046e..0000000
+++ /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
-
similarity index 93%
rename from test/CodeGen/Inputs/instr-profile.profdata
rename to test/Profile/Inputs/c-general.profdata
index f6337d233298c0b242646eca315081942441a455..e87f78e6b569d4ea5ed02b37137843acb0068774 100644 (file)
@@ -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/test/Profile/Inputs/objc-general.profdata b/test/Profile/Inputs/objc-general.profdata
new file mode 100644 (file)
index 0000000..da42158
--- /dev/null
@@ -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/test/Profile/README b/test/Profile/README
new file mode 100644 (file)
index 0000000..8cf13c0
--- /dev/null
@@ -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.
similarity index 93%
rename from test/CodeGen/instr-attribute.c
rename to test/Profile/c-attributes.c
index b2399807543e4c57128908b0cc711dada90c100d..81809551fdee6ece62798d50f980cd56bf6d3c1c 100644 (file)
@@ -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 *);
 
similarity index 96%
rename from test/CodeGen/instr-profile.c
rename to test/Profile/c-general.c
index 05656ab508e67dc0edda576295b62b9970fd4ea8..43ebf511827d72dd0a75f8d64efbb29e60e606cf 100644 (file)
@@ -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
similarity index 85%
rename from test/CodeGenCXX/instr-profile-class.cpp
rename to test/Profile/cxx-class.cpp
index f23aac6f7cb3209ec4564e8cf604e3ae96bfef8a..5934a0adb7d964a24787eb867f2613233063d070 100644 (file)
@@ -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
similarity index 82%
rename from test/CodeGenCXX/instr-profile-throws.cpp
rename to test/Profile/cxx-throws.cpp
index d25827c5e00aab71fe8602b48e269a6c2290185d..0a8ebf1558b0b6508c28e806ff092422e1047072 100644 (file)
@@ -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
similarity index 76%
rename from test/CodeGenObjC/instr-profile.m
rename to test/Profile/objc-general.m
index c1bb50574de7125bfc4f0f84bdc6532179bc84eb..b5f2673302cdad3c1fb369d742fe6c66b786eed3 100644 (file)
@@ -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