]> granicus.if.org Git - clang/commitdiff
test: Use llvm-profdata merge in Profile tests
authorJustin Bogner <mail@justinbogner.com>
Thu, 17 Apr 2014 22:49:06 +0000 (22:49 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 17 Apr 2014 22:49:06 +0000 (22:49 +0000)
In preparation for using a binary format for instrumentation based
profiling, explicitly treat the test inputs as text and transform them
before running. This will allow us to leave the checked in files in
human readable format once the instrumentation format is binary.

No functional change.

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

23 files changed:
test/CMakeLists.txt
test/Profile/Inputs/c-attributes.proftext [moved from test/Profile/Inputs/c-attributes.profdata with 100% similarity]
test/Profile/Inputs/c-captured.proftext [moved from test/Profile/Inputs/c-captured.profdata with 100% similarity]
test/Profile/Inputs/c-counter-overflows.proftext [moved from test/Profile/Inputs/c-counter-overflows.profdata with 100% similarity]
test/Profile/Inputs/c-general.proftext [moved from test/Profile/Inputs/c-general.profdata with 100% similarity]
test/Profile/Inputs/c-outdated-data.proftext [moved from test/Profile/Inputs/c-outdated-data.profdata with 100% similarity]
test/Profile/Inputs/c-unprofiled-blocks.proftext [moved from test/Profile/Inputs/c-unprofiled-blocks.profdata with 100% similarity]
test/Profile/Inputs/cxx-class.proftext [moved from test/Profile/Inputs/cxx-class.profdata with 100% similarity]
test/Profile/Inputs/cxx-lambda.proftext [moved from test/Profile/Inputs/cxx-lambda.profdata with 100% similarity]
test/Profile/Inputs/cxx-templates.proftext [moved from test/Profile/Inputs/cxx-templates.profdata with 100% similarity]
test/Profile/Inputs/cxx-throws.proftext [moved from test/Profile/Inputs/cxx-throws.profdata with 100% similarity]
test/Profile/Inputs/objc-general.proftext [moved from test/Profile/Inputs/objc-general.profdata with 100% similarity]
test/Profile/c-attributes.c
test/Profile/c-captured.c
test/Profile/c-counter-overflows.c
test/Profile/c-general.c
test/Profile/c-outdated-data.c
test/Profile/c-unprofiled-blocks.c
test/Profile/cxx-class.cpp
test/Profile/cxx-lambda.cpp
test/Profile/cxx-templates.cpp
test/Profile/cxx-throws.cpp
test/Profile/objc-general.m

index 209154003ab848bf41fa3c44ea4406c4869554c1..970c7b96b3f98299878e8563c66d8259ee67a0da 100644 (file)
@@ -39,7 +39,7 @@ set(CLANG_TEST_PARAMS
 if( NOT CLANG_BUILT_STANDALONE )
   list(APPEND CLANG_TEST_DEPS
     llvm-config
-    llc opt FileCheck count not llvm-symbolizer
+    llc opt FileCheck count not llvm-symbolizer llvm-profdata
     )
 endif()
 
index 81809551fdee6ece62798d50f980cd56bf6d3c1c..2dcc180624cef13286723539aa093012fb74d93f 100644 (file)
@@ -1,6 +1,7 @@
 // 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/c-attributes.profdata | FileCheck %s
+// RUN: llvm-profdata merge %S/Inputs/c-attributes.proftext -o %t.profdata
+// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%t.profdata | FileCheck %s
 
 extern int atoi(const char *);
 
index a2678ec62830d51b5406a0626df341bf1acef073..47b1bbc7b7672291d84b0e4a2830c6d4e1d2d7c1 100644 (file)
@@ -1,5 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-captured.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck -check-prefix=PGOGEN -check-prefix=PGOALL %s
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-captured.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/c-captured.profdata | FileCheck -check-prefix=PGOUSE -check-prefix=PGOALL %s
+
+// RUN: llvm-profdata merge %S/Inputs/c-captured.proftext -o %t.profdata
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-captured.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE -check-prefix=PGOALL %s
 
 // PGOGEN: @[[DCC:__llvm_profile_counters_debug_captured]] = global [3 x i64] zeroinitializer
 // PGOGEN: @[[CSC:__llvm_profile_counters___captured_stmt]] = internal global [2 x i64] zeroinitializer
index 7cbe9bba8696e17f3033983826ec58d15497fab2..f6f8f73fd9494f8f17b8a3cebf7288f5f02289f8 100644 (file)
@@ -1,7 +1,8 @@
 // Test that big branch weights get scaled down to 32-bits, rather than just
 // truncated.
 
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-counter-overflows.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/c-counter-overflows.profdata | FileCheck %s
+// RUN: llvm-profdata merge %S/Inputs/c-counter-overflows.proftext -o %t.profdata
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-counter-overflows.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck %s
 
 typedef unsigned long long uint64_t;
 
index 1359d287afa81be2f1f4a6115ee2ffa567925e83..21ba005894e6405e539193212844dfeec34e3d94 100644 (file)
@@ -1,7 +1,9 @@
 // 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
+
+// RUN: llvm-profdata merge %S/Inputs/c-general.proftext -o %t.profdata
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE %s
 
 // PGOGEN: @[[SLC:__llvm_profile_counters_simple_loops]] = global [4 x i64] zeroinitializer
 // PGOGEN: @[[IFC:__llvm_profile_counters_conditionals]] = global [11 x i64] zeroinitializer
index c241005b704cfc926c65bb9a2aa2aeba5cd1cfcb..d0503acdb6eafa5501d48a49117650a14ec0d015 100644 (file)
@@ -3,7 +3,8 @@
 // FIXME: It would be nice to use -verify here instead of FileCheck, but -verify
 // doesn't play well with warnings that have no line number.
 
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-outdated-data.c %s -o /dev/null -emit-llvm -fprofile-instr-use=%S/Inputs/c-outdated-data.profdata -Wprofile-instr-dropped 2>&1 | FileCheck %s
+// RUN: llvm-profdata merge %S/Inputs/c-outdated-data.proftext -o %t.profdata
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-outdated-data.c %s -o /dev/null -emit-llvm -fprofile-instr-use=%t.profdata -Wprofile-instr-dropped 2>&1 | FileCheck %s
 // CHECK: warning: profile data may be out of date: of 3 functions, 1 has no data and 1 has mismatched data that will be ignored
 
 void no_usable_data() {
index 1f75a0da47ff74b57b109fccf4dc319085c73342..58bef9e2962d10765cbd4749dc8ec1ef2c3c41d4 100644 (file)
@@ -1,7 +1,8 @@
 // Blocks that we have no profile data for (ie, it was never reached in training
 // runs) shouldn't have any branch weight metadata added.
 
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-unprofiled-blocks.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/c-unprofiled-blocks.profdata | FileCheck -check-prefix=PGOUSE %s
+// RUN: llvm-profdata merge %S/Inputs/c-unprofiled-blocks.proftext -o %t.profdata
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-unprofiled-blocks.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE %s
 
 // PGOUSE-LABEL: @never_called(i32 %i)
 int never_called(int i) {
index 7cbbc09610767dd4f5a2ef54ee190f40112da538..1a0c84bdccea41d0b6cc1df19b4a3b5e0f636feb 100644 (file)
@@ -6,7 +6,8 @@
 // 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/cxx-class.profdata -fno-exceptions -target %itanium_abi_triple > %tuse
+// RUN: llvm-profdata merge %S/Inputs/cxx-class.proftext -o %t.profdata
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%t.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
index fedb1019e7678828765e471b11a1dd273685d5a6..923a432464c183c4e02ce2e349584a32f754be2b 100644 (file)
@@ -4,7 +4,8 @@
 // RUN: FileCheck --input-file=%tgen -check-prefix=PGOGEN %s
 // RUN: FileCheck --input-file=%tgen -check-prefix=LMBGEN %s
 
-// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-lambda.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-use=%S/Inputs/cxx-lambda.profdata > %tuse
+// RUN: llvm-profdata merge %S/Inputs/cxx-lambda.proftext -o %t.profdata
+// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-lambda.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-use=%t.profdata > %tuse
 // RUN: FileCheck --input-file=%tuse -check-prefix=PGOUSE %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=LMBUSE %s
 
index d59f7b97c6bd465db7ac32afdc3c0812d05dc091..5f99b999b8c0b38d60c7a4599bfceb0e7e287087 100644 (file)
@@ -5,7 +5,8 @@
 // RUN: FileCheck --input-file=%tgen -check-prefix=T0GEN -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tgen -check-prefix=T100GEN -check-prefix=ALL %s
 
-// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-templates.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-use=%S/Inputs/cxx-templates.profdata > %tuse
+// RUN: llvm-profdata merge %S/Inputs/cxx-templates.proftext -o %t.profdata
+// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-templates.cpp -std=c++11 -o - -emit-llvm -fprofile-instr-use=%t.profdata > %tuse
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s
 
index cdcf53a14b05cf1c985267044cfdf4fe277a4d0e..e5017bc22bef9f993931d613c9e5d6d4630f112a 100644 (file)
@@ -6,8 +6,9 @@
 // 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/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
+// RUN: llvm-profdata merge %S/Inputs/cxx-throws.proftext -o %t.profdata
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%t.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%t.profdata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s
 
 // PGOGEN: @[[THC:__llvm_profile_counters__Z6throwsv]] = global [9 x i64] zeroinitializer
 // PGOGEN-EXC: @[[THC:__llvm_profile_counters__Z6throwsv]] = global [9 x i64] zeroinitializer
index 568e5e4182d7b63cc774a3e67250a9bc45fa64f5..dc746189a827fb2d8fdf1ead1ea4054ddeb6964a 100644 (file)
@@ -1,7 +1,9 @@
 // Test instrumentation of general constructs in objective C.
 
 // 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
+
+// RUN: llvm-profdata merge %S/Inputs/objc-general.proftext -o %t.profdata
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name objc-general.m %s -o - -emit-llvm -fblocks -fprofile-instr-use=%t.profdata | FileCheck -check-prefix=PGOUSE %s
 
 #ifdef HAVE_FOUNDATION